From 8363e33828ccb91f193cac95dca2b8fff3ea7374 Mon Sep 17 00:00:00 2001 From: Vasek - Tom C Date: Thu, 20 Aug 2026 13:33:59 +0200 Subject: [PATCH 1/3] chore: bump the target engine to v1.0.0-beta.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Everything this repo ships is pinned to one engine release, so a bump moves four things together, and skipping any of them is silent: the vendored library sources, its generated bindings, the bundle built from them, and the Go generator. Re-vendored from the tag. beta.10 changes the library's introspector and its registry, and adds `agent` to the module-facing index.ts — the same export whose absence at beta.9 would have left modules unable to resolve it, caught again here by the check that every re-export exists in the bundle. The generator moved too, and three-way merged cleanly against our local changes: `@agent` support in the entrypoint, nullable objects gated on a beta.10 cutover, and the extendable-type list dropping Binding and Env. Left unsynced, that last one would have generated augmentations for types the engine no longer has. tsdistconsts is unchanged, so the typescript pin and bun image digest hold. sdk-sdk pins its own CLI release, which the workspace now overrides to match — otherwise its harness pairs our beta.10 library with a beta.9 engine and every scaffolded module fails to load. The fixture modules move with it. All eight name an engine release in their dagger-module.toml, and a fixture left behind still generates and still loads — so it goes on passing every check while covering a release we no longer ship for. Three sat at beta.9 and four at beta.7 before this. The release itself stops being repeated: the SDK states it once as targetEngineVersion, the runtimes harness reads it off there, and a check asserts every fixture agrees, so the next bump fails until it has moved everything. VENDOR.md records the new tag and commit, and the two deltas this import changed: bun.lock and .mocharc.json are ours, and the yarn-style scoped mocha resolutions are deliberately not carried forward. Signed-off-by: Tom Chauveau --- .../generate-deno/app/dagger-module.toml | 2 +- .../generate-deps/app/dagger-module.toml | 2 +- .../generate-deps/dep/dagger-module.toml | 2 +- .../managed-toml/app/dagger-module.toml | 2 +- .../.dagger/modules/app/dagger-module.toml | 2 +- .dagger/modules/e2e/sdk.dang | 23 + .dagger/modules/e2e/util.dang | 13 + .../runtimes/fixtures/bun/dagger-module.toml | 2 +- .../runtimes/fixtures/deno/dagger-module.toml | 2 +- .../runtimes/fixtures/node/dagger-module.toml | 2 +- .dagger/modules/runtimes/main.dang | 14 +- dagger.toml | 4 + helpers/codegen/generator/functions.go | 15 + .../templates/entrypoint_functions.go | 12 + .../templates/entrypoint_typedef.go | 1 + .../typescript/templates/functions.go | 11 +- .../templates/src/_method_solve_body.ts.gtpl | 14 +- .../templates/src/method_solve.ts.gtpl | 2 +- .../typescript/templates/src/object_test.go | 33 + .../src/testdata/objects_test_want.ts | 15 +- helpers/codegen/introspection/filters.go | 4 +- library/VENDOR.md | 17 +- library/bun.lock | 13 +- library/bundle/core.d.ts | 63 +- library/bundle/core.js | 2470 ++++++++++++--- library/bundle/index.ts | 1 + library/bundle/introspector.js | 2776 +++++++++++++---- library/package.json | 13 +- library/src/api/client.gen.ts | 352 ++- library/src/module/decorators.ts | 10 + library/src/module/entrypoint/register.ts | 4 + .../introspector/dagger_module/decorator.ts | 3 + .../introspector/dagger_module/function.ts | 7 + .../test/testdata/decorators/expected.json | 21 + .../test/testdata/decorators/index.ts | 10 +- .../src/module/introspector/typedef_json.ts | 1 + library/src/module/registry.ts | 16 + library/src/provisioning/default.ts | 2 +- library/yarn.lock | 50 +- typescript-sdk.dang | 10 + 40 files changed, 4713 insertions(+), 1303 deletions(-) diff --git a/.dagger/modules/e2e/fixtures/generate-deno/app/dagger-module.toml b/.dagger/modules/e2e/fixtures/generate-deno/app/dagger-module.toml index 792f6ca..7fb8e38 100644 --- a/.dagger/modules/e2e/fixtures/generate-deno/app/dagger-module.toml +++ b/.dagger/modules/e2e/fixtures/generate-deno/app/dagger-module.toml @@ -1,5 +1,5 @@ name = "generate-deno-app" -engineVersion = "v1.0.0-beta.9" +engineVersion = "v1.0.0-beta.10" [runtime] source = "typescript" diff --git a/.dagger/modules/e2e/fixtures/generate-deps/app/dagger-module.toml b/.dagger/modules/e2e/fixtures/generate-deps/app/dagger-module.toml index 8962e9f..d5a22bf 100644 --- a/.dagger/modules/e2e/fixtures/generate-deps/app/dagger-module.toml +++ b/.dagger/modules/e2e/fixtures/generate-deps/app/dagger-module.toml @@ -1,5 +1,5 @@ name = "generate-deps-app" -engineVersion = "v1.0.0-beta.7" +engineVersion = "v1.0.0-beta.10" [runtime] source = "typescript" diff --git a/.dagger/modules/e2e/fixtures/generate-deps/dep/dagger-module.toml b/.dagger/modules/e2e/fixtures/generate-deps/dep/dagger-module.toml index 1e0f8eb..4d3a31c 100644 --- a/.dagger/modules/e2e/fixtures/generate-deps/dep/dagger-module.toml +++ b/.dagger/modules/e2e/fixtures/generate-deps/dep/dagger-module.toml @@ -1,5 +1,5 @@ name = "gendep" -engineVersion = "v1.0.0-beta.7" +engineVersion = "v1.0.0-beta.10" [runtime] source = "typescript" diff --git a/.dagger/modules/e2e/fixtures/managed-toml/app/dagger-module.toml b/.dagger/modules/e2e/fixtures/managed-toml/app/dagger-module.toml index 18080c1..480f128 100644 --- a/.dagger/modules/e2e/fixtures/managed-toml/app/dagger-module.toml +++ b/.dagger/modules/e2e/fixtures/managed-toml/app/dagger-module.toml @@ -1,5 +1,5 @@ name = "managed-toml-app" -engineVersion = "v1.0.0-beta.7" +engineVersion = "v1.0.0-beta.10" [runtime] source = "typescript" diff --git a/.dagger/modules/e2e/fixtures/parent-source/.dagger/modules/app/dagger-module.toml b/.dagger/modules/e2e/fixtures/parent-source/.dagger/modules/app/dagger-module.toml index 2eeb0e5..6f6b29c 100644 --- a/.dagger/modules/e2e/fixtures/parent-source/.dagger/modules/app/dagger-module.toml +++ b/.dagger/modules/e2e/fixtures/parent-source/.dagger/modules/app/dagger-module.toml @@ -1,5 +1,5 @@ name = "parent-source-app" -engineVersion = "v1.0.0-beta.7" +engineVersion = "v1.0.0-beta.10" source = "../../../ci" [runtime] diff --git a/.dagger/modules/e2e/sdk.dang b/.dagger/modules/e2e/sdk.dang index a746b0a..09b3ff2 100644 --- a/.dagger/modules/e2e/sdk.dang +++ b/.dagger/modules/e2e/sdk.dang @@ -41,6 +41,29 @@ type SdkChecks { null } + """ + Every managed fixture should target the engine release this SDK's bundle is + built for. + + A fixture left on an older release still generates and still loads, so it goes + on passing every other check here while covering an engine we no longer ship + for — which is how all three runtime fixtures sat at beta.9, and four more at + beta.7, through a bump nobody noticed missing them. + """ + fixtureEngineVersionCheck(ws: Workspace!): Void @check { + let want = "engineVersion = \"v" + typescriptSdk.targetEngineVersion + "\"" + + Fixtures.managedTomlFixtures.each { path => + Asserts.stringContains( + ws.directory("/" + path).file("dagger-module.toml").contents, + want, + path + " should target the engine release this SDK ships for (" + want + ")", + ) + } + + null + } + """ The Go helpers (codegen, config-updator) must pass their own unit + golden tests. Runs `go test` in a container so `dagger check` covers the codegen diff --git a/.dagger/modules/e2e/util.dang b/.dagger/modules/e2e/util.dang index 0145a2e..7646e17 100644 --- a/.dagger/modules/e2e/util.dang +++ b/.dagger/modules/e2e/util.dang @@ -212,4 +212,17 @@ type Fixtures { denoModule, parentSourceModule, ] + runtimeFixtures + """ + The subset of managedModules configured by dagger-module.toml. These are the + fixtures that name an engine release, so they are the ones that can drift from + the release this SDK's bundle is built for; the dagger.json ones say "latest". + """ + let managedTomlFixtures: [String!]! = [ + managedTomlModule, + depAppModule, + depLibModule, + denoModule, + parentSourceModule, + ] + runtimeFixtures + } diff --git a/.dagger/modules/runtimes/fixtures/bun/dagger-module.toml b/.dagger/modules/runtimes/fixtures/bun/dagger-module.toml index 6448a29..403f463 100644 --- a/.dagger/modules/runtimes/fixtures/bun/dagger-module.toml +++ b/.dagger/modules/runtimes/fixtures/bun/dagger-module.toml @@ -1,5 +1,5 @@ name = "runtime-bun" -engineVersion = "v1.0.0-beta.9" +engineVersion = "v1.0.0-beta.10" [runtime] source = "typescript" diff --git a/.dagger/modules/runtimes/fixtures/deno/dagger-module.toml b/.dagger/modules/runtimes/fixtures/deno/dagger-module.toml index 66e89a1..f6f1a3e 100644 --- a/.dagger/modules/runtimes/fixtures/deno/dagger-module.toml +++ b/.dagger/modules/runtimes/fixtures/deno/dagger-module.toml @@ -1,5 +1,5 @@ name = "runtime-deno" -engineVersion = "v1.0.0-beta.9" +engineVersion = "v1.0.0-beta.10" [runtime] source = "typescript" diff --git a/.dagger/modules/runtimes/fixtures/node/dagger-module.toml b/.dagger/modules/runtimes/fixtures/node/dagger-module.toml index ab4c158..97ef1be 100644 --- a/.dagger/modules/runtimes/fixtures/node/dagger-module.toml +++ b/.dagger/modules/runtimes/fixtures/node/dagger-module.toml @@ -1,5 +1,5 @@ name = "runtime-node" -engineVersion = "v1.0.0-beta.9" +engineVersion = "v1.0.0-beta.10" [runtime] source = "typescript" diff --git a/.dagger/modules/runtimes/main.dang b/.dagger/modules/runtimes/main.dang index df7c929..096733b 100644 --- a/.dagger/modules/runtimes/main.dang +++ b/.dagger/modules/runtimes/main.dang @@ -19,6 +19,13 @@ different interpreter, resolving @dagger.io/dagger a different way. type Runtimes { let fixtures: String! = ".dagger/modules/runtimes/fixtures" + """ + Engine release these tests run against. Read off the SDK rather than repeated + here: it is the same pairing the committed bundle is built for, and a second + copy is a second thing to forget on a bump. + """ + let engineVersion: String! = typescriptSdk.targetEngineVersion + """ A node module should generate and run. """ @@ -61,7 +68,12 @@ type Runtimes { and its default was applied. """ invokesFunctionCheck(ws: Workspace!): Void @check { - let target = sdkSdk.target(ws.directory("/"), ".") + # sdk-sdk pins its own CLI (1.0.0-beta.9), and the harness runs the whole + # user path through it. Our committed bundle is built for the engine this + # repo targets, so driving it with an older CLI pairs a beta.10 library with + # a beta.9 engine — the version coupling this SDK owns now that it ships the + # library. Pin the harness to the same engine instead. + let target = sdkSdk(daggerCliVersion: engineVersion).target(ws.directory("/"), ".") let run = target.run(["call", target.moduleName, "base-image-address"]) run.assertSuccess diff --git a/dagger.toml b/dagger.toml index 482cdfe..53bfb3f 100644 --- a/dagger.toml +++ b/dagger.toml @@ -21,6 +21,10 @@ check.skip = ["*"] [modules.sdk-sdk] source = "github.com/dagger/sdk-sdk" +# The contract suite drives a real CLI through the whole user path. It pins its +# own release, which has to match the engine this SDK's committed bundle is +# built for — otherwise the checks pair our library with an older engine. +settings.daggerCliVersion = "1.0.0-beta.10" [modules.typescript-sdk.as-sdk] name = "typescript" diff --git a/helpers/codegen/generator/functions.go b/helpers/codegen/generator/functions.go index a7a0e0b..5877bf1 100644 --- a/helpers/codegen/generator/functions.go +++ b/helpers/codegen/generator/functions.go @@ -2,6 +2,7 @@ package generator import ( "fmt" + "regexp" "strings" "unicode" @@ -9,6 +10,10 @@ import ( "golang.org/x/mod/semver" ) +const nullableObjectSDKCutoverVersion = "v1.0.0-beta.10" + +var betaVersion = regexp.MustCompile(`^(v\d+\.\d+\.\d+-beta\.\d+)`) + const ( QueryStructName = "Query" QueryStructClientName = "Client" @@ -258,3 +263,13 @@ func (c *CommonFunctions) formatType(r *introspection.TypeRef, scope string, inp func (c *CommonFunctions) CheckVersionCompatibility(minVersion string) bool { return semver.Compare(c.schemaVersion, minVersion) >= 0 } + +func SupportsNullableObjects(schemaVersion string) bool { + if schemaVersion == "" || !semver.IsValid(schemaVersion) { + return true + } + if version := betaVersion.FindString(schemaVersion); version != "" { + schemaVersion = version + } + return semver.Compare(schemaVersion, nullableObjectSDKCutoverVersion) >= 0 +} diff --git a/helpers/codegen/generator/typescript/templates/entrypoint_functions.go b/helpers/codegen/generator/typescript/templates/entrypoint_functions.go index a0e3fa5..1500f98 100644 --- a/helpers/codegen/generator/typescript/templates/entrypoint_functions.go +++ b/helpers/codegen/generator/typescript/templates/entrypoint_functions.go @@ -364,6 +364,15 @@ func (c *entrypointFuncCtx) resolveDefaultValue(arg *TypedefArgument) (any, bool return nil, false } +// renderFunctionExpr turns a scanned function into the engine registration call +// that declares it. +// +// The vendored library's Register.addFunction +// (library/src/module/entrypoint/register.ts) does the same translation at +// runtime, from the same typedef. Both are live — the introspector registers +// through the TypeScript one — and nothing enforces that they agree, so a new +// decorator has to be taught to both. beta.10's `agent` needed exactly that. +// Keep the two in step when adding a case here. func (c *entrypointFuncCtx) renderFunctionExpr(fn *TypedefFunction) string { fnName := fn.Alias if fnName == "" { @@ -401,6 +410,9 @@ func (c *entrypointFuncCtx) renderFunctionExpr(fn *TypedefFunction) string { if fn.IsUp { parts = append(parts, ".withUp()") } + if fn.IsAgent { + parts = append(parts, ".withAgent()") + } return strings.Join(parts, "") } diff --git a/helpers/codegen/generator/typescript/templates/entrypoint_typedef.go b/helpers/codegen/generator/typescript/templates/entrypoint_typedef.go index 8ece612..83ccbb2 100644 --- a/helpers/codegen/generator/typescript/templates/entrypoint_typedef.go +++ b/helpers/codegen/generator/typescript/templates/entrypoint_typedef.go @@ -43,6 +43,7 @@ type TypedefFunction struct { IsCheck bool `json:"isCheck"` IsGenerator bool `json:"isGenerator"` IsUp bool `json:"isUp"` + IsAgent bool `json:"isAgent"` Location *TypedefLocation `json:"location,omitempty"` ReturnType *TypedefType `json:"returnType,omitempty"` Arguments []*TypedefArgument `json:"arguments"` diff --git a/helpers/codegen/generator/typescript/templates/functions.go b/helpers/codegen/generator/typescript/templates/functions.go index b3e1005..2eafaa1 100644 --- a/helpers/codegen/generator/typescript/templates/functions.go +++ b/helpers/codegen/generator/typescript/templates/functions.go @@ -134,6 +134,7 @@ func (funcs typescriptTemplateFuncs) FuncMap() template.FuncMap { "IsSelfChainable": commonFunc.IsSelfChainable, "IsListOfObject": commonFunc.IsListOfObject, "IsListOfInterface": funcs.isListOfInterface, + "IsNullableObject": funcs.isNullableObject, "IsListOfEnum": commonFunc.IsListOfEnum, "GetArrayField": commonFunc.GetArrayField, "ToLowerCase": commonFunc.ToLowerCase, @@ -181,6 +182,10 @@ func (funcs typescriptTemplateFuncs) legacyTypeScriptSDKCompat() bool { return semver.Compare(funcs.schemaVersion, legacyTypeScriptSDKCompatCutoverVersion) < 0 } +func (funcs typescriptTemplateFuncs) supportsNullableObjects() bool { + return generator.SupportsNullableObjects(funcs.schemaVersion) +} + // isInterface checks if the type is a GraphQL interface. func (funcs typescriptTemplateFuncs) isInterface(t *introspection.Type) bool { return t.Kind == introspection.TypeKindInterface @@ -337,7 +342,11 @@ func (funcs typescriptTemplateFuncs) solve(field introspection.Field) bool { if field.TypeRef == nil { return false } - return field.TypeRef.IsScalar() || field.TypeRef.IsList() + return field.TypeRef.IsScalar() || field.TypeRef.IsList() || funcs.isNullableObject(field.TypeRef) +} + +func (funcs typescriptTemplateFuncs) isNullableObject(ref *introspection.TypeRef) bool { + return funcs.supportsNullableObjects() && ref != nil && ref.IsOptional() && (ref.IsObject() || ref.IsInterface()) } // subtract subtract integer a with integer b. diff --git a/helpers/codegen/generator/typescript/templates/src/_method_solve_body.ts.gtpl b/helpers/codegen/generator/typescript/templates/src/_method_solve_body.ts.gtpl index 4060d62..a540b5c 100644 --- a/helpers/codegen/generator/typescript/templates/src/_method_solve_body.ts.gtpl +++ b/helpers/codegen/generator/typescript/templates/src/_method_solve_body.ts.gtpl @@ -65,11 +65,21 @@ The dot is an introspection.Field. */ -}} {{- end }} ){{- /* Add subfields */ -}} {{- if and .TypeRef.IsList (IsListOfObject .TypeRef) }}.select("{{- range $i, $v := . | GetArrayField }}{{if $i }} {{ end }}{{ $v.Name | ToLowerCase }}{{- end }}") + {{- else if IsNullableObject .TypeRef }}.select("id") {{- end }} - {{ if not .TypeRef.IsVoid }}const response: Awaited<{{ if $convertID }}{{ . | FormatFieldOutputType }}{{ else }}{{ $promiseRetType }}{{ end }}> = {{ end }}await ctx.execute() + {{ if not .TypeRef.IsVoid }}const response: Awaited<{{ if IsNullableObject .TypeRef }}string | null{{ else if $convertID }}{{ . | FormatFieldOutputType }}{{ else }}{{ $promiseRetType }}{{ end }}> = {{ end }}await ctx.execute() - {{ if $convertID -}} + {{ if IsNullableObject .TypeRef -}} + if (response === null) { + return null + } + {{- if .TypeRef.IsInterface }} + return new _{{ $promiseRetType | FormatProtected | FormatName }}Client(ctx.copy().selectNode(response, "{{ $promiseRetType | FormatProtected }}")) + {{- else }} + return new {{ $promiseRetType | FormatProtected | FormatName }}(ctx.copy().selectNode(response, "{{ $promiseRetType | FormatProtected }}")) + {{- end }} + {{- else if $convertID -}} {{- if IsInterface .ParentObject }} return new _{{ $promiseRetType | FormatProtected | FormatName }}Client(ctx.copy().selectNode(response, "{{ $promiseRetType | FormatProtected }}")) {{- else }} diff --git a/helpers/codegen/generator/typescript/templates/src/method_solve.ts.gtpl b/helpers/codegen/generator/typescript/templates/src/method_solve.ts.gtpl index df98bc4..4df0ee6 100644 --- a/helpers/codegen/generator/typescript/templates/src/method_solve.ts.gtpl +++ b/helpers/codegen/generator/typescript/templates/src/method_solve.ts.gtpl @@ -29,7 +29,7 @@ {{- end }} {{- /* Write return type */ -}} - {{- "" }}): Promise<{{ if .TypeRef.IsVoid }}void{{ else }}{{ . | FormatFieldReturnType }}{{ end }}> => { {{- with .Directives.SourceMap }} // {{ .Module }} ({{ .Filelink | ModuleRelPath }}) {{- end }} + {{- "" }}): Promise<{{ if .TypeRef.IsVoid }}void{{ else }}{{ . | FormatFieldReturnType }}{{ if IsNullableObject .TypeRef }} | null{{ end }}{{ end }}> => { {{- with .Directives.SourceMap }} // {{ .Module }} ({{ .Filelink | ModuleRelPath }}) {{- end }} {{- /* Body is shared with the dep prototype augmentations. */ -}} {{- template "method_solve_body" . }} } diff --git a/helpers/codegen/generator/typescript/templates/src/object_test.go b/helpers/codegen/generator/typescript/templates/src/object_test.go index 455477b..f360ffb 100644 --- a/helpers/codegen/generator/typescript/templates/src/object_test.go +++ b/helpers/codegen/generator/typescript/templates/src/object_test.go @@ -83,6 +83,39 @@ func TestObjectFieldDeprecated(t *testing.T) { require.Equal(t, want, b.String()) } +func TestNullableObjectField(t *testing.T) { + object := objectInit(t, `{ + "kind": "OBJECT", + "name": "GitRepository", + "description": "", + "fields": [{ + "args": [], + "description": "", + "isDeprecated": false, + "name": "latestVersion", + "type": {"kind": "OBJECT", "name": "GitRef"} + }], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }`) + + tmpl := templateHelper(t) + var b bytes.Buffer + require.NoError(t, tmpl.ExecuteTemplate(&b, "object", object)) + require.Contains(t, b.String(), "latestVersion = async (): Promise") + require.Contains(t, b.String(), `"latestVersion",`) + require.Contains(t, b.String(), `.select("id")`) + require.Contains(t, b.String(), "if (response === null)") + + tmpl = templates.New("v1.0.0-beta.9", nil, "", generator.Config{}) + b.Reset() + require.NoError(t, tmpl.ExecuteTemplate(&b, "object", object)) + require.Contains(t, b.String(), "latestVersion = (): GitRef") + require.NotContains(t, b.String(), "response === null") +} + func TestInterfaceMethodOptionalArgDeprecated(t *testing.T) { tmpl := templateHelper(t) diff --git a/helpers/codegen/generator/typescript/templates/src/testdata/objects_test_want.ts b/helpers/codegen/generator/typescript/templates/src/testdata/objects_test_want.ts index 1766fda..9c2c661 100644 --- a/helpers/codegen/generator/typescript/templates/src/testdata/objects_test_want.ts +++ b/helpers/codegen/generator/typescript/templates/src/testdata/objects_test_want.ts @@ -62,13 +62,18 @@ export class Host extends BaseClient { /** * Lookup the value of an environment variable. Null if the variable is not available. */ - envVariable = (name: string): HostVariable => { - + envVariable = async (name: string): Promise => { const ctx = this._ctx.select( "envVariable", - { name }, - ) - return new HostVariable(ctx) + { name}, + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new HostVariable(ctx.copy().selectNode(response, "HostVariable")) } /** diff --git a/helpers/codegen/introspection/filters.go b/helpers/codegen/introspection/filters.go index 75952ab..87ec54f 100644 --- a/helpers/codegen/introspection/filters.go +++ b/helpers/codegen/introspection/filters.go @@ -6,13 +6,11 @@ import "slices" // installing a dependency. var ExtendableTypes = []string{ "Query", - "Binding", - "Env", } // DependencyNames returns the unique list of module names that appear in // the schema's sourceMap directives, excluding the built-in extendable types -// (Query, Binding, Env) whose fields are contributed by multiple modules. +// (Query) whose fields are contributed by multiple modules. func (s *Schema) DependencyNames() []string { seen := map[string]struct{}{} var names []string diff --git a/library/VENDOR.md b/library/VENDOR.md index 52aad6f..04c6db2 100644 --- a/library/VENDOR.md +++ b/library/VENDOR.md @@ -17,8 +17,8 @@ noticing. |---|---| | Repository | `github.com/dagger/dagger` | | Path | `sdk/typescript` | -| Tag | `v1.0.0-beta.9` | -| Commit | `1c6e07b197327c57e9db8584deb36e5166278677` | +| Tag | `v1.0.0-beta.10` | +| Commit | `0e19eba6d38d7fd7e9781a1a3df5fc37208d252a` | The tag is not incidental. This repo ships a library *built* for one engine release, so the vendored sources, the bindings generated from them, the @@ -46,8 +46,10 @@ either a new upstream change (fine) or a delta being dropped (not fine). | File | Delta | Why | |---|---|---| | `package.json` | `scripts` removed | All pointed at things this repo does not have (mocha/eslint/tsx wiring, `../../docs/current_docs`). The packager owns how the bundle is built; see `.dagger/modules/packager/main.dang`. | -| `package.json` | `devDependencies` and `resolutions` trimmed | Kept to what the bundle build actually uses: `rollup`, `rollup-plugin-dts`, and the `@types` the declaration build needs. | +| `package.json` | `devDependencies` and `resolutions` trimmed | Kept to what the bundle build and the vendored test suite actually use: `rollup`, `rollup-plugin-dts`, the `@types` the declaration build needs, and `mocha`/`ts-node`/`@types/mocha` for `library-tests`. | | `package.json` | `version`, `author`, `license`, package metadata | **Tracks upstream.** Nothing here is published, so a local value is a delta that buys nothing and costs an import. Leave them alone. | +| `bun.lock` | Added (not upstream) | `yarn.lock` is a yarn v1 file that does not pin everything bun resolves; without `bun.lock` a rebuild days later drifts. Both are load-bearing — see `libraryBundle`'s doc comment. | +| `.mocharc.json` | Added (not upstream) | Runs the vendored introspector suite against `src/`. | | `bundle/` | Built here, committed | Not upstream at all. Produced by `packager:library-bundle`. | ## What has to move with upstream @@ -77,4 +79,11 @@ has to change the other: `dagger generate packager:library-bundle`. Both are `@generate` functions, so the engine surfaces them as checks that fail when the committed output is stale. -5. Update the **Current source** table and any row of the delta table that moved. +5. Run `packager:library-tests` and the runtime checks. The runtimes group is the + only thing that executes a generated module end to end. +6. Update the **Current source** table and any row of the delta table that moved. + +Yarn-style scoped `resolutions` (`mocha/minimatch`, `mocha/serialize-javascript`) +were dropped on this import and are *not* restored: bun does not honor that +spelling — only the flat keys reach `bun.lock`'s `overrides` — and the lock +already resolves the versions they were reaching for. diff --git a/library/bun.lock b/library/bun.lock index 8ab4ee4..d3886b5 100644 --- a/library/bun.lock +++ b/library/bun.lock @@ -14,7 +14,7 @@ "@opentelemetry/sdk-metrics": "^2.8.0", "@opentelemetry/sdk-node": "^0.219.0", "@opentelemetry/semantic-conventions": "^1.41.1", - "adm-zip": "^0.5.18", + "adm-zip": "^0.6.0", "env-paths": "^4.0.0", "execa": "^9.6.1", "graphql": "^17.0.1", @@ -40,6 +40,7 @@ }, "overrides": { "@grpc/grpc-js": "1.14.4", + "@opentelemetry/propagator-jaeger": "2.9.0", "form-data": "4.0.6", }, "packages": { @@ -117,7 +118,7 @@ "@opentelemetry/propagator-b3": ["@opentelemetry/propagator-b3@2.8.0", "", { "dependencies": { "@opentelemetry/core": "2.8.0" } }, "sha512-SazlvuSKi5533rPHTW2TwBwdMakhjZST4SYs0YauuvfGDkT13KbG1gJS75hV0uWVeevhtVP9sAIlaZLTHdSbMg=="], - "@opentelemetry/propagator-jaeger": ["@opentelemetry/propagator-jaeger@2.8.0", "", { "dependencies": { "@opentelemetry/core": "2.8.0" } }, "sha512-Xnz9zZvvQzUw+9DrOn0MomR7BxFCkA2pcfXBQuHC28ndJpSbjLs7knzYb05kw5SyCjSsEWombkZMgGcJSk8JVg=="], + "@opentelemetry/propagator-jaeger": ["@opentelemetry/propagator-jaeger@2.9.0", "", { "dependencies": { "@opentelemetry/core": "2.9.0" } }, "sha512-4mYGty27rYvSM0jtp1ZUOqd3LfVRCYg9H5G9OFzSx5HViYToU21MFhWfco7x1HwXr7ER8yGOiCIHZUwjPksc0Q=="], "@opentelemetry/resources": ["@opentelemetry/resources@2.8.0", "", { "dependencies": { "@opentelemetry/core": "2.8.0", "@opentelemetry/semantic-conventions": "^1.29.0" } }, "sha512-qmXQ27ilDbUK/vGMqwL8D4/rhn76C+sherM4wTbjlfknR8Nvfc/hCxjRJPhkzZzUsPiNg16SA31NxMabwttRjg=="], @@ -235,7 +236,7 @@ "acorn-walk": ["acorn-walk@https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", { "dependencies": { "acorn": "^8.11.0" } }, "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw=="], - "adm-zip": ["adm-zip@0.5.18", "", {}, "sha512-ufJnssQGbxzLNS1Ho9bCtX4rQKCCvoVuDLHoJyc3F9dOGDB4BkWs2Ci0kv53lqocAEQ/Cbi+I2XCsNYGqVYqng=="], + "adm-zip": ["adm-zip@0.6.0", "", {}, "sha512-XleryMhbuksdKtofnWZ9Sk+4CUTbms4Mb/EU32SZwToAyZ5RgVos/ki8n+yr0LWHOGKuakbXTuuYNHLQjhddgg=="], "ansi-color": ["ansi-color@https://registry.npmjs.org/ansi-color/-/ansi-color-0.2.1.tgz", {}, "sha512-bF6xLaZBLpOQzgYUtYEhJx090nPSZk1BQ/q2oyBK9aMMcJHzx9uXGCjI2Y+LebsN4Jwoykr0V9whbPiogdyHoQ=="], @@ -251,7 +252,7 @@ "balanced-match": ["balanced-match@https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], - "brace-expansion": ["brace-expansion@2.1.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA=="], + "brace-expansion": ["brace-expansion@2.1.4", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg=="], "browser-stdout": ["browser-stdout@https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", {}, "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw=="], @@ -389,7 +390,7 @@ "js-tokens": ["js-tokens@https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], - "js-yaml": ["js-yaml@https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", { "dependencies": { "argparse": "^2.0.1" } }, "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA=="], + "js-yaml": ["js-yaml@4.3.1", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ=="], "locate-path": ["locate-path@https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="], @@ -553,6 +554,8 @@ "@isaacs/cliui/wrap-ansi": ["wrap-ansi@https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", { "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } }, "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ=="], + "@opentelemetry/propagator-jaeger/@opentelemetry/core": ["@opentelemetry/core@2.9.0", "", { "dependencies": { "@opentelemetry/semantic-conventions": "^1.29.0" } }, "sha512-m2nckMT80NnmjTYSPjJQObBJ+8dgkoajEOUbznL8AHZ3T3yHRk2P7gI1PhEBc1+lOnrYE9UWrWHqJDsmqjmNbw=="], + "chalk/supports-color": ["supports-color@https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], "es-set-tostringtag/hasown": ["hasown@https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="], diff --git a/library/bundle/core.d.ts b/library/bundle/core.d.ts index e49bcb7..4a6af2d 100644 --- a/library/bundle/core.d.ts +++ b/library/bundle/core.d.ts @@ -2828,7 +2828,7 @@ declare class Check extends BaseClient { /** * If the check failed, this is the error */ - error: () => Error$1; + error: () => Promise; /** * Return the fully qualified name of the check */ @@ -3002,7 +3002,7 @@ declare class Container extends BaseClient { /** * Retrieves this container's configured docker healthcheck. */ - dockerHealthcheck: () => HealthcheckConfig; + dockerHealthcheck: () => Promise; /** * Return the container's OCI entrypoint. */ @@ -3184,7 +3184,7 @@ declare class Container extends BaseClient { * @param path Path to check (e.g., "/file.txt"). * @param opts.doNotFollowSymlinks If specified, do not follow symlinks. */ - stat: (path: string, opts?: ContainerStatOpts) => Stat; + stat: (path: string, opts?: ContainerStatOpts) => Promise; /** * The buffered standard error stream of the last executed command * @@ -3966,7 +3966,7 @@ declare class Directory extends BaseClient { * @param path Path to stat (e.g., "/file.txt"). * @param opts.doNotFollowSymlinks If specified, do not follow symlinks. */ - stat: (path: string, opts?: DirectoryStatOpts) => Stat; + stat: (path: string, opts?: DirectoryStatOpts) => Promise; /** * Force evaluation in the engine. */ @@ -4274,7 +4274,7 @@ declare class EnumTypeDef extends BaseClient { /** * The location of this enum declaration. */ - sourceMap: () => SourceMap; + sourceMap: () => Promise; /** * If this EnumTypeDef is associated with a Module, the name of the module. Unset otherwise. */ @@ -4317,7 +4317,7 @@ declare class EnumValueTypeDef extends BaseClient { /** * The location of this enum member declaration. */ - sourceMap: () => SourceMap; + sourceMap: () => Promise; /** * The value of the enum member */ @@ -4510,7 +4510,7 @@ declare class FieldTypeDef extends BaseClient { /** * The location of this field declaration. */ - sourceMap: () => SourceMap; + sourceMap: () => Promise; /** * The type of the field. */ @@ -4596,7 +4596,7 @@ declare class File extends BaseClient { /** * Return file status */ - stat: () => Stat; + stat: () => Promise; /** * Force evaluation in the engine. */ @@ -4678,7 +4678,7 @@ declare class Function_ extends BaseClient { /** * The location of this function declaration. */ - sourceMap: () => SourceMap; + sourceMap: () => Promise; /** * If this function is provided by a module, the name of the module. Unset otherwise. */ @@ -4791,7 +4791,7 @@ declare class FunctionArg extends BaseClient { /** * The location of this arg declaration. */ - sourceMap: () => SourceMap; + sourceMap: () => Promise; /** * The type of the argument. */ @@ -5032,7 +5032,7 @@ declare class GitCommit extends BaseClient { * The latest semver release tag reachable from this commit. * @param opts.includePreRelease Include pre-release tags when choosing the latest tag. */ - ancestorReleaseTag: (opts?: GitCommitAncestorReleaseTagOpts) => GitRef; + ancestorReleaseTag: (opts?: GitCommitAncestorReleaseTagOpts) => Promise; /** * Git author email. */ @@ -5077,7 +5077,7 @@ declare class GitCommit extends BaseClient { * The latest semver release tag that points directly at this commit. * @param opts.includePreRelease Include pre-release tags when choosing the latest tag. */ - releaseTag: (opts?: GitCommitReleaseTagOpts) => GitRef; + releaseTag: (opts?: GitCommitReleaseTagOpts) => Promise; /** * The full commit SHA. */ @@ -5419,7 +5419,7 @@ declare class InterfaceTypeDef extends BaseClient { /** * The location of this interface declaration. */ - sourceMap: () => SourceMap; + sourceMap: () => Promise; /** * If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise. */ @@ -5954,11 +5954,11 @@ declare class Module_ extends BaseClient { /** * The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile. */ - runtime: () => Container; + runtime: () => Promise; /** * The SDK config used by this module. */ - sdk: () => SDKConfig; + sdk: () => Promise; /** * Serve a module's API in the current session. * @@ -5976,7 +5976,7 @@ declare class Module_ extends BaseClient { /** * The source for the module. */ - source: () => ModuleSource; + source: () => Promise; /** * Forces evaluation of the module, including any loading into the engine and associated validation. */ @@ -6190,7 +6190,7 @@ declare class ModuleSource extends BaseClient { /** * The SDK configuration of the module. */ - sdk: () => SDKConfig; + sdk: () => Promise; /** * The path, relative to the context directory, that contains the module config. */ @@ -6363,7 +6363,7 @@ declare class ObjectTypeDef extends BaseClient { /** * The function used to construct new instances of this object, if any. */ - constructor_: () => Function_; + constructor_: () => Promise; /** * The reason this enum member is deprecated, if any. */ @@ -6387,7 +6387,7 @@ declare class ObjectTypeDef extends BaseClient { /** * The location of this object declaration. */ - sourceMap: () => SourceMap; + sourceMap: () => Promise; /** * If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise. */ @@ -6606,7 +6606,7 @@ declare class Client extends BaseClient { /** * Load any object by its ID. */ - node: (id: ID) => Node; + node: (id: ID) => Promise; /** * Load a GraphQL introspection schema for merging. * @param json The introspection schema JSON to load. @@ -7063,27 +7063,27 @@ declare class TypeDef extends BaseClient { /** * If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null. */ - asEnum: () => EnumTypeDef; + asEnum: () => Promise; /** * If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null. */ - asInput: () => InputTypeDef; + asInput: () => Promise; /** * If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null. */ - asInterface: () => InterfaceTypeDef; + asInterface: () => Promise; /** * If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null. */ - asList: () => ListTypeDef; + asList: () => Promise; /** * If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null. */ - asObject: () => ObjectTypeDef; + asObject: () => Promise; /** * If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null. */ - asScalar: () => ScalarTypeDef; + asScalar: () => Promise; /** * The kind of type this is (e.g. primitive, list, object). */ @@ -8191,6 +8191,15 @@ declare const generate: () => ((target: object, propertyKey: string | symbol, de * The definition of @up decorator that marks a function as a service for dagger up. */ declare const up: () => ((target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor); +/** + * The definition of @agent decorator that marks a function as an agent + * middleware: it takes a base LLM and returns an LLM with the module's tools + * and prompting folded onto it. `dagger agent` discovers and composes these. + * + * Besides the base LLM, an agent function may not declare any other required + * argument. + */ +declare const agent: () => ((target: object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => void); /** * The definition of @field decorator that should be on top of any * class' property that must be exposed to the Dagger API. @@ -8226,5 +8235,5 @@ declare const argument: (opts?: ArgumentOptions) => ((target: object, propertyKe declare function entrypoint(files: string[]): Promise; -export { Address, Agent, AgentGroup, BaseClient, CacheSharingMode, CacheSharingModeNameToValue, CacheSharingModeValueToName, CacheVolume, Changeset, ChangesetMergeConflict, ChangesetMergeConflictNameToValue, ChangesetMergeConflictValueToName, ChangesetsMergeConflict, ChangesetsMergeConflictNameToValue, ChangesetsMergeConflictValueToName, Check, CheckGroup, Client, ClientFilesyncMirror, Cloud, Container, Context, CurrentModule, CurrentModuleAsSDK, CurrentModuleAsSDKClient, CurrentModuleAsSDKModule, DaggerSDKError, DiffStat, DiffStatKind, DiffStatKindNameToValue, DiffStatKindValueToName, Directory, DockerImageRefValidationError, ERROR_CODES, Engine, EngineCache, EngineCacheEntry, EngineCacheEntrySet, EngineSessionConnectParamsParseError, EngineSessionConnectionTimeoutError, EngineSessionError, EnumTypeDef, EnumValueTypeDef, EnvFile, EnvVariable, Error$1 as Error, ErrorValue, ExecError, ExistsType, ExistsTypeNameToValue, ExistsTypeValueToName, FieldTypeDef, File, FileType, FileTypeNameToValue, FileTypeValueToName, FunctionArg, FunctionCachePolicy, FunctionCachePolicyNameToValue, FunctionCachePolicyValueToName, FunctionCall, FunctionCallArgValue, FunctionNotFound, Function_, GeneratedCode, Generator, GeneratorGroup, GitCommit, GitRef, GitRepository, GraphQLRequestError, HTTPState, HealthcheckConfig, Host, ImageLayerCompression, ImageLayerCompressionNameToValue, ImageLayerCompressionValueToName, ImageMediaTypes, ImageMediaTypesNameToValue, ImageMediaTypesValueToName, InitEngineSessionBinaryError, InputTypeDef, InterfaceTypeDef, IntrospectionError, JSONValue, LLM, LLMContentBlock, LLMContentBlockKind, LLMContentBlockKindNameToValue, LLMContentBlockKindValueToName, LLMMessage, LLMMessageRole, LLMMessageRoleNameToValue, LLMMessageRoleValueToName, LLMSkill, LLMTokenUsage, Label, ListTypeDef, ModuleConfigClient, ModuleSource, ModuleSourceExperimentalFeature, ModuleSourceExperimentalFeatureNameToValue, ModuleSourceExperimentalFeatureValueToName, ModuleSourceKind, ModuleSourceKindNameToValue, ModuleSourceKindValueToName, Module_, NetworkProtocol, NetworkProtocolNameToValue, NetworkProtocolValueToName, NotAwaitedRequestError, ObjectTypeDef, PatchConflict, PatchConflictNameToValue, PatchConflictValueToName, Port, RegistryProtocol, RegistryProtocolNameToValue, RegistryProtocolValueToName, RemoteGitMirror, ReturnType, ReturnTypeNameToValue, ReturnTypeValueToName, SDKConfig, ScalarTypeDef, Schema, SearchResult, SearchSubmatch, Secret, Service, Socket, SourceMap, Stat, Terminal, TooManyNestedObjectsError, TypeDef, TypeDefKind, TypeDefKindNameToValue, TypeDefKindValueToName, UnknownDaggerError, Up, UpGroup, Volume, Workspace, WorkspaceGit, WorkspaceMigration, WorkspaceMigrationStep, WorkspaceModule, WorkspaceModuleSetting, WorkspaceSDK, _ExportableClient, _NodeClient, _SyncerClient, argument, check, connect, connection, dag, entrypoint, enumType, field, func, generate, getRegisteredClass, getTracer, object, up }; +export { Address, Agent, AgentGroup, BaseClient, CacheSharingMode, CacheSharingModeNameToValue, CacheSharingModeValueToName, CacheVolume, Changeset, ChangesetMergeConflict, ChangesetMergeConflictNameToValue, ChangesetMergeConflictValueToName, ChangesetsMergeConflict, ChangesetsMergeConflictNameToValue, ChangesetsMergeConflictValueToName, Check, CheckGroup, Client, ClientFilesyncMirror, Cloud, Container, Context, CurrentModule, CurrentModuleAsSDK, CurrentModuleAsSDKClient, CurrentModuleAsSDKModule, DaggerSDKError, DiffStat, DiffStatKind, DiffStatKindNameToValue, DiffStatKindValueToName, Directory, DockerImageRefValidationError, ERROR_CODES, Engine, EngineCache, EngineCacheEntry, EngineCacheEntrySet, EngineSessionConnectParamsParseError, EngineSessionConnectionTimeoutError, EngineSessionError, EnumTypeDef, EnumValueTypeDef, EnvFile, EnvVariable, Error$1 as Error, ErrorValue, ExecError, ExistsType, ExistsTypeNameToValue, ExistsTypeValueToName, FieldTypeDef, File, FileType, FileTypeNameToValue, FileTypeValueToName, FunctionArg, FunctionCachePolicy, FunctionCachePolicyNameToValue, FunctionCachePolicyValueToName, FunctionCall, FunctionCallArgValue, FunctionNotFound, Function_, GeneratedCode, Generator, GeneratorGroup, GitCommit, GitRef, GitRepository, GraphQLRequestError, HTTPState, HealthcheckConfig, Host, ImageLayerCompression, ImageLayerCompressionNameToValue, ImageLayerCompressionValueToName, ImageMediaTypes, ImageMediaTypesNameToValue, ImageMediaTypesValueToName, InitEngineSessionBinaryError, InputTypeDef, InterfaceTypeDef, IntrospectionError, JSONValue, LLM, LLMContentBlock, LLMContentBlockKind, LLMContentBlockKindNameToValue, LLMContentBlockKindValueToName, LLMMessage, LLMMessageRole, LLMMessageRoleNameToValue, LLMMessageRoleValueToName, LLMSkill, LLMTokenUsage, Label, ListTypeDef, ModuleConfigClient, ModuleSource, ModuleSourceExperimentalFeature, ModuleSourceExperimentalFeatureNameToValue, ModuleSourceExperimentalFeatureValueToName, ModuleSourceKind, ModuleSourceKindNameToValue, ModuleSourceKindValueToName, Module_, NetworkProtocol, NetworkProtocolNameToValue, NetworkProtocolValueToName, NotAwaitedRequestError, ObjectTypeDef, PatchConflict, PatchConflictNameToValue, PatchConflictValueToName, Port, RegistryProtocol, RegistryProtocolNameToValue, RegistryProtocolValueToName, RemoteGitMirror, ReturnType, ReturnTypeNameToValue, ReturnTypeValueToName, SDKConfig, ScalarTypeDef, Schema, SearchResult, SearchSubmatch, Secret, Service, Socket, SourceMap, Stat, Terminal, TooManyNestedObjectsError, TypeDef, TypeDefKind, TypeDefKindNameToValue, TypeDefKindValueToName, UnknownDaggerError, Up, UpGroup, Volume, Workspace, WorkspaceGit, WorkspaceMigration, WorkspaceMigrationStep, WorkspaceModule, WorkspaceModuleSetting, WorkspaceSDK, _ExportableClient, _NodeClient, _SyncerClient, agent, argument, check, connect, connection, dag, entrypoint, enumType, field, func, generate, getRegisteredClass, getTracer, object, up }; export type { AddressDirectoryOpts, AddressFileOpts, AgentGroupComposeOpts, BuildArg, CallbackFct, ChangesetWithChangesetOpts, ChangesetWithChangesetsOpts, CheckGroupRunOpts, ClientCacheVolumeOpts, ClientContainerOpts, ClientCurrentTypeDefsOpts, ClientEngineVolumeOpts, ClientEnvFileOpts, ClientFileOpts, ClientGitOpts, ClientHttpOpts, ClientLLMOpts, ClientModuleSourceOpts, ClientSecretOpts, ClientSshfsVolumeOpts, ConnectOpts, ContainerAsServiceOpts, ContainerAsTarballOpts, ContainerDirectoryOpts, ContainerExistsOpts, ContainerExportImageOpts, ContainerExportOpts, ContainerFileOpts, ContainerFromOpts, ContainerImportOpts, ContainerLayerOpts, ContainerManifestOpts, ContainerPublishOpts, ContainerStatOpts, ContainerTerminalOpts, ContainerUpOpts, ContainerWithDefaultTerminalCmdOpts, ContainerWithDirectoryOpts, ContainerWithDockerHealthcheckOpts, ContainerWithEntrypointOpts, ContainerWithEnvVariableOpts, ContainerWithExecOpts, ContainerWithExposedPortOpts, ContainerWithFileOpts, ContainerWithFilesOpts, ContainerWithMountedCacheOpts, ContainerWithMountedDirectoryOpts, ContainerWithMountedFileOpts, ContainerWithMountedSecretOpts, ContainerWithMountedTempOpts, ContainerWithMountedVolumeOpts, ContainerWithNewFileOpts, ContainerWithSymlinkOpts, ContainerWithUnixSocketOpts, ContainerWithWorkdirOpts, ContainerWithoutDirectoryOpts, ContainerWithoutEntrypointOpts, ContainerWithoutExposedPortOpts, ContainerWithoutFileOpts, ContainerWithoutFilesOpts, ContainerWithoutMountOpts, ContainerWithoutUnixSocketOpts, CurrentModuleGeneratorsOpts, CurrentModuleWorkdirOpts, DirectoryAsModuleOpts, DirectoryAsModuleSourceOpts, DirectoryAsWorkspaceOpts, DirectoryDockerBuildOpts, DirectoryEntriesOpts, DirectoryExistsOpts, DirectoryExportOpts, DirectoryFilterOpts, DirectorySearchOpts, DirectoryStatOpts, DirectoryTerminalOpts, DirectoryWithDirectoryOpts, DirectoryWithFileOpts, DirectoryWithFilesOpts, DirectoryWithNewDirectoryOpts, DirectoryWithNewFileOpts, DirectoryWithPatchFileOpts, DirectoryWithPatchOpts, EngineCacheEntrySetOpts, EngineCachePruneOpts, EnvFileGetOpts, EnvFileVariablesOpts, Exportable, FileAsEnvFileOpts, FileContentsOpts, FileDigestOpts, FileExportOpts, FileSearchOpts, FileWithReplacedOpts, FunctionWithArgOpts, FunctionWithCachePolicyOpts, FunctionWithDeprecatedOpts, GeneratorGroupChangesOpts, GitCommitAncestorReleaseTagOpts, GitCommitReleaseTagOpts, GitCommitTreeOpts, GitRefAsWorkspaceOpts, GitRefLogOpts, GitRefTreeOpts, GitRepositoryAsWorkspaceOpts, GitRepositoryBranchesOpts, GitRepositoryTagsOpts, HostDirectoryOpts, HostFileOpts, HostFindUpOpts, HostServiceOpts, HostTunnelOpts, ID, JSON, JSONValueContentsOpts, LLMContentBlockInput, LLMLoopOpts, LLMStepOpts, LLMWithModelOpts, LLMWithResponseOpts, LLMWithToolsOpts, ModuleChecksOpts, ModuleGeneratorsOpts, ModuleServeOpts, ModuleServicesOpts, Node, PipelineLabel, Platform, PortForward, ServiceEndpointOpts, ServiceStopOpts, ServiceTerminalOpts, ServiceUpOpts, Syncer, TypeDefWithEnumMemberOpts, TypeDefWithEnumOpts, TypeDefWithEnumValueOpts, TypeDefWithFieldOpts, TypeDefWithInterfaceOpts, TypeDefWithObjectOpts, TypeDefWithScalarOpts, Void, WorkspaceAgentsOpts, WorkspaceChangesOpts, WorkspaceChecksOpts, WorkspaceConfigReadOpts, WorkspaceDirectoryOpts, WorkspaceFindRootsOpts, WorkspaceFindUpOpts, WorkspaceGeneratorsOpts, WorkspaceSearchOpts, WorkspaceServicesOpts, WorkspaceWithConfigEnvOpts, WorkspaceWithConfigValueOpts, WorkspaceWithInitClientOpts, WorkspaceWithInitModuleOpts, WorkspaceWithModuleOpts, WorkspaceWithNewFileOpts, WorkspaceWithSdkOpts, WorkspaceWithoutConfigEnvOpts, WorkspaceWithoutConfigValueOpts, WorkspaceWithoutModuleOpts, WorkspaceWithoutSdkOpts, __DirectiveArgsOpts, __FieldArgsOpts, __TypeEnumValuesOpts, __TypeFieldsOpts, __TypeInputFieldsOpts, float }; diff --git a/library/bundle/core.js b/library/bundle/core.js index 32af7c8..565177e 100644 --- a/library/bundle/core.js +++ b/library/bundle/core.js @@ -59351,12 +59351,1381 @@ var require_src27 = __commonJS((exports) => { } }); }); +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js +var require_suppress_tracing2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = undefined; + var api_1 = require_src(); + var SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); + function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); + } + exports.suppressTracing = suppressTracing; + function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); + } + exports.unsuppressTracing = unsuppressTracing; + function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; + } + exports.isTracingSuppressed = isTracingSuppressed; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/baggage/constants.js +var require_constants4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = undefined; + exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; + exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; + exports.BAGGAGE_ITEMS_SEPARATOR = ","; + exports.BAGGAGE_HEADER = "baggage"; + exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; + exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; + exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils13 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseKeyPairsIntoRecord = exports.parseBaggageHeaderString = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = undefined; + var api_1 = require_src(); + var constants_1 = require_constants4(); + function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ""); + } + exports.serializeKeyPairs = serializeKeyPairs; + function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); + } + exports.getKeyPairs = getKeyPairs; + function parsePairKeyValue(entry) { + if (!entry) + return; + const metadataSeparatorIndex = entry.indexOf(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + const keyPairPart = metadataSeparatorIndex === -1 ? entry : entry.substring(0, metadataSeparatorIndex); + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const rawKey = keyPairPart.substring(0, separatorIndex).trim(); + const rawValue = keyPairPart.substring(separatorIndex + 1).trim(); + if (!rawKey || !rawValue) + return; + let key; + let value; + try { + key = decodeURIComponent(rawKey); + value = decodeURIComponent(rawValue); + } catch { + return; + } + let metadata; + if (metadataSeparatorIndex !== -1 && metadataSeparatorIndex < entry.length - 1) { + const metadataString = entry.substring(metadataSeparatorIndex + 1); + metadata = (0, api_1.baggageEntryMetadataFromString)(metadataString); + } + return { key, value, metadata }; + } + exports.parsePairKeyValue = parsePairKeyValue; + function parseBaggageHeaderString(value, baggage, count, totalSize) { + let start = 0; + while (start < value.length && count < constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS) { + const end = value.indexOf(constants_1.BAGGAGE_ITEMS_SEPARATOR, start); + const entryEnd = end === -1 ? value.length : end; + const entryLength = entryEnd - start; + if (entryLength <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS) { + const keyPair = parsePairKeyValue(value.substring(start, entryEnd)); + if (keyPair) { + const entrySize = (count === 0 ? 0 : 1) + entryLength; + if (totalSize + entrySize > constants_1.BAGGAGE_MAX_TOTAL_LENGTH) + break; + baggage[keyPair.key] = keyPair.metadata ? { value: keyPair.value, metadata: keyPair.metadata } : { value: keyPair.value }; + count++; + totalSize += entrySize; + } + } + if (end === -1) + break; + start = end + 1; + } + return [count, totalSize]; + } + exports.parseBaggageHeaderString = parseBaggageHeaderString; + function parseKeyPairsIntoRecord(value) { + const result = {}; + if (typeof value === "string" && value.length > 0) { + value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = parsePairKeyValue(entry); + if (keyPair !== undefined && keyPair.value.length > 0) { + result[keyPair.key] = keyPair.value; + } + }); + } + return result; + } + exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js +var require_W3CBaggagePropagator2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CBaggagePropagator = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing2(); + var constants_1 = require_constants4(); + var utils_1 = require_utils13(); + + class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + if (!headerValue) { + return context; + } + const baggage = {}; + let count = 0; + let totalSize = 0; + if (Array.isArray(headerValue)) { + for (let i = 0;i < headerValue.length; i++) { + [count, totalSize] = (0, utils_1.parseBaggageHeaderString)(headerValue[i], baggage, count, totalSize); + } + } else { + [count] = (0, utils_1.parseBaggageHeaderString)(headerValue, baggage, count, totalSize); + } + if (count === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } + } + exports.W3CBaggagePropagator = W3CBaggagePropagator; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js +var require_anchored_clock2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AnchoredClock = undefined; + + class AnchoredClock { + _monotonicClock; + _epochMillis; + _performanceMillis; + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } + } + exports.AnchoredClock = AnchoredClock; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/attributes.js +var require_attributes2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = undefined; + var api_1 = require_src(); + function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== "object" || attributes == null) { + return out; + } + for (const key in attributes) { + if (!Object.prototype.hasOwnProperty.call(attributes, key)) { + continue; + } + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + const val = attributes[key]; + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } else { + out[key] = val; + } + } + return out; + } + exports.sanitizeAttributes = sanitizeAttributes; + function isAttributeKey(key) { + return typeof key === "string" && key !== ""; + } + exports.isAttributeKey = isAttributeKey; + function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValueType(typeof val); + } + exports.isAttributeValue = isAttributeValue; + function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + if (element == null) + continue; + const elementType = typeof element; + if (elementType === type) { + continue; + } + if (!type) { + if (isValidPrimitiveAttributeValueType(elementType)) { + type = elementType; + continue; + } + return false; + } + return false; + } + return true; + } + function isValidPrimitiveAttributeValueType(valType) { + switch (valType) { + case "number": + case "boolean": + case "string": + return true; + } + return false; + } +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js +var require_logging_error_handler2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.loggingErrorHandler = undefined; + var api_1 = require_src(); + function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; + } + exports.loggingErrorHandler = loggingErrorHandler; + function stringifyException(ex) { + if (typeof ex === "string") { + return ex; + } else { + return JSON.stringify(flattenException(ex)); + } + } + function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach((propertyName) => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; + } +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js +var require_global_error_handler2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.globalErrorHandler = exports.setGlobalErrorHandler = undefined; + var logging_error_handler_1 = require_logging_error_handler2(); + var delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/platform/node/environment.js +var require_environment3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = undefined; + var api_1 = require_src(); + var util_1 = __require("util"); + function getNumberFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + const value = Number(raw); + if (isNaN(value)) { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); + return; + } + return value; + } + exports.getNumberFromEnv = getNumberFromEnv; + function getStringFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + return raw; + } + exports.getStringFromEnv = getStringFromEnv; + function getBooleanFromEnv(key) { + const raw = process.env[key]?.trim().toLowerCase(); + if (raw == null || raw === "") { + return false; + } + if (raw === "true") { + return true; + } else if (raw === "false") { + return false; + } else { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + return false; + } + } + exports.getBooleanFromEnv = getBooleanFromEnv; + function getStringListFromEnv(key) { + return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); + } + exports.getStringListFromEnv = getStringListFromEnv; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/globalThis.js +var require_globalThis2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._globalThis = undefined; + exports._globalThis = globalThis; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/version.js +var require_version9 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = undefined; + exports.VERSION = "2.9.0"; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/semconv.js +var require_semconv7 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_PROCESS_RUNTIME_NAME = undefined; + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js +var require_sdk_info2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SDK_INFO = undefined; + var version_1 = require_version9(); + var semantic_conventions_1 = require_src2(); + var semconv_1 = require_semconv7(); + exports.SDK_INFO = { + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION + }; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node12 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.otperformance = exports.SDK_INFO = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = undefined; + var environment_1 = require_environment3(); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return environment_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return environment_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return environment_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return environment_1.getStringListFromEnv; + } }); + var globalThis_1 = require_globalThis2(); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return globalThis_1._globalThis; + } }); + var sdk_info_1 = require_sdk_info2(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return sdk_info_1.SDK_INFO; + } }); + exports.otperformance = performance; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform11 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.otperformance = exports._globalThis = exports.SDK_INFO = undefined; + var node_1 = require_node12(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return node_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return node_1._globalThis; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return node_1.otperformance; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return node_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return node_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return node_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return node_1.getStringListFromEnv; + } }); +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/time.js +var require_time2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToSeconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = undefined; + var platform_1 = require_platform11(); + var NANOSECOND_DIGITS = 9; + var NANOSECOND_DIGITS_IN_MILLIS = 6; + var MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); + var SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + const seconds = Math.trunc(epochSeconds); + const nanos = Math.round(epochMillis % 1000 * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; + } + exports.millisToHrTime = millisToHrTime; + function getTimeOrigin() { + return platform_1.otperformance.timeOrigin; + } + exports.getTimeOrigin = getTimeOrigin; + function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(platform_1.otperformance.timeOrigin); + const now = millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); + } + exports.hrTime = hrTime; + function timeInputToHrTime(time) { + if (isTimeInputHrTime(time)) { + return time; + } else if (typeof time === "number") { + if (time < platform_1.otperformance.timeOrigin / 2) { + return hrTime(time); + } else { + return millisToHrTime(time); + } + } else if (time instanceof Date) { + return millisToHrTime(time.getTime()); + } else { + throw TypeError("Invalid input type"); + } + } + exports.timeInputToHrTime = timeInputToHrTime; + function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + if (nanos < 0) { + seconds -= 1; + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; + } + exports.hrTimeDuration = hrTimeDuration; + function hrTimeToTimeStamp(time) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date = new Date(time[0] * 1000).toISOString(); + return date.replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + function hrTimeToNanoseconds(time) { + return time[0] * SECOND_TO_NANOSECONDS + time[1]; + } + exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + function hrTimeToMicroseconds(time) { + return time[0] * 1e6 + time[1] / 1000; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + function hrTimeToMilliseconds(time) { + return time[0] * 1000 + time[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + function hrTimeToSeconds(time) { + return time[0] + time[1] / SECOND_TO_NANOSECONDS; + } + exports.hrTimeToSeconds = hrTimeToSeconds; + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + function addHrTimes(time1, time2) { + const out = [time1[0] + time2[0], time1[1] + time2[1]]; + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; + } + exports.addHrTimes = addHrTimes; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/timer-util.js +var require_timer_util2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = undefined; + function unrefTimer(timer) { + if (typeof timer !== "number") { + timer.unref(); + } + } + exports.unrefTimer = unrefTimer; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/ExportResult.js +var require_ExportResult2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExportResultCode = undefined; + var ExportResultCode; + (function(ExportResultCode2) { + ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED"; + })(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/propagation/composite.js +var require_composite2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CompositePropagator = undefined; + var api_1 = require_src(); + + class CompositePropagator { + _propagators; + _fields; + constructor(config = {}) { + this._propagators = config.propagators ?? []; + const fields = new Set; + for (const propagator of this._propagators) { + const propagatorFields = typeof propagator.fields === "function" ? propagator.fields() : []; + for (const field of propagatorFields) { + fields.add(field); + } + } + this._fields = Array.from(fields); + } + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + return this._fields.slice(); + } + } + exports.CompositePropagator = CompositePropagator; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/internal/validators.js +var require_validators2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateValue = exports.validateKey = undefined; + var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + var VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + var VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + var VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + exports.validateKey = validateKey; + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/trace/TraceState.js +var require_TraceState2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceState = undefined; + var validators_1 = require_validators2(); + var MAX_TRACE_STATE_ITEMS = 32; + var MAX_TRACE_STATE_LEN = 512; + var LIST_MEMBERS_SEPARATOR = ","; + var LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + + class TraceState { + _length; + _rawTraceState; + _internalState; + constructor(rawTraceState) { + this._rawTraceState = typeof rawTraceState === "string" ? rawTraceState : ""; + this._length = this._rawTraceState.length; + } + set(key, value) { + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) { + return this; + } + const currState = this._getState(); + const currValue = currState.get(key); + let newLength = this._length; + if (typeof currValue === "string") { + newLength += value.length - currValue.length; + } else { + newLength += key.length + value.length + (currState.size > 0 ? 2 : 1); + } + if (newLength > MAX_TRACE_STATE_LEN) { + return this; + } + const newState = new Map(currState); + newState.delete(key); + newState.set(key, value); + return this._fromState(newState, newLength); + } + unset(key) { + const currState = this._getState(); + const currValue = currState.get(key); + if (typeof currValue !== "string") { + return this; + } + let newLength = this._length - (key.length + currValue.length + 1); + if (currState.size > 1) { + newLength = newLength - 1; + } + const newState = new Map(currState); + newState.delete(key); + return this._fromState(newState, newLength); + } + get(key) { + const currState = this._getState(); + return currState.get(key); + } + serialize() { + let serialized = ""; + let index = 0; + for (const entry of this._getState()) { + if (index > 0) { + serialized = LIST_MEMBERS_SEPARATOR + serialized; + } + serialized = `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized; + index++; + } + return serialized; + } + _getState() { + if (this._internalState) { + return this._internalState; + } + const vendorMembers = this._rawTraceState.split(LIST_MEMBERS_SEPARATOR); + const vendorEntries = new Map; + let currentLength = 0; + for (const member of vendorMembers) { + const m = member.trim(); + const idx = m.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (idx === -1) { + continue; + } + const key = m.slice(0, idx); + const value = m.slice(idx + 1); + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) { + continue; + } + const futureLength = currentLength + m.length + (vendorEntries.size > 0 ? 1 : 0); + if (futureLength > MAX_TRACE_STATE_LEN) { + continue; + } + vendorEntries.set(key, value); + currentLength = futureLength; + if (vendorEntries.size >= MAX_TRACE_STATE_ITEMS) { + break; + } + } + this._length = currentLength; + this._internalState = new Map(Array.from(vendorEntries.entries()).reverse()); + return this._internalState; + } + _fromState(state, length) { + const traceState = Object.create(TraceState.prototype); + traceState._internalState = state; + traceState._length = length; + return traceState; + } + } + exports.TraceState = TraceState; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js +var require_W3CTraceContextPropagator2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing2(); + var TraceState_1 = require_TraceState2(); + exports.TRACE_PARENT_HEADER = "traceparent"; + exports.TRACE_STATE_HEADER = "tracestate"; + var VERSION = "00"; + var VERSION_PART = "(?!ff)[\\da-f]{2}"; + var TRACE_ID_PART = "(?![0]{32})[\\da-f]{32}"; + var PARENT_ID_PART = "(?![0]{16})[\\da-f]{16}"; + var FLAGS_PART = "[\\da-f]{2}"; + var TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); + function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + if (match[1] === "00" && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16) + }; + } + exports.parseTraceParent = parseTraceParent; + + class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context) || !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; + if (typeof traceParent !== "string") + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } + } + exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +var require_rpc_metadata2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = undefined; + var api_1 = require_src(); + var RPC_METADATA_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); + var RPCType; + (function(RPCType2) { + RPCType2["HTTP"] = "http"; + })(RPCType = exports.RPCType || (exports.RPCType = {})); + function setRPCMetadata(context, meta) { + return context.setValue(RPC_METADATA_KEY, meta); + } + exports.setRPCMetadata = setRPCMetadata; + function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); + } + exports.deleteRPCMetadata = deleteRPCMetadata; + function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); + } + exports.getRPCMetadata = getRPCMetadata; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js +var require_lodash_merge2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPlainObject = undefined; + var objectTag = "[object Object]"; + var nullTag = "[object Null]"; + var undefinedTag = "[object Undefined]"; + var funcProto = Function.prototype; + var funcToString = funcProto.toString; + var objectCtorString = funcToString.call(Object); + var getPrototypeOf = Object.getPrototypeOf; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + var nativeObjectToString = objectProto.toString; + function isPlainObject2(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototypeOf(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + exports.isPlainObject = isPlainObject2; + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } catch {} + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + function objectToString(value) { + return nativeObjectToString.call(value); + } +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/merge.js +var require_merge2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = undefined; + var lodash_merge_1 = require_lodash_merge2(); + var MAX_LEVEL = 20; + function merge(...args) { + let result = args.shift(); + const objects = new WeakMap; + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; + } + exports.merge = merge; + function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; + } + function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length;i < j; i++) { + result.push(takeValue(two[i])); + } + } else if (isObject(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + continue; + } + result[key] = takeValue(two[key]); + } + } + } else if (isObject(one)) { + if (isObject(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + continue; + } + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === "undefined") { + delete result[key]; + } else { + result[key] = twoValue; + } + } else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) { + delete result[key]; + } else { + if (isObject(obj1) && isObject(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else { + result = two; + } + } + return result; + } + function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length;i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; + } + function isArray(value) { + return Array.isArray(value); + } + function isFunction(value) { + return typeof value === "function"; + } + function isObject(value) { + return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; + } + function isPrimitive(value) { + return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; + } + function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; + } +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/timeout.js +var require_timeout2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.callWithTimeout = exports.TimeoutError = undefined; + + class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + } + exports.TimeoutError = TimeoutError; + function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/url.js +var require_url2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isUrlIgnored = exports.urlMatches = undefined; + function urlMatches(url, urlToMatch) { + if (typeof urlToMatch === "string") { + return url === urlToMatch; + } else { + return !!url.match(urlToMatch); + } + } + exports.urlMatches = urlMatches; + function isUrlIgnored(url, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url, ignoreUrl)) { + return true; + } + } + return false; + } + exports.isUrlIgnored = isUrlIgnored; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/promise.js +var require_promise2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Deferred = undefined; + + class Deferred { + _promise; + _resolve; + _reject; + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } + } + exports.Deferred = Deferred; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/callback.js +var require_callback2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BindOnceFuture = undefined; + var promise_1 = require_promise2(); + + class BindOnceFuture { + _isCalled = false; + _deferred = new promise_1.Deferred; + _callback; + _that; + constructor(callback, that) { + this._callback = callback; + this._that = that; + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); + } catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } + } + exports.BindOnceFuture = BindOnceFuture; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/configuration.js +var require_configuration2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = undefined; + var api_1 = require_src(); + var logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE + }; + function diagLogLevelFromString(value) { + if (value == null) { + return; + } + const resolvedLogLevel = logLevelMap[value.toUpperCase()]; + if (resolvedLogLevel == null) { + api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); + return api_1.DiagLogLevel.INFO; + } + return resolvedLogLevel; + } + exports.diagLogLevelFromString = diagLogLevelFromString; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/internal/exporter.js +var require_exporter2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._export = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing2(); + function _export(exporter, arg) { + return new Promise((resolve) => { + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, resolve); + }); + }); + } + exports._export = _export; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/index.js +var require_src28 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.unrefTimer = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToSeconds = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = undefined; + exports.internal = undefined; + var W3CBaggagePropagator_1 = require_W3CBaggagePropagator2(); + Object.defineProperty(exports, "W3CBaggagePropagator", { enumerable: true, get: function() { + return W3CBaggagePropagator_1.W3CBaggagePropagator; + } }); + var anchored_clock_1 = require_anchored_clock2(); + Object.defineProperty(exports, "AnchoredClock", { enumerable: true, get: function() { + return anchored_clock_1.AnchoredClock; + } }); + var attributes_1 = require_attributes2(); + Object.defineProperty(exports, "isAttributeValue", { enumerable: true, get: function() { + return attributes_1.isAttributeValue; + } }); + Object.defineProperty(exports, "sanitizeAttributes", { enumerable: true, get: function() { + return attributes_1.sanitizeAttributes; + } }); + var global_error_handler_1 = require_global_error_handler2(); + Object.defineProperty(exports, "globalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.globalErrorHandler; + } }); + Object.defineProperty(exports, "setGlobalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } }); + var logging_error_handler_1 = require_logging_error_handler2(); + Object.defineProperty(exports, "loggingErrorHandler", { enumerable: true, get: function() { + return logging_error_handler_1.loggingErrorHandler; + } }); + var time_1 = require_time2(); + Object.defineProperty(exports, "addHrTimes", { enumerable: true, get: function() { + return time_1.addHrTimes; + } }); + Object.defineProperty(exports, "getTimeOrigin", { enumerable: true, get: function() { + return time_1.getTimeOrigin; + } }); + Object.defineProperty(exports, "hrTime", { enumerable: true, get: function() { + return time_1.hrTime; + } }); + Object.defineProperty(exports, "hrTimeDuration", { enumerable: true, get: function() { + return time_1.hrTimeDuration; + } }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMicroseconds; + } }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMilliseconds; + } }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { enumerable: true, get: function() { + return time_1.hrTimeToNanoseconds; + } }); + Object.defineProperty(exports, "hrTimeToSeconds", { enumerable: true, get: function() { + return time_1.hrTimeToSeconds; + } }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { enumerable: true, get: function() { + return time_1.hrTimeToTimeStamp; + } }); + Object.defineProperty(exports, "isTimeInput", { enumerable: true, get: function() { + return time_1.isTimeInput; + } }); + Object.defineProperty(exports, "isTimeInputHrTime", { enumerable: true, get: function() { + return time_1.isTimeInputHrTime; + } }); + Object.defineProperty(exports, "millisToHrTime", { enumerable: true, get: function() { + return time_1.millisToHrTime; + } }); + Object.defineProperty(exports, "timeInputToHrTime", { enumerable: true, get: function() { + return time_1.timeInputToHrTime; + } }); + var timer_util_1 = require_timer_util2(); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return timer_util_1.unrefTimer; + } }); + var ExportResult_1 = require_ExportResult2(); + Object.defineProperty(exports, "ExportResultCode", { enumerable: true, get: function() { + return ExportResult_1.ExportResultCode; + } }); + var utils_1 = require_utils13(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { enumerable: true, get: function() { + return utils_1.parseKeyPairsIntoRecord; + } }); + var platform_1 = require_platform11(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return platform_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return platform_1._globalThis; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return platform_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return platform_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return platform_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return platform_1.getStringListFromEnv; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return platform_1.otperformance; + } }); + var composite_1 = require_composite2(); + Object.defineProperty(exports, "CompositePropagator", { enumerable: true, get: function() { + return composite_1.CompositePropagator; + } }); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator2(); + Object.defineProperty(exports, "TRACE_PARENT_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; + } }); + Object.defineProperty(exports, "TRACE_STATE_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; + } }); + Object.defineProperty(exports, "W3CTraceContextPropagator", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.W3CTraceContextPropagator; + } }); + Object.defineProperty(exports, "parseTraceParent", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.parseTraceParent; + } }); + var rpc_metadata_1 = require_rpc_metadata2(); + Object.defineProperty(exports, "RPCType", { enumerable: true, get: function() { + return rpc_metadata_1.RPCType; + } }); + Object.defineProperty(exports, "deleteRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.deleteRPCMetadata; + } }); + Object.defineProperty(exports, "getRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.getRPCMetadata; + } }); + Object.defineProperty(exports, "setRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.setRPCMetadata; + } }); + var suppress_tracing_1 = require_suppress_tracing2(); + Object.defineProperty(exports, "isTracingSuppressed", { enumerable: true, get: function() { + return suppress_tracing_1.isTracingSuppressed; + } }); + Object.defineProperty(exports, "suppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.suppressTracing; + } }); + Object.defineProperty(exports, "unsuppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.unsuppressTracing; + } }); + var TraceState_1 = require_TraceState2(); + Object.defineProperty(exports, "TraceState", { enumerable: true, get: function() { + return TraceState_1.TraceState; + } }); + var merge_1 = require_merge2(); + Object.defineProperty(exports, "merge", { enumerable: true, get: function() { + return merge_1.merge; + } }); + var timeout_1 = require_timeout2(); + Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() { + return timeout_1.TimeoutError; + } }); + Object.defineProperty(exports, "callWithTimeout", { enumerable: true, get: function() { + return timeout_1.callWithTimeout; + } }); + var url_1 = require_url2(); + Object.defineProperty(exports, "isUrlIgnored", { enumerable: true, get: function() { + return url_1.isUrlIgnored; + } }); + Object.defineProperty(exports, "urlMatches", { enumerable: true, get: function() { + return url_1.urlMatches; + } }); + var callback_1 = require_callback2(); + Object.defineProperty(exports, "BindOnceFuture", { enumerable: true, get: function() { + return callback_1.BindOnceFuture; + } }); + var configuration_1 = require_configuration2(); + Object.defineProperty(exports, "diagLogLevelFromString", { enumerable: true, get: function() { + return configuration_1.diagLogLevelFromString; + } }); + var exporter_1 = require_exporter2(); + exports.internal = { + _export: exporter_1._export + }; +}); + // node_modules/@opentelemetry/propagator-jaeger/build/src/JaegerPropagator.js var require_JaegerPropagator = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.JaegerPropagator = exports.UBER_BAGGAGE_HEADER_PREFIX = exports.UBER_TRACE_ID_HEADER = undefined; var api_1 = require_src(); - var core_1 = require_src3(); + var core_1 = require_src28(); exports.UBER_TRACE_ID_HEADER = "uber-trace-id"; exports.UBER_BAGGAGE_HEADER_PREFIX = "uberctx"; @@ -59408,8 +60777,14 @@ var require_JaegerPropagator = __commonJS((exports) => { for (const baggageEntry of baggageValues) { if (baggageEntry.value === undefined) continue; + let decodedValue; + try { + decodedValue = decodeURIComponent(baggageEntry.value); + } catch { + continue; + } currentBaggage = currentBaggage.setEntry(baggageEntry.key, { - value: decodeURIComponent(baggageEntry.value) + value: decodedValue }); } newContext = api_1.propagation.setBaggage(newContext, currentBaggage); @@ -59422,7 +60797,13 @@ var require_JaegerPropagator = __commonJS((exports) => { exports.JaegerPropagator = JaegerPropagator; var VALID_HEX_RE = /^[0-9a-f]{1,2}$/i; function deserializeSpanContext(serializedString) { - const headers = decodeURIComponent(serializedString).split(":"); + let decoded; + try { + decoded = decodeURIComponent(serializedString); + } catch { + return null; + } + const headers = decoded.split(":"); if (headers.length !== 4) { return null; } @@ -59435,7 +60816,7 @@ var require_JaegerPropagator = __commonJS((exports) => { }); // node_modules/@opentelemetry/propagator-jaeger/build/src/index.js -var require_src28 = __commonJS((exports) => { +var require_src29 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.UBER_TRACE_ID_HEADER = exports.UBER_BAGGAGE_HEADER_PREFIX = exports.JaegerPropagator = undefined; var JaegerPropagator_1 = require_JaegerPropagator(); @@ -59570,7 +60951,7 @@ var require_OTLPMetricExporter = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/platform/node/index.js -var require_node12 = __commonJS((exports) => { +var require_node13 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; var OTLPMetricExporter_1 = require_OTLPMetricExporter(); @@ -59580,20 +60961,20 @@ var require_node12 = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/platform/index.js -var require_platform11 = __commonJS((exports) => { +var require_platform12 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; - var node_1 = require_node12(); + var node_1 = require_node13(); Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { return node_1.OTLPMetricExporter; } }); }); // node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/index.js -var require_src29 = __commonJS((exports) => { +var require_src30 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporterBase = exports.LowMemoryTemporalitySelector = exports.DeltaTemporalitySelector = exports.CumulativeTemporalitySelector = exports.AggregationTemporalityPreference = exports.OTLPMetricExporter = undefined; - var platform_1 = require_platform11(); + var platform_1 = require_platform12(); Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { return platform_1.OTLPMetricExporter; } }); @@ -59620,7 +61001,7 @@ var require_src29 = __commonJS((exports) => { var require_OTLPMetricExporter2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; - var exporter_metrics_otlp_http_1 = require_src29(); + var exporter_metrics_otlp_http_1 = require_src30(); var otlp_grpc_exporter_base_1 = require_src20(); var otlp_transformer_1 = require_src8(); @@ -59633,7 +61014,7 @@ var require_OTLPMetricExporter2 = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-metrics-otlp-grpc/build/src/index.js -var require_src30 = __commonJS((exports) => { +var require_src31 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; var OTLPMetricExporter_1 = require_OTLPMetricExporter2(); @@ -59646,7 +61027,7 @@ var require_src30 = __commonJS((exports) => { var require_OTLPMetricExporter3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; - var exporter_metrics_otlp_http_1 = require_src29(); + var exporter_metrics_otlp_http_1 = require_src30(); var otlp_transformer_1 = require_src8(); var node_http_1 = require_index_node_http(); @@ -59661,7 +61042,7 @@ var require_OTLPMetricExporter3 = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-metrics-otlp-proto/build/src/platform/node/index.js -var require_node13 = __commonJS((exports) => { +var require_node14 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; var OTLPMetricExporter_1 = require_OTLPMetricExporter3(); @@ -59671,27 +61052,27 @@ var require_node13 = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-metrics-otlp-proto/build/src/platform/index.js -var require_platform12 = __commonJS((exports) => { +var require_platform13 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; - var node_1 = require_node13(); + var node_1 = require_node14(); Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { return node_1.OTLPMetricExporter; } }); }); // node_modules/@opentelemetry/exporter-metrics-otlp-proto/build/src/index.js -var require_src31 = __commonJS((exports) => { +var require_src32 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; - var platform_1 = require_platform12(); + var platform_1 = require_platform13(); Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { return platform_1.OTLPMetricExporter; } }); }); // node_modules/@opentelemetry/sdk-node/build/src/utils.js -var require_utils13 = __commonJS((exports) => { +var require_utils14 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.buildSamplerFromConfig = exports.getInstanceID = exports.getMeterViewsFromConfiguration = exports.getAggregationType = exports.getInstrumentType = exports.getMeterReadersFromConfiguration = exports.getSpanLimitsFromConfiguration = exports.getSpanProcessorsFromConfiguration = exports.getSpanExporter = exports.getHttpAgentOptionsFromTls = exports.getHeadersFromConfiguration = exports.getLogRecordProcessorsFromConfiguration = exports.getLogRecordExporter = exports.getBatchLogRecordProcessorFromEnv = exports.getBatchLogRecordProcessorConfigFromEnv = exports.getLoggerProviderConfigFromEnv = exports.getPeriodicMetricReaderFromConfiguration = exports.getOtlpMetricExporterFromEnv = exports.getPeriodicExportingMetricReaderFromEnv = exports.getNonNegativeNumberFromEnv = exports.getKeyListFromObjectArray = exports.setupPropagator = exports.setupContextManager = exports.getPropagatorFromConfiguration = exports.getPropagatorFromEnv = exports.getSpanProcessorsFromEnv = exports.getOtlpProtocolFromEnv = exports.getResourceDetectorsFromConfiguration = exports.getResourceDetectorsFromEnv = exports.getResourceFromConfiguration = undefined; var api_1 = require_src(); @@ -59703,7 +61084,7 @@ var require_utils13 = __commonJS((exports) => { var resources_1 = require_src6(); var sdk_trace_base_1 = require_src12(); var propagator_b3_1 = require_src27(); - var propagator_jaeger_1 = require_src28(); + var propagator_jaeger_1 = require_src29(); var context_async_hooks_1 = require_src11(); var exporter_logs_otlp_http_1 = require_src16(); var exporter_logs_otlp_grpc_1 = require_src21(); @@ -59711,9 +61092,9 @@ var require_utils13 = __commonJS((exports) => { var otlp_exporter_base_1 = require_src4(); var otlp_grpc_exporter_base_1 = require_src20(); var sdk_metrics_1 = require_src7(); - var exporter_metrics_otlp_grpc_1 = require_src30(); - var exporter_metrics_otlp_http_1 = require_src29(); - var exporter_metrics_otlp_proto_1 = require_src31(); + var exporter_metrics_otlp_grpc_1 = require_src31(); + var exporter_metrics_otlp_http_1 = require_src30(); + var exporter_metrics_otlp_proto_1 = require_src32(); var sdk_logs_1 = require_src10(); var fs = __require("fs"); var RESOURCE_DETECTOR_ENVIRONMENT = "env"; @@ -60524,7 +61905,7 @@ var require_sdk = __commonJS((exports) => { var sdk_trace_node_1 = require_src13(); var semantic_conventions_1 = require_src2(); var core_1 = require_src3(); - var utils_1 = require_utils13(); + var utils_1 = require_utils14(); function getMetricReadersFromEnv() { const metricReaders = []; const enabledExporters = Array.from(new Set((0, core_1.getStringListFromEnv)("OTEL_METRICS_EXPORTER") ?? [])); @@ -62342,7 +63723,7 @@ var require_log = __commonJS((exports) => { }); // node_modules/yaml/dist/schema/yaml-1.1/merge.js -var require_merge2 = __commonJS((exports) => { +var require_merge3 = __commonJS((exports) => { var identity = require_identity(); var Scalar = require_Scalar(); var MERGE_KEY = "<<"; @@ -62398,7 +63779,7 @@ var require_merge2 = __commonJS((exports) => { // node_modules/yaml/dist/nodes/addPairToJSMap.js var require_addPairToJSMap = __commonJS((exports) => { var log = require_log(); - var merge = require_merge2(); + var merge = require_merge3(); var stringify = require_stringify(); var identity = require_identity(); var toJS = require_toJS(); @@ -63675,7 +65056,7 @@ var require_schema4 = __commonJS((exports) => { var bool = require_bool2(); var float = require_float3(); var int = require_int2(); - var merge = require_merge2(); + var merge = require_merge3(); var omap = require_omap(); var pairs = require_pairs(); var set = require_set(); @@ -63718,7 +65099,7 @@ var require_tags = __commonJS((exports) => { var schema = require_schema2(); var schema$1 = require_schema3(); var binary = require_binary(); - var merge = require_merge2(); + var merge = require_merge3(); var omap = require_omap(); var pairs = require_pairs(); var schema$2 = require_schema4(); @@ -67709,7 +69090,7 @@ var require_dist = __commonJS((exports) => { }); // node_modules/@opentelemetry/configuration/build/src/utils.js -var require_utils14 = __commonJS((exports) => { +var require_utils15 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getHttpTlsConfig = exports.initializeDefaultLoggerProviderConfiguration = exports.initializeDefaultMeterProviderConfiguration = exports.initializeDefaultTracerProviderConfiguration = exports.initializeDefaultConfiguration = exports.getGrpcTlsConfig = exports.substituteEnvVars = undefined; var yaml = require_dist(); @@ -67952,7 +69333,7 @@ var require_EnvironmentConfigFactory = __commonJS((exports) => { exports.setLoggerProvider = exports.setMeterProvider = exports.setTracerProvider = exports.setSampler = exports.setPropagators = exports.setAttributeLimits = exports.setResources = exports.EnvironmentConfigFactory = undefined; var core_1 = require_src3(); var api_1 = require_src(); - var utils_1 = require_utils14(); + var utils_1 = require_utils15(); var EnvReader_1 = require_EnvReader(); var EnvDefinition_1 = require_EnvDefinition(); @@ -78168,7 +79549,7 @@ var require_FileConfigFactory = __commonJS((exports) => { var core_1 = require_src3(); var fs = __require("fs"); var yaml = require_dist(); - var utils_1 = require_utils14(); + var utils_1 = require_utils15(); var validateConfig = require_validator(); class FileConfigFactory { @@ -78341,7 +79722,7 @@ var require_ConfigFactory = __commonJS((exports) => { }); // node_modules/@opentelemetry/configuration/build/src/index.js -var require_src32 = __commonJS((exports) => { +var require_src33 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createConfigFactory = undefined; var ConfigFactory_1 = require_ConfigFactory(); @@ -78351,7 +79732,7 @@ var require_src32 = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-node/build/src/semconv.js -var require_semconv7 = __commonJS((exports) => { +var require_semconv8 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_PID = exports.ATTR_HOST_NAME = undefined; exports.ATTR_HOST_NAME = "host.name"; @@ -78418,16 +79799,16 @@ var require_diag2 = __commonJS((exports) => { var require_start = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.setupResource = exports.startNodeSDK = exports.NOOP_SDK = undefined; - var configuration_1 = require_src32(); + var configuration_1 = require_src33(); var api_1 = require_src(); - var utils_1 = require_utils13(); + var utils_1 = require_utils14(); var instrumentation_1 = require_src15(); var sdk_logs_1 = require_src10(); var sdk_metrics_1 = require_src7(); var api_logs_1 = require_src5(); var resources_1 = require_src6(); var context_async_hooks_1 = require_src11(); - var semconv_1 = require_semconv7(); + var semconv_1 = require_semconv8(); var sdk_trace_base_1 = require_src12(); var diag_1 = require_diag2(); exports.NOOP_SDK = { @@ -78551,7 +79932,7 @@ var require_start = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-node/build/src/index.js -var require_src33 = __commonJS((exports) => { +var require_src34 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.startNodeSDK = exports.NodeSDK = exports.tracing = exports.resources = exports.node = exports.metrics = exports.logs = exports.core = exports.contextBase = exports.api = undefined; exports.api = require_src(); @@ -85284,7 +86665,7 @@ var init_client = __esm(() => { }); // node_modules/adm-zip/util/constants.js -var require_constants4 = __commonJS((exports, module) => { +var require_constants5 = __commonJS((exports, module) => { module.exports = { LOCHDR: 30, LOCSIG: 67324752, @@ -85452,10 +86833,10 @@ var require_errors2 = __commonJS((exports) => { }); // node_modules/adm-zip/util/utils.js -var require_utils15 = __commonJS((exports, module) => { +var require_utils16 = __commonJS((exports, module) => { var fsystem = __require("fs"); var pth = __require("path"); - var Constants = require_constants4(); + var Constants = require_constants5(); var Errors = require_errors2(); var isWin = typeof process === "object" && process.platform === "win32"; var is_Obj = (obj) => typeof obj === "object" && obj !== null; @@ -85544,38 +86925,42 @@ var require_utils15 = __commonJS((exports, module) => { if (exist && !overwrite) return callback(false); self2.fs.stat(path, function(err, stat2) { - if (exist && stat2.isDirectory()) { + if (exist && stat2 && stat2.isDirectory()) { return callback(false); } var folder = pth.dirname(path); self2.fs.exists(folder, function(exists) { - if (!exists) - self2.makeDir(folder); + if (!exists) { + try { + self2.makeDir(folder); + } catch (e2) { + return callback(false); + } + } + const writeToFd = function(fd) { + self2.fs.write(fd, content, 0, content.length, 0, function(writeErr) { + self2.fs.close(fd, function() { + if (writeErr) + return callback(false); + self2.fs.chmod(path, attr || 438, function() { + callback(true); + }); + }); + }); + }; self2.fs.open(path, "w", 438, function(err2, fd) { if (err2) { self2.fs.chmod(path, 438, function() { - self2.fs.open(path, "w", 438, function(err3, fd2) { - self2.fs.write(fd2, content, 0, content.length, 0, function() { - self2.fs.close(fd2, function() { - self2.fs.chmod(path, attr || 438, function() { - callback(true); - }); - }); - }); + self2.fs.open(path, "w", 438, function(retryErr, fd2) { + if (retryErr || !fd2) + return callback(false); + writeToFd(fd2); }); }); } else if (fd) { - self2.fs.write(fd, content, 0, content.length, 0, function() { - self2.fs.close(fd, function() { - self2.fs.chmod(path, attr || 438, function() { - callback(true); - }); - }); - }); + writeToFd(fd); } else { - self2.fs.chmod(path, attr || 438, function() { - callback(true); - }); + callback(false); } }); }); @@ -85584,7 +86969,7 @@ var require_utils15 = __commonJS((exports, module) => { }; Utils.prototype.findFiles = function(path) { const self2 = this; - function findSync(dir, pattern, recursive) { + function findSync(dir, pattern, recursive, visited) { if (typeof pattern === "boolean") { recursive = pattern; pattern = undefined; @@ -85596,44 +86981,75 @@ var require_utils15 = __commonJS((exports, module) => { if (!pattern || pattern.test(path2)) { files2.push(pth.normalize(path2) + (stat2.isDirectory() ? self2.sep : "")); } - if (stat2.isDirectory() && recursive) - files2 = files2.concat(findSync(path2, pattern, recursive)); + if (stat2.isDirectory() && recursive) { + const realDir = self2.fs.realpathSync(path2); + if (!visited.has(realDir)) { + visited.add(realDir); + files2 = files2.concat(findSync(path2, pattern, recursive, visited)); + } + } }); return files2; } - return findSync(path, undefined, true); + return findSync(path, undefined, true, new Set([self2.fs.realpathSync(path)])); }; Utils.prototype.findFilesAsync = function(dir, cb) { const self2 = this; - let results = []; - self2.fs.readdir(dir, function(err, list) { - if (err) - return cb(err); - let list_length = list.length; - if (!list_length) - return cb(null, results); - list.forEach(function(file) { - file = pth.join(dir, file); - self2.fs.stat(file, function(err2, stat2) { - if (err2) - return cb(err2); - if (stat2) { + const results = []; + let finished = false; + const finish = function(err) { + if (finished) + return; + finished = true; + cb(err, err ? undefined : results); + }; + const walk = function(dir2, visited, done) { + self2.fs.readdir(dir2, function(err, list) { + if (err) + return done(err); + let pending = list.length; + if (!pending) + return done(); + list.forEach(function(name) { + const file = pth.join(dir2, name); + self2.fs.stat(file, function(err2, stat2) { + if (err2) + return done(err2); + if (!stat2) { + if (!--pending) + done(); + return; + } results.push(pth.normalize(file) + (stat2.isDirectory() ? self2.sep : "")); - if (stat2.isDirectory()) { - self2.findFilesAsync(file, function(err3, res) { - if (err3) - return cb(err3); - results = results.concat(res); - if (!--list_length) - cb(null, results); - }); - } else { - if (!--list_length) - cb(null, results); + if (!stat2.isDirectory()) { + if (!--pending) + done(); + return; } - } + self2.fs.realpath(file, function(err3, realDir) { + if (err3) + return done(err3); + if (visited.has(realDir)) { + if (!--pending) + done(); + return; + } + visited.add(realDir); + walk(file, visited, function(err4) { + if (err4) + return done(err4); + if (!--pending) + done(); + }); + }); + }); }); }); + }; + self2.fs.realpath(dir, function(err, realDir) { + if (err) + return finish(err); + walk(dir, new Set([realDir]), finish); }); }; Utils.prototype.getAttributes = function() {}; @@ -85807,8 +87223,8 @@ var require_decoder2 = __commonJS((exports, module) => { // node_modules/adm-zip/util/index.js var require_util6 = __commonJS((exports, module) => { - module.exports = require_utils15(); - module.exports.Constants = require_constants4(); + module.exports = require_utils16(); + module.exports.Constants = require_constants5(); module.exports.Errors = require_errors2(); module.exports.FileAttr = require_fattr(); module.exports.decoder = require_decoder2(); @@ -86418,35 +87834,8 @@ var require_zipEntry = __commonJS((exports, module) => { return input.slice(_centralHeader.realDataOffset, _centralHeader.realDataOffset + _centralHeader.compressedSize); } function crc32OK(data) { - if (!_centralHeader.flags_desc && !_centralHeader.localHeader.flags_desc) { - if (Utils.crc32(data) !== _centralHeader.localHeader.crc) { - return false; - } - } else { - const descriptor = {}; - const dataEndOffset = _centralHeader.realDataOffset + _centralHeader.compressedSize; - if (input.readUInt32LE(dataEndOffset) == Constants.LOCSIG || input.readUInt32LE(dataEndOffset) == Constants.CENSIG) { - throw Utils.Errors.DESCRIPTOR_NOT_EXIST(); - } - if (input.readUInt32LE(dataEndOffset) == Constants.EXTSIG) { - descriptor.crc = input.readUInt32LE(dataEndOffset + Constants.EXTCRC); - descriptor.compressedSize = input.readUInt32LE(dataEndOffset + Constants.EXTSIZ); - descriptor.size = input.readUInt32LE(dataEndOffset + Constants.EXTLEN); - } else if (input.readUInt16LE(dataEndOffset + 12) === 19280) { - descriptor.crc = input.readUInt32LE(dataEndOffset + Constants.EXTCRC - 4); - descriptor.compressedSize = input.readUInt32LE(dataEndOffset + Constants.EXTSIZ - 4); - descriptor.size = input.readUInt32LE(dataEndOffset + Constants.EXTLEN - 4); - } else { - throw Utils.Errors.DESCRIPTOR_UNKNOWN(); - } - if (descriptor.compressedSize !== _centralHeader.compressedSize || descriptor.size !== _centralHeader.size || descriptor.crc !== _centralHeader.crc) { - throw Utils.Errors.DESCRIPTOR_FAULTY(); - } - if (Utils.crc32(data) !== descriptor.crc) { - return false; - } - } - return true; + const expectedCrc = _centralHeader.flags_desc || _centralHeader.localHeader.flags_desc ? _centralHeader.crc : _centralHeader.localHeader.crc; + return Utils.crc32(data) === expectedCrc; } function decompress(async, callback, pass) { if (typeof callback === "undefined" && typeof async === "string") { @@ -86471,9 +87860,10 @@ var require_zipEntry = __commonJS((exports, module) => { } compressedData = Methods.ZipCrypto.decrypt(compressedData, _centralHeader, pass); } - var data = Buffer.alloc(_centralHeader.size); + var data; switch (_centralHeader.method) { case Utils.Constants.STORED: + data = Buffer.alloc(compressedData.length); compressedData.copy(data); if (!crc32OK(data)) { if (async && callback) @@ -86487,15 +87877,13 @@ var require_zipEntry = __commonJS((exports, module) => { case Utils.Constants.DEFLATED: var inflater = new Methods.Inflater(compressedData, _centralHeader.size); if (!async) { - const result = inflater.inflate(data); - result.copy(data, 0); + data = inflater.inflate(); if (!crc32OK(data)) { throw Utils.Errors.BAD_CRC(`"${decoder.decode(_entryName)}"`); } return data; } else { inflater.inflateAsync(function(result) { - result.copy(result, 0); if (callback) { if (!crc32OK(result)) { callback(result, Utils.Errors.BAD_CRC()); @@ -86639,8 +88027,8 @@ var require_zipEntry = __commonJS((exports, module) => { throw Utils.Errors.COMMENT_TOO_LONG(); }, get name() { - var n = decoder.decode(_entryName); - return _isDirectory ? n.substr(n.length - 1).split("/").pop() : n.split("/").pop(); + const n = decoder.decode(_entryName); + return _isDirectory ? n.replace(/[/\\]$/, "").split("/").pop() : n.split("/").pop(); }, get isDirectory() { return _isDirectory; @@ -86741,7 +88129,7 @@ var require_zipFile = __commonJS((exports, module) => { var Headers3 = require_headers(); var Utils = require_util6(); module.exports = function(inBuffer, options) { - var entryList = [], entryTable = {}, _comment = Buffer.alloc(0), mainHeader = new Headers3.MainHeader, loadedEntries = false; + var entryList = [], entryTable = Object.create(null), _comment = Buffer.alloc(0), mainHeader = new Headers3.MainHeader, loadedEntries = false; var password = null; const temporary = new Set; const opts = options; @@ -86777,7 +88165,7 @@ var require_zipFile = __commonJS((exports, module) => { } function readEntries() { loadedEntries = true; - entryTable = {}; + entryTable = Object.create(null); if (mainHeader.diskEntries > (inBuffer.length - mainHeader.offset) / Utils.Constants.CENHDR) { throw Utils.Errors.DISK_ENTRY_TOO_LARGE(); } @@ -86835,7 +88223,7 @@ var require_zipFile = __commonJS((exports, module) => { } function sortEntries() { if (entryList.length > 1 && !noSort) { - entryList.sort((a, b) => a.entryName.toLowerCase().localeCompare(b.entryName.toLowerCase())); + entryList = entryList.map((entry) => ({ entry, key: entry.entryName.toLowerCase() })).sort((a, b) => a.key.localeCompare(b.key)).map((pair) => pair.entry); } } return { @@ -87071,6 +88459,9 @@ var require_adm_zip = __commonJS((exports, module) => { } Object.assign(opts, options); const filetools = new Utils(opts); + const applyDirAttributes = (dirEntries) => { + dirEntries.filter((d) => d.attr).sort((a, b) => b.path.length - a.path.length).forEach((d) => filetools.fs.chmodSync(d.path, d.attr)); + }; if (typeof opts.decoder !== "object" || typeof opts.decoder.encode !== "function" || typeof opts.decoder.decode !== "function") { opts.decoder = Utils.decoder; } @@ -87435,8 +88826,8 @@ var require_adm_zip = __commonJS((exports, module) => { if (!content2) { throw Utils.Errors.CANT_EXTRACT_FILE(); } - var name = canonical(child.entryName); - var childName = sanitize(targetPath, maintainEntryPath ? name : pth.basename(name)); + var name = canonical(maintainEntryPath ? child.entryName : child.entryName.substring(item.entryName.length)); + var childName = sanitize(targetPath, name); const fileAttr2 = keepOriginalPermission ? child.header.fileAttr : undefined; filetools.writeFileTo(childName, content2, overwrite, fileAttr2); }); @@ -87461,7 +88852,7 @@ var require_adm_zip = __commonJS((exports, module) => { if (entry.isDirectory) { continue; } - var content = _zip.entries[entry].getData(pass); + var content = entry.getData(pass); if (!content) { return false; } @@ -87477,10 +88868,13 @@ var require_adm_zip = __commonJS((exports, module) => { overwrite = get_Bool(false, overwrite); if (!_zip) throw Utils.Errors.NO_ZIP(); + const dirEntries = []; _zip.entries.forEach(function(entry) { var entryName = sanitize(targetPath, canonical(entry.entryName)); if (entry.isDirectory) { filetools.makeDir(entryName); + if (keepOriginalPermission) + dirEntries.push({ path: entryName, attr: entry.header.fileAttr }); return; } var content = entry.getData(pass); @@ -87491,10 +88885,9 @@ var require_adm_zip = __commonJS((exports, module) => { filetools.writeFileTo(entryName, content, overwrite, fileAttr); try { filetools.fs.utimesSync(entryName, entry.header.time, entry.header.time); - } catch (err) { - throw Utils.Errors.CANT_EXTRACT_FILE(); - } + } catch (err) {} }); + applyDirAttributes(dirEntries); }, extractAllToAsync: function(targetPath, overwrite, keepOriginalPermission, callback) { callback = get_Fun(overwrite, keepOriginalPermission, callback); @@ -87527,18 +88920,32 @@ var require_adm_zip = __commonJS((exports, module) => { fileEntries.push(e2); } }); + const deferredDirAttr = []; for (const entry of dirEntries) { const dirPath = getPath(entry); const dirAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; try { filetools.makeDir(dirPath); - if (dirAttr) - filetools.fs.chmodSync(dirPath, dirAttr); - filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time); } catch (er) { callback(getError("Unable to create folder", dirPath)); + continue; } + if (dirAttr) + deferredDirAttr.push({ path: dirPath, attr: dirAttr }); + try { + filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time); + } catch (er) {} } + const done = (err) => { + if (!err) { + try { + applyDirAttributes(deferredDirAttr); + } catch (er) { + return callback(getError("Unable to set folder permissions", er.path || "")); + } + } + callback(err); + }; fileEntries.reverse().reduce(function(next, entry) { return function(err) { if (err) { @@ -87555,21 +88962,17 @@ var require_adm_zip = __commonJS((exports, module) => { const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; filetools.writeFileToAsync(filePath, content, overwrite, fileAttr, function(succ) { if (!succ) { - next(getError("Unable to write file", filePath)); + return next(getError("Unable to write file", filePath)); } - filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function(err_2) { - if (err_2) { - next(getError("Unable to set times", filePath)); - } else { - next(); - } + filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function() { + next(); }); }); } }); } }; - }, callback)(); + }, done)(); }, writeZip: function(targetFileName, callback) { if (arguments.length === 1) { @@ -98394,7 +99797,7 @@ var init_bin = __esm(() => { }); // src/provisioning/default.ts -var CLI_VERSION = "1.0.0-beta.9"; +var CLI_VERSION = "1.0.0-beta.10"; // src/provisioning/index.ts var exports_provisioning = {}; @@ -99421,7 +100824,7 @@ var opentelemetry2 = __toESM(require_src(), 1); // src/telemetry/init.ts var import_core = __toESM(require_src3(), 1); var import_exporter_trace_otlp_proto = __toESM(require_src9(), 1); -var import_sdk_node = __toESM(require_src33(), 1); +var import_sdk_node = __toESM(require_src34(), 1); var import_sdk_trace_base2 = __toESM(require_src12(), 1); // src/telemetry/live_processor.ts @@ -100779,9 +102182,13 @@ class Check extends BaseClient { const response = await ctx.execute(); return response; }; - error = () => { - const ctx = this._ctx.select("error"); - return new Error2(ctx); + error = async () => { + const ctx = this._ctx.select("error").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Error2(ctx.copy().selectNode(response, "Error")); }; name = async () => { if (this._name) { @@ -100974,9 +102381,13 @@ class Container extends BaseClient { const ctx = this._ctx.select("directory", { path, ...opts }); return new Directory(ctx); }; - dockerHealthcheck = () => { - const ctx = this._ctx.select("dockerHealthcheck"); - return new HealthcheckConfig(ctx); + dockerHealthcheck = async () => { + const ctx = this._ctx.select("dockerHealthcheck").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new HealthcheckConfig(ctx.copy().selectNode(response, "HealthcheckConfig")); }; entrypoint = async () => { const ctx = this._ctx.select("entrypoint"); @@ -101133,9 +102544,13 @@ class Container extends BaseClient { const ctx = this._ctx.select("rootfs"); return new Directory(ctx); }; - stat = (path, opts) => { - const ctx = this._ctx.select("stat", { path, ...opts }); - return new Stat(ctx); + stat = async (path, opts) => { + const ctx = this._ctx.select("stat", { path, ...opts }).select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Stat(ctx.copy().selectNode(response, "Stat")); }; stderr = async () => { if (this._stderr) { @@ -101751,9 +103166,13 @@ class Directory extends BaseClient { const response = await ctx.execute(); return response.map((r) => new SearchResult(ctx.copy().selectNode(r.id, "SearchResult"))); }; - stat = (path, opts) => { - const ctx = this._ctx.select("stat", { path, ...opts }); - return new Stat(ctx); + stat = async (path, opts) => { + const ctx = this._ctx.select("stat", { path, ...opts }).select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Stat(ctx.copy().selectNode(response, "Stat")); }; sync = async () => { const ctx = this._ctx.select("sync"); @@ -102108,9 +103527,13 @@ class EnumTypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; sourceModuleName = async () => { if (this._sourceModuleName) { @@ -102173,263 +103596,271 @@ class EnumValueTypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); - }; - value = async () => { - if (this._value) { - return this._value; - } - const ctx = this._ctx.select("value"); - const response = await ctx.execute(); - return response; - }; -} - -class EnvFile extends BaseClient { - _id = undefined; - _exists = undefined; - _get = undefined; - constructor(ctx, _id, _exists, _get) { - super(ctx); - this._id = _id; - this._exists = _exists; - this._get = _get; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); - const response = await ctx.execute(); - return response; - }; - asFile = () => { - const ctx = this._ctx.select("asFile"); - return new File(ctx); - }; - exists = async (name) => { - if (this._exists) { - return this._exists; - } - const ctx = this._ctx.select("exists", { name }); - const response = await ctx.execute(); - return response; - }; - get = async (name, opts) => { - if (this._get) { - return this._get; - } - const ctx = this._ctx.select("get", { name, ...opts }); - const response = await ctx.execute(); - return response; - }; - namespace_ = (prefix) => { - const ctx = this._ctx.select("namespace", { prefix }); - return new EnvFile(ctx); - }; - variables = async (opts) => { - const ctx = this._ctx.select("variables", { ...opts }).select("id"); - const response = await ctx.execute(); - return response.map((r) => new EnvVariable(ctx.copy().selectNode(r.id, "EnvVariable"))); - }; - withVariable = (name, value) => { - const ctx = this._ctx.select("withVariable", { name, value }); - return new EnvFile(ctx); - }; - withoutVariable = (name) => { - const ctx = this._ctx.select("withoutVariable", { name }); - return new EnvFile(ctx); - }; - with = (arg) => { - return arg(this); - }; -} - -class EnvVariable extends BaseClient { - _id = undefined; - _name = undefined; - _value = undefined; - constructor(ctx, _id, _name, _value) { - super(ctx); - this._id = _id; - this._name = _name; - this._value = _value; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); - const response = await ctx.execute(); - return response; - }; - name = async () => { - if (this._name) { - return this._name; - } - const ctx = this._ctx.select("name"); - const response = await ctx.execute(); - return response; - }; - value = async () => { - if (this._value) { - return this._value; - } - const ctx = this._ctx.select("value"); - const response = await ctx.execute(); - return response; - }; -} - -class Error2 extends BaseClient { - _id = undefined; - _message = undefined; - constructor(ctx, _id, _message) { - super(ctx); - this._id = _id; - this._message = _message; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); - const response = await ctx.execute(); - return response; - }; - message = async () => { - if (this._message) { - return this._message; - } - const ctx = this._ctx.select("message"); - const response = await ctx.execute(); - return response; - }; - values = async () => { - const ctx = this._ctx.select("values").select("id"); - const response = await ctx.execute(); - return response.map((r) => new ErrorValue(ctx.copy().selectNode(r.id, "ErrorValue"))); - }; - withValue = (name, value) => { - const ctx = this._ctx.select("withValue", { name, value }); - return new Error2(ctx); - }; - with = (arg) => { - return arg(this); - }; -} - -class ErrorValue extends BaseClient { - _id = undefined; - _name = undefined; - _value = undefined; - constructor(ctx, _id, _name, _value) { - super(ctx); - this._id = _id; - this._name = _name; - this._value = _value; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); - const response = await ctx.execute(); - return response; - }; - name = async () => { - if (this._name) { - return this._name; - } - const ctx = this._ctx.select("name"); - const response = await ctx.execute(); - return response; - }; - value = async () => { - if (this._value) { - return this._value; - } - const ctx = this._ctx.select("value"); - const response = await ctx.execute(); - return response; - }; -} - -class _ExportableClient extends BaseClient { - _id = undefined; - _export = undefined; - constructor(ctx, _id, _export) { - super(ctx); - this._id = _id; - this._export = _export; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); - const response = await ctx.execute(); - return response; - }; - export = async (path) => { - if (this._export) { - return this._export; - } - const ctx = this._ctx.select("export", { path }); - const response = await ctx.execute(); - return response; - }; -} - -class FieldTypeDef extends BaseClient { - _id = undefined; - _deprecated = undefined; - _description = undefined; - _name = undefined; - constructor(ctx, _id, _deprecated, _description, _name) { - super(ctx); - this._id = _id; - this._deprecated = _deprecated; - this._description = _description; - this._name = _name; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); + }; + value = async () => { + if (this._value) { + return this._value; + } + const ctx = this._ctx.select("value"); + const response = await ctx.execute(); + return response; + }; +} + +class EnvFile extends BaseClient { + _id = undefined; + _exists = undefined; + _get = undefined; + constructor(ctx, _id, _exists, _get) { + super(ctx); + this._id = _id; + this._exists = _exists; + this._get = _get; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + asFile = () => { + const ctx = this._ctx.select("asFile"); + return new File(ctx); + }; + exists = async (name) => { + if (this._exists) { + return this._exists; + } + const ctx = this._ctx.select("exists", { name }); + const response = await ctx.execute(); + return response; + }; + get = async (name, opts) => { + if (this._get) { + return this._get; + } + const ctx = this._ctx.select("get", { name, ...opts }); + const response = await ctx.execute(); + return response; + }; + namespace_ = (prefix) => { + const ctx = this._ctx.select("namespace", { prefix }); + return new EnvFile(ctx); + }; + variables = async (opts) => { + const ctx = this._ctx.select("variables", { ...opts }).select("id"); + const response = await ctx.execute(); + return response.map((r) => new EnvVariable(ctx.copy().selectNode(r.id, "EnvVariable"))); + }; + withVariable = (name, value) => { + const ctx = this._ctx.select("withVariable", { name, value }); + return new EnvFile(ctx); + }; + withoutVariable = (name) => { + const ctx = this._ctx.select("withoutVariable", { name }); + return new EnvFile(ctx); + }; + with = (arg) => { + return arg(this); + }; +} + +class EnvVariable extends BaseClient { + _id = undefined; + _name = undefined; + _value = undefined; + constructor(ctx, _id, _name, _value) { + super(ctx); + this._id = _id; + this._name = _name; + this._value = _value; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + name = async () => { + if (this._name) { + return this._name; + } + const ctx = this._ctx.select("name"); + const response = await ctx.execute(); + return response; + }; + value = async () => { + if (this._value) { + return this._value; + } + const ctx = this._ctx.select("value"); + const response = await ctx.execute(); + return response; + }; +} + +class Error2 extends BaseClient { + _id = undefined; + _message = undefined; + constructor(ctx, _id, _message) { + super(ctx); + this._id = _id; + this._message = _message; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + message = async () => { + if (this._message) { + return this._message; + } + const ctx = this._ctx.select("message"); + const response = await ctx.execute(); + return response; + }; + values = async () => { + const ctx = this._ctx.select("values").select("id"); + const response = await ctx.execute(); + return response.map((r) => new ErrorValue(ctx.copy().selectNode(r.id, "ErrorValue"))); + }; + withValue = (name, value) => { + const ctx = this._ctx.select("withValue", { name, value }); + return new Error2(ctx); + }; + with = (arg) => { + return arg(this); + }; +} + +class ErrorValue extends BaseClient { + _id = undefined; + _name = undefined; + _value = undefined; + constructor(ctx, _id, _name, _value) { + super(ctx); + this._id = _id; + this._name = _name; + this._value = _value; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + name = async () => { + if (this._name) { + return this._name; + } + const ctx = this._ctx.select("name"); + const response = await ctx.execute(); + return response; + }; + value = async () => { + if (this._value) { + return this._value; + } + const ctx = this._ctx.select("value"); + const response = await ctx.execute(); + return response; + }; +} + +class _ExportableClient extends BaseClient { + _id = undefined; + _export = undefined; + constructor(ctx, _id, _export) { + super(ctx); + this._id = _id; + this._export = _export; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + export = async (path) => { + if (this._export) { + return this._export; + } + const ctx = this._ctx.select("export", { path }); + const response = await ctx.execute(); + return response; + }; +} + +class FieldTypeDef extends BaseClient { + _id = undefined; + _deprecated = undefined; + _description = undefined; + _name = undefined; + constructor(ctx, _id, _deprecated, _description, _name) { + super(ctx); + this._id = _id; + this._deprecated = _deprecated; + this._description = _description; + this._name = _name; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + deprecated = async () => { + if (this._deprecated) { + return this._deprecated; + } + const ctx = this._ctx.select("deprecated"); + const response = await ctx.execute(); + return response; + }; + description = async () => { + if (this._description) { + return this._description; + } + const ctx = this._ctx.select("description"); + const response = await ctx.execute(); + return response; + }; + name = async () => { + if (this._name) { + return this._name; + } + const ctx = this._ctx.select("name"); + const response = await ctx.execute(); + return response; + }; + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); const response = await ctx.execute(); - return response; - }; - deprecated = async () => { - if (this._deprecated) { - return this._deprecated; - } - const ctx = this._ctx.select("deprecated"); - const response = await ctx.execute(); - return response; - }; - description = async () => { - if (this._description) { - return this._description; - } - const ctx = this._ctx.select("description"); - const response = await ctx.execute(); - return response; - }; - name = async () => { - if (this._name) { - return this._name; + if (response === null) { + return null; } - const ctx = this._ctx.select("name"); - const response = await ctx.execute(); - return response; - }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; typeDef = () => { const ctx = this._ctx.select("typeDef"); @@ -102520,9 +103951,13 @@ class File extends BaseClient { const response = await ctx.execute(); return response; }; - stat = () => { - const ctx = this._ctx.select("stat"); - return new Stat(ctx); + stat = async () => { + const ctx = this._ctx.select("stat").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Stat(ctx.copy().selectNode(response, "Stat")); }; sync = async () => { const ctx = this._ctx.select("sync"); @@ -102601,9 +104036,13 @@ class Function_ extends BaseClient { const ctx = this._ctx.select("returnType"); return new TypeDef(ctx); }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; sourceModuleName = async () => { if (this._sourceModuleName) { @@ -102736,9 +104175,13 @@ class FunctionArg extends BaseClient { const response = await ctx.execute(); return response; }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; typeDef = () => { const ctx = this._ctx.select("typeDef"); @@ -103054,9 +104497,13 @@ class GitCommit extends BaseClient { const response = await ctx.execute(); return response; }; - ancestorReleaseTag = (opts) => { - const ctx = this._ctx.select("ancestorReleaseTag", { ...opts }); - return new GitRef(ctx); + ancestorReleaseTag = async (opts) => { + const ctx = this._ctx.select("ancestorReleaseTag", { ...opts }).select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new GitRef(ctx.copy().selectNode(response, "GitRef")); }; authorEmail = async () => { if (this._authorEmail) { @@ -103135,9 +104582,13 @@ class GitCommit extends BaseClient { const response = await ctx.execute(); return response; }; - releaseTag = (opts) => { - const ctx = this._ctx.select("releaseTag", { ...opts }); - return new GitRef(ctx); + releaseTag = async (opts) => { + const ctx = this._ctx.select("releaseTag", { ...opts }).select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new GitRef(ctx.copy().selectNode(response, "GitRef")); }; sha = async () => { if (this._sha) { @@ -103528,9 +104979,13 @@ class InterfaceTypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; sourceModuleName = async () => { if (this._sourceModuleName) { @@ -104215,13 +105670,21 @@ class Module_ extends BaseClient { const response = await ctx.execute(); return response.map((r) => new TypeDef(ctx.copy().selectNode(r.id, "TypeDef"))); }; - runtime = () => { - const ctx = this._ctx.select("runtime"); - return new Container(ctx); + runtime = async () => { + const ctx = this._ctx.select("runtime").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Container(ctx.copy().selectNode(response, "Container")); }; - sdk = () => { - const ctx = this._ctx.select("sdk"); - return new SDKConfig(ctx); + sdk = async () => { + const ctx = this._ctx.select("sdk").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SDKConfig(ctx.copy().selectNode(response, "SDKConfig")); }; serve = async (opts) => { if (this._serve) { @@ -104234,9 +105697,13 @@ class Module_ extends BaseClient { const ctx = this._ctx.select("services", { ...opts }); return new UpGroup(ctx); }; - source = () => { - const ctx = this._ctx.select("source"); - return new ModuleSource(ctx); + source = async () => { + const ctx = this._ctx.select("source").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new ModuleSource(ctx.copy().selectNode(response, "ModuleSource")); }; sync = async () => { const ctx = this._ctx.select("sync"); @@ -104528,9 +105995,13 @@ class ModuleSource extends BaseClient { const response = await ctx.execute(); return response; }; - sdk = () => { - const ctx = this._ctx.select("sdk"); - return new SDKConfig(ctx); + sdk = async () => { + const ctx = this._ctx.select("sdk").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SDKConfig(ctx.copy().selectNode(response, "SDKConfig")); }; sourceRootSubpath = async () => { if (this._sourceRootSubpath) { @@ -104693,9 +106164,13 @@ class ObjectTypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - constructor_ = () => { - const ctx = this._ctx.select("constructor"); - return new Function_(ctx); + constructor_ = async () => { + const ctx = this._ctx.select("constructor").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Function_(ctx.copy().selectNode(response, "Function")); }; deprecated = async () => { if (this._deprecated) { @@ -104731,9 +106206,13 @@ class ObjectTypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; sourceModuleName = async () => { if (this._sourceModuleName) { @@ -104931,9 +106410,13 @@ class Client extends BaseClient { const ctx = this._ctx.select("moduleSource", { refString, ...opts, __metadata: metadata }); return new ModuleSource(ctx); }; - node = (id) => { - const ctx = this._ctx.select("node", { id }); - return new _NodeClient(ctx); + node = async (id) => { + const ctx = this._ctx.select("node", { id }).select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new _NodeClient(ctx.copy().selectNode(response, "Node")); }; schema = (json) => { const ctx = this._ctx.select("schema", { json }); @@ -105536,29 +107019,53 @@ class TypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - asEnum = () => { - const ctx = this._ctx.select("asEnum"); - return new EnumTypeDef(ctx); + asEnum = async () => { + const ctx = this._ctx.select("asEnum").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new EnumTypeDef(ctx.copy().selectNode(response, "EnumTypeDef")); }; - asInput = () => { - const ctx = this._ctx.select("asInput"); - return new InputTypeDef(ctx); + asInput = async () => { + const ctx = this._ctx.select("asInput").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new InputTypeDef(ctx.copy().selectNode(response, "InputTypeDef")); }; - asInterface = () => { - const ctx = this._ctx.select("asInterface"); - return new InterfaceTypeDef(ctx); + asInterface = async () => { + const ctx = this._ctx.select("asInterface").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new InterfaceTypeDef(ctx.copy().selectNode(response, "InterfaceTypeDef")); }; - asList = () => { - const ctx = this._ctx.select("asList"); - return new ListTypeDef(ctx); + asList = async () => { + const ctx = this._ctx.select("asList").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new ListTypeDef(ctx.copy().selectNode(response, "ListTypeDef")); }; - asObject = () => { - const ctx = this._ctx.select("asObject"); - return new ObjectTypeDef(ctx); + asObject = async () => { + const ctx = this._ctx.select("asObject").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new ObjectTypeDef(ctx.copy().selectNode(response, "ObjectTypeDef")); }; - asScalar = () => { - const ctx = this._ctx.select("asScalar"); - return new ScalarTypeDef(ctx); + asScalar = async () => { + const ctx = this._ctx.select("asScalar").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new ScalarTypeDef(ctx.copy().selectNode(response, "ScalarTypeDef")); }; kind = async () => { if (this._kind) { @@ -106316,6 +107823,9 @@ class Registry { up = () => { return (target, propertyKey, descriptor) => descriptor; }; + agent = () => { + return (target, propertyKey, descriptor) => {}; + }; argument = (opts) => { return (target, propertyKey, parameterIndex) => {}; }; @@ -106356,6 +107866,7 @@ var func = registry.func; var check = registry.check; var generate = registry.generate; var up = registry.up; +var agent = registry.agent; var field = registry.field; var enumType = registry.enumType; var argument = registry.argument; @@ -106964,6 +108475,7 @@ var FUNCTION_DECORATOR = func.name; var CHECK_DECORATOR = check.name; var GENERATOR_DECORATOR = generate.name; var UP_DECORATOR = up.name; +var AGENT_DECORATOR = agent.name; var FIELD_DECORATOR = field.name; var ARGUMENT_DECORATOR = argument.name; var ENUM_DECORATOR = enumType.name; @@ -107273,6 +108785,7 @@ class DaggerFunction extends Locatable { isCheck = false; isGenerator = false; isUp = false; + isAgent = false; signature; symbol; constructor(node, ast2) { @@ -107303,6 +108816,9 @@ class DaggerFunction extends Locatable { if (this.ast.isNodeDecoratedWith(this.node, UP_DECORATOR)) { this.isUp = true; } + if (this.ast.isNodeDecoratedWith(this.node, AGENT_DECORATOR)) { + this.isAgent = true; + } for (const parameter of this.node.parameters) { this.arguments[parameter.name.getText()] = new DaggerArgument(parameter, this.ast); } @@ -108338,6 +109854,9 @@ class Register { if (fct.isUp) { fnDef = fnDef.withUp(); } + if (fct.isAgent) { + fnDef = fnDef.withAgent(); + } return fnDef; } addArg(args) { @@ -108496,6 +110015,7 @@ export { connect, check, argument, + agent, _SyncerClient, _NodeClient, _ExportableClient, diff --git a/library/bundle/index.ts b/library/bundle/index.ts index 6c13820..abdf4ed 100644 --- a/library/bundle/index.ts +++ b/library/bundle/index.ts @@ -6,6 +6,7 @@ export { check, generate, up, + agent, argument, object, field, diff --git a/library/bundle/introspector.js b/library/bundle/introspector.js index af80922..0b77dcf 100644 --- a/library/bundle/introspector.js +++ b/library/bundle/introspector.js @@ -26067,38 +26067,42 @@ var require_utils3 = __commonJS((exports, module) => { if (exist && !overwrite) return callback(false); self2.fs.stat(path, function(err, stat2) { - if (exist && stat2.isDirectory()) { + if (exist && stat2 && stat2.isDirectory()) { return callback(false); } var folder = pth.dirname(path); self2.fs.exists(folder, function(exists) { - if (!exists) - self2.makeDir(folder); + if (!exists) { + try { + self2.makeDir(folder); + } catch (e2) { + return callback(false); + } + } + const writeToFd = function(fd) { + self2.fs.write(fd, content, 0, content.length, 0, function(writeErr) { + self2.fs.close(fd, function() { + if (writeErr) + return callback(false); + self2.fs.chmod(path, attr || 438, function() { + callback(true); + }); + }); + }); + }; self2.fs.open(path, "w", 438, function(err2, fd) { if (err2) { self2.fs.chmod(path, 438, function() { - self2.fs.open(path, "w", 438, function(err3, fd2) { - self2.fs.write(fd2, content, 0, content.length, 0, function() { - self2.fs.close(fd2, function() { - self2.fs.chmod(path, attr || 438, function() { - callback(true); - }); - }); - }); + self2.fs.open(path, "w", 438, function(retryErr, fd2) { + if (retryErr || !fd2) + return callback(false); + writeToFd(fd2); }); }); } else if (fd) { - self2.fs.write(fd, content, 0, content.length, 0, function() { - self2.fs.close(fd, function() { - self2.fs.chmod(path, attr || 438, function() { - callback(true); - }); - }); - }); + writeToFd(fd); } else { - self2.fs.chmod(path, attr || 438, function() { - callback(true); - }); + callback(false); } }); }); @@ -26107,7 +26111,7 @@ var require_utils3 = __commonJS((exports, module) => { }; Utils.prototype.findFiles = function(path) { const self2 = this; - function findSync(dir, pattern, recursive) { + function findSync(dir, pattern, recursive, visited) { if (typeof pattern === "boolean") { recursive = pattern; pattern = undefined; @@ -26119,44 +26123,75 @@ var require_utils3 = __commonJS((exports, module) => { if (!pattern || pattern.test(path2)) { files2.push(pth.normalize(path2) + (stat2.isDirectory() ? self2.sep : "")); } - if (stat2.isDirectory() && recursive) - files2 = files2.concat(findSync(path2, pattern, recursive)); + if (stat2.isDirectory() && recursive) { + const realDir = self2.fs.realpathSync(path2); + if (!visited.has(realDir)) { + visited.add(realDir); + files2 = files2.concat(findSync(path2, pattern, recursive, visited)); + } + } }); return files2; } - return findSync(path, undefined, true); + return findSync(path, undefined, true, new Set([self2.fs.realpathSync(path)])); }; Utils.prototype.findFilesAsync = function(dir, cb) { const self2 = this; - let results = []; - self2.fs.readdir(dir, function(err, list) { - if (err) - return cb(err); - let list_length = list.length; - if (!list_length) - return cb(null, results); - list.forEach(function(file) { - file = pth.join(dir, file); - self2.fs.stat(file, function(err2, stat2) { - if (err2) - return cb(err2); - if (stat2) { + const results = []; + let finished = false; + const finish = function(err) { + if (finished) + return; + finished = true; + cb(err, err ? undefined : results); + }; + const walk = function(dir2, visited, done) { + self2.fs.readdir(dir2, function(err, list) { + if (err) + return done(err); + let pending = list.length; + if (!pending) + return done(); + list.forEach(function(name) { + const file = pth.join(dir2, name); + self2.fs.stat(file, function(err2, stat2) { + if (err2) + return done(err2); + if (!stat2) { + if (!--pending) + done(); + return; + } results.push(pth.normalize(file) + (stat2.isDirectory() ? self2.sep : "")); - if (stat2.isDirectory()) { - self2.findFilesAsync(file, function(err3, res) { - if (err3) - return cb(err3); - results = results.concat(res); - if (!--list_length) - cb(null, results); - }); - } else { - if (!--list_length) - cb(null, results); + if (!stat2.isDirectory()) { + if (!--pending) + done(); + return; } - } + self2.fs.realpath(file, function(err3, realDir) { + if (err3) + return done(err3); + if (visited.has(realDir)) { + if (!--pending) + done(); + return; + } + visited.add(realDir); + walk(file, visited, function(err4) { + if (err4) + return done(err4); + if (!--pending) + done(); + }); + }); + }); }); }); + }; + self2.fs.realpath(dir, function(err, realDir) { + if (err) + return finish(err); + walk(dir, new Set([realDir]), finish); }); }; Utils.prototype.getAttributes = function() {}; @@ -26941,35 +26976,8 @@ var require_zipEntry = __commonJS((exports, module) => { return input.slice(_centralHeader.realDataOffset, _centralHeader.realDataOffset + _centralHeader.compressedSize); } function crc32OK(data) { - if (!_centralHeader.flags_desc && !_centralHeader.localHeader.flags_desc) { - if (Utils.crc32(data) !== _centralHeader.localHeader.crc) { - return false; - } - } else { - const descriptor = {}; - const dataEndOffset = _centralHeader.realDataOffset + _centralHeader.compressedSize; - if (input.readUInt32LE(dataEndOffset) == Constants.LOCSIG || input.readUInt32LE(dataEndOffset) == Constants.CENSIG) { - throw Utils.Errors.DESCRIPTOR_NOT_EXIST(); - } - if (input.readUInt32LE(dataEndOffset) == Constants.EXTSIG) { - descriptor.crc = input.readUInt32LE(dataEndOffset + Constants.EXTCRC); - descriptor.compressedSize = input.readUInt32LE(dataEndOffset + Constants.EXTSIZ); - descriptor.size = input.readUInt32LE(dataEndOffset + Constants.EXTLEN); - } else if (input.readUInt16LE(dataEndOffset + 12) === 19280) { - descriptor.crc = input.readUInt32LE(dataEndOffset + Constants.EXTCRC - 4); - descriptor.compressedSize = input.readUInt32LE(dataEndOffset + Constants.EXTSIZ - 4); - descriptor.size = input.readUInt32LE(dataEndOffset + Constants.EXTLEN - 4); - } else { - throw Utils.Errors.DESCRIPTOR_UNKNOWN(); - } - if (descriptor.compressedSize !== _centralHeader.compressedSize || descriptor.size !== _centralHeader.size || descriptor.crc !== _centralHeader.crc) { - throw Utils.Errors.DESCRIPTOR_FAULTY(); - } - if (Utils.crc32(data) !== descriptor.crc) { - return false; - } - } - return true; + const expectedCrc = _centralHeader.flags_desc || _centralHeader.localHeader.flags_desc ? _centralHeader.crc : _centralHeader.localHeader.crc; + return Utils.crc32(data) === expectedCrc; } function decompress(async, callback, pass) { if (typeof callback === "undefined" && typeof async === "string") { @@ -26994,9 +27002,10 @@ var require_zipEntry = __commonJS((exports, module) => { } compressedData = Methods.ZipCrypto.decrypt(compressedData, _centralHeader, pass); } - var data = Buffer.alloc(_centralHeader.size); + var data; switch (_centralHeader.method) { case Utils.Constants.STORED: + data = Buffer.alloc(compressedData.length); compressedData.copy(data); if (!crc32OK(data)) { if (async && callback) @@ -27010,15 +27019,13 @@ var require_zipEntry = __commonJS((exports, module) => { case Utils.Constants.DEFLATED: var inflater = new Methods.Inflater(compressedData, _centralHeader.size); if (!async) { - const result = inflater.inflate(data); - result.copy(data, 0); + data = inflater.inflate(); if (!crc32OK(data)) { throw Utils.Errors.BAD_CRC(`"${decoder.decode(_entryName)}"`); } return data; } else { inflater.inflateAsync(function(result) { - result.copy(result, 0); if (callback) { if (!crc32OK(result)) { callback(result, Utils.Errors.BAD_CRC()); @@ -27162,8 +27169,8 @@ var require_zipEntry = __commonJS((exports, module) => { throw Utils.Errors.COMMENT_TOO_LONG(); }, get name() { - var n = decoder.decode(_entryName); - return _isDirectory ? n.substr(n.length - 1).split("/").pop() : n.split("/").pop(); + const n = decoder.decode(_entryName); + return _isDirectory ? n.replace(/[/\\]$/, "").split("/").pop() : n.split("/").pop(); }, get isDirectory() { return _isDirectory; @@ -27264,7 +27271,7 @@ var require_zipFile = __commonJS((exports, module) => { var Headers3 = require_headers(); var Utils = require_util(); module.exports = function(inBuffer, options) { - var entryList = [], entryTable = {}, _comment = Buffer.alloc(0), mainHeader = new Headers3.MainHeader, loadedEntries = false; + var entryList = [], entryTable = Object.create(null), _comment = Buffer.alloc(0), mainHeader = new Headers3.MainHeader, loadedEntries = false; var password = null; const temporary = new Set; const opts = options; @@ -27300,7 +27307,7 @@ var require_zipFile = __commonJS((exports, module) => { } function readEntries() { loadedEntries = true; - entryTable = {}; + entryTable = Object.create(null); if (mainHeader.diskEntries > (inBuffer.length - mainHeader.offset) / Utils.Constants.CENHDR) { throw Utils.Errors.DISK_ENTRY_TOO_LARGE(); } @@ -27358,7 +27365,7 @@ var require_zipFile = __commonJS((exports, module) => { } function sortEntries() { if (entryList.length > 1 && !noSort) { - entryList.sort((a, b) => a.entryName.toLowerCase().localeCompare(b.entryName.toLowerCase())); + entryList = entryList.map((entry) => ({ entry, key: entry.entryName.toLowerCase() })).sort((a, b) => a.key.localeCompare(b.key)).map((pair) => pair.entry); } } return { @@ -27594,6 +27601,9 @@ var require_adm_zip = __commonJS((exports, module) => { } Object.assign(opts, options); const filetools = new Utils(opts); + const applyDirAttributes = (dirEntries) => { + dirEntries.filter((d) => d.attr).sort((a, b) => b.path.length - a.path.length).forEach((d) => filetools.fs.chmodSync(d.path, d.attr)); + }; if (typeof opts.decoder !== "object" || typeof opts.decoder.encode !== "function" || typeof opts.decoder.decode !== "function") { opts.decoder = Utils.decoder; } @@ -27958,8 +27968,8 @@ var require_adm_zip = __commonJS((exports, module) => { if (!content2) { throw Utils.Errors.CANT_EXTRACT_FILE(); } - var name = canonical(child.entryName); - var childName = sanitize(targetPath, maintainEntryPath ? name : pth.basename(name)); + var name = canonical(maintainEntryPath ? child.entryName : child.entryName.substring(item.entryName.length)); + var childName = sanitize(targetPath, name); const fileAttr2 = keepOriginalPermission ? child.header.fileAttr : undefined; filetools.writeFileTo(childName, content2, overwrite, fileAttr2); }); @@ -27984,7 +27994,7 @@ var require_adm_zip = __commonJS((exports, module) => { if (entry.isDirectory) { continue; } - var content = _zip.entries[entry].getData(pass); + var content = entry.getData(pass); if (!content) { return false; } @@ -28000,10 +28010,13 @@ var require_adm_zip = __commonJS((exports, module) => { overwrite = get_Bool(false, overwrite); if (!_zip) throw Utils.Errors.NO_ZIP(); + const dirEntries = []; _zip.entries.forEach(function(entry) { var entryName = sanitize(targetPath, canonical(entry.entryName)); if (entry.isDirectory) { filetools.makeDir(entryName); + if (keepOriginalPermission) + dirEntries.push({ path: entryName, attr: entry.header.fileAttr }); return; } var content = entry.getData(pass); @@ -28014,10 +28027,9 @@ var require_adm_zip = __commonJS((exports, module) => { filetools.writeFileTo(entryName, content, overwrite, fileAttr); try { filetools.fs.utimesSync(entryName, entry.header.time, entry.header.time); - } catch (err) { - throw Utils.Errors.CANT_EXTRACT_FILE(); - } + } catch (err) {} }); + applyDirAttributes(dirEntries); }, extractAllToAsync: function(targetPath, overwrite, keepOriginalPermission, callback) { callback = get_Fun(overwrite, keepOriginalPermission, callback); @@ -28050,18 +28062,32 @@ var require_adm_zip = __commonJS((exports, module) => { fileEntries.push(e2); } }); + const deferredDirAttr = []; for (const entry of dirEntries) { const dirPath = getPath(entry); const dirAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; try { filetools.makeDir(dirPath); - if (dirAttr) - filetools.fs.chmodSync(dirPath, dirAttr); - filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time); } catch (er) { callback(getError("Unable to create folder", dirPath)); + continue; } + if (dirAttr) + deferredDirAttr.push({ path: dirPath, attr: dirAttr }); + try { + filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time); + } catch (er) {} } + const done = (err) => { + if (!err) { + try { + applyDirAttributes(deferredDirAttr); + } catch (er) { + return callback(getError("Unable to set folder permissions", er.path || "")); + } + } + callback(err); + }; fileEntries.reverse().reduce(function(next, entry) { return function(err) { if (err) { @@ -28078,21 +28104,17 @@ var require_adm_zip = __commonJS((exports, module) => { const fileAttr = keepOriginalPermission ? entry.header.fileAttr : undefined; filetools.writeFileToAsync(filePath, content, overwrite, fileAttr, function(succ) { if (!succ) { - next(getError("Unable to write file", filePath)); + return next(getError("Unable to write file", filePath)); } - filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function(err_2) { - if (err_2) { - next(getError("Unable to set times", filePath)); - } else { - next(); - } + filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function() { + next(); }); }); } }); } }; - }, callback)(); + }, done)(); }, writeZip: function(targetFileName, callback) { if (arguments.length === 1) { @@ -38917,7 +38939,7 @@ var init_bin = __esm(() => { }); // src/provisioning/default.ts -var CLI_VERSION = "1.0.0-beta.9"; +var CLI_VERSION = "1.0.0-beta.10"; // src/provisioning/index.ts var exports_provisioning = {}; @@ -79195,249 +79217,1630 @@ var require_src27 = __commonJS((exports) => { } }); }); -// node_modules/@opentelemetry/propagator-jaeger/build/src/JaegerPropagator.js -var require_JaegerPropagator = __commonJS((exports) => { +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js +var require_suppress_tracing2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.JaegerPropagator = exports.UBER_BAGGAGE_HEADER_PREFIX = exports.UBER_TRACE_ID_HEADER = undefined; + exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = undefined; var api_1 = require_src(); - var core_1 = require_src3(); - exports.UBER_TRACE_ID_HEADER = "uber-trace-id"; - exports.UBER_BAGGAGE_HEADER_PREFIX = "uberctx"; + var SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); + function suppressTracing(context2) { + return context2.setValue(SUPPRESS_TRACING_KEY, true); + } + exports.suppressTracing = suppressTracing; + function unsuppressTracing(context2) { + return context2.deleteValue(SUPPRESS_TRACING_KEY); + } + exports.unsuppressTracing = unsuppressTracing; + function isTracingSuppressed(context2) { + return context2.getValue(SUPPRESS_TRACING_KEY) === true; + } + exports.isTracingSuppressed = isTracingSuppressed; +}); - class JaegerPropagator { - _jaegerTraceHeader; - _jaegerBaggageHeaderPrefix; - constructor(config) { - if (typeof config === "string") { - this._jaegerTraceHeader = config; - this._jaegerBaggageHeaderPrefix = exports.UBER_BAGGAGE_HEADER_PREFIX; - } else { - this._jaegerTraceHeader = config?.customTraceHeader || exports.UBER_TRACE_ID_HEADER; - this._jaegerBaggageHeaderPrefix = config?.customBaggageHeaderPrefix || exports.UBER_BAGGAGE_HEADER_PREFIX; +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/baggage/constants.js +var require_constants5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = undefined; + exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; + exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; + exports.BAGGAGE_ITEMS_SEPARATOR = ","; + exports.BAGGAGE_HEADER = "baggage"; + exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; + exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; + exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils14 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseKeyPairsIntoRecord = exports.parseBaggageHeaderString = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = undefined; + var api_1 = require_src(); + var constants_1 = require_constants5(); + function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ""); + } + exports.serializeKeyPairs = serializeKeyPairs; + function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); + } + exports.getKeyPairs = getKeyPairs; + function parsePairKeyValue(entry) { + if (!entry) + return; + const metadataSeparatorIndex = entry.indexOf(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + const keyPairPart = metadataSeparatorIndex === -1 ? entry : entry.substring(0, metadataSeparatorIndex); + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const rawKey = keyPairPart.substring(0, separatorIndex).trim(); + const rawValue = keyPairPart.substring(separatorIndex + 1).trim(); + if (!rawKey || !rawValue) + return; + let key; + let value; + try { + key = decodeURIComponent(rawKey); + value = decodeURIComponent(rawValue); + } catch { + return; + } + let metadata; + if (metadataSeparatorIndex !== -1 && metadataSeparatorIndex < entry.length - 1) { + const metadataString = entry.substring(metadataSeparatorIndex + 1); + metadata = (0, api_1.baggageEntryMetadataFromString)(metadataString); + } + return { key, value, metadata }; + } + exports.parsePairKeyValue = parsePairKeyValue; + function parseBaggageHeaderString(value, baggage, count2, totalSize) { + let start = 0; + while (start < value.length && count2 < constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS) { + const end = value.indexOf(constants_1.BAGGAGE_ITEMS_SEPARATOR, start); + const entryEnd = end === -1 ? value.length : end; + const entryLength = entryEnd - start; + if (entryLength <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS) { + const keyPair = parsePairKeyValue(value.substring(start, entryEnd)); + if (keyPair) { + const entrySize = (count2 === 0 ? 0 : 1) + entryLength; + if (totalSize + entrySize > constants_1.BAGGAGE_MAX_TOTAL_LENGTH) + break; + baggage[keyPair.key] = keyPair.metadata ? { value: keyPair.value, metadata: keyPair.metadata } : { value: keyPair.value }; + count2++; + totalSize += entrySize; + } } + if (end === -1) + break; + start = end + 1; + } + return [count2, totalSize]; + } + exports.parseBaggageHeaderString = parseBaggageHeaderString; + function parseKeyPairsIntoRecord(value) { + const result = {}; + if (typeof value === "string" && value.length > 0) { + value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = parsePairKeyValue(entry); + if (keyPair !== undefined && keyPair.value.length > 0) { + result[keyPair.key] = keyPair.value; + } + }); } + return result; + } + exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js +var require_W3CBaggagePropagator2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CBaggagePropagator = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing2(); + var constants_1 = require_constants5(); + var utils_1 = require_utils14(); + + class W3CBaggagePropagator { inject(context2, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context2); const baggage = api_1.propagation.getBaggage(context2); - if (spanContext && (0, core_1.isTracingSuppressed)(context2) === false) { - const traceFlags = `0${(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; - setter.set(carrier, this._jaegerTraceHeader, `${spanContext.traceId}:${spanContext.spanId}:0:${traceFlags}`); - } - if (baggage) { - for (const [key, entry] of baggage.getAllEntries()) { - setter.set(carrier, `${this._jaegerBaggageHeaderPrefix}-${key}`, encodeURIComponent(entry.value)); - } + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context2)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); } } extract(context2, carrier, getter) { - const uberTraceIdHeader = getter.get(carrier, this._jaegerTraceHeader); - const uberTraceId = Array.isArray(uberTraceIdHeader) ? uberTraceIdHeader[0] : uberTraceIdHeader; - const baggageValues = getter.keys(carrier).filter((key) => key.startsWith(`${this._jaegerBaggageHeaderPrefix}-`)).map((key) => { - const value = getter.get(carrier, key); - return { - key: key.substring(this._jaegerBaggageHeaderPrefix.length + 1), - value: Array.isArray(value) ? value[0] : value - }; - }); - let newContext = context2; - if (typeof uberTraceId === "string") { - const spanContext = deserializeSpanContext(uberTraceId); - if (spanContext) { - newContext = api_1.trace.setSpanContext(newContext, spanContext); + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + if (!headerValue) { + return context2; + } + const baggage = {}; + let count2 = 0; + let totalSize = 0; + if (Array.isArray(headerValue)) { + for (let i3 = 0;i3 < headerValue.length; i3++) { + [count2, totalSize] = (0, utils_1.parseBaggageHeaderString)(headerValue[i3], baggage, count2, totalSize); } + } else { + [count2] = (0, utils_1.parseBaggageHeaderString)(headerValue, baggage, count2, totalSize); } - if (baggageValues.length === 0) - return newContext; - let currentBaggage = api_1.propagation.getBaggage(context2) ?? api_1.propagation.createBaggage(); - for (const baggageEntry of baggageValues) { - if (baggageEntry.value === undefined) - continue; - currentBaggage = currentBaggage.setEntry(baggageEntry.key, { - value: decodeURIComponent(baggageEntry.value) - }); + if (count2 === 0) { + return context2; } - newContext = api_1.propagation.setBaggage(newContext, currentBaggage); - return newContext; + return api_1.propagation.setBaggage(context2, api_1.propagation.createBaggage(baggage)); } fields() { - return [this._jaegerTraceHeader]; - } - } - exports.JaegerPropagator = JaegerPropagator; - var VALID_HEX_RE = /^[0-9a-f]{1,2}$/i; - function deserializeSpanContext(serializedString) { - const headers = decodeURIComponent(serializedString).split(":"); - if (headers.length !== 4) { - return null; + return [constants_1.BAGGAGE_HEADER]; } - const [_traceId, _spanId, , flags] = headers; - const traceId = _traceId.padStart(32, "0"); - const spanId = _spanId.padStart(16, "0"); - const traceFlags = VALID_HEX_RE.test(flags) ? parseInt(flags, 16) & 1 : 1; - return { traceId, spanId, isRemote: true, traceFlags }; } + exports.W3CBaggagePropagator = W3CBaggagePropagator; }); -// node_modules/@opentelemetry/propagator-jaeger/build/src/index.js -var require_src28 = __commonJS((exports) => { +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js +var require_anchored_clock2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.UBER_TRACE_ID_HEADER = exports.UBER_BAGGAGE_HEADER_PREFIX = exports.JaegerPropagator = undefined; - var JaegerPropagator_1 = require_JaegerPropagator(); - Object.defineProperty(exports, "JaegerPropagator", { enumerable: true, get: function() { - return JaegerPropagator_1.JaegerPropagator; - } }); - Object.defineProperty(exports, "UBER_BAGGAGE_HEADER_PREFIX", { enumerable: true, get: function() { - return JaegerPropagator_1.UBER_BAGGAGE_HEADER_PREFIX; - } }); - Object.defineProperty(exports, "UBER_TRACE_ID_HEADER", { enumerable: true, get: function() { - return JaegerPropagator_1.UBER_TRACE_ID_HEADER; - } }); -}); + exports.AnchoredClock = undefined; -// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/OTLPMetricExporterOptions.js -var require_OTLPMetricExporterOptions = __commonJS((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AggregationTemporalityPreference = undefined; - var AggregationTemporalityPreference; - (function(AggregationTemporalityPreference2) { - AggregationTemporalityPreference2[AggregationTemporalityPreference2["DELTA"] = 0] = "DELTA"; - AggregationTemporalityPreference2[AggregationTemporalityPreference2["CUMULATIVE"] = 1] = "CUMULATIVE"; - AggregationTemporalityPreference2[AggregationTemporalityPreference2["LOWMEMORY"] = 2] = "LOWMEMORY"; - })(AggregationTemporalityPreference = exports.AggregationTemporalityPreference || (exports.AggregationTemporalityPreference = {})); + class AnchoredClock { + _monotonicClock; + _epochMillis; + _performanceMillis; + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } + } + exports.AnchoredClock = AnchoredClock; }); -// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/OTLPMetricExporterBase.js -var require_OTLPMetricExporterBase = __commonJS((exports) => { +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/attributes.js +var require_attributes2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPMetricExporterBase = exports.LowMemoryTemporalitySelector = exports.DeltaTemporalitySelector = exports.CumulativeTemporalitySelector = undefined; - var core_1 = require_src3(); - var sdk_metrics_1 = require_src7(); - var OTLPMetricExporterOptions_1 = require_OTLPMetricExporterOptions(); - var otlp_exporter_base_1 = require_src4(); + exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = undefined; var api_1 = require_src(); - var CumulativeTemporalitySelector = () => sdk_metrics_1.AggregationTemporality.CUMULATIVE; - exports.CumulativeTemporalitySelector = CumulativeTemporalitySelector; - var DeltaTemporalitySelector = (instrumentType) => { - switch (instrumentType) { - case sdk_metrics_1.InstrumentType.COUNTER: - case sdk_metrics_1.InstrumentType.OBSERVABLE_COUNTER: - case sdk_metrics_1.InstrumentType.GAUGE: - case sdk_metrics_1.InstrumentType.HISTOGRAM: - case sdk_metrics_1.InstrumentType.OBSERVABLE_GAUGE: - return sdk_metrics_1.AggregationTemporality.DELTA; - case sdk_metrics_1.InstrumentType.UP_DOWN_COUNTER: - case sdk_metrics_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: - return sdk_metrics_1.AggregationTemporality.CUMULATIVE; - } - }; - exports.DeltaTemporalitySelector = DeltaTemporalitySelector; - var LowMemoryTemporalitySelector = (instrumentType) => { - switch (instrumentType) { - case sdk_metrics_1.InstrumentType.COUNTER: - case sdk_metrics_1.InstrumentType.HISTOGRAM: - return sdk_metrics_1.AggregationTemporality.DELTA; - case sdk_metrics_1.InstrumentType.GAUGE: - case sdk_metrics_1.InstrumentType.UP_DOWN_COUNTER: - case sdk_metrics_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: - case sdk_metrics_1.InstrumentType.OBSERVABLE_COUNTER: - case sdk_metrics_1.InstrumentType.OBSERVABLE_GAUGE: - return sdk_metrics_1.AggregationTemporality.CUMULATIVE; + function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== "object" || attributes == null) { + return out; } - }; - exports.LowMemoryTemporalitySelector = LowMemoryTemporalitySelector; - function chooseTemporalitySelectorFromEnvironment() { - const configuredTemporality = ((0, core_1.getStringFromEnv)("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE") ?? "cumulative").toLowerCase(); - if (configuredTemporality === "cumulative") { - return exports.CumulativeTemporalitySelector; + for (const key in attributes) { + if (!Object.prototype.hasOwnProperty.call(attributes, key)) { + continue; + } + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + const val = attributes[key]; + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } else { + out[key] = val; + } } - if (configuredTemporality === "delta") { - return exports.DeltaTemporalitySelector; + return out; + } + exports.sanitizeAttributes = sanitizeAttributes; + function isAttributeKey(key) { + return typeof key === "string" && key !== ""; + } + exports.isAttributeKey = isAttributeKey; + function isAttributeValue(val) { + if (val == null) { + return true; } - if (configuredTemporality === "lowmemory") { - return exports.LowMemoryTemporalitySelector; + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); } - api_1.diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${configuredTemporality}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`); - return exports.CumulativeTemporalitySelector; + return isValidPrimitiveAttributeValueType(typeof val); } - function chooseTemporalitySelector(temporalityPreference) { - if (temporalityPreference != null) { - if (temporalityPreference === OTLPMetricExporterOptions_1.AggregationTemporalityPreference.DELTA) { - return exports.DeltaTemporalitySelector; - } else if (temporalityPreference === OTLPMetricExporterOptions_1.AggregationTemporalityPreference.LOWMEMORY) { - return exports.LowMemoryTemporalitySelector; + exports.isAttributeValue = isAttributeValue; + function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + if (element == null) + continue; + const elementType = typeof element; + if (elementType === type) { + continue; } - return exports.CumulativeTemporalitySelector; + if (!type) { + if (isValidPrimitiveAttributeValueType(elementType)) { + type = elementType; + continue; + } + return false; + } + return false; } - return chooseTemporalitySelectorFromEnvironment(); - } - var DEFAULT_AGGREGATION = Object.freeze({ - type: sdk_metrics_1.AggregationType.DEFAULT - }); - function chooseAggregationSelector(config) { - return config?.aggregationPreference ?? (() => DEFAULT_AGGREGATION); + return true; } - - class OTLPMetricExporterBase extends otlp_exporter_base_1.OTLPExporterBase { - _aggregationTemporalitySelector; - _aggregationSelector; - constructor(delegate, config) { - super(delegate); - this._aggregationSelector = chooseAggregationSelector(config); - this._aggregationTemporalitySelector = chooseTemporalitySelector(config?.temporalityPreference); - } - selectAggregation(instrumentType) { - return this._aggregationSelector(instrumentType); - } - selectAggregationTemporality(instrumentType) { - return this._aggregationTemporalitySelector(instrumentType); + function isValidPrimitiveAttributeValueType(valType) { + switch (valType) { + case "number": + case "boolean": + case "string": + return true; } + return false; } - exports.OTLPMetricExporterBase = OTLPMetricExporterBase; }); -// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/platform/node/OTLPMetricExporter.js -var require_OTLPMetricExporter = __commonJS((exports) => { +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js +var require_logging_error_handler2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPMetricExporter = undefined; - var OTLPMetricExporterBase_1 = require_OTLPMetricExporterBase(); - var otlp_transformer_1 = require_src8(); - var node_http_1 = require_index_node_http(); - - class OTLPMetricExporter extends OTLPMetricExporterBase_1.OTLPMetricExporterBase { - constructor(config) { - super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config ?? {}, "METRICS", "v1/metrics", { - "Content-Type": "application/json" - }), otlp_transformer_1.JsonMetricsSerializer), config); + exports.loggingErrorHandler = undefined; + var api_1 = require_src(); + function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; + } + exports.loggingErrorHandler = loggingErrorHandler; + function stringifyException(ex) { + if (typeof ex === "string") { + return ex; + } else { + return JSON.stringify(flattenException(ex)); } } - exports.OTLPMetricExporter = OTLPMetricExporter; + function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach((propertyName) => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; + } }); -// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/platform/node/index.js -var require_node12 = __commonJS((exports) => { +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js +var require_global_error_handler2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPMetricExporter = undefined; - var OTLPMetricExporter_1 = require_OTLPMetricExporter(); - Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { - return OTLPMetricExporter_1.OTLPMetricExporter; - } }); + exports.globalErrorHandler = exports.setGlobalErrorHandler = undefined; + var logging_error_handler_1 = require_logging_error_handler2(); + var delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; }); -// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/platform/index.js -var require_platform11 = __commonJS((exports) => { +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/platform/node/environment.js +var require_environment3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPMetricExporter = undefined; - var node_1 = require_node12(); - Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { - return node_1.OTLPMetricExporter; - } }); -}); - -// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/index.js + exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = undefined; + var api_1 = require_src(); + var util_1 = __require("util"); + function getNumberFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + const value = Number(raw); + if (isNaN(value)) { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); + return; + } + return value; + } + exports.getNumberFromEnv = getNumberFromEnv; + function getStringFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + return raw; + } + exports.getStringFromEnv = getStringFromEnv; + function getBooleanFromEnv(key) { + const raw = process.env[key]?.trim().toLowerCase(); + if (raw == null || raw === "") { + return false; + } + if (raw === "true") { + return true; + } else if (raw === "false") { + return false; + } else { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + return false; + } + } + exports.getBooleanFromEnv = getBooleanFromEnv; + function getStringListFromEnv(key) { + return getStringFromEnv(key)?.split(",").map((v2) => v2.trim()).filter((s4) => s4 !== ""); + } + exports.getStringListFromEnv = getStringListFromEnv; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/globalThis.js +var require_globalThis2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._globalThis = undefined; + exports._globalThis = globalThis; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/version.js +var require_version9 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = undefined; + exports.VERSION = "2.9.0"; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/semconv.js +var require_semconv7 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_PROCESS_RUNTIME_NAME = undefined; + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js +var require_sdk_info2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SDK_INFO = undefined; + var version_1 = require_version9(); + var semantic_conventions_1 = require_src2(); + var semconv_1 = require_semconv7(); + exports.SDK_INFO = { + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION + }; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node12 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.otperformance = exports.SDK_INFO = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = undefined; + var environment_1 = require_environment3(); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return environment_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return environment_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return environment_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return environment_1.getStringListFromEnv; + } }); + var globalThis_1 = require_globalThis2(); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return globalThis_1._globalThis; + } }); + var sdk_info_1 = require_sdk_info2(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return sdk_info_1.SDK_INFO; + } }); + exports.otperformance = performance; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform11 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.otperformance = exports._globalThis = exports.SDK_INFO = undefined; + var node_1 = require_node12(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return node_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return node_1._globalThis; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return node_1.otperformance; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return node_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return node_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return node_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return node_1.getStringListFromEnv; + } }); +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/time.js +var require_time2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToSeconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = undefined; + var platform_1 = require_platform11(); + var NANOSECOND_DIGITS = 9; + var NANOSECOND_DIGITS_IN_MILLIS = 6; + var MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); + var SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + const seconds = Math.trunc(epochSeconds); + const nanos = Math.round(epochMillis % 1000 * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; + } + exports.millisToHrTime = millisToHrTime; + function getTimeOrigin() { + return platform_1.otperformance.timeOrigin; + } + exports.getTimeOrigin = getTimeOrigin; + function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(platform_1.otperformance.timeOrigin); + const now = millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); + } + exports.hrTime = hrTime; + function timeInputToHrTime(time) { + if (isTimeInputHrTime(time)) { + return time; + } else if (typeof time === "number") { + if (time < platform_1.otperformance.timeOrigin / 2) { + return hrTime(time); + } else { + return millisToHrTime(time); + } + } else if (time instanceof Date) { + return millisToHrTime(time.getTime()); + } else { + throw TypeError("Invalid input type"); + } + } + exports.timeInputToHrTime = timeInputToHrTime; + function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + if (nanos < 0) { + seconds -= 1; + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; + } + exports.hrTimeDuration = hrTimeDuration; + function hrTimeToTimeStamp(time) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date = new Date(time[0] * 1000).toISOString(); + return date.replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + function hrTimeToNanoseconds(time) { + return time[0] * SECOND_TO_NANOSECONDS + time[1]; + } + exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + function hrTimeToMicroseconds(time) { + return time[0] * 1e6 + time[1] / 1000; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + function hrTimeToMilliseconds(time) { + return time[0] * 1000 + time[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + function hrTimeToSeconds(time) { + return time[0] + time[1] / SECOND_TO_NANOSECONDS; + } + exports.hrTimeToSeconds = hrTimeToSeconds; + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + function addHrTimes(time1, time2) { + const out = [time1[0] + time2[0], time1[1] + time2[1]]; + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; + } + exports.addHrTimes = addHrTimes; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/common/timer-util.js +var require_timer_util2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = undefined; + function unrefTimer(timer) { + if (typeof timer !== "number") { + timer.unref(); + } + } + exports.unrefTimer = unrefTimer; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/ExportResult.js +var require_ExportResult2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExportResultCode = undefined; + var ExportResultCode; + (function(ExportResultCode2) { + ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED"; + })(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/propagation/composite.js +var require_composite2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CompositePropagator = undefined; + var api_1 = require_src(); + + class CompositePropagator { + _propagators; + _fields; + constructor(config = {}) { + this._propagators = config.propagators ?? []; + const fields = new Set; + for (const propagator of this._propagators) { + const propagatorFields = typeof propagator.fields === "function" ? propagator.fields() : []; + for (const field of propagatorFields) { + fields.add(field); + } + } + this._fields = Array.from(fields); + } + inject(context2, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context2, carrier, setter); + } catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + extract(context2, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context2); + } + fields() { + return this._fields.slice(); + } + } + exports.CompositePropagator = CompositePropagator; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/internal/validators.js +var require_validators2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateValue = exports.validateKey = undefined; + var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + var VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + var VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + var VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + exports.validateKey = validateKey; + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/trace/TraceState.js +var require_TraceState2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceState = undefined; + var validators_1 = require_validators2(); + var MAX_TRACE_STATE_ITEMS = 32; + var MAX_TRACE_STATE_LEN = 512; + var LIST_MEMBERS_SEPARATOR = ","; + var LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + + class TraceState { + _length; + _rawTraceState; + _internalState; + constructor(rawTraceState) { + this._rawTraceState = typeof rawTraceState === "string" ? rawTraceState : ""; + this._length = this._rawTraceState.length; + } + set(key, value) { + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) { + return this; + } + const currState = this._getState(); + const currValue = currState.get(key); + let newLength = this._length; + if (typeof currValue === "string") { + newLength += value.length - currValue.length; + } else { + newLength += key.length + value.length + (currState.size > 0 ? 2 : 1); + } + if (newLength > MAX_TRACE_STATE_LEN) { + return this; + } + const newState = new Map(currState); + newState.delete(key); + newState.set(key, value); + return this._fromState(newState, newLength); + } + unset(key) { + const currState = this._getState(); + const currValue = currState.get(key); + if (typeof currValue !== "string") { + return this; + } + let newLength = this._length - (key.length + currValue.length + 1); + if (currState.size > 1) { + newLength = newLength - 1; + } + const newState = new Map(currState); + newState.delete(key); + return this._fromState(newState, newLength); + } + get(key) { + const currState = this._getState(); + return currState.get(key); + } + serialize() { + let serialized = ""; + let index = 0; + for (const entry of this._getState()) { + if (index > 0) { + serialized = LIST_MEMBERS_SEPARATOR + serialized; + } + serialized = `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized; + index++; + } + return serialized; + } + _getState() { + if (this._internalState) { + return this._internalState; + } + const vendorMembers = this._rawTraceState.split(LIST_MEMBERS_SEPARATOR); + const vendorEntries = new Map; + let currentLength = 0; + for (const member of vendorMembers) { + const m3 = member.trim(); + const idx = m3.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (idx === -1) { + continue; + } + const key = m3.slice(0, idx); + const value = m3.slice(idx + 1); + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) { + continue; + } + const futureLength = currentLength + m3.length + (vendorEntries.size > 0 ? 1 : 0); + if (futureLength > MAX_TRACE_STATE_LEN) { + continue; + } + vendorEntries.set(key, value); + currentLength = futureLength; + if (vendorEntries.size >= MAX_TRACE_STATE_ITEMS) { + break; + } + } + this._length = currentLength; + this._internalState = new Map(Array.from(vendorEntries.entries()).reverse()); + return this._internalState; + } + _fromState(state, length) { + const traceState = Object.create(TraceState.prototype); + traceState._internalState = state; + traceState._length = length; + return traceState; + } + } + exports.TraceState = TraceState; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js +var require_W3CTraceContextPropagator2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing2(); + var TraceState_1 = require_TraceState2(); + exports.TRACE_PARENT_HEADER = "traceparent"; + exports.TRACE_STATE_HEADER = "tracestate"; + var VERSION = "00"; + var VERSION_PART = "(?!ff)[\\da-f]{2}"; + var TRACE_ID_PART = "(?![0]{32})[\\da-f]{32}"; + var PARENT_ID_PART = "(?![0]{16})[\\da-f]{16}"; + var FLAGS_PART = "[\\da-f]{2}"; + var TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); + function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + if (match[1] === "00" && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16) + }; + } + exports.parseTraceParent = parseTraceParent; + + class W3CTraceContextPropagator { + inject(context2, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context2); + if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context2) || !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context2, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context2; + const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; + if (typeof traceParent !== "string") + return context2; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context2; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : undefined); + } + return api_1.trace.setSpanContext(context2, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } + } + exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +var require_rpc_metadata2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = undefined; + var api_1 = require_src(); + var RPC_METADATA_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); + var RPCType; + (function(RPCType2) { + RPCType2["HTTP"] = "http"; + })(RPCType = exports.RPCType || (exports.RPCType = {})); + function setRPCMetadata(context2, meta) { + return context2.setValue(RPC_METADATA_KEY, meta); + } + exports.setRPCMetadata = setRPCMetadata; + function deleteRPCMetadata(context2) { + return context2.deleteValue(RPC_METADATA_KEY); + } + exports.deleteRPCMetadata = deleteRPCMetadata; + function getRPCMetadata(context2) { + return context2.getValue(RPC_METADATA_KEY); + } + exports.getRPCMetadata = getRPCMetadata; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js +var require_lodash_merge2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPlainObject = undefined; + var objectTag = "[object Object]"; + var nullTag = "[object Null]"; + var undefinedTag = "[object Undefined]"; + var funcProto = Function.prototype; + var funcToString = funcProto.toString; + var objectCtorString = funcToString.call(Object); + var getPrototypeOf = Object.getPrototypeOf; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + var nativeObjectToString = objectProto.toString; + function isPlainObject3(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototypeOf(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + exports.isPlainObject = isPlainObject3; + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString3(value); + } + function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } catch {} + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + function objectToString3(value) { + return nativeObjectToString.call(value); + } +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/merge.js +var require_merge2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = undefined; + var lodash_merge_1 = require_lodash_merge2(); + var MAX_LEVEL = 20; + function merge(...args) { + let result = args.shift(); + const objects = new WeakMap; + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; + } + exports.merge = merge; + function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; + } + function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i3 = 0, j2 = two.length;i3 < j2; i3++) { + result.push(takeValue(two[i3])); + } + } else if (isObject2(two)) { + const keys = Object.keys(two); + for (let i3 = 0, j2 = keys.length;i3 < j2; i3++) { + const key = keys[i3]; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + continue; + } + result[key] = takeValue(two[key]); + } + } + } else if (isObject2(one)) { + if (isObject2(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i3 = 0, j2 = keys.length;i3 < j2; i3++) { + const key = keys[i3]; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + continue; + } + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === "undefined") { + delete result[key]; + } else { + result[key] = twoValue; + } + } else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) { + delete result[key]; + } else { + if (isObject2(obj1) && isObject2(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else { + result = two; + } + } + return result; + } + function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i3 = 0, j2 = arr.length;i3 < j2; i3++) { + const info = arr[i3]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; + } + function isArray(value) { + return Array.isArray(value); + } + function isFunction(value) { + return typeof value === "function"; + } + function isObject2(value) { + return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; + } + function isPrimitive(value) { + return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; + } + function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; + } +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/timeout.js +var require_timeout2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.callWithTimeout = exports.TimeoutError = undefined; + + class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + } + exports.TimeoutError = TimeoutError; + function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/url.js +var require_url2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isUrlIgnored = exports.urlMatches = undefined; + function urlMatches(url, urlToMatch) { + if (typeof urlToMatch === "string") { + return url === urlToMatch; + } else { + return !!url.match(urlToMatch); + } + } + exports.urlMatches = urlMatches; + function isUrlIgnored(url, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url, ignoreUrl)) { + return true; + } + } + return false; + } + exports.isUrlIgnored = isUrlIgnored; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/promise.js +var require_promise2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Deferred = undefined; + + class Deferred { + _promise; + _resolve; + _reject; + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } + } + exports.Deferred = Deferred; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/callback.js +var require_callback2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BindOnceFuture = undefined; + var promise_1 = require_promise2(); + + class BindOnceFuture { + _isCalled = false; + _deferred = new promise_1.Deferred; + _callback; + _that; + constructor(callback, that) { + this._callback = callback; + this._that = that; + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); + } catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } + } + exports.BindOnceFuture = BindOnceFuture; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/utils/configuration.js +var require_configuration2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = undefined; + var api_1 = require_src(); + var logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE + }; + function diagLogLevelFromString(value) { + if (value == null) { + return; + } + const resolvedLogLevel = logLevelMap[value.toUpperCase()]; + if (resolvedLogLevel == null) { + api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); + return api_1.DiagLogLevel.INFO; + } + return resolvedLogLevel; + } + exports.diagLogLevelFromString = diagLogLevelFromString; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/internal/exporter.js +var require_exporter2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._export = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing2(); + function _export(exporter, arg) { + return new Promise((resolve) => { + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, resolve); + }); + }); + } + exports._export = _export; +}); + +// node_modules/@opentelemetry/propagator-jaeger/node_modules/@opentelemetry/core/build/src/index.js +var require_src28 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.unrefTimer = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToSeconds = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = undefined; + exports.internal = undefined; + var W3CBaggagePropagator_1 = require_W3CBaggagePropagator2(); + Object.defineProperty(exports, "W3CBaggagePropagator", { enumerable: true, get: function() { + return W3CBaggagePropagator_1.W3CBaggagePropagator; + } }); + var anchored_clock_1 = require_anchored_clock2(); + Object.defineProperty(exports, "AnchoredClock", { enumerable: true, get: function() { + return anchored_clock_1.AnchoredClock; + } }); + var attributes_1 = require_attributes2(); + Object.defineProperty(exports, "isAttributeValue", { enumerable: true, get: function() { + return attributes_1.isAttributeValue; + } }); + Object.defineProperty(exports, "sanitizeAttributes", { enumerable: true, get: function() { + return attributes_1.sanitizeAttributes; + } }); + var global_error_handler_1 = require_global_error_handler2(); + Object.defineProperty(exports, "globalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.globalErrorHandler; + } }); + Object.defineProperty(exports, "setGlobalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } }); + var logging_error_handler_1 = require_logging_error_handler2(); + Object.defineProperty(exports, "loggingErrorHandler", { enumerable: true, get: function() { + return logging_error_handler_1.loggingErrorHandler; + } }); + var time_1 = require_time2(); + Object.defineProperty(exports, "addHrTimes", { enumerable: true, get: function() { + return time_1.addHrTimes; + } }); + Object.defineProperty(exports, "getTimeOrigin", { enumerable: true, get: function() { + return time_1.getTimeOrigin; + } }); + Object.defineProperty(exports, "hrTime", { enumerable: true, get: function() { + return time_1.hrTime; + } }); + Object.defineProperty(exports, "hrTimeDuration", { enumerable: true, get: function() { + return time_1.hrTimeDuration; + } }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMicroseconds; + } }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMilliseconds; + } }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { enumerable: true, get: function() { + return time_1.hrTimeToNanoseconds; + } }); + Object.defineProperty(exports, "hrTimeToSeconds", { enumerable: true, get: function() { + return time_1.hrTimeToSeconds; + } }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { enumerable: true, get: function() { + return time_1.hrTimeToTimeStamp; + } }); + Object.defineProperty(exports, "isTimeInput", { enumerable: true, get: function() { + return time_1.isTimeInput; + } }); + Object.defineProperty(exports, "isTimeInputHrTime", { enumerable: true, get: function() { + return time_1.isTimeInputHrTime; + } }); + Object.defineProperty(exports, "millisToHrTime", { enumerable: true, get: function() { + return time_1.millisToHrTime; + } }); + Object.defineProperty(exports, "timeInputToHrTime", { enumerable: true, get: function() { + return time_1.timeInputToHrTime; + } }); + var timer_util_1 = require_timer_util2(); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return timer_util_1.unrefTimer; + } }); + var ExportResult_1 = require_ExportResult2(); + Object.defineProperty(exports, "ExportResultCode", { enumerable: true, get: function() { + return ExportResult_1.ExportResultCode; + } }); + var utils_1 = require_utils14(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { enumerable: true, get: function() { + return utils_1.parseKeyPairsIntoRecord; + } }); + var platform_1 = require_platform11(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return platform_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return platform_1._globalThis; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return platform_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return platform_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return platform_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return platform_1.getStringListFromEnv; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return platform_1.otperformance; + } }); + var composite_1 = require_composite2(); + Object.defineProperty(exports, "CompositePropagator", { enumerable: true, get: function() { + return composite_1.CompositePropagator; + } }); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator2(); + Object.defineProperty(exports, "TRACE_PARENT_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; + } }); + Object.defineProperty(exports, "TRACE_STATE_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; + } }); + Object.defineProperty(exports, "W3CTraceContextPropagator", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.W3CTraceContextPropagator; + } }); + Object.defineProperty(exports, "parseTraceParent", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.parseTraceParent; + } }); + var rpc_metadata_1 = require_rpc_metadata2(); + Object.defineProperty(exports, "RPCType", { enumerable: true, get: function() { + return rpc_metadata_1.RPCType; + } }); + Object.defineProperty(exports, "deleteRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.deleteRPCMetadata; + } }); + Object.defineProperty(exports, "getRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.getRPCMetadata; + } }); + Object.defineProperty(exports, "setRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.setRPCMetadata; + } }); + var suppress_tracing_1 = require_suppress_tracing2(); + Object.defineProperty(exports, "isTracingSuppressed", { enumerable: true, get: function() { + return suppress_tracing_1.isTracingSuppressed; + } }); + Object.defineProperty(exports, "suppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.suppressTracing; + } }); + Object.defineProperty(exports, "unsuppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.unsuppressTracing; + } }); + var TraceState_1 = require_TraceState2(); + Object.defineProperty(exports, "TraceState", { enumerable: true, get: function() { + return TraceState_1.TraceState; + } }); + var merge_1 = require_merge2(); + Object.defineProperty(exports, "merge", { enumerable: true, get: function() { + return merge_1.merge; + } }); + var timeout_1 = require_timeout2(); + Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() { + return timeout_1.TimeoutError; + } }); + Object.defineProperty(exports, "callWithTimeout", { enumerable: true, get: function() { + return timeout_1.callWithTimeout; + } }); + var url_1 = require_url2(); + Object.defineProperty(exports, "isUrlIgnored", { enumerable: true, get: function() { + return url_1.isUrlIgnored; + } }); + Object.defineProperty(exports, "urlMatches", { enumerable: true, get: function() { + return url_1.urlMatches; + } }); + var callback_1 = require_callback2(); + Object.defineProperty(exports, "BindOnceFuture", { enumerable: true, get: function() { + return callback_1.BindOnceFuture; + } }); + var configuration_1 = require_configuration2(); + Object.defineProperty(exports, "diagLogLevelFromString", { enumerable: true, get: function() { + return configuration_1.diagLogLevelFromString; + } }); + var exporter_1 = require_exporter2(); + exports.internal = { + _export: exporter_1._export + }; +}); + +// node_modules/@opentelemetry/propagator-jaeger/build/src/JaegerPropagator.js +var require_JaegerPropagator = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JaegerPropagator = exports.UBER_BAGGAGE_HEADER_PREFIX = exports.UBER_TRACE_ID_HEADER = undefined; + var api_1 = require_src(); + var core_1 = require_src28(); + exports.UBER_TRACE_ID_HEADER = "uber-trace-id"; + exports.UBER_BAGGAGE_HEADER_PREFIX = "uberctx"; + + class JaegerPropagator { + _jaegerTraceHeader; + _jaegerBaggageHeaderPrefix; + constructor(config) { + if (typeof config === "string") { + this._jaegerTraceHeader = config; + this._jaegerBaggageHeaderPrefix = exports.UBER_BAGGAGE_HEADER_PREFIX; + } else { + this._jaegerTraceHeader = config?.customTraceHeader || exports.UBER_TRACE_ID_HEADER; + this._jaegerBaggageHeaderPrefix = config?.customBaggageHeaderPrefix || exports.UBER_BAGGAGE_HEADER_PREFIX; + } + } + inject(context2, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context2); + const baggage = api_1.propagation.getBaggage(context2); + if (spanContext && (0, core_1.isTracingSuppressed)(context2) === false) { + const traceFlags = `0${(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, this._jaegerTraceHeader, `${spanContext.traceId}:${spanContext.spanId}:0:${traceFlags}`); + } + if (baggage) { + for (const [key, entry] of baggage.getAllEntries()) { + setter.set(carrier, `${this._jaegerBaggageHeaderPrefix}-${key}`, encodeURIComponent(entry.value)); + } + } + } + extract(context2, carrier, getter) { + const uberTraceIdHeader = getter.get(carrier, this._jaegerTraceHeader); + const uberTraceId = Array.isArray(uberTraceIdHeader) ? uberTraceIdHeader[0] : uberTraceIdHeader; + const baggageValues = getter.keys(carrier).filter((key) => key.startsWith(`${this._jaegerBaggageHeaderPrefix}-`)).map((key) => { + const value = getter.get(carrier, key); + return { + key: key.substring(this._jaegerBaggageHeaderPrefix.length + 1), + value: Array.isArray(value) ? value[0] : value + }; + }); + let newContext = context2; + if (typeof uberTraceId === "string") { + const spanContext = deserializeSpanContext(uberTraceId); + if (spanContext) { + newContext = api_1.trace.setSpanContext(newContext, spanContext); + } + } + if (baggageValues.length === 0) + return newContext; + let currentBaggage = api_1.propagation.getBaggage(context2) ?? api_1.propagation.createBaggage(); + for (const baggageEntry of baggageValues) { + if (baggageEntry.value === undefined) + continue; + let decodedValue; + try { + decodedValue = decodeURIComponent(baggageEntry.value); + } catch { + continue; + } + currentBaggage = currentBaggage.setEntry(baggageEntry.key, { + value: decodedValue + }); + } + newContext = api_1.propagation.setBaggage(newContext, currentBaggage); + return newContext; + } + fields() { + return [this._jaegerTraceHeader]; + } + } + exports.JaegerPropagator = JaegerPropagator; + var VALID_HEX_RE = /^[0-9a-f]{1,2}$/i; + function deserializeSpanContext(serializedString) { + let decoded; + try { + decoded = decodeURIComponent(serializedString); + } catch { + return null; + } + const headers = decoded.split(":"); + if (headers.length !== 4) { + return null; + } + const [_traceId, _spanId, , flags] = headers; + const traceId = _traceId.padStart(32, "0"); + const spanId = _spanId.padStart(16, "0"); + const traceFlags = VALID_HEX_RE.test(flags) ? parseInt(flags, 16) & 1 : 1; + return { traceId, spanId, isRemote: true, traceFlags }; + } +}); + +// node_modules/@opentelemetry/propagator-jaeger/build/src/index.js var require_src29 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.UBER_TRACE_ID_HEADER = exports.UBER_BAGGAGE_HEADER_PREFIX = exports.JaegerPropagator = undefined; + var JaegerPropagator_1 = require_JaegerPropagator(); + Object.defineProperty(exports, "JaegerPropagator", { enumerable: true, get: function() { + return JaegerPropagator_1.JaegerPropagator; + } }); + Object.defineProperty(exports, "UBER_BAGGAGE_HEADER_PREFIX", { enumerable: true, get: function() { + return JaegerPropagator_1.UBER_BAGGAGE_HEADER_PREFIX; + } }); + Object.defineProperty(exports, "UBER_TRACE_ID_HEADER", { enumerable: true, get: function() { + return JaegerPropagator_1.UBER_TRACE_ID_HEADER; + } }); +}); + +// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/OTLPMetricExporterOptions.js +var require_OTLPMetricExporterOptions = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AggregationTemporalityPreference = undefined; + var AggregationTemporalityPreference; + (function(AggregationTemporalityPreference2) { + AggregationTemporalityPreference2[AggregationTemporalityPreference2["DELTA"] = 0] = "DELTA"; + AggregationTemporalityPreference2[AggregationTemporalityPreference2["CUMULATIVE"] = 1] = "CUMULATIVE"; + AggregationTemporalityPreference2[AggregationTemporalityPreference2["LOWMEMORY"] = 2] = "LOWMEMORY"; + })(AggregationTemporalityPreference = exports.AggregationTemporalityPreference || (exports.AggregationTemporalityPreference = {})); +}); + +// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/OTLPMetricExporterBase.js +var require_OTLPMetricExporterBase = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPMetricExporterBase = exports.LowMemoryTemporalitySelector = exports.DeltaTemporalitySelector = exports.CumulativeTemporalitySelector = undefined; + var core_1 = require_src3(); + var sdk_metrics_1 = require_src7(); + var OTLPMetricExporterOptions_1 = require_OTLPMetricExporterOptions(); + var otlp_exporter_base_1 = require_src4(); + var api_1 = require_src(); + var CumulativeTemporalitySelector = () => sdk_metrics_1.AggregationTemporality.CUMULATIVE; + exports.CumulativeTemporalitySelector = CumulativeTemporalitySelector; + var DeltaTemporalitySelector = (instrumentType) => { + switch (instrumentType) { + case sdk_metrics_1.InstrumentType.COUNTER: + case sdk_metrics_1.InstrumentType.OBSERVABLE_COUNTER: + case sdk_metrics_1.InstrumentType.GAUGE: + case sdk_metrics_1.InstrumentType.HISTOGRAM: + case sdk_metrics_1.InstrumentType.OBSERVABLE_GAUGE: + return sdk_metrics_1.AggregationTemporality.DELTA; + case sdk_metrics_1.InstrumentType.UP_DOWN_COUNTER: + case sdk_metrics_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: + return sdk_metrics_1.AggregationTemporality.CUMULATIVE; + } + }; + exports.DeltaTemporalitySelector = DeltaTemporalitySelector; + var LowMemoryTemporalitySelector = (instrumentType) => { + switch (instrumentType) { + case sdk_metrics_1.InstrumentType.COUNTER: + case sdk_metrics_1.InstrumentType.HISTOGRAM: + return sdk_metrics_1.AggregationTemporality.DELTA; + case sdk_metrics_1.InstrumentType.GAUGE: + case sdk_metrics_1.InstrumentType.UP_DOWN_COUNTER: + case sdk_metrics_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: + case sdk_metrics_1.InstrumentType.OBSERVABLE_COUNTER: + case sdk_metrics_1.InstrumentType.OBSERVABLE_GAUGE: + return sdk_metrics_1.AggregationTemporality.CUMULATIVE; + } + }; + exports.LowMemoryTemporalitySelector = LowMemoryTemporalitySelector; + function chooseTemporalitySelectorFromEnvironment() { + const configuredTemporality = ((0, core_1.getStringFromEnv)("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE") ?? "cumulative").toLowerCase(); + if (configuredTemporality === "cumulative") { + return exports.CumulativeTemporalitySelector; + } + if (configuredTemporality === "delta") { + return exports.DeltaTemporalitySelector; + } + if (configuredTemporality === "lowmemory") { + return exports.LowMemoryTemporalitySelector; + } + api_1.diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${configuredTemporality}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`); + return exports.CumulativeTemporalitySelector; + } + function chooseTemporalitySelector(temporalityPreference) { + if (temporalityPreference != null) { + if (temporalityPreference === OTLPMetricExporterOptions_1.AggregationTemporalityPreference.DELTA) { + return exports.DeltaTemporalitySelector; + } else if (temporalityPreference === OTLPMetricExporterOptions_1.AggregationTemporalityPreference.LOWMEMORY) { + return exports.LowMemoryTemporalitySelector; + } + return exports.CumulativeTemporalitySelector; + } + return chooseTemporalitySelectorFromEnvironment(); + } + var DEFAULT_AGGREGATION = Object.freeze({ + type: sdk_metrics_1.AggregationType.DEFAULT + }); + function chooseAggregationSelector(config) { + return config?.aggregationPreference ?? (() => DEFAULT_AGGREGATION); + } + + class OTLPMetricExporterBase extends otlp_exporter_base_1.OTLPExporterBase { + _aggregationTemporalitySelector; + _aggregationSelector; + constructor(delegate, config) { + super(delegate); + this._aggregationSelector = chooseAggregationSelector(config); + this._aggregationTemporalitySelector = chooseTemporalitySelector(config?.temporalityPreference); + } + selectAggregation(instrumentType) { + return this._aggregationSelector(instrumentType); + } + selectAggregationTemporality(instrumentType) { + return this._aggregationTemporalitySelector(instrumentType); + } + } + exports.OTLPMetricExporterBase = OTLPMetricExporterBase; +}); + +// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/platform/node/OTLPMetricExporter.js +var require_OTLPMetricExporter = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPMetricExporter = undefined; + var OTLPMetricExporterBase_1 = require_OTLPMetricExporterBase(); + var otlp_transformer_1 = require_src8(); + var node_http_1 = require_index_node_http(); + + class OTLPMetricExporter extends OTLPMetricExporterBase_1.OTLPMetricExporterBase { + constructor(config) { + super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config ?? {}, "METRICS", "v1/metrics", { + "Content-Type": "application/json" + }), otlp_transformer_1.JsonMetricsSerializer), config); + } + } + exports.OTLPMetricExporter = OTLPMetricExporter; +}); + +// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/platform/node/index.js +var require_node13 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPMetricExporter = undefined; + var OTLPMetricExporter_1 = require_OTLPMetricExporter(); + Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { + return OTLPMetricExporter_1.OTLPMetricExporter; + } }); +}); + +// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/platform/index.js +var require_platform12 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPMetricExporter = undefined; + var node_1 = require_node13(); + Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { + return node_1.OTLPMetricExporter; + } }); +}); + +// node_modules/@opentelemetry/exporter-metrics-otlp-http/build/src/index.js +var require_src30 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporterBase = exports.LowMemoryTemporalitySelector = exports.DeltaTemporalitySelector = exports.CumulativeTemporalitySelector = exports.AggregationTemporalityPreference = exports.OTLPMetricExporter = undefined; - var platform_1 = require_platform11(); + var platform_1 = require_platform12(); Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { return platform_1.OTLPMetricExporter; } }); @@ -79464,7 +80867,7 @@ var require_src29 = __commonJS((exports) => { var require_OTLPMetricExporter2 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; - var exporter_metrics_otlp_http_1 = require_src29(); + var exporter_metrics_otlp_http_1 = require_src30(); var otlp_grpc_exporter_base_1 = require_src20(); var otlp_transformer_1 = require_src8(); @@ -79477,7 +80880,7 @@ var require_OTLPMetricExporter2 = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-metrics-otlp-grpc/build/src/index.js -var require_src30 = __commonJS((exports) => { +var require_src31 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; var OTLPMetricExporter_1 = require_OTLPMetricExporter2(); @@ -79490,7 +80893,7 @@ var require_src30 = __commonJS((exports) => { var require_OTLPMetricExporter3 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; - var exporter_metrics_otlp_http_1 = require_src29(); + var exporter_metrics_otlp_http_1 = require_src30(); var otlp_transformer_1 = require_src8(); var node_http_1 = require_index_node_http(); @@ -79505,7 +80908,7 @@ var require_OTLPMetricExporter3 = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-metrics-otlp-proto/build/src/platform/node/index.js -var require_node13 = __commonJS((exports) => { +var require_node14 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; var OTLPMetricExporter_1 = require_OTLPMetricExporter3(); @@ -79515,27 +80918,27 @@ var require_node13 = __commonJS((exports) => { }); // node_modules/@opentelemetry/exporter-metrics-otlp-proto/build/src/platform/index.js -var require_platform12 = __commonJS((exports) => { +var require_platform13 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; - var node_1 = require_node13(); + var node_1 = require_node14(); Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { return node_1.OTLPMetricExporter; } }); }); // node_modules/@opentelemetry/exporter-metrics-otlp-proto/build/src/index.js -var require_src31 = __commonJS((exports) => { +var require_src32 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.OTLPMetricExporter = undefined; - var platform_1 = require_platform12(); + var platform_1 = require_platform13(); Object.defineProperty(exports, "OTLPMetricExporter", { enumerable: true, get: function() { return platform_1.OTLPMetricExporter; } }); }); // node_modules/@opentelemetry/sdk-node/build/src/utils.js -var require_utils14 = __commonJS((exports) => { +var require_utils15 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.buildSamplerFromConfig = exports.getInstanceID = exports.getMeterViewsFromConfiguration = exports.getAggregationType = exports.getInstrumentType = exports.getMeterReadersFromConfiguration = exports.getSpanLimitsFromConfiguration = exports.getSpanProcessorsFromConfiguration = exports.getSpanExporter = exports.getHttpAgentOptionsFromTls = exports.getHeadersFromConfiguration = exports.getLogRecordProcessorsFromConfiguration = exports.getLogRecordExporter = exports.getBatchLogRecordProcessorFromEnv = exports.getBatchLogRecordProcessorConfigFromEnv = exports.getLoggerProviderConfigFromEnv = exports.getPeriodicMetricReaderFromConfiguration = exports.getOtlpMetricExporterFromEnv = exports.getPeriodicExportingMetricReaderFromEnv = exports.getNonNegativeNumberFromEnv = exports.getKeyListFromObjectArray = exports.setupPropagator = exports.setupContextManager = exports.getPropagatorFromConfiguration = exports.getPropagatorFromEnv = exports.getSpanProcessorsFromEnv = exports.getOtlpProtocolFromEnv = exports.getResourceDetectorsFromConfiguration = exports.getResourceDetectorsFromEnv = exports.getResourceFromConfiguration = undefined; var api_1 = require_src(); @@ -79547,7 +80950,7 @@ var require_utils14 = __commonJS((exports) => { var resources_1 = require_src6(); var sdk_trace_base_1 = require_src12(); var propagator_b3_1 = require_src27(); - var propagator_jaeger_1 = require_src28(); + var propagator_jaeger_1 = require_src29(); var context_async_hooks_1 = require_src11(); var exporter_logs_otlp_http_1 = require_src16(); var exporter_logs_otlp_grpc_1 = require_src21(); @@ -79555,9 +80958,9 @@ var require_utils14 = __commonJS((exports) => { var otlp_exporter_base_1 = require_src4(); var otlp_grpc_exporter_base_1 = require_src20(); var sdk_metrics_1 = require_src7(); - var exporter_metrics_otlp_grpc_1 = require_src30(); - var exporter_metrics_otlp_http_1 = require_src29(); - var exporter_metrics_otlp_proto_1 = require_src31(); + var exporter_metrics_otlp_grpc_1 = require_src31(); + var exporter_metrics_otlp_http_1 = require_src30(); + var exporter_metrics_otlp_proto_1 = require_src32(); var sdk_logs_1 = require_src10(); var fs4 = __require("fs"); var RESOURCE_DETECTOR_ENVIRONMENT = "env"; @@ -80368,7 +81771,7 @@ var require_sdk = __commonJS((exports) => { var sdk_trace_node_1 = require_src13(); var semantic_conventions_1 = require_src2(); var core_1 = require_src3(); - var utils_1 = require_utils14(); + var utils_1 = require_utils15(); function getMetricReadersFromEnv() { const metricReaders = []; const enabledExporters = Array.from(new Set((0, core_1.getStringListFromEnv)("OTEL_METRICS_EXPORTER") ?? [])); @@ -82186,7 +83589,7 @@ var require_log = __commonJS((exports) => { }); // node_modules/yaml/dist/schema/yaml-1.1/merge.js -var require_merge2 = __commonJS((exports) => { +var require_merge3 = __commonJS((exports) => { var identity3 = require_identity(); var Scalar = require_Scalar(); var MERGE_KEY = "<<"; @@ -82242,7 +83645,7 @@ var require_merge2 = __commonJS((exports) => { // node_modules/yaml/dist/nodes/addPairToJSMap.js var require_addPairToJSMap = __commonJS((exports) => { var log2 = require_log(); - var merge = require_merge2(); + var merge = require_merge3(); var stringify = require_stringify(); var identity3 = require_identity(); var toJS = require_toJS(); @@ -83519,7 +84922,7 @@ var require_schema4 = __commonJS((exports) => { var bool = require_bool2(); var float = require_float3(); var int = require_int2(); - var merge = require_merge2(); + var merge = require_merge3(); var omap = require_omap(); var pairs = require_pairs(); var set = require_set(); @@ -83562,7 +84965,7 @@ var require_tags = __commonJS((exports) => { var schema = require_schema2(); var schema$1 = require_schema3(); var binary = require_binary(); - var merge = require_merge2(); + var merge = require_merge3(); var omap = require_omap(); var pairs = require_pairs(); var schema$2 = require_schema4(); @@ -87553,7 +88956,7 @@ var require_dist = __commonJS((exports) => { }); // node_modules/@opentelemetry/configuration/build/src/utils.js -var require_utils15 = __commonJS((exports) => { +var require_utils16 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getHttpTlsConfig = exports.initializeDefaultLoggerProviderConfiguration = exports.initializeDefaultMeterProviderConfiguration = exports.initializeDefaultTracerProviderConfiguration = exports.initializeDefaultConfiguration = exports.getGrpcTlsConfig = exports.substituteEnvVars = undefined; var yaml = require_dist(); @@ -87796,7 +89199,7 @@ var require_EnvironmentConfigFactory = __commonJS((exports) => { exports.setLoggerProvider = exports.setMeterProvider = exports.setTracerProvider = exports.setSampler = exports.setPropagators = exports.setAttributeLimits = exports.setResources = exports.EnvironmentConfigFactory = undefined; var core_1 = require_src3(); var api_1 = require_src(); - var utils_1 = require_utils15(); + var utils_1 = require_utils16(); var EnvReader_1 = require_EnvReader(); var EnvDefinition_1 = require_EnvDefinition(); @@ -98012,7 +99415,7 @@ var require_FileConfigFactory = __commonJS((exports) => { var core_1 = require_src3(); var fs4 = __require("fs"); var yaml = require_dist(); - var utils_1 = require_utils15(); + var utils_1 = require_utils16(); var validateConfig = require_validator(); class FileConfigFactory { @@ -98185,7 +99588,7 @@ var require_ConfigFactory = __commonJS((exports) => { }); // node_modules/@opentelemetry/configuration/build/src/index.js -var require_src32 = __commonJS((exports) => { +var require_src33 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.createConfigFactory = undefined; var ConfigFactory_1 = require_ConfigFactory(); @@ -98195,7 +99598,7 @@ var require_src32 = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-node/build/src/semconv.js -var require_semconv7 = __commonJS((exports) => { +var require_semconv8 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_PID = exports.ATTR_HOST_NAME = undefined; exports.ATTR_HOST_NAME = "host.name"; @@ -98262,16 +99665,16 @@ var require_diag2 = __commonJS((exports) => { var require_start = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.setupResource = exports.startNodeSDK = exports.NOOP_SDK = undefined; - var configuration_1 = require_src32(); + var configuration_1 = require_src33(); var api_1 = require_src(); - var utils_1 = require_utils14(); + var utils_1 = require_utils15(); var instrumentation_1 = require_src15(); var sdk_logs_1 = require_src10(); var sdk_metrics_1 = require_src7(); var api_logs_1 = require_src5(); var resources_1 = require_src6(); var context_async_hooks_1 = require_src11(); - var semconv_1 = require_semconv7(); + var semconv_1 = require_semconv8(); var sdk_trace_base_1 = require_src12(); var diag_1 = require_diag2(); exports.NOOP_SDK = { @@ -98395,7 +99798,7 @@ var require_start = __commonJS((exports) => { }); // node_modules/@opentelemetry/sdk-node/build/src/index.js -var require_src33 = __commonJS((exports) => { +var require_src34 = __commonJS((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.startNodeSDK = exports.NodeSDK = exports.tracing = exports.resources = exports.node = exports.metrics = exports.logs = exports.core = exports.contextBase = exports.api = undefined; exports.api = require_src(); @@ -100181,9 +101584,13 @@ class Check extends BaseClient { const response = await ctx.execute(); return response; }; - error = () => { - const ctx = this._ctx.select("error"); - return new Error2(ctx); + error = async () => { + const ctx = this._ctx.select("error").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Error2(ctx.copy().selectNode(response, "Error")); }; name = async () => { if (this._name) { @@ -100359,9 +101766,13 @@ class Container extends BaseClient { const ctx = this._ctx.select("directory", { path, ...opts }); return new Directory(ctx); }; - dockerHealthcheck = () => { - const ctx = this._ctx.select("dockerHealthcheck"); - return new HealthcheckConfig(ctx); + dockerHealthcheck = async () => { + const ctx = this._ctx.select("dockerHealthcheck").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new HealthcheckConfig(ctx.copy().selectNode(response, "HealthcheckConfig")); }; entrypoint = async () => { const ctx = this._ctx.select("entrypoint"); @@ -100518,9 +101929,13 @@ class Container extends BaseClient { const ctx = this._ctx.select("rootfs"); return new Directory(ctx); }; - stat = (path, opts) => { - const ctx = this._ctx.select("stat", { path, ...opts }); - return new Stat(ctx); + stat = async (path, opts) => { + const ctx = this._ctx.select("stat", { path, ...opts }).select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Stat(ctx.copy().selectNode(response, "Stat")); }; stderr = async () => { if (this._stderr) { @@ -101136,9 +102551,13 @@ class Directory extends BaseClient { const response = await ctx.execute(); return response.map((r) => new SearchResult(ctx.copy().selectNode(r.id, "SearchResult"))); }; - stat = (path, opts) => { - const ctx = this._ctx.select("stat", { path, ...opts }); - return new Stat(ctx); + stat = async (path, opts) => { + const ctx = this._ctx.select("stat", { path, ...opts }).select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Stat(ctx.copy().selectNode(response, "Stat")); }; sync = async () => { const ctx = this._ctx.select("sync"); @@ -101493,9 +102912,13 @@ class EnumTypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; sourceModuleName = async () => { if (this._sourceModuleName) { @@ -101558,236 +102981,244 @@ class EnumValueTypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); - }; - value = async () => { - if (this._value) { - return this._value; - } - const ctx = this._ctx.select("value"); - const response = await ctx.execute(); - return response; - }; -} - -class EnvFile extends BaseClient { - _id = undefined; - _exists = undefined; - _get = undefined; - constructor(ctx, _id, _exists, _get) { - super(ctx); - this._id = _id; - this._exists = _exists; - this._get = _get; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); - const response = await ctx.execute(); - return response; - }; - asFile = () => { - const ctx = this._ctx.select("asFile"); - return new File(ctx); - }; - exists = async (name) => { - if (this._exists) { - return this._exists; - } - const ctx = this._ctx.select("exists", { name }); - const response = await ctx.execute(); - return response; - }; - get = async (name, opts) => { - if (this._get) { - return this._get; - } - const ctx = this._ctx.select("get", { name, ...opts }); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); + }; + value = async () => { + if (this._value) { + return this._value; + } + const ctx = this._ctx.select("value"); + const response = await ctx.execute(); + return response; + }; +} + +class EnvFile extends BaseClient { + _id = undefined; + _exists = undefined; + _get = undefined; + constructor(ctx, _id, _exists, _get) { + super(ctx); + this._id = _id; + this._exists = _exists; + this._get = _get; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + asFile = () => { + const ctx = this._ctx.select("asFile"); + return new File(ctx); + }; + exists = async (name) => { + if (this._exists) { + return this._exists; + } + const ctx = this._ctx.select("exists", { name }); + const response = await ctx.execute(); + return response; + }; + get = async (name, opts) => { + if (this._get) { + return this._get; + } + const ctx = this._ctx.select("get", { name, ...opts }); + const response = await ctx.execute(); + return response; + }; + namespace_ = (prefix) => { + const ctx = this._ctx.select("namespace", { prefix }); + return new EnvFile(ctx); + }; + variables = async (opts) => { + const ctx = this._ctx.select("variables", { ...opts }).select("id"); + const response = await ctx.execute(); + return response.map((r) => new EnvVariable(ctx.copy().selectNode(r.id, "EnvVariable"))); + }; + withVariable = (name, value) => { + const ctx = this._ctx.select("withVariable", { name, value }); + return new EnvFile(ctx); + }; + withoutVariable = (name) => { + const ctx = this._ctx.select("withoutVariable", { name }); + return new EnvFile(ctx); + }; + with = (arg) => { + return arg(this); + }; +} + +class EnvVariable extends BaseClient { + _id = undefined; + _name = undefined; + _value = undefined; + constructor(ctx, _id, _name, _value) { + super(ctx); + this._id = _id; + this._name = _name; + this._value = _value; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + name = async () => { + if (this._name) { + return this._name; + } + const ctx = this._ctx.select("name"); + const response = await ctx.execute(); + return response; + }; + value = async () => { + if (this._value) { + return this._value; + } + const ctx = this._ctx.select("value"); + const response = await ctx.execute(); + return response; + }; +} + +class Error2 extends BaseClient { + _id = undefined; + _message = undefined; + constructor(ctx, _id, _message) { + super(ctx); + this._id = _id; + this._message = _message; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + message = async () => { + if (this._message) { + return this._message; + } + const ctx = this._ctx.select("message"); + const response = await ctx.execute(); + return response; + }; + values = async () => { + const ctx = this._ctx.select("values").select("id"); + const response = await ctx.execute(); + return response.map((r) => new ErrorValue(ctx.copy().selectNode(r.id, "ErrorValue"))); + }; + withValue = (name, value) => { + const ctx = this._ctx.select("withValue", { name, value }); + return new Error2(ctx); + }; + with = (arg) => { + return arg(this); + }; +} + +class ErrorValue extends BaseClient { + _id = undefined; + _name = undefined; + _value = undefined; + constructor(ctx, _id, _name, _value) { + super(ctx); + this._id = _id; + this._name = _name; + this._value = _value; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + name = async () => { + if (this._name) { + return this._name; + } + const ctx = this._ctx.select("name"); + const response = await ctx.execute(); + return response; + }; + value = async () => { + if (this._value) { + return this._value; + } + const ctx = this._ctx.select("value"); + const response = await ctx.execute(); + return response; + }; +} +class FieldTypeDef extends BaseClient { + _id = undefined; + _deprecated = undefined; + _description = undefined; + _name = undefined; + constructor(ctx, _id, _deprecated, _description, _name) { + super(ctx); + this._id = _id; + this._deprecated = _deprecated; + this._description = _description; + this._name = _name; + } + id = async () => { + if (this._id) { + return this._id; + } + const ctx = this._ctx.select("id"); + const response = await ctx.execute(); + return response; + }; + deprecated = async () => { + if (this._deprecated) { + return this._deprecated; + } + const ctx = this._ctx.select("deprecated"); + const response = await ctx.execute(); + return response; + }; + description = async () => { + if (this._description) { + return this._description; + } + const ctx = this._ctx.select("description"); + const response = await ctx.execute(); + return response; + }; + name = async () => { + if (this._name) { + return this._name; + } + const ctx = this._ctx.select("name"); + const response = await ctx.execute(); + return response; + }; + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); const response = await ctx.execute(); - return response; - }; - namespace_ = (prefix) => { - const ctx = this._ctx.select("namespace", { prefix }); - return new EnvFile(ctx); - }; - variables = async (opts) => { - const ctx = this._ctx.select("variables", { ...opts }).select("id"); - const response = await ctx.execute(); - return response.map((r) => new EnvVariable(ctx.copy().selectNode(r.id, "EnvVariable"))); - }; - withVariable = (name, value) => { - const ctx = this._ctx.select("withVariable", { name, value }); - return new EnvFile(ctx); - }; - withoutVariable = (name) => { - const ctx = this._ctx.select("withoutVariable", { name }); - return new EnvFile(ctx); - }; - with = (arg) => { - return arg(this); - }; -} - -class EnvVariable extends BaseClient { - _id = undefined; - _name = undefined; - _value = undefined; - constructor(ctx, _id, _name, _value) { - super(ctx); - this._id = _id; - this._name = _name; - this._value = _value; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); - const response = await ctx.execute(); - return response; - }; - name = async () => { - if (this._name) { - return this._name; - } - const ctx = this._ctx.select("name"); - const response = await ctx.execute(); - return response; - }; - value = async () => { - if (this._value) { - return this._value; - } - const ctx = this._ctx.select("value"); - const response = await ctx.execute(); - return response; - }; -} - -class Error2 extends BaseClient { - _id = undefined; - _message = undefined; - constructor(ctx, _id, _message) { - super(ctx); - this._id = _id; - this._message = _message; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); - const response = await ctx.execute(); - return response; - }; - message = async () => { - if (this._message) { - return this._message; - } - const ctx = this._ctx.select("message"); - const response = await ctx.execute(); - return response; - }; - values = async () => { - const ctx = this._ctx.select("values").select("id"); - const response = await ctx.execute(); - return response.map((r) => new ErrorValue(ctx.copy().selectNode(r.id, "ErrorValue"))); - }; - withValue = (name, value) => { - const ctx = this._ctx.select("withValue", { name, value }); - return new Error2(ctx); - }; - with = (arg) => { - return arg(this); - }; -} - -class ErrorValue extends BaseClient { - _id = undefined; - _name = undefined; - _value = undefined; - constructor(ctx, _id, _name, _value) { - super(ctx); - this._id = _id; - this._name = _name; - this._value = _value; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); - const response = await ctx.execute(); - return response; - }; - name = async () => { - if (this._name) { - return this._name; - } - const ctx = this._ctx.select("name"); - const response = await ctx.execute(); - return response; - }; - value = async () => { - if (this._value) { - return this._value; - } - const ctx = this._ctx.select("value"); - const response = await ctx.execute(); - return response; - }; -} -class FieldTypeDef extends BaseClient { - _id = undefined; - _deprecated = undefined; - _description = undefined; - _name = undefined; - constructor(ctx, _id, _deprecated, _description, _name) { - super(ctx); - this._id = _id; - this._deprecated = _deprecated; - this._description = _description; - this._name = _name; - } - id = async () => { - if (this._id) { - return this._id; - } - const ctx = this._ctx.select("id"); - const response = await ctx.execute(); - return response; - }; - deprecated = async () => { - if (this._deprecated) { - return this._deprecated; - } - const ctx = this._ctx.select("deprecated"); - const response = await ctx.execute(); - return response; - }; - description = async () => { - if (this._description) { - return this._description; - } - const ctx = this._ctx.select("description"); - const response = await ctx.execute(); - return response; - }; - name = async () => { - if (this._name) { - return this._name; + if (response === null) { + return null; } - const ctx = this._ctx.select("name"); - const response = await ctx.execute(); - return response; - }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; typeDef = () => { const ctx = this._ctx.select("typeDef"); @@ -101878,9 +103309,13 @@ class File extends BaseClient { const response = await ctx.execute(); return response; }; - stat = () => { - const ctx = this._ctx.select("stat"); - return new Stat(ctx); + stat = async () => { + const ctx = this._ctx.select("stat").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Stat(ctx.copy().selectNode(response, "Stat")); }; sync = async () => { const ctx = this._ctx.select("sync"); @@ -101959,9 +103394,13 @@ class Function_ extends BaseClient { const ctx = this._ctx.select("returnType"); return new TypeDef(ctx); }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; sourceModuleName = async () => { if (this._sourceModuleName) { @@ -102094,9 +103533,13 @@ class FunctionArg extends BaseClient { const response = await ctx.execute(); return response; }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; typeDef = () => { const ctx = this._ctx.select("typeDef"); @@ -102412,9 +103855,13 @@ class GitCommit extends BaseClient { const response = await ctx.execute(); return response; }; - ancestorReleaseTag = (opts) => { - const ctx = this._ctx.select("ancestorReleaseTag", { ...opts }); - return new GitRef(ctx); + ancestorReleaseTag = async (opts) => { + const ctx = this._ctx.select("ancestorReleaseTag", { ...opts }).select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new GitRef(ctx.copy().selectNode(response, "GitRef")); }; authorEmail = async () => { if (this._authorEmail) { @@ -102493,9 +103940,13 @@ class GitCommit extends BaseClient { const response = await ctx.execute(); return response; }; - releaseTag = (opts) => { - const ctx = this._ctx.select("releaseTag", { ...opts }); - return new GitRef(ctx); + releaseTag = async (opts) => { + const ctx = this._ctx.select("releaseTag", { ...opts }).select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new GitRef(ctx.copy().selectNode(response, "GitRef")); }; sha = async () => { if (this._sha) { @@ -102869,9 +104320,13 @@ class InterfaceTypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; sourceModuleName = async () => { if (this._sourceModuleName) { @@ -103556,13 +105011,21 @@ class Module_ extends BaseClient { const response = await ctx.execute(); return response.map((r) => new TypeDef(ctx.copy().selectNode(r.id, "TypeDef"))); }; - runtime = () => { - const ctx = this._ctx.select("runtime"); - return new Container(ctx); + runtime = async () => { + const ctx = this._ctx.select("runtime").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Container(ctx.copy().selectNode(response, "Container")); }; - sdk = () => { - const ctx = this._ctx.select("sdk"); - return new SDKConfig(ctx); + sdk = async () => { + const ctx = this._ctx.select("sdk").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SDKConfig(ctx.copy().selectNode(response, "SDKConfig")); }; serve = async (opts) => { if (this._serve) { @@ -103575,9 +105038,13 @@ class Module_ extends BaseClient { const ctx = this._ctx.select("services", { ...opts }); return new UpGroup(ctx); }; - source = () => { - const ctx = this._ctx.select("source"); - return new ModuleSource(ctx); + source = async () => { + const ctx = this._ctx.select("source").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new ModuleSource(ctx.copy().selectNode(response, "ModuleSource")); }; sync = async () => { const ctx = this._ctx.select("sync"); @@ -103869,9 +105336,13 @@ class ModuleSource extends BaseClient { const response = await ctx.execute(); return response; }; - sdk = () => { - const ctx = this._ctx.select("sdk"); - return new SDKConfig(ctx); + sdk = async () => { + const ctx = this._ctx.select("sdk").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SDKConfig(ctx.copy().selectNode(response, "SDKConfig")); }; sourceRootSubpath = async () => { if (this._sourceRootSubpath) { @@ -104034,9 +105505,13 @@ class ObjectTypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - constructor_ = () => { - const ctx = this._ctx.select("constructor"); - return new Function_(ctx); + constructor_ = async () => { + const ctx = this._ctx.select("constructor").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new Function_(ctx.copy().selectNode(response, "Function")); }; deprecated = async () => { if (this._deprecated) { @@ -104072,9 +105547,13 @@ class ObjectTypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - sourceMap = () => { - const ctx = this._ctx.select("sourceMap"); - return new SourceMap(ctx); + sourceMap = async () => { + const ctx = this._ctx.select("sourceMap").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")); }; sourceModuleName = async () => { if (this._sourceModuleName) { @@ -104272,9 +105751,13 @@ class Client extends BaseClient { const ctx = this._ctx.select("moduleSource", { refString, ...opts, __metadata: metadata }); return new ModuleSource(ctx); }; - node = (id) => { - const ctx = this._ctx.select("node", { id }); - return new _NodeClient(ctx); + node = async (id) => { + const ctx = this._ctx.select("node", { id }).select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new _NodeClient(ctx.copy().selectNode(response, "Node")); }; schema = (json) => { const ctx = this._ctx.select("schema", { json }); @@ -104813,29 +106296,53 @@ class TypeDef extends BaseClient { const response = await ctx.execute(); return response; }; - asEnum = () => { - const ctx = this._ctx.select("asEnum"); - return new EnumTypeDef(ctx); + asEnum = async () => { + const ctx = this._ctx.select("asEnum").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new EnumTypeDef(ctx.copy().selectNode(response, "EnumTypeDef")); }; - asInput = () => { - const ctx = this._ctx.select("asInput"); - return new InputTypeDef(ctx); + asInput = async () => { + const ctx = this._ctx.select("asInput").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new InputTypeDef(ctx.copy().selectNode(response, "InputTypeDef")); }; - asInterface = () => { - const ctx = this._ctx.select("asInterface"); - return new InterfaceTypeDef(ctx); + asInterface = async () => { + const ctx = this._ctx.select("asInterface").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new InterfaceTypeDef(ctx.copy().selectNode(response, "InterfaceTypeDef")); }; - asList = () => { - const ctx = this._ctx.select("asList"); - return new ListTypeDef(ctx); + asList = async () => { + const ctx = this._ctx.select("asList").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new ListTypeDef(ctx.copy().selectNode(response, "ListTypeDef")); }; - asObject = () => { - const ctx = this._ctx.select("asObject"); - return new ObjectTypeDef(ctx); + asObject = async () => { + const ctx = this._ctx.select("asObject").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new ObjectTypeDef(ctx.copy().selectNode(response, "ObjectTypeDef")); }; - asScalar = () => { - const ctx = this._ctx.select("asScalar"); - return new ScalarTypeDef(ctx); + asScalar = async () => { + const ctx = this._ctx.select("asScalar").select("id"); + const response = await ctx.execute(); + if (response === null) { + return null; + } + return new ScalarTypeDef(ctx.copy().selectNode(response, "ScalarTypeDef")); }; kind = async () => { if (this._kind) { @@ -105531,7 +107038,7 @@ var opentelemetry2 = __toESM(require_src(), 1); // src/telemetry/init.ts var import_core2 = __toESM(require_src3(), 1); var import_exporter_trace_otlp_proto = __toESM(require_src9(), 1); -var import_sdk_node = __toESM(require_src33(), 1); +var import_sdk_node = __toESM(require_src34(), 1); var import_sdk_trace_base2 = __toESM(require_src12(), 1); // src/telemetry/live_processor.ts @@ -106145,6 +107652,9 @@ class Registry { up = () => { return (target, propertyKey, descriptor) => descriptor; }; + agent = () => { + return (target, propertyKey, descriptor) => {}; + }; argument = (opts) => { return (target, propertyKey, parameterIndex) => {}; }; @@ -106181,6 +107691,7 @@ var func = registry.func; var check = registry.check; var generate = registry.generate; var up = registry.up; +var agent = registry.agent; var field = registry.field; var enumType = registry.enumType; var argument = registry.argument; @@ -106191,6 +107702,7 @@ var FUNCTION_DECORATOR = func.name; var CHECK_DECORATOR = check.name; var GENERATOR_DECORATOR = generate.name; var UP_DECORATOR = up.name; +var AGENT_DECORATOR = agent.name; var FIELD_DECORATOR = field.name; var ARGUMENT_DECORATOR = argument.name; var ENUM_DECORATOR = enumType.name; @@ -106500,6 +108012,7 @@ class DaggerFunction extends Locatable { isCheck = false; isGenerator = false; isUp = false; + isAgent = false; signature; symbol; constructor(node, ast2) { @@ -106530,6 +108043,9 @@ class DaggerFunction extends Locatable { if (this.ast.isNodeDecoratedWith(this.node, UP_DECORATOR)) { this.isUp = true; } + if (this.ast.isNodeDecoratedWith(this.node, AGENT_DECORATOR)) { + this.isAgent = true; + } for (const parameter of this.node.parameters) { this.arguments[parameter.name.getText()] = new DaggerArgument(parameter, this.ast); } @@ -107713,6 +109229,7 @@ function serializeFunction(fn) { isCheck: f4.isCheck === true, isGenerator: f4.isGenerator === true, isUp: f4.isUp === true, + isAgent: f4.isAgent === true, location: f4.getLocation(), returnType: f4.returnType ? serializeType(f4.returnType) : undefined, arguments: Object.values(f4.arguments).map(serializeArgument) @@ -107888,6 +109405,9 @@ class Register { if (fct.isUp) { fnDef = fnDef.withUp(); } + if (fct.isAgent) { + fnDef = fnDef.withAgent(); + } return fnDef; } addArg(args) { diff --git a/library/package.json b/library/package.json index 212597a..43e4242 100644 --- a/library/package.json +++ b/library/package.json @@ -1,7 +1,7 @@ { "name": "@dagger.io/dagger", - "version": "1.0.0", - "author": "dagger.io", + "version": "0.0.0", + "author": "hello@dagger.io", "license": "Apache-2.0", "types": "./dist/src/index.d.ts", "type": "module", @@ -26,7 +26,7 @@ "@opentelemetry/sdk-metrics": "^2.8.0", "@opentelemetry/sdk-node": "^0.219.0", "@opentelemetry/semantic-conventions": "^1.41.1", - "adm-zip": "^0.5.18", + "adm-zip": "^0.6.0", "env-paths": "^4.0.0", "execa": "^9.6.1", "graphql": "^17.0.1", @@ -39,13 +39,12 @@ "typescript": "^6.0.3" }, "resolutions": { + "@grpc/grpc-js": "1.14.4", "**/@grpc/proto-loader/protobufjs": "7.6.1", "**/@opentelemetry/otlp-transformer/protobufjs": "8.4.1", + "@opentelemetry/propagator-jaeger": "2.9.0", "**/glob/minimatch": "9.0.9", - "@grpc/grpc-js": "1.14.4", - "form-data": "4.0.6", - "mocha/minimatch": "9.0.9", - "mocha/serialize-javascript": "7.0.3" + "form-data": "4.0.6" }, "devDependencies": { "@types/adm-zip": "^0.5.8", diff --git a/library/src/api/client.gen.ts b/library/src/api/client.gen.ts index 20c44e8..087b20f 100644 --- a/library/src/api/client.gen.ts +++ b/library/src/api/client.gen.ts @@ -4132,12 +4132,17 @@ export class Check extends BaseClient { /** * If the check failed, this is the error */ - error = (): Error => { - + error = async (): Promise => { const ctx = this._ctx.select( "error", - ) - return new Error(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new Error(ctx.copy().selectNode(response, "Error")) } /** @@ -4608,12 +4613,17 @@ export class Container extends BaseClient { /** * Retrieves this container's configured docker healthcheck. */ - dockerHealthcheck = (): HealthcheckConfig => { - + dockerHealthcheck = async (): Promise => { const ctx = this._ctx.select( "dockerHealthcheck", - ) - return new HealthcheckConfig(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new HealthcheckConfig(ctx.copy().selectNode(response, "HealthcheckConfig")) } /** @@ -5090,13 +5100,19 @@ export class Container extends BaseClient { * @param path Path to check (e.g., "/file.txt"). * @param opts.doNotFollowSymlinks If specified, do not follow symlinks. */ - stat = (path: string, opts?: ContainerStatOpts): Stat => { - + stat = async (path: string, + opts?: ContainerStatOpts): Promise => { const ctx = this._ctx.select( "stat", - { path, ...opts }, - ) - return new Stat(ctx) + { path, ...opts}, + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new Stat(ctx.copy().selectNode(response, "Stat")) } /** @@ -6988,13 +7004,19 @@ export class Directory extends BaseClient { * @param path Path to stat (e.g., "/file.txt"). * @param opts.doNotFollowSymlinks If specified, do not follow symlinks. */ - stat = (path: string, opts?: DirectoryStatOpts): Stat => { - + stat = async (path: string, + opts?: DirectoryStatOpts): Promise => { const ctx = this._ctx.select( "stat", - { path, ...opts }, - ) - return new Stat(ctx) + { path, ...opts}, + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new Stat(ctx.copy().selectNode(response, "Stat")) } /** @@ -7898,12 +7920,17 @@ export class EnumTypeDef extends BaseClient { /** * The location of this enum declaration. */ - sourceMap = (): SourceMap => { - + sourceMap = async (): Promise => { const ctx = this._ctx.select( "sourceMap", - ) - return new SourceMap(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")) } /** @@ -8049,12 +8076,17 @@ export class EnumValueTypeDef extends BaseClient { /** * The location of this enum member declaration. */ - sourceMap = (): SourceMap => { - + sourceMap = async (): Promise => { const ctx = this._ctx.select( "sourceMap", - ) - return new SourceMap(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")) } /** @@ -8659,12 +8691,17 @@ export class FieldTypeDef extends BaseClient { /** * The location of this field declaration. */ - sourceMap = (): SourceMap => { - + sourceMap = async (): Promise => { const ctx = this._ctx.select( "sourceMap", - ) - return new SourceMap(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")) } /** @@ -8909,12 +8946,17 @@ export class File extends BaseClient { /** * Return file status */ - stat = (): Stat => { - + stat = async (): Promise => { const ctx = this._ctx.select( "stat", - ) - return new Stat(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new Stat(ctx.copy().selectNode(response, "Stat")) } /** @@ -9133,12 +9175,17 @@ export class Function_ extends BaseClient { /** * The location of this function declaration. */ - sourceMap = (): SourceMap => { - + sourceMap = async (): Promise => { const ctx = this._ctx.select( "sourceMap", - ) - return new SourceMap(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")) } /** @@ -9471,12 +9518,17 @@ export class FunctionArg extends BaseClient { /** * The location of this arg declaration. */ - sourceMap = (): SourceMap => { - + sourceMap = async (): Promise => { const ctx = this._ctx.select( "sourceMap", - ) - return new SourceMap(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")) } /** @@ -10222,13 +10274,19 @@ export class GitCommit extends BaseClient { * The latest semver release tag reachable from this commit. * @param opts.includePreRelease Include pre-release tags when choosing the latest tag. */ - ancestorReleaseTag = (opts?: GitCommitAncestorReleaseTagOpts): GitRef => { - + ancestorReleaseTag = async ( + opts?: GitCommitAncestorReleaseTagOpts): Promise => { const ctx = this._ctx.select( "ancestorReleaseTag", - { ...opts }, - ) - return new GitRef(ctx) + { ...opts}, + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new GitRef(ctx.copy().selectNode(response, "GitRef")) } /** @@ -10411,13 +10469,19 @@ export class GitCommit extends BaseClient { * The latest semver release tag that points directly at this commit. * @param opts.includePreRelease Include pre-release tags when choosing the latest tag. */ - releaseTag = (opts?: GitCommitReleaseTagOpts): GitRef => { - + releaseTag = async ( + opts?: GitCommitReleaseTagOpts): Promise => { const ctx = this._ctx.select( "releaseTag", - { ...opts }, - ) - return new GitRef(ctx) + { ...opts}, + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new GitRef(ctx.copy().selectNode(response, "GitRef")) } /** @@ -11431,12 +11495,17 @@ export class InterfaceTypeDef extends BaseClient { /** * The location of this interface declaration. */ - sourceMap = (): SourceMap => { - + sourceMap = async (): Promise => { const ctx = this._ctx.select( "sourceMap", - ) - return new SourceMap(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")) } /** @@ -13142,23 +13211,33 @@ export class Module_ extends BaseClient { /** * The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile. */ - runtime = (): Container => { - + runtime = async (): Promise => { const ctx = this._ctx.select( "runtime", - ) - return new Container(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new Container(ctx.copy().selectNode(response, "Container")) } /** * The SDK config used by this module. */ - sdk = (): SDKConfig => { - + sdk = async (): Promise => { const ctx = this._ctx.select( "sdk", - ) - return new SDKConfig(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new SDKConfig(ctx.copy().selectNode(response, "SDKConfig")) } /** @@ -13201,12 +13280,17 @@ export class Module_ extends BaseClient { /** * The source for the module. */ - source = (): ModuleSource => { - + source = async (): Promise => { const ctx = this._ctx.select( "source", - ) - return new ModuleSource(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new ModuleSource(ctx.copy().selectNode(response, "ModuleSource")) } /** @@ -13901,12 +13985,17 @@ export class ModuleSource extends BaseClient { /** * The SDK configuration of the module. */ - sdk = (): SDKConfig => { - + sdk = async (): Promise => { const ctx = this._ctx.select( "sdk", - ) - return new SDKConfig(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new SDKConfig(ctx.copy().selectNode(response, "SDKConfig")) } /** @@ -14374,12 +14463,17 @@ export class ObjectTypeDef extends BaseClient { /** * The function used to construct new instances of this object, if any. */ - constructor_ = (): Function_ => { - + constructor_ = async (): Promise => { const ctx = this._ctx.select( "constructor", - ) - return new Function_(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new Function_(ctx.copy().selectNode(response, "Function")) } /** @@ -14475,12 +14569,17 @@ export class ObjectTypeDef extends BaseClient { /** * The location of this object declaration. */ - sourceMap = (): SourceMap => { - + sourceMap = async (): Promise => { const ctx = this._ctx.select( "sourceMap", - ) - return new SourceMap(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new SourceMap(ctx.copy().selectNode(response, "SourceMap")) } /** @@ -15050,13 +15149,18 @@ export class Client extends BaseClient { /** * Load any object by its ID. */ - node = (id: ID): Node => { - + node = async (id: ID): Promise => { const ctx = this._ctx.select( "node", - { id }, - ) - return new _NodeClient(ctx) + { id}, + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new _NodeClient(ctx.copy().selectNode(response, "Node")) } /** @@ -16476,67 +16580,97 @@ export class TypeDef extends BaseClient { /** * If kind is ENUM, the enum-specific type definition. If kind is not ENUM, this will be null. */ - asEnum = (): EnumTypeDef => { - + asEnum = async (): Promise => { const ctx = this._ctx.select( "asEnum", - ) - return new EnumTypeDef(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new EnumTypeDef(ctx.copy().selectNode(response, "EnumTypeDef")) } /** * If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null. */ - asInput = (): InputTypeDef => { - + asInput = async (): Promise => { const ctx = this._ctx.select( "asInput", - ) - return new InputTypeDef(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new InputTypeDef(ctx.copy().selectNode(response, "InputTypeDef")) } /** * If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null. */ - asInterface = (): InterfaceTypeDef => { - + asInterface = async (): Promise => { const ctx = this._ctx.select( "asInterface", - ) - return new InterfaceTypeDef(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new InterfaceTypeDef(ctx.copy().selectNode(response, "InterfaceTypeDef")) } /** * If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null. */ - asList = (): ListTypeDef => { - + asList = async (): Promise => { const ctx = this._ctx.select( "asList", - ) - return new ListTypeDef(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new ListTypeDef(ctx.copy().selectNode(response, "ListTypeDef")) } /** * If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null. */ - asObject = (): ObjectTypeDef => { - + asObject = async (): Promise => { const ctx = this._ctx.select( "asObject", - ) - return new ObjectTypeDef(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new ObjectTypeDef(ctx.copy().selectNode(response, "ObjectTypeDef")) } /** * If kind is SCALAR, the scalar-specific type definition. If kind is not SCALAR, this will be null. */ - asScalar = (): ScalarTypeDef => { - + asScalar = async (): Promise => { const ctx = this._ctx.select( "asScalar", - ) - return new ScalarTypeDef(ctx) + ).select("id") + + const response: Awaited = await ctx.execute() + + if (response === null) { + return null + } + return new ScalarTypeDef(ctx.copy().selectNode(response, "ScalarTypeDef")) } /** diff --git a/library/src/module/decorators.ts b/library/src/module/decorators.ts index 2987bb6..99252d9 100644 --- a/library/src/module/decorators.ts +++ b/library/src/module/decorators.ts @@ -36,6 +36,16 @@ export const generate = registry.generate */ export const up = registry.up +/** + * The definition of @agent decorator that marks a function as an agent + * middleware: it takes a base LLM and returns an LLM with the module's tools + * and prompting folded onto it. `dagger agent` discovers and composes these. + * + * Besides the base LLM, an agent function may not declare any other required + * argument. + */ +export const agent = registry.agent + /** * The definition of @field decorator that should be on top of any * class' property that must be exposed to the Dagger API. diff --git a/library/src/module/entrypoint/register.ts b/library/src/module/entrypoint/register.ts index 0575528..e69942c 100644 --- a/library/src/module/entrypoint/register.ts +++ b/library/src/module/entrypoint/register.ts @@ -176,6 +176,10 @@ export class Register { fnDef = fnDef.withUp() } + if ((fct as Method).isAgent) { + fnDef = fnDef.withAgent() + } + return fnDef } diff --git a/library/src/module/introspector/dagger_module/decorator.ts b/library/src/module/introspector/dagger_module/decorator.ts index 79e2d97..54496f7 100644 --- a/library/src/module/introspector/dagger_module/decorator.ts +++ b/library/src/module/introspector/dagger_module/decorator.ts @@ -7,6 +7,7 @@ import { check, generate, up, + agent, } from "../../decorators.js" export type DaggerDecorators = @@ -15,6 +16,7 @@ export type DaggerDecorators = | "check" | "generate" | "up" + | "agent" | "argument" | "enumType" | "field" @@ -24,6 +26,7 @@ export const FUNCTION_DECORATOR = func.name as DaggerDecorators export const CHECK_DECORATOR = check.name as DaggerDecorators export const GENERATOR_DECORATOR = generate.name as DaggerDecorators export const UP_DECORATOR = up.name as DaggerDecorators +export const AGENT_DECORATOR = agent.name as DaggerDecorators export const FIELD_DECORATOR = field.name as DaggerDecorators export const ARGUMENT_DECORATOR = argument.name as DaggerDecorators export const ENUM_DECORATOR = enumType.name as DaggerDecorators diff --git a/library/src/module/introspector/dagger_module/function.ts b/library/src/module/introspector/dagger_module/function.ts index 1d7d881..b77f36b 100644 --- a/library/src/module/introspector/dagger_module/function.ts +++ b/library/src/module/introspector/dagger_module/function.ts @@ -11,6 +11,7 @@ import { } from "../typescript_module/index.js" import { DaggerArgument, DaggerArguments } from "./argument.js" import { + AGENT_DECORATOR, CHECK_DECORATOR, FUNCTION_DECORATOR, GENERATOR_DECORATOR, @@ -33,6 +34,7 @@ export class DaggerFunction extends Locatable { public isCheck: boolean = false public isGenerator: boolean = false public isUp: boolean = false + public isAgent: boolean = false private signature: ts.Signature private symbol: ts.Symbol @@ -79,6 +81,11 @@ export class DaggerFunction extends Locatable { this.isUp = true } + // Parse @agent decorator + if (this.ast.isNodeDecoratedWith(this.node, AGENT_DECORATOR)) { + this.isAgent = true + } + for (const parameter of this.node.parameters) { this.arguments[parameter.name.getText()] = new DaggerArgument( parameter, diff --git a/library/src/module/introspector/test/testdata/decorators/expected.json b/library/src/module/introspector/test/testdata/decorators/expected.json index 16dfc87..9b0e5e1 100644 --- a/library/src/module/introspector/test/testdata/decorators/expected.json +++ b/library/src/module/introspector/test/testdata/decorators/expected.json @@ -263,6 +263,27 @@ "kind": "OBJECT_KIND", "name": "Service" } + }, + "agentSomething": { + "name": "agentSomething", + "description": "", + "arguments": { + "base": { + "name": "base", + "description": "", + "type": { + "kind": "OBJECT_KIND", + "name": "LLM" + }, + "isVariadic": false, + "isNullable": false, + "isOptional": false + } + }, + "returnType": { + "kind": "OBJECT_KIND", + "name": "LLM" + } } }, "properties": { diff --git a/library/src/module/introspector/test/testdata/decorators/index.ts b/library/src/module/introspector/test/testdata/decorators/index.ts index 1e6a713..2e7378b 100644 --- a/library/src/module/introspector/test/testdata/decorators/index.ts +++ b/library/src/module/introspector/test/testdata/decorators/index.ts @@ -3,9 +3,11 @@ import { Container, Directory, File, + LLM, Service, } from "../../../../../api/client.gen.js" import { + agent, argument, check, field, @@ -138,7 +140,7 @@ export class Decorators { return "cached" } - // --- @check / @generate / @up markers (combined with @func) --- + // --- @check / @generate / @up / @agent markers (combined with @func) --- @func() @check() @@ -155,4 +157,10 @@ export class Decorators { upSomething(): Service { throw new Error("not implemented") } + + @func() + @agent() + agentSomething(base: LLM): LLM { + return base + } } diff --git a/library/src/module/introspector/typedef_json.ts b/library/src/module/introspector/typedef_json.ts index fb20f42..8eca05a 100644 --- a/library/src/module/introspector/typedef_json.ts +++ b/library/src/module/introspector/typedef_json.ts @@ -72,6 +72,7 @@ function serializeFunction(fn: DaggerFunction | DaggerInterfaceFunction) { isCheck: f.isCheck === true, isGenerator: f.isGenerator === true, isUp: f.isUp === true, + isAgent: f.isAgent === true, location: f.getLocation(), returnType: f.returnType ? serializeType(f.returnType) : undefined, arguments: Object.values(f.arguments).map(serializeArgument), diff --git a/library/src/module/registry.ts b/library/src/module/registry.ts index 95a6f46..e13a5ac 100644 --- a/library/src/module/registry.ts +++ b/library/src/module/registry.ts @@ -175,6 +175,22 @@ export class Registry { return (target, propertyKey, descriptor) => descriptor } + /** + * The definition of @agent decorator that marks a function as an agent + * middleware, composed by `dagger agent`. + */ + agent = (): (( + target: object, + propertyKey: string | symbol, + descriptor?: PropertyDescriptor, + ) => void) => { + return ( + target: object, + propertyKey: string | symbol, + descriptor?: PropertyDescriptor, + ) => {} + } + argument = ( opts?: ArgumentOptions, ): (( diff --git a/library/src/provisioning/default.ts b/library/src/provisioning/default.ts index 0d245a9..4b7d5aa 100644 --- a/library/src/provisioning/default.ts +++ b/library/src/provisioning/default.ts @@ -1,2 +1,2 @@ // Code generated by dagger. DO NOT EDIT. -export const CLI_VERSION = "1.0.0-beta.9" +export const CLI_VERSION = "1.0.0-beta.10" diff --git a/library/yarn.lock b/library/yarn.lock index 5a1e24d..f322ea0 100644 --- a/library/yarn.lock +++ b/library/yarn.lock @@ -486,6 +486,13 @@ dependencies: "@opentelemetry/semantic-conventions" "^1.29.0" +"@opentelemetry/core@2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-2.9.0.tgz#49de86106f86255b471b2ff035ef1003a851b252" + integrity sha512-m2nckMT80NnmjTYSPjJQObBJ+8dgkoajEOUbznL8AHZ3T3yHRk2P7gI1PhEBc1+lOnrYE9UWrWHqJDsmqjmNbw== + dependencies: + "@opentelemetry/semantic-conventions" "^1.29.0" + "@opentelemetry/exporter-jaeger@^2.8.0": version "2.8.0" resolved "https://registry.yarnpkg.com/@opentelemetry/exporter-jaeger/-/exporter-jaeger-2.8.0.tgz#9ea71246710570fc3375d235a04d39c3227e9103" @@ -844,19 +851,12 @@ dependencies: "@opentelemetry/core" "2.8.0" -"@opentelemetry/propagator-jaeger@2.3.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-jaeger/-/propagator-jaeger-2.3.0.tgz#4056de2c3a3fc8a39122a196188a407730e15e2b" - integrity sha512-1SPtVuU5wF9NSrkpdu78B2Nta+Vi7xjRRZ2OGhmV1Ju8TSsTL4LCrty9uBxPdkGI4J/HISwRsaMt8GdM4P3HqA== - dependencies: - "@opentelemetry/core" "2.3.0" - -"@opentelemetry/propagator-jaeger@2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-jaeger/-/propagator-jaeger-2.8.0.tgz#b8866476fd4a3953dd660a6ab5dc8e2b618dd9e8" - integrity sha512-Xnz9zZvvQzUw+9DrOn0MomR7BxFCkA2pcfXBQuHC28ndJpSbjLs7knzYb05kw5SyCjSsEWombkZMgGcJSk8JVg== +"@opentelemetry/propagator-jaeger@2.3.0", "@opentelemetry/propagator-jaeger@2.8.0", "@opentelemetry/propagator-jaeger@2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-jaeger/-/propagator-jaeger-2.9.0.tgz#7fbb5943782aa8cb83d5c41c316cd8be00438747" + integrity sha512-4mYGty27rYvSM0jtp1ZUOqd3LfVRCYg9H5G9OFzSx5HViYToU21MFhWfco7x1HwXr7ER8yGOiCIHZUwjPksc0Q== dependencies: - "@opentelemetry/core" "2.8.0" + "@opentelemetry/core" "2.9.0" "@opentelemetry/resources@2.3.0": version "2.3.0" @@ -1415,10 +1415,10 @@ acorn@^8.16.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.16.0.tgz#4ce79c89be40afe7afe8f3adb902a1f1ce9ac08a" integrity sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw== -adm-zip@^0.5.18: - version "0.5.18" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.5.18.tgz#283a05f2bf1e3fd315f0f31cde29b7a6e3c1619d" - integrity sha512-ufJnssQGbxzLNS1Ho9bCtX4rQKCCvoVuDLHoJyc3F9dOGDB4BkWs2Ci0kv53lqocAEQ/Cbi+I2XCsNYGqVYqng== +adm-zip@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.6.0.tgz#bbc5c6c333755e967a06dd98747f431e1d53a3cf" + integrity sha512-XleryMhbuksdKtofnWZ9Sk+4CUTbms4Mb/EU32SZwToAyZ5RgVos/ki8n+yr0LWHOGKuakbXTuuYNHLQjhddgg== ajv@^6.14.0: version "6.14.0" @@ -1483,16 +1483,16 @@ balanced-match@^4.0.2: integrity sha512-1pHv8LX9CpKut1Zp4EXey7Z8OfH11ONNH6Dhi2WDUt31VVZFXZzKwXcysBgqSumFCmR+0dqjMK5v5JiFHzi0+g== brace-expansion@^2.0.2: - version "2.1.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.1.tgz#c68b1c4111c76aae3a6fba55d496cee10c39dad8" - integrity sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA== + version "2.1.4" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.4.tgz#589dab11c0018d0366be64cd8bf12c8dbecc8326" + integrity sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg== dependencies: balanced-match "^1.0.0" brace-expansion@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-5.0.2.tgz#b6c16d0791087af6c2bc463f52a8142046c06b6f" - integrity sha512-Pdk8c9poy+YhOgVWw1JNN22/HcivgKWwpxKq04M/jTmHyCZn12WPJebZxdjSa5TmBqISrUSgNYU3eRORljfCCw== + version "5.0.9" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-5.0.9.tgz#7c72438809b5fa5babf54199a1f1c281a6984fcf" + integrity sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg== dependencies: balanced-match "^4.0.2" @@ -2224,9 +2224,9 @@ js-tokens@^4.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + version "4.3.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.3.1.tgz#01216c001d67f48e2cd560d708c7af21090a3848" + integrity sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ== dependencies: argparse "^2.0.1" diff --git a/typescript-sdk.dang b/typescript-sdk.dang index b473beb..08064d8 100644 --- a/typescript-sdk.dang +++ b/typescript-sdk.dang @@ -25,6 +25,16 @@ type TypescriptSdk { "typescript" } + """ + Engine release the committed library bundle is built for. + + This SDK ships the library rather than letting the engine build it, so the + pairing is ours to state: checks drive their harness at this release, and + every fixture module in the repo targets it. Bumping the bundle means bumping + this, and the fixture check fails until they agree. + """ + targetEngineVersion: String! = "1.0.0-beta.10" + """ Config filenames that mark a Dagger module root: the CLI 1.0 `dagger-module.toml` (workspace-managed modules) and the legacy `dagger.json`. From 72679f7bf6481647875450e68eae4b232a166550 Mon Sep 17 00:00:00 2001 From: Vasek - Tom C Date: Thu, 20 Aug 2026 15:53:28 +0200 Subject: [PATCH 2/3] docs(dagger.toml): say why the sdk-sdk CLI pin stays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dagger/sdk-sdk#20 threaded the configured CLI release through to the contract checks, which had been running mod-test's own pinned default and so pairing this SDK's beta.10 bundle with a beta.9 engine. That fix reached us through the sdk-sdk resolution already recorded in dagger.lock, not through anything in this commit — only the comment changes here, and the subject should not suggest otherwise. What the comment now says: the pin stays because this SDK ships a library built for one engine release, so the version the harness runs is load-bearing. sdk-sdk's default happens to match ours today; stating the requirement here means its default moving ahead of ours shows up as a failing check rather than a library quietly paired with a newer engine. All 22 contract-suite checks pass. Signed-off-by: Tom Chauveau --- dagger.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dagger.toml b/dagger.toml index 53bfb3f..33a103c 100644 --- a/dagger.toml +++ b/dagger.toml @@ -21,9 +21,11 @@ check.skip = ["*"] [modules.sdk-sdk] source = "github.com/dagger/sdk-sdk" -# The contract suite drives a real CLI through the whole user path. It pins its -# own release, which has to match the engine this SDK's committed bundle is -# built for — otherwise the checks pair our library with an older engine. +# The contract suite drives a real CLI through the whole user path, so the +# release it runs has to match the engine this SDK's committed bundle is built +# for. sdk-sdk's own default tracks the same version today; pinning it here +# states the requirement, so its default moving ahead of ours shows up as a +# failing check rather than a library quietly paired with a newer engine. settings.daggerCliVersion = "1.0.0-beta.10" [modules.typescript-sdk.as-sdk] From f1dcf91a379e0ee9a85fefbd861453c3b2b741a8 Mon Sep 17 00:00:00 2001 From: Vasek - Tom C Date: Thu, 20 Aug 2026 16:09:08 +0200 Subject: [PATCH 3/3] docs: record what fork.withDirectory actually does MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The client-bundle design leaned on withDirectory being an overlay, which it is not: the polyfill documents it as "add or replace" and the replace is real in the changeset's after tree. What makes client regeneration safe is that a client changeset is only ever applied to disk, and applying is additive. That distinction is the difference between the two paths. Module generation stages its changeset into a workspace and reads it back, where unstaged files — the module's own config and source — do disappear; hence the diff-based staging it uses instead. Verified rather than reasoned: a client directory holding a vendored sdk/core.js and an unrelated NOTES.md keeps both across a regeneration, with removedPaths empty. Signed-off-by: Tom Chauveau --- design/client-bundle.md | 15 +++++++++++---- design/module-gen.md | 15 +++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/design/client-bundle.md b/design/client-bundle.md index e291f47..3ecf21e 100644 --- a/design/client-bundle.md +++ b/design/client-bundle.md @@ -70,10 +70,17 @@ upstream's `Local` SDK-lib origin (`detectSDKLibOrigin`: `"@dagger.io/dagger" == client-dir config, filtered from the workspace root so a not-yet-existing client dir falls back to empty. - The vendored `sdk/` directory itself survives regeneration for free: the fork - stages the client via `withDirectory(client.path, generated)`, which is an - **overlay** — files the user has under `/sdk/` that codegen - doesn't emit are preserved. + The vendored `sdk/` directory itself survives regeneration for free — though + not because `withDirectory` is an overlay, as this originally claimed. The + polyfill documents it as "add or replace", and the replace is real in the + changeset's *after* tree. What makes this safe is that a client changeset is + only ever applied to disk, and applying is additive. Confirmed by + regenerating a client directory holding a vendored `sdk/core.js` and an + unrelated `NOTES.md`: both survive, and `removedPaths` comes back empty. + + The distinction matters if this is reused elsewhere. Module generation stages + its changeset into a workspace and reads it back, where the replace *does* + drop unstaged files — see `module-gen.md`. That's it. No new engine primitive, no bundle shipped by this repo, no new generator modes. diff --git a/design/module-gen.md b/design/module-gen.md index 1b533d3..5fc958c 100644 --- a/design/module-gen.md +++ b/design/module-gen.md @@ -598,6 +598,21 @@ staleness check, with a better message than a hand-written one: with the committed bindings and watching it fail. An engine bump therefore shows up as a failing check rather than silent drift. +**On `fork.withDirectory` (worth knowing before reusing it).** The polyfill +documents it as "add or replace", and the replace is real: whatever is not +staged is absent from the changeset's *after* tree. That only shows up when a +changeset is staged into a workspace and read back — `ws.withChanges`, which is +how the engine generates a local dependency — where it silently drops the +module's own config and source. Applying to disk is additive, so the same +changeset looks fine there. + +Module generation therefore stages a diff over the module's existing tree +(§7 Phase 3). Client generation does not need to: a client changeset is only +ever applied, never staged and re-read. Verified rather than assumed — a client +directory carrying a vendored `sdk/` and an unrelated file keeps both across a +regeneration, and the changeset's `removedPaths` is empty, so the preservation +`client-bundle.md` relies on holds. + **VCS files are not written** (decided): no `.gitignore`, no `.gitattributes`. The engine appends to both around codegen, but for a workspace module the ignore list is reduced to `node_modules`/`.pnpm-store` anyway, which is the