alink-cli 0.11.0 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/agentlink.js +1 -1
- package/dist/{Config-CxDW-52j.mjs → Config-nQ0ig08n.mjs} +5 -5
- package/dist/Config-nQ0ig08n.mjs.map +1 -0
- package/dist/{NodeHttpServer-D2VeYRw1.mjs → NodeHttpServer-D8xOGdyN.mjs} +11 -11
- package/dist/NodeHttpServer-D8xOGdyN.mjs.map +1 -0
- package/dist/{NodeServices-BtcL7AtO.mjs → NodeServices-D5Lui-4t.mjs} +22 -22
- package/dist/NodeServices-D5Lui-4t.mjs.map +1 -0
- package/dist/{NodeSocket-CLfrrutd.mjs → NodeSocket-C7yHTDM1.mjs} +61 -61
- package/dist/NodeSocket-C7yHTDM1.mjs.map +1 -0
- package/dist/{NodeSqliteClient-FfrElFAX.mjs → NodeSqliteClient-S86HxjMf.mjs} +5 -5
- package/dist/NodeSqliteClient-S86HxjMf.mjs.map +1 -0
- package/dist/{Schema-B4KtKnpr.mjs → Schema-CxqR6bXx.mjs} +91 -91
- package/dist/Schema-CxqR6bXx.mjs.map +1 -0
- package/dist/{SqlClient-BQM_tAo_.mjs → SqlClient-ePUtEqLJ.mjs} +6 -6
- package/dist/SqlClient-ePUtEqLJ.mjs.map +1 -0
- package/dist/bin.mjs +249 -183
- package/dist/bin.mjs.map +1 -1
- package/dist/daemon.js +149 -155
- package/dist/qr.js +22 -22
- package/dist/ui.js +172 -172
- package/package.json +1 -1
- package/dist/Config-CxDW-52j.mjs.map +0 -1
- package/dist/NodeHttpServer-D2VeYRw1.mjs.map +0 -1
- package/dist/NodeServices-BtcL7AtO.mjs.map +0 -1
- package/dist/NodeSocket-CLfrrutd.mjs.map +0 -1
- package/dist/NodeSqliteClient-FfrElFAX.mjs.map +0 -1
- package/dist/Schema-B4KtKnpr.mjs.map +0 -1
- package/dist/SqlClient-BQM_tAo_.mjs.map +0 -1
package/bin/agentlink.js
CHANGED
|
@@ -207,7 +207,7 @@ async function browserLogin(hub) {
|
|
|
207
207
|
const url = httpUrl(hub, "/login");
|
|
208
208
|
url.searchParams.set("cli_callback", `http://127.0.0.1:${address.port}/callback`);
|
|
209
209
|
url.searchParams.set("cli_state", state);
|
|
210
|
-
console.log(`\n请在浏览器完成
|
|
210
|
+
console.log(`\n请在浏览器完成 AgentLink 账号登录:\n${url}\n`);
|
|
211
211
|
const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
|
|
212
212
|
const commandArgs = process.platform === "win32" ? ["/c", "start", "", url.toString()] : [url.toString()];
|
|
213
213
|
const opener = spawn(command, commandArgs, { detached: true, stdio: "ignore" });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { $d as hasProperty, $s as TaggedError, B as Union, C as Number$1, Co as map$1, D as String$1, E as Record$1, Ed as some, En as transformOrFail, Eo as mapErrorEager, F as URL, Fa as catchEager, Iu as map$2, Jt as _is, Ka as die, Kn as Pointer, Lo as orDie, Nd as Prototype, Pa as catchDefect, Pd as PipeInspectableProto, Pt as toCodecStringTree, Rd as assignProperty, Sa as all$1, Td as none, Tt as make$2, Xa as fail, Yt as decodeUnknownEffect, Z as decodeTo$1, Zt as SchemaError, Zu as Reference, _n as Transformation, en as applyToSelfOrLastLinkEncoding, eo as flatMapEager, g as Literals, gf as flow, gn as unknown, hf as dual, hn as toEncoded, m as Int, r as Boolean$1, ro as fnUntraced, rs as succeed, tn as decodeTo, ut as isBetween, vn as splitKeyValue, wn as passthrough, wo as mapEager, yn as transform } from "./Schema-
|
|
4
|
-
//#region
|
|
3
|
+
import { $d as hasProperty, $s as TaggedError, B as Union, C as Number$1, Co as map$1, D as String$1, E as Record$1, Ed as some, En as transformOrFail, Eo as mapErrorEager, F as URL, Fa as catchEager, Iu as map$2, Jt as _is, Ka as die, Kn as Pointer, Lo as orDie, Nd as Prototype, Pa as catchDefect, Pd as PipeInspectableProto, Pt as toCodecStringTree, Rd as assignProperty, Sa as all$1, Td as none, Tt as make$2, Xa as fail, Yt as decodeUnknownEffect, Z as decodeTo$1, Zt as SchemaError, Zu as Reference, _n as Transformation, en as applyToSelfOrLastLinkEncoding, eo as flatMapEager, g as Literals, gf as flow, gn as unknown, hf as dual, hn as toEncoded, m as Int, r as Boolean$1, ro as fnUntraced, rs as succeed, tn as decodeTo, ut as isBetween, vn as splitKeyValue, wn as passthrough, wo as mapEager, yn as transform } from "./Schema-CxqR6bXx.mjs";
|
|
4
|
+
//#region ../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=a18f963109656ddbeb2a99ca45f942ecf54830986259eb01ce6a970421c9c6a9/node_modules/effect/dist/ConfigProvider.js
|
|
5
5
|
/**
|
|
6
6
|
* Data sources used by `Config` to load raw configuration values. A
|
|
7
7
|
* `ConfigProvider` reads paths from places such as environment variables,
|
|
@@ -352,7 +352,7 @@ function trieNodeAt(root, path) {
|
|
|
352
352
|
return node;
|
|
353
353
|
}
|
|
354
354
|
//#endregion
|
|
355
|
-
//#region
|
|
355
|
+
//#region ../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=a18f963109656ddbeb2a99ca45f942ecf54830986259eb01ce6a970421c9c6a9/node_modules/effect/dist/LogLevel.js
|
|
356
356
|
/**
|
|
357
357
|
* Returns all `LogLevel` values in order from `All` through the concrete severities to
|
|
358
358
|
* `None`.
|
|
@@ -389,7 +389,7 @@ const values = [
|
|
|
389
389
|
"None"
|
|
390
390
|
];
|
|
391
391
|
//#endregion
|
|
392
|
-
//#region
|
|
392
|
+
//#region ../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=a18f963109656ddbeb2a99ca45f942ecf54830986259eb01ce6a970421c9c6a9/node_modules/effect/dist/Config.js
|
|
393
393
|
const TypeId = "~effect/Config";
|
|
394
394
|
/**
|
|
395
395
|
* Returns `true` if `u` is a `Config` instance.
|
|
@@ -1218,4 +1218,4 @@ function url(name) {
|
|
|
1218
1218
|
//#endregion
|
|
1219
1219
|
export { withDefault as _, all as a, logLevel as c, option as d, port as f, url as g, unwrap as h, TrueValues as i, map as l, string as m, FalseValues as n, boolean as o, schema as p, Record as r, int as s, Boolean as t, number as u };
|
|
1220
1220
|
|
|
1221
|
-
//# sourceMappingURL=Config-
|
|
1221
|
+
//# sourceMappingURL=Config-nQ0ig08n.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config-nQ0ig08n.mjs","names":["Data.TaggedError","Proto","make","Effect.succeed","Predicate.hasProperty","ConfigProvider.ConfigProvider","Effect.mapErrorEager","Effect.flatMapEager","Effect.succeed","Effect.fail","Effect.catchDefect","ConfigProvider.SourceError","Effect.die","Effect.map","Effect.all","Rec.map","Effect.mapEager","Option.some","Option.none","Effect.orDie","SchemaAST.decodeTo","SchemaAST.unknown","SchemaTransformation.Transformation","SchemaGetter.transformOrFail","SchemaGetter.passthrough","SchemaAST.applyToSelfOrLastLinkEncoding","SchemaParser._is","Effect.fnUntraced","Schema.toCodecStringTree","SchemaAST.toEncoded","SchemaParser.decodeUnknownEffect","Schema.make","Effect.catchEager","Schema.SchemaError","SchemaIssue.Pointer","Schema.Boolean","LogLevel_.values","Schema.Record","SchemaTransformation.splitKeyValue","Schema.decodeTo","Schema.Union","Schema.String","Schema.Number","Schema.Int","Schema.URL"],"sources":["../../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=a18f963109656ddbeb2a99ca45f942ecf54830986259eb01ce6a970421c9c6a9/node_modules/effect/dist/ConfigProvider.js","../../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=a18f963109656ddbeb2a99ca45f942ecf54830986259eb01ce6a970421c9c6a9/node_modules/effect/dist/LogLevel.js","../../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=a18f963109656ddbeb2a99ca45f942ecf54830986259eb01ce6a970421c9c6a9/node_modules/effect/dist/Config.js"],"sourcesContent":["/**\n * Data sources used by `Config` to load raw configuration values. A\n * `ConfigProvider` reads paths from places such as environment variables,\n * JavaScript objects, `.env` contents, or directories, and returns a uniform\n * `Node` shape that config schemas can decode. The module also includes helpers\n * for composing providers, changing paths, and installing providers through\n * layers.\n *\n * @since 4.0.0\n */\nimport * as Context from \"./Context.js\";\nimport * as Data from \"./Data.js\";\nimport * as Effect from \"./Effect.js\";\nimport * as FileSystem from \"./FileSystem.js\";\nimport { format } from \"./Formatter.js\";\nimport { dual, flow } from \"./Function.js\";\nimport { PipeInspectableProto } from \"./internal/core.js\";\nimport * as Layer from \"./Layer.js\";\nimport * as Path_ from \"./Path.js\";\nimport * as Predicate from \"./Predicate.js\";\nimport * as Str from \"./String.js\";\n/**\n * Creates a `Value` node representing a terminal string leaf.\n *\n * **When to use**\n *\n * Use when building nodes inside a custom `ConfigProvider`'s `get`\n * callback.\n *\n * **Details**\n *\n * The function returns a new plain object.\n *\n * **Example** (Creating a value node)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider } from \"effect\"\n *\n * ConfigProvider.makeValue(\"3000\") // => { _tag: \"Value\", value: \"3000\" }\n * ```\n *\n * @see {@link makeRecord} – for object-like containers\n * @see {@link makeArray} – for array-like containers\n *\n * @category constructors\n * @since 4.0.0\n */\nexport function makeValue(value) {\n return {\n _tag: \"Value\",\n value\n };\n}\n/**\n * Creates a `Record` node representing an object-like container with known\n * child keys.\n *\n * **When to use**\n *\n * Use when you need to describe a directory or JSON object inside a custom\n * provider.\n *\n * **Details**\n *\n * The optional `value` allows a node to be both a container and a leaf at the\n * same time (for example, an env var `A=x` that also has children `A_FOO` and\n * `A_BAR`).\n *\n * **Example** (Creating a record node)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider } from \"effect\"\n *\n * const node = ConfigProvider.makeRecord(new Set([\"host\", \"port\"]))\n * node._tag // => \"Record\"\n * if (node._tag === \"Record\") {\n * node.keys // => new Set([\"host\", \"port\"])\n * node.value // => undefined\n * }\n * ```\n *\n * @see {@link makeValue} – for terminal leaves\n * @see {@link makeArray} – for array-like containers\n *\n * @category constructors\n * @since 4.0.0\n */\nexport function makeRecord(keys, value) {\n return {\n _tag: \"Record\",\n keys,\n value\n };\n}\n/**\n * Creates an `Array` node representing an indexed container with a known\n * length.\n *\n * **When to use**\n *\n * Use when you need to describe a JSON array or numerically indexed env vars\n * inside a custom provider.\n *\n * **Details**\n *\n * The optional `value` allows a node to be both a container and a leaf at the\n * same time.\n *\n * **Example** (Creating an array node)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider } from \"effect\"\n *\n * ConfigProvider.makeArray(3) // => { _tag: \"Array\", length: 3, value: undefined }\n * ```\n *\n * @see {@link makeValue} – for terminal leaves\n * @see {@link makeRecord} – for object-like containers\n *\n * @category constructors\n * @since 4.0.0\n */\nexport function makeArray(length, value) {\n return {\n _tag: \"Array\",\n length,\n value\n };\n}\n/**\n * Typed error indicating that a configuration source could not be read.\n *\n * **When to use**\n *\n * Use when you need to report that a custom provider's underlying store is\n * unreachable or produced an I/O error while reading configuration data.\n *\n * **Gotchas**\n *\n * Do not use `SourceError` for \"key not found\". That case is represented by\n * returning `undefined` from `load`.\n *\n * **Example** (Failing with a SourceError)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider, Effect } from \"effect\"\n *\n * const provider = ConfigProvider.make((_path) =>\n * Effect.fail(\n * new ConfigProvider.SourceError({ message: \"connection refused\" })\n * )\n * )\n *\n * Effect.runSync(Effect.flip(provider.load([\"host\"]))).message // => \"connection refused\"\n * ```\n *\n * @see {@link ConfigProvider} – the interface whose `load` may fail with this\n * error\n *\n * @category errors\n * @since 4.0.0\n */\nexport class SourceError extends /*#__PURE__*/Data.TaggedError(\"SourceError\") {}\n/**\n * Context reference for the active raw configuration provider, registered in the context with a\n * default value of `fromEnv()`. Because it is a `Context.Reference`, it is\n * available without explicit provision; `Config` schemas automatically resolve\n * it.\n *\n * **When to use**\n *\n * Use to override the active raw configuration provider for an entire program,\n * or retrieve the current provider inside an Effect.\n *\n * **Example** (Providing a custom provider)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider, Effect } from \"effect\"\n *\n * const provider = ConfigProvider.fromUnknown({ port: 8080 })\n *\n * const program = Effect.gen(function*() {\n * const current = yield* ConfigProvider.ConfigProvider\n * return current\n * }).pipe(\n * Effect.provideService(ConfigProvider.ConfigProvider, provider)\n * )\n *\n * Effect.runSync(program) === provider // => true\n * ```\n *\n * @see {@link layer} – install a provider as a Layer\n * @see {@link layerAdd} – add a fallback provider as a Layer\n *\n * @category services\n * @since 4.0.0\n */\nexport const ConfigProvider = /*#__PURE__*/Context.Reference(\"effect/ConfigProvider\", {\n defaultValue: () => fromEnv()\n});\nconst Proto = {\n ...PipeInspectableProto,\n toJSON() {\n return {\n _id: \"ConfigProvider\"\n };\n }\n};\nconst identityPath = path => path;\nfunction makeProvider(load, mapInput) {\n const self = Object.create(Proto);\n self.load = load;\n self.mapInput = mapInput;\n return self;\n}\nfunction makeSource(get, transform) {\n return makeProvider(path => get(transform(path)), f => makeSource(get, flow(transform, f)));\n}\nfunction makeOrElse(first, second) {\n return makeProvider(path => Effect.flatMap(first.load(path), node => node !== undefined ? Effect.succeed(node) : second.load(path)), f => makeOrElse(first.mapInput(f), second.mapInput(f)));\n}\n/**\n * Creates a `ConfigProvider` from a raw lookup function.\n *\n * **When to use**\n *\n * Use when implementing a provider backed by a custom store, such as a\n * database, remote API, or in-memory map.\n *\n * **Details**\n *\n * The `get` callback receives a `Path` and must return\n * `Effect<Node | undefined, SourceError>`. Return `undefined` when the path does\n * not exist, a `Node` when it does, and fail with `SourceError` only when the\n * source cannot be read.\n *\n * Providers created by `make` also implement the path-transformation\n * capability used by {@link mapInput}, {@link constantCase}, and\n * {@link nested}.\n *\n * **Example** (Creating a simple in-memory provider)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider, Effect } from \"effect\"\n *\n * const data: Record<string, string> = {\n * host: \"localhost\",\n * port: \"5432\"\n * }\n *\n * const provider = ConfigProvider.make((path) => {\n * const key = path.join(\".\")\n * const value = data[key]\n * return Effect.succeed(\n * value !== undefined ? ConfigProvider.makeValue(value) : undefined\n * )\n * })\n *\n * Effect.runSync(provider.load([\"host\"])) // => ConfigProvider.makeValue(\"localhost\")\n * ```\n *\n * @see {@link fromEnv} – pre-built provider for environment variables\n * @see {@link fromUnknown} – pre-built provider for JSON objects\n *\n * @category constructors\n * @since 4.0.0\n */\nexport function make(get) {\n return makeSource(get, identityPath);\n}\n/**\n * Returns a provider that falls back to `that` when `self` returns `undefined`\n * for a path.\n *\n * **When to use**\n *\n * Use to layer multiple config sources, such as env vars plus a defaults file,\n * or provide partial overrides on top of a base config.\n *\n * **Details**\n *\n * Each provider keeps its own path transformations. If the combined provider\n * is later transformed with {@link mapInput} or {@link nested}, the\n * transformation is applied to both sides.\n *\n * **Gotchas**\n *\n * The fallback only runs when the path is not found (`undefined`). A\n * `SourceError` from `self` is not caught; it propagates immediately.\n *\n * **Example** (Falling back to a default provider)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider, Effect } from \"effect\"\n *\n * const envProvider = ConfigProvider.fromEnv({\n * env: { HOST: \"prod.example.com\" }\n * })\n * const defaults = ConfigProvider.fromUnknown({ HOST: \"localhost\", PORT: \"3000\" })\n *\n * const combined = ConfigProvider.orElse(envProvider, defaults)\n *\n * const host = Effect.runSync(combined.load([\"HOST\"]))\n * const port = Effect.runSync(combined.load([\"PORT\"]))\n * const values = [host?.value, port?.value] // => [\"prod.example.com\", \"3000\"]\n * ```\n *\n * @see {@link layerAdd} – install a fallback provider via a Layer\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => makeOrElse(self, that));\n/**\n * Transforms the path segments before they reach the underlying store.\n *\n * **When to use**\n *\n * Use when you need to rename, re-case, or otherwise transform config path\n * segments before lookup.\n *\n * **Details**\n *\n * The function `f` receives the whole path produced by earlier provider\n * transformations and must return a new path. Lookup path transformations\n * compose in application order: the existing transformation runs first, then\n * `f` runs. For providers composed with {@link orElse}, the transformation is\n * applied to each operand.\n *\n * The combinator delegates transformation to the provider itself. Use\n * {@link make} for custom sources so this capability is implemented\n * automatically.\n *\n * **Example** (Uppercasing path segments)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider, Effect } from \"effect\"\n *\n * const provider = ConfigProvider.fromEnv({\n * env: { APP_HOST: \"localhost\" }\n * })\n *\n * const upper = ConfigProvider.mapInput(provider, (path) =>\n * path.map((seg) =>\n * typeof seg === \"string\" ? seg.toUpperCase() : seg\n * )\n * )\n *\n * const node = Effect.runSync(upper.load([\"app_host\"]))\n * node?.value // => \"localhost\"\n * ```\n *\n * @see {@link constantCase} – a preset that converts to `CONSTANT_CASE`\n * @see {@link nested} – for prepending a prefix instead of transforming\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const mapInput = /*#__PURE__*/dual(2, (self, f) => self.mapInput(f));\n/**\n * Converts all string path segments to `CONSTANT_CASE` before lookup.\n *\n * **When to use**\n *\n * Use to bridge camelCase schema keys to `SCREAMING_SNAKE_CASE`\n * environment variables.\n *\n * **Details**\n *\n * Numeric segments are left unchanged. String segments use `String.configCase`\n * so numeric word groups such as `v2` are preserved for environment variable\n * names. This is a specialization of {@link mapInput}.\n *\n * **Example** (Resolving camelCase keys to env vars)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider, Effect } from \"effect\"\n *\n * const provider = ConfigProvider.fromEnv({\n * env: { DATABASE_HOST: \"localhost\" }\n * }).pipe(ConfigProvider.constantCase)\n *\n * // path [\"databaseHost\"] now resolves to env var DATABASE_HOST\n * const node = Effect.runSync(provider.load([\"databaseHost\"]))\n * node?.value // => \"localhost\"\n * ```\n *\n * @see {@link mapInput} – for arbitrary path transformations\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const constantCase = /*#__PURE__*/mapInput(path => path.map(seg => typeof seg === \"number\" ? seg : Str.configCase(seg)));\n/**\n * Scopes a provider so that all lookups are prefixed with the given path\n * segments.\n *\n * **When to use**\n *\n * Use to namespace config under a prefix like `\"app\"` or `\"database\"`, or\n * reuse the same provider shape for multiple sub-configs.\n *\n * **Details**\n *\n * Accepts a single string or a full `Path` array. For providers composed with\n * {@link orElse}, the prefix is applied to each operand. Supports both\n * data-last and data-first calling conventions.\n *\n * **Gotchas**\n *\n * Ordering matters when composing with {@link mapInput} or\n * {@link constantCase}. Later provider transformations run after earlier ones:\n * a later `nested` becomes the outer prefix, and a later `mapInput` sees the\n * whole path produced by previous transformations.\n *\n * **Example** (Nesting under a prefix)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider, Effect } from \"effect\"\n *\n * const provider = ConfigProvider.fromEnv({\n * env: { APP_HOST: \"localhost\", APP_PORT: \"3000\" }\n * })\n *\n * // Lookups for [\"HOST\"] now resolve to [\"APP\", \"HOST\"]\n * const scoped = ConfigProvider.nested(provider, \"APP\")\n * const node = Effect.runSync(scoped.load([\"HOST\"]))\n * node?.value // => \"localhost\"\n * ```\n *\n * @see {@link mapInput} – for arbitrary path transformations\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const nested = /*#__PURE__*/dual(2, (self, prefix) => {\n const path = typeof prefix === \"string\" ? [prefix] : prefix;\n return mapInput(self, input => [...path, ...input]);\n});\n/**\n * Provides a layer that installs a `ConfigProvider` as the active provider for\n * all downstream effects, replacing any previously installed provider.\n *\n * **When to use**\n *\n * Use to set the config source for an entire application or test suite.\n *\n * **Details**\n *\n * Accepts either a plain `ConfigProvider` or an `Effect` that produces one.\n * When given an Effect, it is evaluated once when the layer is built.\n *\n * **Example** (Reading config from a JSON object)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect, Layer } from \"effect\"\n *\n * const TestLayer = ConfigProvider.layer(\n * ConfigProvider.fromUnknown({ port: 8080 })\n * )\n *\n * const program = Effect.gen(function*() {\n * const port = yield* Config.number(\"port\")\n * return port\n * })\n *\n * Effect.runSync(Effect.provide(program, TestLayer)) // => 8080\n * ```\n *\n * @see {@link layerAdd} – add a provider without replacing the existing one\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = self => Effect.isEffect(self) ? Layer.effect(ConfigProvider)(self) : Layer.succeed(ConfigProvider)(self);\n/**\n * Creates a Layer that composes a new `ConfigProvider` with the currently\n * active one, rather than replacing it.\n *\n * **When to use**\n *\n * Use to add defaults that should only apply when the primary provider has no\n * value for a path, or override specific keys while keeping the rest from the\n * existing provider by setting `asPrimary: true`.\n *\n * **Details**\n *\n * By default, the new provider acts as a fallback and is consulted only when\n * the current provider returns `undefined`. Set `asPrimary: true` to make\n * the new provider the primary source, with the existing one as fallback.\n *\n * **Example** (Adding default values)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect, Layer } from \"effect\"\n *\n * const defaults = ConfigProvider.fromUnknown({\n * HOST: \"localhost\",\n * PORT: \"3000\"\n * })\n *\n * // The current env provider is tried first; `defaults` is the fallback\n * const DefaultsLayer = ConfigProvider.layerAdd(defaults)\n * const BaseLayer = ConfigProvider.layer(ConfigProvider.fromUnknown({}))\n * const program = Config.string(\"HOST\")\n *\n * const layer = Layer.provide(DefaultsLayer, BaseLayer)\n * Effect.runSync(Effect.provide(program, layer)) // => \"localhost\"\n * ```\n *\n * @see {@link layer} – replace the provider entirely\n * @see {@link orElse} – compose providers without layers\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerAdd = (self, options) => Layer.effect(ConfigProvider)(Effect.gen(function* () {\n const current = yield* ConfigProvider;\n const configProvider = Effect.isEffect(self) ? yield* self : self;\n return options?.asPrimary ? orElse(configProvider, current) : orElse(current, configProvider);\n}));\n/**\n * Creates a `ConfigProvider` backed by an in-memory JavaScript value\n * (typically a parsed JSON object).\n *\n * **When to use**\n *\n * Use when you need deterministic config from an in-memory JavaScript value,\n * such as in tests, embedded config, or parsed JSON.\n *\n * **Details**\n *\n * Path traversal follows standard JS rules: string segments index into object\n * keys, numeric segments index into arrays. Returns `undefined` for any\n * path that cannot be resolved. Never fails with `SourceError`.\n *\n * Primitive values (`number`, `boolean`, `bigint`) are stringified via\n * `String(...)`.\n *\n * Literal empty strings are treated as missing values when loaded as values by\n * default. Pass `{ preserveEmptyStrings: true }` to keep empty strings as\n * explicit values.\n *\n * **Gotchas**\n *\n * Object keys and array lengths reflect the original input shape. A leaf value\n * of `\"\"` is treated as missing when that leaf is loaded, but the parent\n * container still reports its original keys or length.\n *\n * **Example** (Providing config from a plain object)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const provider = ConfigProvider.fromUnknown({\n * database: {\n * host: \"localhost\",\n * port: 5432\n * }\n * })\n *\n * const host = Config.string(\"host\").parse(\n * provider.pipe(ConfigProvider.nested(\"database\"))\n * )\n *\n * Effect.runSync(host) // => \"localhost\"\n * ```\n *\n * @see {@link fromEnv} – for environment variables\n * @see {@link make} – for custom backing stores\n *\n * @category constructors\n * @since 4.0.0\n */\nexport function fromUnknown(root, options) {\n const preserveEmptyStrings = options?.preserveEmptyStrings === true;\n return make(path => Effect.succeed(nodeAtJson(root, path, preserveEmptyStrings)));\n}\nfunction nodeAtJson(root, path, preserveEmptyStrings) {\n let cur = root;\n for (const seg of path) {\n if (cur === null || cur === undefined) return undefined;\n if (Array.isArray(cur)) {\n if (typeof seg !== \"number\" || !Number.isInteger(seg) || seg < 0 || seg >= cur.length) return undefined;\n cur = cur[seg];\n continue;\n }\n if (Predicate.isObject(cur)) {\n if (typeof seg !== \"string\") return undefined;\n if (!Object.hasOwn(cur, seg)) return undefined;\n cur = cur[seg];\n continue;\n }\n // cannot descend\n return undefined;\n }\n return describeUnknown(cur, preserveEmptyStrings);\n}\nfunction describeUnknown(u, preserveEmptyStrings) {\n if (u === undefined || u === null) return undefined;\n if (typeof u === \"string\") return stringNode(u, preserveEmptyStrings);\n if (typeof u === \"number\" || typeof u === \"boolean\" || typeof u === \"bigint\") {\n return makeValue(String(u));\n }\n if (Array.isArray(u)) return makeArray(u.length);\n if (Predicate.isObject(u)) {\n return makeRecord(new Set(Object.keys(u)));\n }\n // unknown values\n return makeValue(format(u));\n}\nfunction stringNode(value, preserveEmptyStrings) {\n const normalized = emptyStringAsMissing(value, preserveEmptyStrings);\n return normalized === undefined ? undefined : makeValue(normalized);\n}\nfunction emptyStringAsMissing(value, preserveEmptyStrings) {\n return value === \"\" && !preserveEmptyStrings ? undefined : value;\n}\n/**\n * Creates a `ConfigProvider` backed by environment variables.\n *\n * **When to use**\n *\n * Use to read configuration from `process.env`, which is the default when no\n * provider is explicitly set, or pass a custom env record for testing or\n * non-Node runtimes.\n *\n * **Details**\n *\n * Path segments are joined with `_` for direct lookup, and env var names are\n * also split on `_` to build a trie for child key discovery. This means\n * `DATABASE_HOST=localhost` is accessible at both path `[\"DATABASE_HOST\"]`\n * and `[\"DATABASE\", \"HOST\"]`. If all immediate children of a trie node have\n * purely numeric names, the node is reported as an `Array`; otherwise as a\n * `Record`.\n *\n * The default environment merges `process.env` and `import.meta.env` (when\n * available). Override by passing `{ env: { ... } }`.\n *\n * Literal empty strings are treated as missing values when loaded as values by\n * default. Pass `{ preserveEmptyStrings: true }` to keep empty strings as\n * explicit values. Child discovery still reflects the environment variable\n * names present in the source.\n *\n * Never fails with `SourceError` — all lookups are synchronous.\n *\n * **Example** (Reading from a custom env record)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const provider = ConfigProvider.fromEnv({\n * env: {\n * DATABASE_HOST: \"localhost\",\n * DATABASE_PORT: \"5432\"\n * }\n * })\n *\n * const host = Config.string(\"HOST\").parse(\n * provider.pipe(ConfigProvider.nested(\"DATABASE\"))\n * )\n *\n * Effect.runSync(host) // => \"localhost\"\n * ```\n *\n * @see {@link fromUnknown} – for JSON objects\n * @see {@link constantCase} – bridge camelCase keys to SCREAMING_SNAKE_CASE\n *\n * @category constructors\n * @since 2.0.0\n */\nexport function fromEnv(options) {\n const env = options?.env ?? {\n ...globalThis.process?.env,\n ...import.meta?.env\n };\n const preserveEmptyStrings = options?.preserveEmptyStrings === true;\n const trie = buildEnvTrie(env);\n return make(path => Effect.succeed(nodeAtEnv(trie, env, path, preserveEmptyStrings)));\n}\nfunction buildEnvTrie(env) {\n const trie = {};\n for (const [name, value] of Object.entries(env)) {\n if (value === undefined) continue;\n // Split on \"_\" and keep empty segments (no special handling for \"__\")\n const segments = name.split(\"_\");\n let node = trie;\n for (const seg of segments) {\n const children = node.children ??= Object.create(null);\n node = children[seg] ??= {};\n }\n }\n return trie;\n}\nconst NUMERIC_INDEX = /^(0|[1-9][0-9]*)$/;\nfunction nodeAtEnv(trie, env, path, preserveEmptyStrings) {\n const key = path.map(String).join(\"_\");\n const leafValue = emptyStringAsMissing(Object.hasOwn(env, key) ? env[key] : undefined, preserveEmptyStrings);\n const trieNode = trieNodeAt(trie, path);\n const children = trieNode?.children ? Object.keys(trieNode.children) : [];\n if (children.length === 0) {\n return leafValue === undefined ? undefined : makeValue(leafValue);\n }\n const allNumeric = children.every(k => NUMERIC_INDEX.test(k));\n if (allNumeric) {\n const length = Math.max(...children.map(k => parseInt(k, 10))) + 1;\n return makeArray(length, leafValue);\n }\n return makeRecord(new Set(children), leafValue);\n}\nfunction trieNodeAt(root, path) {\n if (path.length === 0) return root;\n // Convert path segments to strings and navigate through the trie\n let node = root;\n for (const seg of path) {\n node = node?.children?.[String(seg)];\n if (!node) return undefined;\n }\n return node;\n}\n/**\n * Creates a `ConfigProvider` by parsing the string contents of a `.env` file.\n *\n * **When to use**\n *\n * Use when you already have the `.env` contents as a string, such as contents\n * fetched from a remote store or embedded in a test.\n *\n * **Details**\n *\n * Supports `export` prefixes, single/double/backtick quoting, inline comments,\n * and escaped newlines. Variable expansion (for example, `${VAR}`) is disabled\n * by default; enable with `{ expandVariables: true }`.\n *\n * Literal empty strings are treated as missing values when loaded as values by\n * default. Pass `{ preserveEmptyStrings: true }` to keep empty strings as\n * explicit values. Child discovery still reflects the keys present in the\n * parsed `.env` source.\n *\n * Parsing is based on the `dotenv` / `dotenv-expand` algorithm.\n *\n * Internally delegates to {@link fromEnv} with the parsed key-value pairs.\n *\n * **Example** (Parsing .env contents)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider, Effect } from \"effect\"\n *\n * const contents = `\n * HOST=localhost\n * PORT=3000\n * # this is a comment\n * `\n *\n * const provider = ConfigProvider.fromDotEnvContents(contents)\n * const port = Effect.runSync(provider.load([\"PORT\"]))\n * port?.value // => \"3000\"\n * ```\n *\n * @see {@link fromDotEnv} – loads a `.env` file from disk\n * @see {@link fromEnv} – for raw environment variable access\n *\n * @category constructors\n * @since 4.0.0\n */\nexport function fromDotEnvContents(lines, options) {\n let env = parseDotEnvContents(lines);\n if (options?.expandVariables) {\n env = dotEnvExpand(env);\n }\n return fromEnv({\n env,\n preserveEmptyStrings: options?.preserveEmptyStrings\n });\n}\nconst DOT_ENV_LINE = /(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg;\nfunction parseDotEnvContents(lines) {\n const obj = Object.create(null);\n // Convert line breaks to same format\n lines = lines.replace(/\\r\\n?/gm, \"\\n\");\n let match;\n while ((match = DOT_ENV_LINE.exec(lines)) != null) {\n const key = match[1];\n // Default undefined or null to empty string\n let value = match[2] || \"\";\n // Remove whitespace\n value = value.trim();\n // Check if double quoted\n const maybeQuote = value[0];\n // Remove surrounding quotes\n value = value.replace(/^(['\"`])([\\s\\S]*)\\1$/gm, \"$2\");\n // Expand newlines if double quoted\n if (maybeQuote === \"\\\"\") {\n value = value.replace(/\\\\n/g, \"\\n\");\n value = value.replace(/\\\\r/g, \"\\r\");\n }\n // Add to object\n obj[key] = value;\n }\n return obj;\n}\nfunction dotEnvExpand(parsed) {\n const newParsed = Object.create(null);\n for (const configKey of Object.keys(parsed)) {\n // resolve escape sequences\n newParsed[configKey] = interpolate(parsed[configKey], parsed).replace(/\\\\\\$/g, \"$\");\n }\n return newParsed;\n}\nfunction interpolate(envValue, parsed) {\n // find the last unescaped dollar sign in the\n // value so that we can evaluate it\n const lastUnescapedDollarSignIndex = searchLast(envValue, /(?!(?<=\\\\))\\$/g);\n // If we couldn't match any unescaped dollar sign\n // let's return the string as is\n if (lastUnescapedDollarSignIndex === -1) return envValue;\n // This is the right-most group of variables in the string\n const rightMostGroup = envValue.slice(lastUnescapedDollarSignIndex);\n /**\n * This finds the inner most variable/group divided\n * by variable name and default value (if present)\n * (\n * (?!(?<=\\\\))\\$ // only match dollar signs that are not escaped\n * {? // optional opening curly brace\n * ([\\w]+) // match the variable name\n * (?::-([^}\\\\]*))? // match an optional default value\n * }? // optional closing curly brace\n * )\n */\n const matchGroup = /((?!(?<=\\\\))\\${?([\\w]+)(?::-([^}\\\\]*))?}?)/;\n const match = rightMostGroup.match(matchGroup);\n if (match !== null) {\n const [_, group, variableName, defaultValue] = match;\n return interpolate(envValue.replace(group, defaultValue || (Object.hasOwn(parsed, variableName) ? parsed[variableName] : \"\")), parsed);\n }\n return envValue;\n}\nfunction searchLast(str, rgx) {\n const matches = Array.from(str.matchAll(rgx));\n return matches.length > 0 ? matches.slice(-1)[0].index : -1;\n}\n/**\n * Creates a `ConfigProvider` by reading and parsing a `.env` file from the\n * file system.\n *\n * **When to use**\n *\n * Use to load environment config from a `.env` file at application startup.\n *\n * **Details**\n *\n * Requires `FileSystem` in the Effect context. Defaults to reading `\".env\"` in\n * the current directory; override with `{ path: \"/custom/.env\" }`.\n * Variable expansion (for example, `${VAR}`) is disabled by default; enable\n * with `{ expandVariables: true }`.\n *\n * Literal empty strings are treated as missing values when loaded as values by\n * default. Pass `{ preserveEmptyStrings: true }` to keep empty strings as\n * explicit values. Child discovery still reflects the keys present in the\n * parsed `.env` source.\n *\n * Returns an `Effect` that resolves to a `ConfigProvider`. Fails with a\n * `PlatformError` if the file cannot be read.\n *\n * **Example** (Loading a .env file)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider, Effect, FileSystem } from \"effect\"\n *\n * const fileSystem = FileSystem.makeNoop({\n * readFileString: () => Effect.succeed(\"HOST=localhost\")\n * })\n *\n * const program = Effect.gen(function*() {\n * const provider = yield* ConfigProvider.fromDotEnv()\n * return yield* provider.load([\"HOST\"])\n * })\n *\n * const node = await Effect.runPromise(\n * Effect.provideService(program, FileSystem.FileSystem, fileSystem)\n * )\n * node?.value // => \"localhost\"\n * ```\n *\n * @see {@link fromDotEnvContents} – parse a `.env` string directly\n * @see {@link fromEnv} – read from the runtime environment\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fromDotEnv = /*#__PURE__*/Effect.fnUntraced(function* (options) {\n const fs = yield* FileSystem.FileSystem;\n const content = yield* fs.readFileString(options?.path ?? \".env\");\n return fromDotEnvContents(content, options);\n});\n/**\n * Creates a `ConfigProvider` that reads configuration from a directory tree\n * on disk, where each file is a leaf value and each directory is a container.\n *\n * **When to use**\n *\n * Use when you expose each config key as a file under a directory, such as\n * Kubernetes ConfigMap or Secret volume mounts.\n *\n * **Details**\n *\n * Resolution tries a regular file first and returns a `Value` node for\n * non-empty trimmed file contents. If the file read fails, it tries a directory\n * and returns a `Record` node with immediate child names as keys. If both fail\n * with `NotFound`, it returns `undefined`. Other platform failures return\n * `SourceError`.\n *\n * Requires `Path` and `FileSystem` in the Effect context. Defaults to root\n * path `/`; override with `{ rootPath: \"/etc/config\" }`.\n *\n * Literal empty strings are treated as missing values by default after file\n * contents are trimmed. Pass `{ preserveEmptyStrings: true }` to keep empty\n * strings as explicit values. Directory listings still reflect the file names\n * present on disk.\n *\n * **Example** (Reading config from a directory)\n *\n * ```ts import.meta.vitest\n * import { ConfigProvider, Effect, FileSystem, Path } from \"effect\"\n *\n * const fileSystem = FileSystem.makeNoop({\n * readFileString: (path) =>\n * path === \"/etc/myapp/host\"\n * ? Effect.succeed(\"localhost\")\n * : Effect.die(\"unexpected path\")\n * })\n *\n * const program = Effect.gen(function*() {\n * const provider = yield* ConfigProvider.fromDir({\n * rootPath: \"/etc/myapp\"\n * })\n * return yield* provider.load([\"host\"])\n * })\n *\n * const node = await Effect.runPromise(\n * program.pipe(\n * Effect.provide(Path.layer),\n * Effect.provideService(FileSystem.FileSystem, fileSystem)\n * )\n * )\n * node?.value // => \"localhost\"\n * ```\n *\n * @see {@link fromEnv} – for environment variables\n * @see {@link fromDotEnv} – for `.env` files\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fromDir = /*#__PURE__*/Effect.fnUntraced(function* (options) {\n const platformPath = yield* Path_.Path;\n const fs = yield* FileSystem.FileSystem;\n const rootPath = options?.rootPath ?? \"/\";\n const preserveEmptyStrings = options?.preserveEmptyStrings === true;\n return make(path => {\n const fullPath = platformPath.join(rootPath, ...path.map(String));\n // Try reading as a *file*\n const asFile = fs.readFileString(fullPath).pipe(Effect.map(content => stringNode(content.trim(), preserveEmptyStrings)));\n // If not a file, try reading as a *directory*\n const asDirectory = fs.readDirectory(fullPath).pipe(Effect.map(entries => makeRecord(new Set(entries.map(entry => platformPath.basename(entry))))));\n return asFile.pipe(Effect.catch(fileCause => asDirectory.pipe(Effect.catch(dirCause => isNotFound(fileCause) && isNotFound(dirCause) ? Effect.succeed(undefined) : Effect.fail(isNotFound(fileCause) ? dirCause : fileCause)))), Effect.mapError(cause => new SourceError({\n message: `Failed to read file at ${platformPath.join(rootPath, ...path.map(String))}`,\n cause\n })));\n });\n});\nconst isNotFound = cause => cause.reason._tag === \"NotFound\";\n//# sourceMappingURL=ConfigProvider.js.map","import * as Equ from \"./Equivalence.js\";\nimport * as core from \"./internal/core.js\";\nimport * as effect from \"./internal/effect.js\";\nimport * as Ord from \"./Order.js\";\nimport * as References from \"./References.js\";\n/**\n * Returns all `LogLevel` values in order from `All` through the concrete severities to\n * `None`.\n *\n * **When to use**\n *\n * Use to enumerate or validate all accepted `LogLevel` string values, including\n * the `All` and `None` sentinel levels.\n *\n * **Details**\n *\n * The array order matches the module severity order: `All`, concrete\n * severities from `Fatal` to `Trace`, then `None`.\n *\n * **Gotchas**\n *\n * This list includes `All` and `None`, so it is not limited to concrete emitted\n * severities.\n *\n * @see {@link Severity} for the concrete message severity type that excludes `All` and `None`\n * @see {@link Order} for comparing these levels by severity order\n *\n * @category constants\n * @since 4.0.0\n */\nexport const values = [\"All\", \"Fatal\", \"Error\", \"Warn\", \"Info\", \"Debug\", \"Trace\", \"None\"];\n/**\n * Order instance for `LogLevel` that defines the severity ordering.\n *\n * **When to use**\n *\n * Use to sort or compare log levels according to Effect's severity order.\n *\n * **Details**\n *\n * This order treats \"All\" as the least restrictive level and \"None\" as the most restrictive,\n * with Fatal being the most severe actual log level.\n *\n * **Example** (Ordering log levels)\n *\n * ```ts import.meta.vitest\n * import { LogLevel } from \"effect\"\n *\n * LogLevel.Order(\"Error\", \"Info\") // => 1\n * LogLevel.Order(\"Debug\", \"Error\") // => -1\n * LogLevel.Order(\"Info\", \"Info\") // => 0\n * ```\n *\n * @category ordering\n * @since 2.0.0\n */\nexport const Order = effect.LogLevelOrder;\n/**\n * Equivalence instance for log levels using strict equality (`===`).\n *\n * **When to use**\n *\n * Use to compare two `LogLevel` values when only the exact same level should\n * match.\n *\n * **Details**\n *\n * Each log level string, including `All` and `None`, only matches itself.\n *\n * **Example** (Comparing log levels)\n *\n * ```ts import.meta.vitest\n * import { LogLevel } from \"effect\"\n *\n * LogLevel.Equivalence(\"Error\", \"Error\") // => true\n * LogLevel.Equivalence(\"Error\", \"Info\") // => false\n * ```\n *\n * @see {@link Order} for severity ordering rather than exact level equality\n * @see {@link isGreaterThanOrEqualTo} for minimum-threshold checks\n *\n * @category instances\n * @since 4.0.0\n */\nexport const Equivalence = /*#__PURE__*/Equ.strictEqual();\n/**\n * Returns the ordinal value of the log level.\n *\n * **When to use**\n *\n * Use to project a `LogLevel` into the numeric sort key used by\n * `LogLevel.Order` when custom ordering code or an integration needs a number\n * instead of an `Order` comparison.\n *\n * **Details**\n *\n * The mapping is `All` to `Number.MIN_SAFE_INTEGER`, `Trace` to `0`, `Debug` to\n * `10000`, `Info` to `20000`, `Warn` to `30000`, `Error` to `40000`, `Fatal` to\n * `50000`, and `None` to `Number.MAX_SAFE_INTEGER`.\n *\n * **Gotchas**\n *\n * These ordinals are internal sort keys; do not treat them as external severity\n * numbers.\n *\n * @see {@link Order} for comparing log levels without exposing numeric keys\n * @see {@link isGreaterThanOrEqualTo} for minimum-threshold filtering\n *\n * @category ordering\n * @since 4.0.0\n */\nexport const getOrdinal = self => effect.logLevelToOrder(self);\n/**\n * Determines if the first log level is more severe than the second.\n *\n * **When to use**\n *\n * Use to check whether one log level is strictly more severe than another.\n *\n * **Details**\n *\n * Returns `true` if `self` represents a more severe level than `that`.\n *\n * **Example** (Checking higher severity)\n *\n * ```ts import.meta.vitest\n * import { LogLevel } from \"effect\"\n *\n * LogLevel.isGreaterThan(\"Error\", \"Info\") // => true\n * LogLevel.isGreaterThan(\"Debug\", \"Error\") // => false\n *\n * // Use with filtering\n * const isFatal = LogLevel.isGreaterThan(\"Fatal\", \"Warn\")\n * const isError = LogLevel.isGreaterThan(\"Error\", \"Warn\")\n * const isDebug = LogLevel.isGreaterThan(\"Debug\", \"Warn\")\n * isFatal // => true\n * isError // => true\n * isDebug // => false\n *\n * // Curried usage\n * const isMoreSevereThanInfo = LogLevel.isGreaterThan(\"Info\")\n * isMoreSevereThanInfo(\"Error\") // => true\n * isMoreSevereThanInfo(\"Debug\") // => false\n * ```\n *\n * @category ordering\n * @since 4.0.0\n */\nexport const isGreaterThan = effect.isLogLevelGreaterThan;\n/**\n * Determines if the first log level is more severe than or equal to the second.\n *\n * **When to use**\n *\n * Use to implement minimum log-level filtering by checking whether a message\n * level meets a threshold.\n *\n * **Details**\n *\n * Returns `true` if `self` represents a level that is more severe than or equal to `that`.\n *\n * **Example** (Filtering by minimum log level)\n *\n * ```ts import.meta.vitest\n * import { LogLevel } from \"effect\"\n *\n * LogLevel.isGreaterThanOrEqualTo(\"Error\", \"Error\") // => true\n * LogLevel.isGreaterThanOrEqualTo(\"Error\", \"Info\") // => true\n * LogLevel.isGreaterThanOrEqualTo(\"Debug\", \"Info\") // => false\n *\n * const isInfoOrAbove = LogLevel.isGreaterThanOrEqualTo(\"Info\")\n * isInfoOrAbove(\"Error\") // => true\n * ```\n *\n * @category ordering\n * @since 4.0.0\n */\nexport const isGreaterThanOrEqualTo = /*#__PURE__*/Ord.isGreaterThanOrEqualTo(Order);\n/**\n * Determines if the first log level is less severe than the second.\n *\n * **When to use**\n *\n * Use to check whether one log level is strictly less severe than another.\n *\n * **Details**\n *\n * Returns `true` if `self` represents a less severe level than `that`.\n *\n * **Example** (Checking lower severity)\n *\n * ```ts import.meta.vitest\n * import { LogLevel } from \"effect\"\n *\n * LogLevel.isLessThan(\"Debug\", \"Info\") // => true\n * LogLevel.isLessThan(\"Error\", \"Info\") // => false\n *\n * // Filter out verbose logs\n * const isFatalVerbose = LogLevel.isLessThan(\"Fatal\", \"Info\")\n * const isErrorVerbose = LogLevel.isLessThan(\"Error\", \"Info\")\n * const isTraceVerbose = LogLevel.isLessThan(\"Trace\", \"Info\")\n * isFatalVerbose // => false\n * isErrorVerbose // => false\n * isTraceVerbose // => true\n *\n * // Curried usage\n * const isLessSevereThanError = LogLevel.isLessThan(\"Error\")\n * isLessSevereThanError(\"Info\") // => true\n * isLessSevereThanError(\"Fatal\") // => false\n * ```\n *\n * @category ordering\n * @since 4.0.0\n */\nexport const isLessThan = /*#__PURE__*/Ord.isLessThan(Order);\n/**\n * Determines if the first log level is less severe than or equal to the second.\n *\n * **When to use**\n *\n * Use to implement maximum log-level filtering by checking whether a level is\n * at or below a threshold.\n *\n * **Details**\n *\n * Returns `true` if `self` represents a level that is less severe than or equal to `that`.\n *\n * **Example** (Filtering by maximum log level)\n *\n * ```ts import.meta.vitest\n * import { LogLevel } from \"effect\"\n *\n * LogLevel.isLessThanOrEqualTo(\"Info\", \"Info\") // => true\n * LogLevel.isLessThanOrEqualTo(\"Debug\", \"Info\") // => true\n * LogLevel.isLessThanOrEqualTo(\"Error\", \"Info\") // => false\n *\n * const isInfoOrBelow = LogLevel.isLessThanOrEqualTo(\"Info\")\n * isInfoOrBelow(\"Debug\") // => true\n * ```\n *\n * @category ordering\n * @since 4.0.0\n */\nexport const isLessThanOrEqualTo = /*#__PURE__*/Ord.isLessThanOrEqualTo(Order);\n/**\n * Checks whether a given log level is enabled for the current fiber.\n *\n * **When to use**\n *\n * Use to check whether a log level would be emitted under the current fiber's\n * minimum log level.\n *\n * **Details**\n *\n * A log level is enabled when it is greater than or equal to\n * `References.MinimumLogLevel`.\n *\n * **Example** (Checking current fiber log level)\n *\n * ```ts import.meta.vitest\n * import { Effect, LogLevel, References } from \"effect\"\n *\n * const program = Effect.gen(function*() {\n * const debugEnabled = yield* LogLevel.isEnabled(\"Debug\")\n * const errorEnabled = yield* LogLevel.isEnabled(\"Error\")\n *\n * return { debugEnabled, errorEnabled }\n * })\n *\n * const warnOnly = program.pipe(\n * Effect.provideService(References.MinimumLogLevel, \"Warn\")\n * )\n *\n * await Effect.runPromise(warnOnly) // => { debugEnabled: false, errorEnabled: true }\n * ```\n *\n * @category predicates\n * @since 4.0.0\n */\nexport const isEnabled = self => core.withFiber(fiber => effect.succeed(!isGreaterThan(fiber.getRef(References.MinimumLogLevel), self)));\n//# sourceMappingURL=LogLevel.js.map","import * as ConfigProvider from \"./ConfigProvider.js\";\nimport * as Effect from \"./Effect.js\";\nimport * as Effectable from \"./Effectable.js\";\nimport { dual } from \"./Function.js\";\nimport * as InternalRecord from \"./internal/record.js\";\nimport * as LogLevel_ from \"./LogLevel.js\";\nimport * as Option from \"./Option.js\";\nimport * as Predicate from \"./Predicate.js\";\nimport * as Rec from \"./Record.js\";\nimport * as Schema from \"./Schema.js\";\nimport * as SchemaAST from \"./SchemaAST.js\";\nimport * as SchemaGetter from \"./SchemaGetter.js\";\nimport * as SchemaIssue from \"./SchemaIssue.js\";\nimport * as SchemaParser from \"./SchemaParser.js\";\nimport * as SchemaTransformation from \"./SchemaTransformation.js\";\nconst TypeId = \"~effect/Config\";\n/**\n * Returns `true` if `u` is a `Config` instance.\n *\n * **When to use**\n *\n * Use when you need to distinguish a `Config` from an unknown value before\n * calling `.parse` or {@link unwrap}.\n *\n * **Example** (Checking Config values)\n *\n * ```ts import.meta.vitest\n * import { Config } from \"effect\"\n *\n * Config.isConfig(Config.string(\"HOST\")) // => true\n * Config.isConfig(\"not a config\") // => false\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isConfig = u => Predicate.hasProperty(u, TypeId);\n/**\n * Represents the error type produced when config loading or validation fails.\n *\n * **When to use**\n *\n * Use when you need to inspect config loading or validation failures.\n *\n * **Details**\n *\n * Wraps either:\n * - A `SourceError` — the provider could not read data (I/O failure).\n * - A `SchemaError` — the data was found but did not match the schema\n * (wrong type, out of range, missing key, etc.).\n *\n * @see {@link orElse} – recover from a ConfigError\n * @see {@link withDefault} – provide a fallback when relevant input is absent\n *\n * @category errors\n * @since 4.0.0\n */\nexport class ConfigError {\n _tag = \"ConfigError\";\n name = \"ConfigError\";\n cause;\n constructor(cause) {\n this.cause = cause;\n }\n get message() {\n return this.cause.toString();\n }\n toString() {\n return `ConfigError(${this.message})`;\n }\n}\nconst Proto = {\n ... /*#__PURE__*/Effectable.Prototype({\n label: \"Config\",\n evaluate(fiber) {\n return this.parse(fiber.getRef(ConfigProvider.ConfigProvider));\n }\n }),\n [TypeId]: TypeId,\n toJSON() {\n return {\n _id: \"Config\"\n };\n }\n};\nfunction make(evaluator) {\n const self = Object.create(Proto);\n self.evaluator = evaluator;\n self.parse = provider => evaluator(provider, []).pipe(Effect.mapErrorEager(failure => failure.error), Effect.flatMapEager(resolution => resolution._tag === \"Resolved\" ? Effect.succeed(resolution.value) : Effect.fail(resolution.error)));\n return self;\n}\nconst evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);\nconst resolved = (value, hasInput) => ({\n _tag: \"Resolved\",\n value,\n hasInput\n});\nconst absent = error => ({\n _tag: \"Absent\",\n error\n});\nconst evaluationFailure = (error, hasInput) => ({\n error,\n hasInput\n});\nconst catchSourceError = (self, hasInput) => self.pipe(Effect.catchDefect(defect => defect instanceof ConfigProvider.SourceError ? Effect.fail(evaluationFailure(new ConfigError(defect), hasInput)) : Effect.die(defect)));\nconst preserveInputEvidence = (self, hasInput) => {\n if (!hasInput) return self;\n return self.pipe(Effect.mapErrorEager(failure => evaluationFailure(failure.error, true)), Effect.flatMapEager(resolution => resolution._tag === \"Resolved\" ? Effect.succeed(resolved(resolution.value, true)) : Effect.fail(evaluationFailure(resolution.error, true))));\n};\n/**\n * Transforms the parsed value of a config with a pure function.\n *\n * **When to use**\n *\n * Use when you need to transform a parsed config value with a function that\n * cannot fail.\n *\n * **Example** (Uppercasing a string config)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const upper = Config.string(\"name\").pipe(\n * Config.map((s) => s.toUpperCase())\n * )\n *\n * const provider = ConfigProvider.fromUnknown({ name: \"alice\" })\n * Effect.runSync(upper.parse(provider)) // => \"ALICE\"\n * ```\n *\n * @see {@link mapOrFail} – when the transformation can fail\n *\n * @category mapping\n * @since 2.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => {\n return make((provider, pathPrefix) => Effect.map(evaluateAt(self, provider, pathPrefix), resolution => resolution._tag === \"Resolved\" ? resolved(f(resolution.value), resolution.hasInput) : resolution));\n});\n/**\n * Transforms the parsed value with a function that may fail.\n *\n * **When to use**\n *\n * Use when you need to transform a parsed config value with a function that can\n * produce a `ConfigError` (e.g. parsing a URL, checking a range).\n *\n * **Example** (Wrapping a value in an effectful transformation)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const trimmed = Config.string(\"name\").pipe(\n * Config.mapOrFail((s) => Effect.succeed(s.trim()))\n * )\n * const provider = ConfigProvider.fromUnknown({ name: \" Alice \" })\n * Effect.runSync(trimmed.parse(provider)) // => \"Alice\"\n * ```\n *\n * @see {@link map} – when the transformation cannot fail\n *\n * @category mapping\n * @since 2.0.0\n */\nexport const mapOrFail = /*#__PURE__*/dual(2, (self, f) => {\n return make((provider, pathPrefix) => Effect.flatMap(evaluateAt(self, provider, pathPrefix), resolution => resolution._tag === \"Resolved\" ? f(resolution.value).pipe(Effect.mapEager(value => resolved(value, resolution.hasInput)), Effect.mapErrorEager(error => evaluationFailure(error, resolution.hasInput))) : Effect.succeed(resolution)));\n});\n/**\n * Provides a fallback config when parsing fails with a `ConfigError`.\n *\n * **When to use**\n *\n * Use when you need to try an alternative config source after the primary one\n * fails.\n *\n * **Details**\n *\n * Unlike {@link withDefault}, this handles both semantic absence and **all**\n * `ConfigError`s. The fallback function receives the error and returns a new\n * `Config`.\n *\n * **Gotchas**\n *\n * Recovery preserves whether the primary config read provider input. When the\n * recovered config is composed with {@link all}, invalid input in the primary\n * branch still makes the enclosing group partially supplied, so an outer\n * {@link withDefault} or {@link option} does not replace the whole group.\n *\n * **Example** (Falling back to a literal)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const hostConfig = Config.string(\"HOST\").pipe(\n * Config.orElse(() => Config.succeed(\"localhost\"))\n * )\n * const provider = ConfigProvider.fromUnknown({})\n * Effect.runSync(hostConfig.parse(provider)) // => \"localhost\"\n * ```\n *\n * @see {@link withDefault} – fallback only on semantic absence\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => {\n return make((provider, pathPrefix) => Effect.matchEffect(evaluateAt(self, provider, pathPrefix), {\n onFailure: failure => preserveInputEvidence(evaluateAt(that(failure.error), provider, pathPrefix), failure.hasInput),\n onSuccess: resolution => resolution._tag === \"Absent\" ? evaluateAt(that(resolution.error), provider, pathPrefix) : Effect.succeed(resolution)\n }));\n});\n/**\n * Combines multiple configs into a single config that parses all of them.\n *\n * **When to use**\n *\n * Use when you need to group related configs into a tuple or named struct.\n *\n * **Details**\n *\n * Accepts a tuple (preserves positions), an iterable, or a record of configs.\n * Returns a config whose parsed value mirrors the input shape.\n *\n * A combined config is absent when at least one child cannot resolve and none\n * of the other children read provider input. This lets {@link withDefault} and\n * {@link option} handle a wholly absent group. Once any child reads input, a\n * missing sibling makes the group incomplete and parsing fails. Values supplied\n * by child defaults do not count as provider input.\n *\n * Unlike a `Schema.Struct` passed to {@link schema}, `all` only considers input\n * read by its children. An explicitly present but empty parent container does\n * not by itself make the group present.\n *\n * **Example** (Combining configs as a struct)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const dbConfig = Config.all({\n * host: Config.string(\"host\"),\n * port: Config.number(\"port\")\n * })\n *\n * const provider = ConfigProvider.fromUnknown({ host: \"localhost\", port: 5432 })\n * Effect.runSync(dbConfig.parse(provider)) // => { host: \"localhost\", port: 5432 }\n * ```\n *\n * @category combinators\n * @since 2.0.0\n */\nexport function all(arg) {\n const configs = Array.isArray(arg) ? arg : Symbol.iterator in arg ? [...arg] : arg;\n if (Array.isArray(configs)) {\n return make((provider, pathPrefix) => Effect.flatMapEager(Effect.all(configs.map(config => evaluateAt(config, provider, pathPrefix))), resolveArray));\n } else {\n return make((provider, pathPrefix) => Effect.flatMapEager(Effect.all(Rec.map(configs, config => evaluateAt(config, provider, pathPrefix))), resolveRecord));\n }\n}\nconst resolveArray = resolutions => {\n const values = [];\n let firstAbsent;\n let hasInput = false;\n for (const resolution of resolutions) {\n if (resolution._tag === \"Absent\") {\n firstAbsent ??= resolution;\n } else {\n values.push(resolution.value);\n hasInput = hasInput || resolution.hasInput;\n }\n }\n if (firstAbsent !== undefined) {\n return hasInput ? Effect.fail(evaluationFailure(firstAbsent.error, true)) : Effect.succeed(firstAbsent);\n }\n return Effect.succeed(resolved(values, hasInput));\n};\nconst resolveRecord = resolutions => {\n const values = {};\n let firstAbsent;\n let hasInput = false;\n for (const key in resolutions) {\n const resolution = resolutions[key];\n if (resolution._tag === \"Absent\") {\n firstAbsent ??= resolution;\n } else {\n InternalRecord.assignProperty(values, key, resolution.value);\n hasInput = hasInput || resolution.hasInput;\n }\n }\n if (firstAbsent !== undefined) {\n return hasInput ? Effect.fail(evaluationFailure(firstAbsent.error, true)) : Effect.succeed(firstAbsent);\n }\n return Effect.succeed(resolved(values, hasInput));\n};\n/**\n * Provides a fallback value when the config cannot resolve because none of its\n * relevant input is present.\n *\n * **When to use**\n *\n * Use when you need to make a config key optional with a sensible default.\n *\n * **Gotchas**\n *\n * Validation errors and partially supplied groups still propagate. A schema\n * that successfully decodes absent input also keeps its decoded value instead\n * of using the default. Schema configs first represent a missing or\n * incompatible provider shape as `undefined`; the default is used only when\n * the schema rejects that value and no relevant input was found.\n *\n * **Example** (Defaulting a missing port)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const port = Config.number(\"port\").pipe(Config.withDefault(3000))\n *\n * const provider = ConfigProvider.fromUnknown({})\n * Effect.runSync(port.parse(provider)) // => 3000\n * ```\n *\n * @see {@link option} – returns `Option` instead of a default value\n * @see {@link orElse} – catches all errors, not just absent input\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const withDefault = /*#__PURE__*/dual(2, (self, defaultValue) => {\n return make((provider, pathPrefix) => Effect.mapEager(evaluateAt(self, provider, pathPrefix), resolution => resolution._tag === \"Absent\" ? resolved(defaultValue, false) : resolution));\n});\n/**\n * Makes a config optional: returns `Some(value)` on success and `None` when the\n * config cannot resolve because none of its relevant input is present.\n *\n * **When to use**\n *\n * Use when you need to handle a config key that may or may not be present.\n *\n * **Gotchas**\n *\n * Validation errors and partially supplied groups still propagate. Successful\n * values are always wrapped in `Some`, including `undefined` when the schema\n * explicitly accepts it. Schema configs first represent a missing or\n * incompatible provider shape as `undefined`; `None` is returned only when the\n * schema rejects that value and no relevant input was found.\n *\n * **Example** (Reading optional config)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect, Option } from \"effect\"\n *\n * const maybePort = Config.option(Config.number(\"port\"))\n *\n * const provider = ConfigProvider.fromUnknown({})\n * Effect.runSync(maybePort.parse(provider)) // => Option.none()\n * ```\n *\n * @see {@link withDefault} – provide a concrete fallback value instead\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const option = self => self.pipe(map(Option.some), withDefault(Option.none()));\n/**\n * Constructs a `Config<T>` from a value matching `Wrap<T>`.\n *\n * **When to use**\n *\n * Use when accepting config from callers who may pass either a single `Config` or a\n * record of individual `Config`s.\n *\n * **Details**\n *\n * If the input is already a `Config`, it is returned as-is. Otherwise, each\n * key is recursively unwrapped and combined.\n *\n * **Example** (Unwrapping a record of configs)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * interface Options {\n * key: string\n * }\n *\n * const makeConfig = (config: Config.Wrap<Options>): Config.Config<Options> =>\n * Config.unwrap(config)\n *\n * const config = makeConfig({ key: Config.string(\"key\") })\n * const provider = ConfigProvider.fromUnknown({ key: \"value\" })\n * Effect.runSync(config.parse(provider)) // => { key: \"value\" }\n * ```\n *\n * @see {@link Wrap} – the utility type accepted by this function\n *\n * @category converting\n * @since 2.0.0\n */\nexport const unwrap = wrapped => {\n if (isConfig(wrapped)) return wrapped;\n return all(Rec.map(wrapped, config => unwrap(config)));\n};\nconst cursorToString = () => \"<configuration>\";\nconst loadCursor = (provider, path) => provider.load(path).pipe(Effect.orDie, Effect.mapEager(node => ({\n provider,\n path,\n node,\n toString: cursorToString\n})));\nconst loadChildCursor = (cursor, segment) => loadCursor(cursor.provider, [...cursor.path, segment]);\nconst getScalar = node => node?.value;\nconst decodeFromCursor = (ast, decode) => SchemaAST.decodeTo(SchemaAST.unknown, ast, new SchemaTransformation.Transformation(SchemaGetter.transformOrFail(input => decode(input)), SchemaGetter.passthrough()));\nconst isScalarInput = ast => {\n switch (ast._tag) {\n case \"Union\":\n return ast.types.every(isScalarInput);\n case \"Objects\":\n case \"Arrays\":\n case \"Suspend\":\n return false;\n default:\n return true;\n }\n};\nconst hasProviderInput = (ast, node) => {\n switch (ast._tag) {\n case \"Objects\":\n return node?._tag === \"Record\";\n case \"Arrays\":\n return node?._tag === \"Array\";\n case \"Union\":\n return ast.types.some(ast => hasProviderInput(ast, node));\n case \"Suspend\":\n return hasProviderInput(ast.thunk(), node);\n default:\n return getScalar(node) !== undefined;\n }\n};\nconst toConfigCursorAST = root => {\n const seen = new WeakSet();\n const recur = SchemaAST.applyToSelfOrLastLinkEncoding(ast => {\n seen.add(ast);\n switch (ast._tag) {\n case \"Objects\":\n {\n const matchesIndex = ast.indexSignatures.map(is => SchemaParser._is(is.parameter));\n const materialize = Effect.fnUntraced(function* (cursor) {\n if (cursor.node?._tag !== \"Record\") {\n return undefined;\n }\n const node = cursor.node;\n const keys = new Set();\n for (const property of ast.propertySignatures) {\n if (typeof property.name === \"string\") keys.add(property.name);\n }\n if (matchesIndex.length > 0) {\n for (const key of node.keys) {\n if (matchesIndex.some(matches => matches(key))) keys.add(key);\n }\n }\n const out = {};\n for (const key of keys) {\n const child = yield* loadChildCursor(cursor, key);\n if (child.node !== undefined) InternalRecord.assignProperty(out, key, child);\n }\n return out;\n });\n return decodeFromCursor(ast.recur(recur, ast => ast), materialize);\n }\n case \"Arrays\":\n {\n const materialize = Effect.fnUntraced(function* (cursor) {\n if (cursor.node?._tag !== \"Array\") {\n return undefined;\n }\n const out = [];\n for (let i = 0; i < cursor.node.length; i++) {\n out.push(yield* loadChildCursor(cursor, i));\n }\n return out;\n });\n return decodeFromCursor(ast.recur(recur), materialize);\n }\n case \"Union\":\n for (const member of ast.types) {\n recur(member);\n }\n return isScalarInput(ast) ? decodeFromCursor(ast, cursor => Effect.succeed(getScalar(cursor.node))) : ast.recur(recur);\n case \"Suspend\":\n {\n const target = ast.thunk();\n // Force new branches so opaque encodings fail when the Config is constructed.\n if (!seen.has(target)) recur(target);\n return ast.recur(recur);\n }\n case \"Declaration\":\n case \"Any\":\n throw new globalThis.Error(\"Config.schema does not support opaque StringTree encodings\", {\n cause: ast\n });\n default:\n return decodeFromCursor(ast, cursor => Effect.succeed(getScalar(cursor.node)));\n }\n });\n return recur(root);\n};\n/**\n * Creates a `Config<T>` from a `Schema.Codec`.\n *\n * **When to use**\n *\n * Use when you need to read structured or schema-validated configuration.\n *\n * **Details**\n *\n * The optional `path` sets the local path segment(s) for the config lookup.\n * It is appended to the logical path prefix accumulated from outer\n * {@link nested} calls. Pass a single string for a flat key or an array for\n * nested paths.\n *\n * Convenience constructors such as `string`, `number`, and `boolean` delegate\n * to this API.\n *\n * The codec is converted to its canonical `StringTree` form. Its encoded shape\n * determines how provider data is loaded: scalar schemas read a co-located\n * scalar value, object schemas read declared properties and matching record\n * keys, and array schemas read indexed children. A mixed-shape union loads each\n * member according to that member's shape before applying the union's mode and\n * checks.\n *\n * At the config's lookup path, a missing node or a node that cannot provide the\n * representation required by the schema is decoded as `undefined`. Missing\n * object properties remain omitted so the schema's property semantics still\n * apply. Decoding success always wins, even when no provider input was found.\n * For example,\n * `Schema.UndefinedOr(Schema.String)` decodes to `undefined` and is not replaced\n * by {@link withDefault}. If decoding fails and no relevant representation was\n * found, the config is absent. Invalid data in a relevant representation is a\n * validation failure. Provider `SourceError`s are always failures.\n *\n * **Gotchas**\n *\n * Plain `Schema.Array` and `Schema.Record` schemas use structural provider\n * input. Use {@link Array} or {@link Record} when a flat separated string must\n * also be accepted.\n *\n * `Schema.Struct` and {@link all} describe different lookup models. An\n * explicitly present empty object is relevant input for a struct and required\n * fields are validated. The same empty parent container does not make an\n * `all` group present when all of its child configs are absent.\n *\n * The canonical `StringTree` encoding must expose a concrete scalar, object,\n * array, or union shape. Opaque encodings such as `Schema.Any`,\n * `Schema.Unknown`, `Schema.ObjectKeyword`, `Schema.Json`, and\n * `Schema.MutableJson` are rejected synchronously when this config is\n * constructed, including when they are nested in another schema. Suspended\n * recursive schemas remain supported when their eventual shape is concrete.\n * Declarations such as `Schema.URL` also remain supported when their canonical\n * encoding has a concrete shape. To read arbitrary JSON from one scalar value,\n * use `Schema.fromJsonString(Schema.Json)`.\n *\n * **Example** (Reading a structured config)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect, Schema } from \"effect\"\n *\n * const DbConfig = Config.schema(\n * Schema.Struct({\n * host: Schema.String,\n * port: Schema.Int\n * }),\n * \"db\"\n * )\n *\n * const provider = ConfigProvider.fromUnknown({\n * db: { host: \"localhost\", port: 5432 }\n * })\n *\n * Effect.runSync(DbConfig.parse(provider)) // => { host: \"localhost\", port: 5432 }\n * ```\n *\n * @see {@link string} / {@link number} / {@link boolean} – shortcuts for\n * single-value configs\n *\n * @category schemas\n * @since 4.0.0\n */\nexport function schema(codec, path) {\n const codecStringTree = Schema.toCodecStringTree(codec);\n const encodedAst = SchemaAST.toEncoded(codecStringTree.ast);\n const decodeCursor = SchemaParser.decodeUnknownEffect(Schema.make(toConfigCursorAST(codecStringTree.ast)));\n const localPath = typeof path === \"string\" ? [path] : path ?? [];\n return make((provider, pathPrefix) => {\n const fullPath = [...pathPrefix, ...localPath];\n return catchSourceError(loadCursor(provider, fullPath), false).pipe(Effect.flatMapEager(cursor => {\n const hasInput = hasProviderInput(encodedAst, cursor.node);\n return catchSourceError(decodeCursor(cursor).pipe(Effect.mapEager(value => resolved(value, hasInput)), Effect.catchEager(issue => {\n const error = new ConfigError(new Schema.SchemaError(fullPath.length > 0 ? new SchemaIssue.Pointer(fullPath, issue) : issue));\n return hasInput ? Effect.fail(evaluationFailure(error, true)) : Effect.succeed(absent(error));\n })), hasInput);\n }));\n });\n}\n/** @internal */\nexport const TrueValues = /*#__PURE__*/Schema.Literals([\"true\", \"yes\", \"on\", \"1\", \"y\"]);\n/** @internal */\nexport const FalseValues = /*#__PURE__*/Schema.Literals([\"false\", \"no\", \"off\", \"0\", \"n\"]);\n/**\n * Schema for boolean values encoded as strings.\n *\n * **When to use**\n *\n * Use when you need the reusable boolean schema value for `Config.schema` with\n * custom paths.\n *\n * **Details**\n *\n * Accepted string values: `true`, `false`, `yes`, `no`, `on`, `off`, `1`,\n * `0`, `y`, `n` (case-sensitive).\n *\n * @see {@link boolean} – convenience constructor\n *\n * @category schemas\n * @since 4.0.0\n */\nexport const Boolean = /*#__PURE__*/Schema.Literals([...TrueValues.literals, ...FalseValues.literals]).pipe(/*#__PURE__*/Schema.decodeTo(Schema.Boolean, /*#__PURE__*/SchemaTransformation.transform({\n decode: value => value === \"true\" || value === \"yes\" || value === \"on\" || value === \"1\" || value === \"y\",\n encode: value => value ? \"true\" : \"false\"\n})));\n/**\n * Schema for port numbers (integers in 1–65535).\n *\n * **When to use**\n *\n * Use when you need the reusable port schema value for `Config.schema` with\n * custom paths.\n *\n * @see {@link port} – convenience constructor\n *\n * @category schemas\n * @since 4.0.0\n */\nexport const Port = /*#__PURE__*/Schema.Int.check(/*#__PURE__*/Schema.isBetween({\n minimum: 1,\n maximum: 65535\n}));\n/**\n * Schema for `LogLevel` string literals.\n *\n * **When to use**\n *\n * Use when you need the reusable log-level schema value for `Config.schema`\n * with custom paths.\n *\n * **Details**\n *\n * Accepted values: `\"All\"`, `\"Fatal\"`, `\"Error\"`, `\"Warn\"`, `\"Info\"`,\n * `\"Debug\"`, `\"Trace\"`, `\"None\"`.\n *\n * @see {@link logLevel} – convenience constructor\n *\n * @category schemas\n * @since 4.0.0\n */\nexport const LogLevel = /*#__PURE__*/Schema.Literals(LogLevel_.values);\n/**\n * Schema for key-value record types that can also be parsed from\n * a flat comma-separated string.\n *\n * **When to use**\n *\n * Use when reading key-value maps from a single env var (e.g. OpenTelemetry\n * resource attributes).\n *\n * **Details**\n *\n * Accepts either a JSON-like record from the provider or a flat string like\n * `\"key1=val1,key2=val2\"`. The `separator` (default `\",\"`) and\n * `keyValueSeparator` (default `\"=\"`) can be customized.\n *\n * **Example** (Parsing a comma-separated record)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect, Schema } from \"effect\"\n *\n * const schema = Config.Record(Schema.String, Schema.String)\n * const config = Config.schema(schema, \"OTEL_RESOURCE_ATTRIBUTES\")\n *\n * const provider = ConfigProvider.fromEnv({\n * env: {\n * OTEL_RESOURCE_ATTRIBUTES:\n * \"service.name=my-service,service.version=1.0.0,custom.attribute=value\"\n * }\n * })\n *\n * const result = Effect.runSync(config.parse(provider))\n * result[\"service.name\"] // => \"my-service\"\n * result[\"service.version\"] // => \"1.0.0\"\n * result[\"custom.attribute\"] // => \"value\"\n * ```\n *\n * @see {@link Array} for separated or structural array input\n *\n * @category schemas\n * @since 4.0.0\n */\nexport const Record = (key, value, options) => {\n const record = Schema.Record(key, value);\n const split = SchemaTransformation.splitKeyValue(options);\n const recordString = Schema.String.pipe(Schema.decodeTo(Schema.toCodecStringTree(record), {\n decode: split.decode,\n encode: SchemaGetter.passthrough({\n strict: false\n }).compose(split.encode)\n }));\n return Schema.Union([record, recordString]);\n};\nconst ArrayConfig = (value, options) => {\n const array = Schema.Array(value);\n const separator = options?.separator ?? \",\";\n const arrayString = Schema.String.pipe(Schema.decodeTo(Schema.toCodecStringTree(array), {\n decode: SchemaGetter.split(options),\n encode: SchemaGetter.passthrough({\n strict: false\n }).compose(SchemaGetter.transform(input => input.join(separator)))\n }));\n return Schema.Union([arrayString, array]);\n};\nexport {\n/**\n * Schema for array types that can also be parsed from a flat separated string.\n *\n * **When to use**\n *\n * Use when reading array values from a single env var, such as comma-separated\n * exporter names.\n *\n * **Details**\n *\n * Accepts either a JSON-like array from the provider or a flat string like\n * `\"a,b,c\"`. The `separator` defaults to `\",\"` and can be customized.\n *\n * @see {@link Record} for separated or structural record input\n *\n * @category schemas\n * @since 4.0.0\n */\nArrayConfig as Array };\n// -----------------------------------------------------------------------------\n// constructors\n// -----------------------------------------------------------------------------\n/**\n * Creates a config that always fails with the given error.\n *\n * **When to use**\n *\n * Use when you need to re-raise a specific config error, such as inside\n * {@link orElse}.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport function fail(err) {\n return make(() => Effect.fail(evaluationFailure(new ConfigError(err), false)));\n}\n/**\n * Creates a config that always succeeds with the given value, ignoring the\n * provider entirely.\n *\n * **When to use**\n *\n * Use when you need a hardcoded config value, such as inside {@link orElse} or\n * tests.\n *\n * **Example** (Returning a constant fallback)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const host = Config.string(\"HOST\").pipe(\n * Config.orElse(() => Config.succeed(\"localhost\"))\n * )\n * const provider = ConfigProvider.fromUnknown({})\n * Effect.runSync(host.parse(provider)) // => \"localhost\"\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport function succeed(value) {\n return make(() => Effect.succeed(resolved(value, false)));\n}\n/**\n * Creates a config for a single string value.\n *\n * **When to use**\n *\n * Use when reading a single string env var or config key.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Schema.String, name)`.\n *\n * **Example** (Reading a string config)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const host = Config.string(\"HOST\")\n *\n * const provider = ConfigProvider.fromUnknown({ HOST: \"localhost\" })\n * Effect.runSync(host.parse(provider)) // => \"localhost\"\n * ```\n *\n * @see {@link nonEmptyString} – rejects empty strings\n * @see {@link schema} – for more complex types\n *\n * @category constructors\n * @since 2.0.0\n */\nexport function string(name) {\n return schema(Schema.String, name);\n}\n/**\n * Creates a config for a non-empty string value. Fails if the value is an\n * empty string.\n *\n * **When to use**\n *\n * Use to read a string config value that must contain at least one character.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Schema.NonEmptyString, name)`.\n *\n * @see {@link string} for allowing empty strings\n *\n * @category constructors\n * @since 3.7.0\n */\nexport function nonEmptyString(name) {\n return schema(Schema.NonEmptyString, name);\n}\n/**\n * Creates a config for a numeric value (including `NaN`, `Infinity`).\n *\n * **When to use**\n *\n * Use when you need config input to accept JavaScript's full number domain,\n * including NaN and infinities, rather than reject non-finite values.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Schema.Number, name)`.\n *\n * @see {@link finite} for rejecting `NaN` and `Infinity`\n * @see {@link int} for accepting only integers\n *\n * @category constructors\n * @since 2.0.0\n */\nexport function number(name) {\n return schema(Schema.Number, name);\n}\n/**\n * Creates a config for a finite number (rejects `NaN` and `Infinity`).\n *\n * **When to use**\n *\n * Use to read a numeric config value that must be finite.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Schema.Finite, name)`.\n *\n * @see {@link number} for accepting `NaN` and `Infinity`\n * @see {@link int} for accepting only integers\n *\n * @category constructors\n * @since 4.0.0\n */\nexport function finite(name) {\n return schema(Schema.Finite, name);\n}\n/**\n * Creates a config for an integer value. Rejects floats.\n *\n * **When to use**\n *\n * Use to read a numeric config value that must be an integer.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Schema.Int, name)`.\n *\n * @see {@link number} for accepting any number\n * @see {@link port} for accepting only integers in `1` through `65535`\n *\n * @category constructors\n * @since 4.0.0\n */\nexport function int(name) {\n return schema(Schema.Int, name);\n}\n/**\n * Creates a config that only accepts a specific literal value.\n *\n * **When to use**\n *\n * Use to restrict a config to a single, specific literal value.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Schema.Literal(literal), name)`.\n *\n * **Example** (Restricting to a literal)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const env = Config.literal(\"production\", \"ENV\")\n * const provider = ConfigProvider.fromUnknown({ ENV: \"production\" })\n * Effect.runSync(env.parse(provider)) // => \"production\"\n * ```\n *\n * @see {@link literals} – accepts multiple literal values\n * @category constructors\n * @since 2.0.0\n */\nexport function literal(literal, name) {\n return schema(Schema.Literal(literal), name);\n}\n/**\n * Creates a config that only accepts one of the specified literal values.\n *\n * **When to use**\n *\n * Use to restrict a config to a fixed set of allowed literal values.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Schema.Literals(literals), name)`.\n *\n * **Example** (Restricting to a set of literals)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const env = Config.literals([\"development\", \"production\"], \"ENV\")\n * const provider = ConfigProvider.fromUnknown({ ENV: \"development\" })\n * Effect.runSync(env.parse(provider)) // => \"development\"\n * ```\n *\n * @see {@link literal} for accepting one specific literal value\n *\n * @category constructors\n * @since 4.0.0\n */\nexport function literals(literals, name) {\n return schema(Schema.Literals(literals), name);\n}\n/**\n * Creates a config for a boolean value parsed from common string\n * representations.\n *\n * **When to use**\n *\n * Use to read boolean flags from string-like config sources.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Config.Boolean, name)`.\n *\n * Accepted values: `true`, `false`, `yes`, `no`, `on`, `off`, `1`, `0`,\n * `y`, `n`.\n *\n * **Example** (Reading a boolean flag)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const program = Config.boolean(\"FEATURE_FLAG\")\n *\n * const provider = ConfigProvider.fromEnv({\n * env: {\n * FEATURE_FLAG: \"yes\"\n * }\n * })\n *\n * Effect.runSync(\n * program.pipe(Effect.provideService(ConfigProvider.ConfigProvider, provider))\n * ) // => true\n * ```\n *\n * @see {@link Boolean} for the underlying boolean codec\n *\n * @category constructors\n * @since 2.0.0\n */\nexport function boolean(name) {\n return schema(Boolean, name);\n}\n/**\n * Creates a config for a `Duration` value parsed from a human-readable\n * string.\n *\n * **When to use**\n *\n * Use to read time duration settings such as timeouts, intervals, or TTLs.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Schema.DurationFromString, name)`.\n *\n * Accepts any string that `Duration.fromInput` can parse (e.g.\n * `\"10 seconds\"`, `\"500 millis\"`, `\"Infinity\"`, `\"-Infinity\"`).\n *\n * **Example** (Reading a duration)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Duration, Effect } from \"effect\"\n *\n * const program = Config.duration(\"DURATION\").pipe(Effect.map(Duration.toMillis))\n *\n * const provider = ConfigProvider.fromEnv({\n * env: {\n * DURATION: \"10 seconds\"\n * }\n * })\n *\n * Effect.runSync(\n * program.pipe(Effect.provideService(ConfigProvider.ConfigProvider, provider))\n * ) // => 10000\n * ```\n *\n * @see {@link schema} for decoding configuration values with a custom codec\n *\n * @category constructors\n * @since 2.5.0\n */\nexport function duration(name) {\n return schema(Schema.DurationFromString, name);\n}\n/**\n * Creates a config for a port number (integer in 1–65535).\n *\n * **When to use**\n *\n * Use to read network port settings that must be valid port numbers.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Config.Port, name)`.\n *\n * **Example** (Reading a port)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const program = Config.port(\"PORT\")\n *\n * const provider = ConfigProvider.fromEnv({\n * env: {\n * PORT: \"8080\"\n * }\n * })\n *\n * Effect.runSync(\n * program.pipe(Effect.provideService(ConfigProvider.ConfigProvider, provider))\n * ) // => 8080\n * ```\n *\n * @see {@link int} for integer config values outside the port range\n * @see {@link Port} for the underlying port codec\n *\n * @category constructors\n * @since 3.16.0\n */\nexport function port(name) {\n return schema(Port, name);\n}\n/**\n * Creates a config for a log level string.\n *\n * **When to use**\n *\n * Use to read Effect log-level settings from configuration.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Config.LogLevel, name)`.\n *\n * Accepted values: `\"All\"`, `\"Fatal\"`, `\"Error\"`, `\"Warn\"`, `\"Info\"`,\n * `\"Debug\"`, `\"Trace\"`, `\"None\"`.\n *\n * **Example** (Reading a log level)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const program = Config.logLevel(\"LOG_LEVEL\")\n *\n * const provider = ConfigProvider.fromEnv({\n * env: {\n * LOG_LEVEL: \"Info\"\n * }\n * })\n *\n * Effect.runSync(\n * program.pipe(Effect.provideService(ConfigProvider.ConfigProvider, provider))\n * ) // => \"Info\"\n * ```\n *\n * @see {@link LogLevel} for the underlying log-level codec\n *\n * @category constructors\n * @since 2.0.0\n */\nexport function logLevel(name) {\n return schema(LogLevel, name);\n}\n/**\n * Creates a config for a redacted string value. The parsed result is wrapped\n * in a `Redacted` container that hides the value from logs and `toString`.\n *\n * **When to use**\n *\n * Use to read secret string settings that should not be exposed in logs or\n * string output.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Schema.Redacted(Schema.String), name)`.\n *\n * **Example** (Reading a secret)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const program = Config.redacted(\"API_KEY\").pipe(Effect.map(String))\n *\n * const provider = ConfigProvider.fromEnv({\n * env: {\n * API_KEY: \"sk-1234567890abcdef\"\n * }\n * })\n *\n * Effect.runSync(\n * program.pipe(Effect.provideService(ConfigProvider.ConfigProvider, provider))\n * ) // => \"<redacted>\"\n * ```\n *\n * @see {@link string} for non-secret string settings\n *\n * @category constructors\n * @since 2.0.0\n */\nexport function redacted(name) {\n return schema(Schema.Redacted(Schema.String), name);\n}\n/**\n * Creates a config for a `URL` value parsed from a string.\n *\n * **When to use**\n *\n * Use to read configuration values that must be valid URL strings.\n *\n * **Details**\n *\n * This is a shortcut for `Config.schema(Schema.URL, name)`.\n *\n * **Gotchas**\n *\n * Fails if the string cannot be parsed by the `URL` constructor.\n *\n * **Example** (Reading a URL)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const program = Config.url(\"URL\").pipe(Effect.map((url) => url.href))\n *\n * const provider = ConfigProvider.fromEnv({\n * env: {\n * URL: \"https://example.com\"\n * }\n * })\n *\n * Effect.runSync(\n * program.pipe(Effect.provideService(ConfigProvider.ConfigProvider, provider))\n * ) // => \"https://example.com/\"\n * ```\n *\n * @see {@link schema} for decoding configuration values with a custom codec\n *\n * @category constructors\n * @since 3.11.0\n */\nexport function url(name) {\n return schema(Schema.URL, name);\n}\n/**\n * Creates a config for a `Date` value parsed from a string.\n *\n * **When to use**\n *\n * Use to read date settings that must parse to valid `Date` values.\n *\n * **Details**\n *\n * Shortcut for `Config.schema(Schema.Date, name)`.\n *\n * **Gotchas**\n *\n * Fails with a `SchemaError` if the string produces an invalid `Date`.\n *\n * **Example** (Reading a date)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const createdAt = Config.date(\"CREATED_AT\")\n *\n * const provider = ConfigProvider.fromUnknown({ CREATED_AT: \"2024-01-15\" })\n * Effect.runSync(createdAt.parse(provider)).toISOString() // => \"2024-01-15T00:00:00.000Z\"\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport function date(name) {\n return schema(Schema.Date, name);\n}\n/**\n * Scopes a config under a named prefix.\n *\n * **When to use**\n *\n * Use when you need to group related config keys under a common namespace.\n *\n * **Details**\n *\n * The prefix is prepended to every key the inner config reads. With\n * `fromUnknown` this means an extra object level; with `fromEnv` it means\n * a `_`-separated prefix on env var names.\n *\n * Multiple `nested` calls compose: the outermost name becomes the\n * outermost path segment.\n *\n * **Example** (Nesting a struct config under `\"database\"`)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const dbConfig = Config.all({\n * host: Config.string(\"host\"),\n * port: Config.number(\"port\")\n * }).pipe(Config.nested(\"database\"))\n *\n * const provider = ConfigProvider.fromUnknown({\n * database: { host: \"localhost\", port: \"5432\" }\n * })\n * Effect.runSync(dbConfig.parse(provider)) // => { host: \"localhost\", port: 5432 }\n * ```\n *\n * **Example** (Reading env vars with a nested prefix)\n *\n * ```ts import.meta.vitest\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const host = Config.string(\"host\").pipe(Config.nested(\"database\"))\n *\n * const provider = ConfigProvider.fromEnv({\n * env: { database_host: \"localhost\" }\n * })\n * Effect.runSync(host.parse(provider)) // => \"localhost\"\n * ```\n *\n * @see {@link all} – combine multiple configs into a struct\n * @see {@link schema} – read structured config from a schema\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const nested = /*#__PURE__*/dual(2, (self, name) => make((provider, pathPrefix) =>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
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { $t as parseHeader, Ct as setHeader, E as toHandled, H as toPersisted, J as fromWebSocket, Mt as TypeId, N as TypeId$2, Nt as inspect, Qt as isEmpty, R as MultipartError, St as setBody, U as decodeField, V as makeConfig, W as make$5, _n as fromInput$1, a as layer$3, at as ResponseError, bt as removeHeader, c as make$6, cn as fromRecordUnsafe, ct as causeResponse, dt as HttpPlatform, fn as raw, ft as make$4, hn as uint8Array, i as RequestInit, in as layerWeak, it as RequestParseError, j as HttpServerRequest, jt as MaxBodySize, ln as merge, n as import_websocket_server, nt as ClientAbort, o as HttpServer, pn as stream$1, r as Mime_default, rn as layer$2, rt as HttpServerError, s as layerTestClient, sn as fromInput, st as ServeError, tn as toSetCookieHeaders, vt as raw$1, z as TypeId$1 } from "./NodeSocket-
|
|
4
|
-
import { $a as flatMap, $u as add, Bd as Class, Ca as andThen, Cc as forkUnsafe, Co as map, Ds as withFiber, Ec as provide$1, Ir as orDie, Jo as runForkWith, Ka as die, Ma as callback, Oo as matchCauseEffect, Or as map$1, Xa as fail, Xo as runSync, Za as failCause, Zo as scope, _s as try_, bc as addFinalizerExit, cc as fresh, dc as provide, ea as makeUnsafe, el as combine, fc as provideMerge, gd as fromNullishOr, gf as flow, gs as tryPromise, hs as timeoutOrElse, ic as effect, ja as cached, ls as tapCause, mo as interruptible, oa as runIn, os as suspend, pc as succeed$1, qr as runForEachArray, ri as unwrap, ro as fnUntraced, rs as succeed, ss as sync, tl as die$1, uc as mergeAll, uu as seconds, vf as pipe, ws as void_, ya as acquireRelease, yc as addFinalizer } from "./Schema-
|
|
5
|
-
import { c as layer$4, d as pipeThroughDuplex, f as toArrayBuffer, m as toUint8Array, n as layer$5, p as toString, u as fromReadable } from "./NodeServices-
|
|
6
|
-
import { h as unwrap$1 } from "./Config-
|
|
3
|
+
import { $t as parseHeader, Ct as setHeader, E as toHandled, H as toPersisted, J as fromWebSocket, Mt as TypeId, N as TypeId$2, Nt as inspect, Qt as isEmpty, R as MultipartError, St as setBody, U as decodeField, V as makeConfig, W as make$5, _n as fromInput$1, a as layer$3, at as ResponseError, bt as removeHeader, c as make$6, cn as fromRecordUnsafe, ct as causeResponse, dt as HttpPlatform, fn as raw, ft as make$4, hn as uint8Array, i as RequestInit, in as layerWeak, it as RequestParseError, j as HttpServerRequest, jt as MaxBodySize, ln as merge, n as import_websocket_server, nt as ClientAbort, o as HttpServer, pn as stream$1, r as Mime_default, rn as layer$2, rt as HttpServerError, s as layerTestClient, sn as fromInput, st as ServeError, tn as toSetCookieHeaders, vt as raw$1, z as TypeId$1 } from "./NodeSocket-C7yHTDM1.mjs";
|
|
4
|
+
import { $a as flatMap, $u as add, Bd as Class, Ca as andThen, Cc as forkUnsafe, Co as map, Ds as withFiber, Ec as provide$1, Ir as orDie, Jo as runForkWith, Ka as die, Ma as callback, Oo as matchCauseEffect, Or as map$1, Xa as fail, Xo as runSync, Za as failCause, Zo as scope, _s as try_, bc as addFinalizerExit, cc as fresh, dc as provide, ea as makeUnsafe, el as combine, fc as provideMerge, gd as fromNullishOr, gf as flow, gs as tryPromise, hs as timeoutOrElse, ic as effect, ja as cached, ls as tapCause, mo as interruptible, oa as runIn, os as suspend, pc as succeed$1, qr as runForEachArray, ri as unwrap, ro as fnUntraced, rs as succeed, ss as sync, tl as die$1, uc as mergeAll, uu as seconds, vf as pipe, ws as void_, ya as acquireRelease, yc as addFinalizer } from "./Schema-CxqR6bXx.mjs";
|
|
5
|
+
import { c as layer$4, d as pipeThroughDuplex, f as toArrayBuffer, m as toUint8Array, n as layer$5, p as toString, u as fromReadable } from "./NodeServices-D5Lui-4t.mjs";
|
|
6
|
+
import { h as unwrap$1 } from "./Config-nQ0ig08n.mjs";
|
|
7
7
|
import { Duplex, Readable } from "node:stream";
|
|
8
8
|
import * as Fs from "node:fs";
|
|
9
9
|
import * as Http from "node:http";
|
|
10
10
|
import * as NodeStreamP from "node:stream/promises";
|
|
11
11
|
import { pipeline } from "node:stream/promises";
|
|
12
12
|
import * as Zlib from "node:zlib";
|
|
13
|
-
//#region
|
|
13
|
+
//#region ../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/@effect+platform-node@4.0.0-beta.103_bufferutil@4.1.0_effect@4.0.0-beta.103_patch_hash=_7eec308fcf6351488fccaf9a0edac255/node_modules/@effect/platform-node/dist/NodeHttpIncomingMessage.js
|
|
14
14
|
/**
|
|
15
15
|
* Adapter base for exposing Node `http.IncomingMessage` values as Effect HTTP
|
|
16
16
|
* incoming messages.
|
|
@@ -109,7 +109,7 @@ var NodeHttpIncomingMessage = class extends Class {
|
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
//#endregion
|
|
112
|
-
//#region
|
|
112
|
+
//#region ../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.103_bufferutil@4.1.0_effect@4.0.0-beta.103_patc_c414c3b6e1e822e230993f828f7aeb31/node_modules/@effect/platform-node-shared/dist/NodeHttpCompression.js
|
|
113
113
|
/**
|
|
114
114
|
* HTTP response compression backed by `node:zlib`, shared by the Node.js, Bun,
|
|
115
115
|
* and Deno platforms.
|
|
@@ -208,7 +208,7 @@ const compressTransform = (algorithm, options) => {
|
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
//#endregion
|
|
211
|
-
//#region
|
|
211
|
+
//#region ../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/@effect+platform-node@4.0.0-beta.103_bufferutil@4.1.0_effect@4.0.0-beta.103_patch_hash=_7eec308fcf6351488fccaf9a0edac255/node_modules/@effect/platform-node/dist/NodeHttpPlatform.js
|
|
212
212
|
/**
|
|
213
213
|
* Node.js implementation of the Effect HTTP platform service.
|
|
214
214
|
*
|
|
@@ -281,7 +281,7 @@ const make$2 = /*#__PURE__*/ make$4({
|
|
|
281
281
|
*/
|
|
282
282
|
const layer$1 = /*#__PURE__*/ pipe(/*#__PURE__*/ effect(HttpPlatform)(make$2), /*#__PURE__*/ provide(layer$4), /*#__PURE__*/ provide(layer$2));
|
|
283
283
|
//#endregion
|
|
284
|
-
//#region
|
|
284
|
+
//#region ../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/multipasta@0.2.8/node_modules/multipasta/dist/esm/node.js
|
|
285
285
|
var MultipastaStream = class extends Duplex {
|
|
286
286
|
_parser;
|
|
287
287
|
_canWrite = true;
|
|
@@ -362,7 +362,7 @@ var FileStream = class extends Readable {
|
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
364
|
//#endregion
|
|
365
|
-
//#region
|
|
365
|
+
//#region ../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/@effect+platform-node@4.0.0-beta.103_bufferutil@4.1.0_effect@4.0.0-beta.103_patch_hash=_7eec308fcf6351488fccaf9a0edac255/node_modules/@effect/platform-node/dist/NodeMultipart.js
|
|
366
366
|
/**
|
|
367
367
|
* Node.js multipart parsing for HTTP `multipart/form-data` request bodies.
|
|
368
368
|
*
|
|
@@ -473,7 +473,7 @@ function convertError(cause) {
|
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
//#endregion
|
|
476
|
-
//#region
|
|
476
|
+
//#region ../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/@effect+platform-node@4.0.0-beta.103_bufferutil@4.1.0_effect@4.0.0-beta.103_patch_hash=_7eec308fcf6351488fccaf9a0edac255/node_modules/@effect/platform-node/dist/NodeHttpServer.js
|
|
477
477
|
/**
|
|
478
478
|
* Node.js implementation of the Effect `HttpServer`.
|
|
479
479
|
*
|
|
@@ -823,4 +823,4 @@ const handleCause = (nodeResponse, originalResponse) => (originalCause) => flatM
|
|
|
823
823
|
//#endregion
|
|
824
824
|
export { layer, layerConfig, layerHttpServices, layerServer, layerTest, make, makeHandler, makeUpgradeHandler };
|
|
825
825
|
|
|
826
|
-
//# sourceMappingURL=NodeHttpServer-
|
|
826
|
+
//# sourceMappingURL=NodeHttpServer-D8xOGdyN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeHttpServer-D8xOGdyN.mjs","names":["Inspectable.Class","IncomingMessage.TypeId","Headers.fromInput","Option.fromNullishOr","Effect.runSync","Effect.cached","Effect.flatMap","IncomingMessage.MaxBodySize","NodeStream.toString","Effect.map","Effect.try","UrlParams.fromInput","NodeStream.fromReadable","Effect.withFiber","NodeStream.toArrayBuffer","Effect.callback","Effect.succeed","Effect.die","make","Effect.map","Response.setHeader","Response.setBody","HttpBody.uint8Array","ServerResponse.removeHeader","ServerResponse.setBody","NodeHttpCompression.algorithms","Effect.succeed","HttpBody.stream","NodeStream.pipeThroughDuplex","NodeHttpCompression.compressTransform","HttpBody.raw","make","ServerResponse.raw","Mime","Headers.merge","Headers.fromRecordUnsafe","layer","Platform.HttpPlatform","NodeFileSystem.layer","EtagImpl.layer","MP.make","make","Multipart.makeConfig","Effect.map","NodeStream.fromReadable","MP.make","Stream.unwrap","Stream.map","Multipart.toPersisted","Effect.tryPromise","NFS","Inspectable.Class","Multipart.TypeId","MP.decodeField","NodeStream.toUint8Array","scope","Effect.scope","Effect.callback","Effect.void","Effect.die","Effect.cached","Effect.timeoutOrElse","Duration.seconds","Scope.addFinalizer","Effect.fail","Effect.acquireRelease","Effect.sync","Scope.provide","HttpServer.make","Effect.fnUntraced","Scope.forkUnsafe","Scope.addFinalizerExit","HttpEffect.toHandled","Effect.withFiber","Effect.succeed","Context.add","Fiber.runIn","Effect.runForkWith","Socket.fromWebSocket","Effect.flatMap","Request.TypeId","Cookies.parseHeader","Effect.runSync","NodeMultipart.persisted","NodeMultipart.stream","HttpIncomingMessage.inspect","HttpServer.HttpServer","NodeHttpPlatform.layer","Etag.layerWeak","NodeServices.layer","Layer.mergeAll","Layer.effect","Config.unwrap","FetchHttpClient.layer","FetchHttpClient.RequestInit","Cookies.isEmpty","Cookies.toSetCookieHeaders","Effect.andThen","Effect.tryPromise","Effect.interruptible","Effect.tapCause","Effect.suspend","Latch.makeUnsafe","Stream.orDie","Stream.runForEachArray","Effect.matchCauseEffect","Effect.failCause","Cause.combine","Cause.die"],"sources":["../../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/@effect+platform-node@4.0.0-beta.103_bufferutil@4.1.0_effect@4.0.0-beta.103_patch_hash=_7eec308fcf6351488fccaf9a0edac255/node_modules/@effect/platform-node/dist/NodeHttpIncomingMessage.js","../../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.103_bufferutil@4.1.0_effect@4.0.0-beta.103_patc_c414c3b6e1e822e230993f828f7aeb31/node_modules/@effect/platform-node-shared/dist/NodeHttpCompression.js","../../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/@effect+platform-node@4.0.0-beta.103_bufferutil@4.1.0_effect@4.0.0-beta.103_patch_hash=_7eec308fcf6351488fccaf9a0edac255/node_modules/@effect/platform-node/dist/NodeHttpPlatform.js","../../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/multipasta@0.2.8/node_modules/multipasta/dist/esm/node.js","../../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/@effect+platform-node@4.0.0-beta.103_bufferutil@4.1.0_effect@4.0.0-beta.103_patch_hash=_7eec308fcf6351488fccaf9a0edac255/node_modules/@effect/platform-node/dist/NodeMultipart.js","../../../../../../Users/chenbai/Projects/agentlink/node_modules/.pnpm/@effect+platform-node@4.0.0-beta.103_bufferutil@4.1.0_effect@4.0.0-beta.103_patch_hash=_7eec308fcf6351488fccaf9a0edac255/node_modules/@effect/platform-node/dist/NodeHttpServer.js"],"sourcesContent":["/**\n * Adapter base for exposing Node `http.IncomingMessage` values as Effect HTTP\n * incoming messages.\n *\n * Server requests and Node client responses both arrive as Node readable\n * streams with raw header objects, socket metadata, and one-shot body\n * consumption. This module's `NodeHttpIncomingMessage` class keeps the original\n * Node message available while presenting Effect's `HttpIncomingMessage` shape:\n * typed headers, remote address lookup, stream access, and text, JSON,\n * URL-encoded, and array-buffer body readers.\n *\n * @since 4.0.0\n */\nimport * as Effect from \"effect/Effect\";\nimport * as Inspectable from \"effect/Inspectable\";\nimport * as Option from \"effect/Option\";\nimport * as Headers from \"effect/unstable/http/Headers\";\nimport * as IncomingMessage from \"effect/unstable/http/HttpIncomingMessage\";\nimport * as UrlParams from \"effect/unstable/http/UrlParams\";\nimport * as NodeStream from \"./NodeStream.js\";\n/**\n * Adapts a Node `IncomingMessage` to Effect HTTP incoming messages.\n *\n * **When to use**\n *\n * Use to implement Node HTTP request or response adapters that expose the\n * Effect HTTP incoming-message interface.\n *\n * **Details**\n *\n * The adapter exposes headers, remote address, stream access, and cached body\n * decoders. Subclasses provide the error mapping for unknown Node errors.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport class NodeHttpIncomingMessage extends Inspectable.Class {\n /**\n * Marks this value as an HTTP incoming message for runtime guards.\n *\n * @since 4.0.0\n */\n [IncomingMessage.TypeId];\n source;\n onError;\n remoteAddressOverride;\n constructor(source, onError, remoteAddressOverride) {\n super();\n this[IncomingMessage.TypeId] = IncomingMessage.TypeId;\n this.source = source;\n this.onError = onError;\n this.remoteAddressOverride = remoteAddressOverride;\n }\n get headers() {\n return Headers.fromInput(this.source.headers);\n }\n get remoteAddress() {\n return this.remoteAddressOverride ?? Option.fromNullishOr(this.source.socket.remoteAddress);\n }\n textEffect;\n get text() {\n if (this.textEffect) {\n return this.textEffect;\n }\n this.textEffect = Effect.runSync(Effect.cached(Effect.flatMap(IncomingMessage.MaxBodySize, maxBodySize => NodeStream.toString(() => this.source, {\n onError: this.onError,\n maxBytes: maxBodySize\n }))));\n this.arrayBufferEffect = Effect.map(this.textEffect, _ => new TextEncoder().encode(_).buffer);\n return this.textEffect;\n }\n get textUnsafe() {\n return Effect.runSync(this.text);\n }\n get json() {\n return Effect.flatMap(this.text, text => Effect.try({\n try: () => text === \"\" ? null : JSON.parse(text),\n catch: this.onError\n }));\n }\n get jsonUnsafe() {\n return Effect.runSync(this.json);\n }\n get urlParamsBody() {\n return Effect.flatMap(this.text, _ => Effect.try({\n try: () => UrlParams.fromInput(new URLSearchParams(_)),\n catch: this.onError\n }));\n }\n get stream() {\n return NodeStream.fromReadable({\n evaluate: () => this.source,\n onError: this.onError\n });\n }\n arrayBufferEffect;\n get arrayBuffer() {\n if (this.arrayBufferEffect) {\n return this.arrayBufferEffect;\n }\n this.arrayBufferEffect = Effect.withFiber(fiber => NodeStream.toArrayBuffer(() => this.source, {\n onError: this.onError,\n maxBytes: fiber.getRef(IncomingMessage.MaxBodySize)\n })).pipe(Effect.cached, Effect.runSync);\n this.textEffect = Effect.map(this.arrayBufferEffect, _ => new TextDecoder().decode(_));\n return this.arrayBufferEffect;\n }\n}\n//# sourceMappingURL=NodeHttpIncomingMessage.js.map","/**\n * HTTP response compression backed by `node:zlib`, shared by the Node.js, Bun,\n * and Deno platforms.\n *\n * Byte-array bodies are compressed in one shot with the asynchronous\n * `node:zlib` APIs, preserving an exact `Content-Length`. Streaming bodies go\n * through `node:zlib` transform streams that flush each input chunk.\n *\n * @since 4.0.0\n */\nimport * as Effect from \"effect/Effect\";\nimport * as HttpBody from \"effect/unstable/http/HttpBody\";\nimport * as Response from \"effect/unstable/http/HttpServerResponse\";\nimport { Readable } from \"node:stream\";\nimport * as Zlib from \"node:zlib\";\n/**\n * The compression algorithms supported by the runtime's `node:zlib`. `zstd`\n * requires Node.js 22.15 or newer.\n *\n * @category constants\n * @since 4.0.0\n */\nexport const algorithms = /*#__PURE__*/new Set(typeof Zlib.zstdCompress === \"function\" ? [\"gzip\", \"deflate\", \"br\", \"zstd\"] : [\"gzip\", \"deflate\", \"br\"]);\nconst brotliParams = (level, sizeHint) => {\n const params = {};\n if (level !== undefined) {\n params[Zlib.constants.BROTLI_PARAM_QUALITY] = level;\n }\n if (sizeHint !== undefined) {\n params[Zlib.constants.BROTLI_PARAM_SIZE_HINT] = sizeHint;\n }\n return {\n params\n };\n};\nconst zstdParams = level => level === undefined || level === 3 ? undefined : {\n params: {\n [Zlib.constants.ZSTD_c_compressionLevel]: level\n }\n};\nconst compress = (data, algorithm, options) => Effect.callback(resume => {\n const complete = (error, result) => resume(error === null ? Effect.succeed(result) : Effect.die(error));\n switch (algorithm) {\n case \"gzip\":\n {\n Zlib.gzip(data, {\n level: options?.level\n }, complete);\n break;\n }\n case \"deflate\":\n {\n Zlib.deflate(data, {\n level: options?.level\n }, complete);\n break;\n }\n case \"br\":\n {\n Zlib.brotliCompress(data, brotliParams(options?.level, data.byteLength), complete);\n break;\n }\n case \"zstd\":\n {\n const params = zstdParams(options?.level);\n if (params === undefined) {\n Zlib.zstdCompress(data, complete);\n } else {\n Zlib.zstdCompress(data, params, complete);\n }\n break;\n }\n }\n});\n/**\n * Creates a `Compression` that compresses byte-array bodies in one shot with\n * the asynchronous `node:zlib` APIs, setting the exact `Content-Length` of the\n * compressed body. All other bodies are delegated to `fallback`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = fallback => ({\n algorithms: fallback.algorithms,\n compressResponse(response, algorithm, options) {\n const body = response.body;\n if (body._tag !== \"Uint8Array\") {\n return fallback.compressResponse(response, algorithm, options);\n }\n return Effect.map(compress(body.body, algorithm, options), result => Response.setHeader(Response.setBody(response, HttpBody.uint8Array(result, body.contentType)), \"content-length\", result.byteLength.toString()));\n }\n});\n/**\n * Creates a `node:zlib` compression transform stream that flushes each input\n * chunk, for streaming response bodies.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const compressTransform = (algorithm, options) => {\n switch (algorithm) {\n case \"gzip\":\n {\n return Zlib.createGzip({\n level: options?.level,\n flush: Zlib.constants.Z_SYNC_FLUSH\n });\n }\n case \"deflate\":\n {\n return Zlib.createDeflate({\n level: options?.level,\n flush: Zlib.constants.Z_SYNC_FLUSH\n });\n }\n case \"br\":\n {\n return Zlib.createBrotliCompress({\n ...brotliParams(options?.level),\n flush: Zlib.constants.BROTLI_OPERATION_FLUSH\n });\n }\n case \"zstd\":\n {\n return Zlib.createZstdCompress({\n ...zstdParams(options?.level),\n flush: Zlib.constants.ZSTD_e_flush\n });\n }\n }\n};\n/**\n * A Web `ReadableStream` version of `compressTransform`, for platforms that\n * stream response bodies as Web streams.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const compressTransformWeb = (algorithm, options) => stream => {\n const transform = compressTransform(algorithm, options);\n const source = Readable.fromWeb(stream);\n source.on(\"error\", cause => transform.destroy(cause));\n transform.on(\"close\", () => source.destroy());\n return Readable.toWeb(source.pipe(transform));\n};\n//# sourceMappingURL=NodeHttpCompression.js.map","/**\n * Node.js implementation of the Effect HTTP platform service.\n *\n * This module connects the portable `HttpPlatform` file response helpers to\n * Node runtime primitives. It serves local files through Node readable streams,\n * supports byte ranges, converts Web `File` values to readable streams, and\n * fills in content type and content length headers when needed.\n *\n * @since 4.0.0\n */\nimport * as NodeHttpCompression from \"@effect/platform-node-shared/NodeHttpCompression\";\nimport * as Effect from \"effect/Effect\";\nimport { pipe } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport * as EtagImpl from \"effect/unstable/http/Etag\";\nimport * as Headers from \"effect/unstable/http/Headers\";\nimport * as HttpBody from \"effect/unstable/http/HttpBody\";\nimport * as Platform from \"effect/unstable/http/HttpPlatform\";\nimport * as ServerResponse from \"effect/unstable/http/HttpServerResponse\";\nimport * as Fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport Mime from \"./Mime.js\";\nimport * as NodeFileSystem from \"./NodeFileSystem.js\";\nimport * as NodeStream from \"./NodeStream.js\";\n// replaces the response body while keeping every other field, dropping the\n// now-stale Content-Length header\nconst compressedBody = (response, body) => ServerResponse.removeHeader(ServerResponse.setBody(response, body), \"content-length\");\nconst compression = /*#__PURE__*/NodeHttpCompression.make({\n algorithms: NodeHttpCompression.algorithms,\n compressResponse(response, algorithm, options) {\n const body = response.body;\n switch (body._tag) {\n case \"Stream\":\n {\n return Effect.succeed(compressedBody(response, HttpBody.stream(NodeStream.pipeThroughDuplex(body.stream, {\n evaluate: () => NodeHttpCompression.compressTransform(algorithm, options)\n }), body.contentType)));\n }\n case \"Raw\":\n {\n const readable = body.body instanceof Readable ? body.body : Readable.fromWeb(new Response(body.body).body);\n const transform = NodeHttpCompression.compressTransform(algorithm, options);\n readable.on(\"error\", cause => transform.destroy(cause));\n transform.on(\"error\", cause => readable.destroy(cause));\n transform.on(\"close\", () => readable.destroy());\n return Effect.succeed(compressedBody(response, HttpBody.raw(readable.pipe(transform), {\n contentType: body.contentType\n })));\n }\n default:\n {\n return Effect.succeed(response);\n }\n }\n }\n});\n/**\n * Creates the Node `HttpPlatform`, serving file responses from Node readable\n * streams and adding MIME type and content-length headers when needed.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = /*#__PURE__*/Platform.make({\n platform: \"node\",\n compression,\n fileResponse(path, status, statusText, headers, start, end, contentLength) {\n const stream = contentLength === 0 ? Readable.from([]) : Fs.createReadStream(path, {\n start,\n end: end === undefined ? undefined : end - 1\n });\n return ServerResponse.raw(stream, {\n headers: {\n ...headers,\n \"content-type\": headers[\"content-type\"] ?? Mime.getType(path) ?? \"application/octet-stream\",\n \"content-length\": contentLength.toString()\n },\n status,\n statusText\n });\n },\n fileWebResponse(file, status, statusText, headers, _options) {\n return ServerResponse.raw(Readable.fromWeb(file.stream()), {\n headers: Headers.merge(headers, Headers.fromRecordUnsafe({\n \"content-type\": headers[\"content-type\"] ?? Mime.getType(file.name) ?? \"application/octet-stream\",\n \"content-length\": file.size.toString()\n })),\n status,\n statusText\n });\n }\n});\n/**\n * Provides the Node `HttpPlatform` together with the filesystem and ETag\n * services it needs for file responses.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = /*#__PURE__*/pipe(/*#__PURE__*/Layer.effect(Platform.HttpPlatform)(make), /*#__PURE__*/Layer.provide(NodeFileSystem.layer), /*#__PURE__*/Layer.provide(EtagImpl.layer));\n//# sourceMappingURL=NodeHttpPlatform.js.map","import * as MP from \"./index.js\";\nimport { Duplex, Readable } from \"node:stream\";\nexport { decodeField } from \"./index.js\";\nexport class MultipastaStream extends Duplex {\n _parser;\n _canWrite = true;\n _writeCallback;\n constructor(config) {\n super({\n readableObjectMode: true\n });\n let currentError;\n let currentFile;\n this._parser = MP.make({\n ...config,\n onField: (info, value) => {\n if (currentError !== undefined) return;\n const field = {\n _tag: \"Field\",\n info,\n value\n };\n this.push(field);\n this.emit(\"field\", field);\n },\n onFile: info => {\n if (currentError !== undefined) return _ => {};\n const file = new FileStream(info, this);\n currentFile = file;\n this.push(file);\n this.emit(\"file\", file);\n return chunk => {\n this._canWrite = file.push(chunk);\n if (chunk === null && !this._canWrite) {\n currentFile = undefined;\n this._resume();\n }\n };\n },\n onError: error => {\n this.emit(\"error\", error);\n currentFile?.emit(\"error\", error);\n currentError = error;\n },\n onDone: () => {\n this.push(null);\n }\n });\n }\n _resume() {\n this._canWrite = true;\n if (this._writeCallback !== undefined) {\n const callback = this._writeCallback;\n this._writeCallback = undefined;\n callback();\n }\n }\n _read(_size) {}\n _write(chunk, encoding, callback) {\n this._parser.write(chunk instanceof Uint8Array ? chunk : Buffer.from(chunk, encoding));\n if (this._canWrite) {\n callback();\n } else {\n this._writeCallback = callback;\n }\n }\n _final(callback) {\n this._parser.end();\n callback();\n }\n}\nexport const make = config => new MultipastaStream(config);\nexport class FileStream extends Readable {\n info;\n _parent;\n _tag = \"File\";\n filename;\n constructor(info, _parent) {\n super();\n this.info = info;\n this._parent = _parent;\n this.filename = info.filename;\n }\n _read(_size) {\n if (this._parent._canWrite === false) {\n this._parent._resume();\n }\n }\n}\n//# sourceMappingURL=node.js.map","/**\n * Node.js multipart parsing for HTTP `multipart/form-data` request bodies.\n *\n * `NodeMultipart` adapts a Node `Readable` plus incoming HTTP headers into\n * Effect's shared multipart model. It can expose form parts as a stream or\n * collect a complete persisted form by writing file uploads to scoped temporary\n * files through the current `FileSystem` and `Path` services. `fileToReadable`\n * returns the underlying Node readable stream for file parts produced by this\n * parser.\n *\n * @since 4.0.0\n */\nimport * as Effect from \"effect/Effect\";\nimport * as Inspectable from \"effect/Inspectable\";\nimport * as Stream from \"effect/Stream\";\nimport * as Multipart from \"effect/unstable/http/Multipart\";\nimport * as MP from \"effect/unstable/http/Multipasta/Node\";\nimport * as NFS from \"node:fs\";\nimport * as NodeStreamP from \"node:stream/promises\";\nimport * as NodeStream from \"./NodeStream.js\";\n/**\n * Parses multipart data from a Node readable request body and headers into a\n * stream of `Multipart.Part` values, converting parser failures to\n * `MultipartError`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const stream = (source, headers) => Multipart.makeConfig(headers).pipe(Effect.map(config => NodeStream.fromReadable({\n evaluate() {\n const parser = MP.make(config);\n source.pipe(parser);\n return parser;\n },\n onError: error => convertError(error)\n})), Stream.unwrap, Stream.map(convertPart));\n/**\n * Parses multipart data from a Node readable request body and persists file\n * parts using the current `FileSystem`, `Path`, and `Scope` services.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const persisted = (source, headers) => Multipart.toPersisted(stream(source, headers), (path, file) => Effect.tryPromise({\n try: signal => NodeStreamP.pipeline(file.file, NFS.createWriteStream(path), {\n signal\n }),\n catch: cause => Multipart.MultipartError.fromReason(\"InternalError\", cause)\n}));\n/**\n * Returns the underlying Node readable stream for a multipart file produced by\n * the Node multipart parser.\n *\n * @category converting\n * @since 4.0.0\n */\nexport const fileToReadable = file => file.file;\n// -----------------------------------------------------------------------------\n// Internal\n// -----------------------------------------------------------------------------\nconst convertPart = part => part._tag === \"Field\" ? new FieldImpl(part.info, part.value) : new FileImpl(part);\nclass PartBase extends Inspectable.Class {\n [Multipart.TypeId];\n constructor() {\n super();\n this[Multipart.TypeId] = Multipart.TypeId;\n }\n}\nclass FieldImpl extends PartBase {\n _tag = \"Field\";\n key;\n contentType;\n value;\n constructor(info, value) {\n super();\n this.key = info.name;\n this.contentType = info.contentType;\n this.value = MP.decodeField(info, value);\n }\n toJSON() {\n return {\n _id: \"@effect/platform/Multipart/Part\",\n _tag: \"Field\",\n key: this.key,\n value: this.value,\n contentType: this.contentType\n };\n }\n}\nclass FileImpl extends PartBase {\n _tag = \"File\";\n key;\n name;\n contentType;\n content;\n contentEffect;\n file;\n constructor(file) {\n super();\n this.file = file;\n this.key = file.info.name;\n this.name = file.filename ?? file.info.name;\n this.contentType = file.info.contentType;\n this.content = NodeStream.fromReadable({\n evaluate: () => file,\n onError: cause => Multipart.MultipartError.fromReason(\"InternalError\", cause)\n });\n this.contentEffect = NodeStream.toUint8Array(() => file, {\n onError: cause => Multipart.MultipartError.fromReason(\"InternalError\", cause)\n });\n }\n toJSON() {\n return {\n _id: \"@effect/platform/Multipart/Part\",\n _tag: \"File\",\n key: this.key,\n name: this.name,\n contentType: this.contentType\n };\n }\n}\nfunction convertError(cause) {\n switch (cause._tag) {\n case \"ReachedLimit\":\n {\n switch (cause.limit) {\n case \"MaxParts\":\n {\n return Multipart.MultipartError.fromReason(\"TooManyParts\", cause);\n }\n case \"MaxFieldSize\":\n {\n return Multipart.MultipartError.fromReason(\"FieldTooLarge\", cause);\n }\n case \"MaxPartSize\":\n {\n return Multipart.MultipartError.fromReason(\"FileTooLarge\", cause);\n }\n case \"MaxTotalSize\":\n {\n return Multipart.MultipartError.fromReason(\"BodyTooLarge\", cause);\n }\n }\n }\n default:\n {\n return Multipart.MultipartError.fromReason(\"Parse\", cause);\n }\n }\n}\n//# sourceMappingURL=NodeMultipart.js.map","/**\n * Node.js implementation of the Effect `HttpServer`.\n *\n * This module adapts a supplied Node `http.Server` into Effect's\n * platform-independent HTTP server service. It starts the server with Node\n * `listen` options, converts `request` events into `HttpServerRequest` values,\n * writes `HttpServerResponse` bodies through Node's `ServerResponse`, and\n * handles `upgrade` events by exposing the upgraded socket through\n * `HttpServerRequest.upgrade`. It also exports request and upgrade handler\n * constructors plus layers for the server alone, HTTP support services, the\n * combined server, configurable options, and tests.\n *\n * @since 4.0.0\n */\nimport * as Cause from \"effect/Cause\";\nimport * as Config from \"effect/Config\";\nimport * as Context from \"effect/Context\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Fiber from \"effect/Fiber\";\nimport { flow } from \"effect/Function\";\nimport * as Latch from \"effect/Latch\";\nimport * as Layer from \"effect/Layer\";\nimport * as Scope from \"effect/Scope\";\nimport * as Stream from \"effect/Stream\";\nimport * as Cookies from \"effect/unstable/http/Cookies\";\nimport * as Etag from \"effect/unstable/http/Etag\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport * as HttpEffect from \"effect/unstable/http/HttpEffect\";\nimport * as HttpIncomingMessage from \"effect/unstable/http/HttpIncomingMessage\";\nimport * as HttpServer from \"effect/unstable/http/HttpServer\";\nimport { causeResponse, ClientAbort, HttpServerError, RequestParseError, ResponseError, ServeError } from \"effect/unstable/http/HttpServerError\";\nimport * as Request from \"effect/unstable/http/HttpServerRequest\";\nimport { HttpServerRequest } from \"effect/unstable/http/HttpServerRequest\";\nimport * as Socket from \"effect/unstable/socket/Socket\";\nimport * as Http from \"node:http\";\nimport { Readable } from \"node:stream\";\nimport { pipeline } from \"node:stream/promises\";\nimport { NodeHttpIncomingMessage } from \"./NodeHttpIncomingMessage.js\";\nimport * as NodeHttpPlatform from \"./NodeHttpPlatform.js\";\nimport * as NodeMultipart from \"./NodeMultipart.js\";\nimport * as NodeServices from \"./NodeServices.js\";\nimport { NodeWS } from \"./NodeSocket.js\";\n/**\n * Creates a scoped `HttpServer` from a Node `http.Server`, starts listening\n * with the supplied options, registers request and upgrade handling, and closes\n * the server during scope finalization with optional graceful-shutdown control.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = /*#__PURE__*/Effect.fnUntraced(function* (evaluate, options) {\n const scope = yield* Effect.scope;\n const server = evaluate();\n const shutdown = yield* Effect.callback(resume => {\n if (!server.listening) {\n return resume(Effect.void);\n }\n server.close(error => {\n if (error) {\n resume(Effect.die(error));\n } else {\n resume(Effect.void);\n }\n });\n }).pipe(Effect.cached);\n const preemptiveShutdown = options.disablePreemptiveShutdown ? Effect.void : Effect.timeoutOrElse(shutdown, {\n duration: options.gracefulShutdownTimeout ?? Duration.seconds(20),\n orElse: () => Effect.void\n });\n yield* Scope.addFinalizer(scope, shutdown);\n yield* Effect.callback(resume => {\n function onError(cause) {\n resume(Effect.fail(new ServeError({\n cause\n })));\n }\n server.on(\"error\", onError);\n server.listen(options, () => {\n server.off(\"error\", onError);\n resume(Effect.void);\n });\n });\n const address = server.address();\n const wss = yield* Effect.acquireRelease(Effect.sync(() => new NodeWS.WebSocketServer({\n ...options.websocket,\n noServer: true\n })), wss => Effect.callback(resume => {\n wss.close(() => resume(Effect.void));\n })).pipe(Scope.provide(scope), Effect.cached);\n return HttpServer.make({\n address: typeof address === \"string\" ? {\n _tag: \"UnixAddress\",\n path: address\n } : {\n _tag: \"TcpAddress\",\n hostname: address.address === \"::\" ? \"0.0.0.0\" : address.address,\n port: address.port\n },\n serve: Effect.fnUntraced(function* (httpApp, middleware) {\n const serveScope = yield* Effect.scope;\n const scope = Scope.forkUnsafe(serveScope, \"parallel\");\n const handler = yield* makeHandler(httpApp, {\n middleware: middleware,\n scope\n });\n const upgradeHandler = yield* makeUpgradeHandler(wss, httpApp, {\n middleware: middleware,\n scope\n });\n yield* Scope.addFinalizerExit(serveScope, () => {\n server.off(\"request\", handler);\n server.off(\"upgrade\", upgradeHandler);\n return preemptiveShutdown;\n });\n server.on(\"request\", handler);\n server.on(\"upgrade\", upgradeHandler);\n })\n });\n});\n/**\n * Creates a Node `request` event handler for an Effect HTTP application,\n * injecting a `HttpServerRequest` and interrupting the request fiber if the\n * client closes the response before it finishes.\n *\n * @category handlers\n * @since 4.0.0\n */\nexport const makeHandler = (httpEffect, options) => {\n const handled = HttpEffect.toHandled(httpEffect, handleResponse, options.middleware);\n return Effect.withFiber(parent => {\n const services = parent.context;\n return Effect.succeed(function handler(nodeRequest, nodeResponse) {\n const context = Context.add(services, HttpServerRequest, new ServerRequestImpl(nodeRequest, nodeResponse));\n const fiber = Fiber.runIn(Effect.runForkWith(context)(handled), options.scope);\n nodeResponse.on(\"close\", () => {\n if (!nodeResponse.writableEnded) {\n fiber.interruptUnsafe(parent.id, ClientAbort.annotation);\n }\n });\n });\n });\n};\n/**\n * Creates a Node `upgrade` event handler for an Effect HTTP application,\n * exposing the upgraded WebSocket as the request's `upgrade` effect and\n * interrupting the request fiber when the socket closes early.\n *\n * @category handlers\n * @since 4.0.0\n */\nexport const makeUpgradeHandler = (lazyWss, httpEffect, options) => {\n const handledApp = HttpEffect.toHandled(httpEffect, handleResponse, options.middleware);\n return Effect.withFiber(parent => {\n const services = parent.context;\n return Effect.succeed(function handler(nodeRequest, socket, head) {\n let nodeResponse_ = undefined;\n const nodeResponse = () => {\n if (nodeResponse_ === undefined) {\n nodeResponse_ = new Http.ServerResponse(nodeRequest);\n nodeResponse_.assignSocket(socket);\n nodeResponse_.on(\"finish\", () => {\n socket.end();\n });\n }\n return nodeResponse_;\n };\n const upgradeEffect = Socket.fromWebSocket(Effect.flatMap(lazyWss, wss => Effect.acquireRelease(Effect.callback(resume => wss.handleUpgrade(nodeRequest, socket, head, ws => {\n resume(Effect.succeed(ws));\n })), ws => Effect.sync(() => ws.close()))));\n const context = Context.add(services, HttpServerRequest, new ServerRequestImpl(nodeRequest, nodeResponse, upgradeEffect));\n const fiber = Fiber.runIn(Effect.runForkWith(context)(handledApp), options.scope);\n socket.on(\"close\", () => {\n if (!socket.writableEnded) {\n fiber.interruptUnsafe(parent.id, ClientAbort.annotation);\n }\n });\n });\n });\n};\nclass ServerRequestImpl extends NodeHttpIncomingMessage {\n [Request.TypeId];\n response;\n upgradeEffect;\n url;\n headersOverride;\n constructor(source, response, upgradeEffect, url = source.url, headersOverride, remoteAddressOverride) {\n super(source, cause => new HttpServerError({\n reason: new RequestParseError({\n request: this,\n cause\n })\n }), remoteAddressOverride);\n this[Request.TypeId] = Request.TypeId;\n this.response = response;\n this.upgradeEffect = upgradeEffect;\n this.url = url;\n this.headersOverride = headersOverride;\n }\n cachedCookies;\n get cookies() {\n if (this.cachedCookies) {\n return this.cachedCookies;\n }\n return this.cachedCookies = Cookies.parseHeader(this.headers.cookie ?? \"\");\n }\n get resolvedResponse() {\n return typeof this.response === \"function\" ? this.response() : this.response;\n }\n modify(options) {\n return new ServerRequestImpl(this.source, this.response, this.upgradeEffect, options.url ?? this.url, options.headers ?? this.headersOverride, \"remoteAddress\" in options ? options.remoteAddress : this.remoteAddressOverride);\n }\n get originalUrl() {\n return this.source.url;\n }\n cachedMethod;\n get method() {\n return this.cachedMethod ??= this.source.method.toUpperCase();\n }\n get headers() {\n this.headersOverride ??= this.source.headers;\n return this.headersOverride;\n }\n multipartEffect;\n get multipart() {\n if (this.multipartEffect) {\n return this.multipartEffect;\n }\n this.multipartEffect = Effect.runSync(Effect.cached(NodeMultipart.persisted(this.source, this.source.headers)));\n return this.multipartEffect;\n }\n get multipartStream() {\n return NodeMultipart.stream(this.source, this.source.headers);\n }\n get upgrade() {\n return this.upgradeEffect ?? Effect.fail(new HttpServerError({\n reason: new RequestParseError({\n request: this,\n description: \"not an upgradeable ServerRequest\"\n })\n }));\n }\n toString() {\n return `ServerRequest(${this.method} ${this.url})`;\n }\n toJSON() {\n return HttpIncomingMessage.inspect(this, {\n _id: \"HttpServerRequest\",\n method: this.method,\n url: this.originalUrl\n });\n }\n}\n/**\n * Provides an `HttpServer` by creating and managing a scoped Node\n * `http.Server` with the supplied listen and shutdown options.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerServer = /*#__PURE__*/flow(make, /*#__PURE__*/Layer.effect(HttpServer.HttpServer));\n/**\n * Provides the Node HTTP support services used by `NodeHttpServer`, including\n * the HTTP platform, ETag generator, and core Node platform services.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerHttpServices = /*#__PURE__*/Layer.mergeAll(NodeHttpPlatform.layer, Etag.layerWeak, NodeServices.layer);\n/**\n * Provides a Node `HttpServer` together with the Node HTTP platform, ETag, and\n * core platform services required to serve requests.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = (evaluate, options) => Layer.mergeAll(layerServer(evaluate, options), layerHttpServices);\n/**\n * Provides a Node `HttpServer` together with the Node HTTP platform, ETag,\n * and core Node platform services, reading the listen and shutdown options from\n * a `Config` value.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerConfig = (evaluate, options) => Layer.mergeAll(Layer.effect(HttpServer.HttpServer)(Effect.flatMap(Config.unwrap(options), options => make(evaluate, options))), layerHttpServices);\n/**\n * Provides a test HTTP server listening on an ephemeral port together with a\n * Fetch-backed `HttpClient` configured for server integration tests.\n *\n * @category testing\n * @since 4.0.0\n */\nexport const layerTest = /*#__PURE__*/HttpServer.layerTestClient.pipe(/*#__PURE__*/Layer.provide(/*#__PURE__*/Layer.fresh(FetchHttpClient.layer).pipe(/*#__PURE__*/Layer.provide(/*#__PURE__*/Layer.succeed(FetchHttpClient.RequestInit)({\n keepalive: false\n})))), /*#__PURE__*/Layer.provideMerge(/*#__PURE__*/layer(Http.createServer, {\n port: 0\n})));\n// -----------------------------------------------------------------------------\n// Internal\n// -----------------------------------------------------------------------------\nconst handleResponse = (request, response) => {\n const nodeResponse = request.resolvedResponse;\n if (nodeResponse.writableEnded) {\n return Effect.void;\n }\n let headers = response.headers;\n if (!Cookies.isEmpty(response.cookies)) {\n headers = {\n ...headers\n };\n const toSet = Cookies.toSetCookieHeaders(response.cookies);\n if (headers[\"set-cookie\"] !== undefined) {\n toSet.push(headers[\"set-cookie\"]);\n }\n headers[\"set-cookie\"] = toSet;\n }\n if (request.method === \"HEAD\") {\n nodeResponse.writeHead(response.status, headers);\n return Effect.andThen(cancelResponseBody(response.body), Effect.callback(resume => {\n let completed = false;\n const done = () => {\n if (completed) return;\n completed = true;\n nodeResponse.off(\"close\", done);\n resume(Effect.void);\n };\n nodeResponse.once(\"close\", done);\n nodeResponse.end(done);\n }));\n }\n const body = response.body;\n switch (body._tag) {\n case \"Empty\":\n {\n nodeResponse.writeHead(response.status, headers);\n nodeResponse.end();\n return Effect.void;\n }\n case \"Raw\":\n {\n nodeResponse.writeHead(response.status, headers);\n if (typeof body.body === \"object\" && body.body !== null && \"pipe\" in body.body && typeof body.body.pipe === \"function\") {\n return Effect.tryPromise({\n try: signal => pipeline(body.body, nodeResponse, {\n signal,\n end: true\n }),\n catch: cause => new HttpServerError({\n reason: new ResponseError({\n request,\n response,\n description: \"Error writing raw response\",\n cause\n })\n })\n }).pipe(Effect.interruptible, Effect.tapCause(handleCause(nodeResponse, response)));\n }\n return Effect.callback(resume => {\n nodeResponse.end(body.body, () => resume(Effect.void));\n });\n }\n case \"Uint8Array\":\n {\n nodeResponse.writeHead(response.status, headers);\n // If the body is less than 1MB, we skip the callback\n if (body.body.length < 1024 * 1024) {\n nodeResponse.end(body.body);\n return Effect.void;\n }\n return Effect.callback(resume => {\n nodeResponse.end(body.body, () => resume(Effect.void));\n });\n }\n case \"FormData\":\n {\n return Effect.suspend(() => {\n const r = new globalThis.Response(body.formData);\n nodeResponse.writeHead(response.status, {\n ...headers,\n ...Object.fromEntries(r.headers)\n });\n return Effect.callback((resume, signal) => {\n Readable.fromWeb(r.body, {\n signal\n }).pipe(nodeResponse).on(\"error\", cause => {\n resume(Effect.fail(new HttpServerError({\n reason: new ResponseError({\n request,\n response,\n description: \"Error writing FormData response\",\n cause\n })\n })));\n }).once(\"finish\", () => {\n resume(Effect.void);\n });\n }).pipe(Effect.interruptible, Effect.tapCause(handleCause(nodeResponse, response)));\n });\n }\n case \"Stream\":\n {\n nodeResponse.writeHead(response.status, headers);\n const drainLatch = Latch.makeUnsafe();\n nodeResponse.on(\"drain\", () => drainLatch.openUnsafe());\n return body.stream.pipe(Stream.orDie, Stream.runForEachArray(array => {\n const chunk = array.length > 1 ? Buffer.concat(array) : array[0];\n if (nodeResponse.write(chunk)) return Effect.void;\n drainLatch.closeUnsafe();\n return drainLatch.await;\n }), Effect.interruptible, Effect.matchCauseEffect({\n onSuccess: () => Effect.sync(() => nodeResponse.end()),\n onFailure: handleCause(nodeResponse, response)\n }));\n }\n }\n};\nconst cancelResponseBody = body => {\n const stream = body._tag === \"Raw\" ? body.body : undefined;\n if (stream instanceof Readable) {\n return Effect.sync(() => stream.destroy());\n }\n return Effect.void;\n};\nconst handleCause = (nodeResponse, originalResponse) => originalCause => Effect.flatMap(causeResponse(originalCause), ([response, cause]) => {\n const headersSent = nodeResponse.headersSent;\n if (!headersSent) {\n nodeResponse.writeHead(response.status);\n }\n if (!nodeResponse.writableEnded) {\n nodeResponse.end();\n }\n return Effect.failCause(headersSent ? Cause.combine(originalCause, Cause.die(originalResponse)) : cause);\n});\n//# sourceMappingURL=NodeHttpServer.js.map"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,0BAAb,cAA6CA,MAAkB;;;;;;CAM7D,CAACC;CACD;CACA;CACA;CACA,YAAY,QAAQ,SAAS,uBAAuB;EAClD,MAAM;EACN,KAAKA,UAA0BA;EAC/B,KAAK,SAAS;EACd,KAAK,UAAU;EACf,KAAK,wBAAwB;CAC/B;CACA,IAAI,UAAU;EACZ,OAAOC,UAAkB,KAAK,OAAO,OAAO;CAC9C;CACA,IAAI,gBAAgB;EAClB,OAAO,KAAK,yBAAyBC,cAAqB,KAAK,OAAO,OAAO,aAAa;CAC5F;CACA;CACA,IAAI,OAAO;EACT,IAAI,KAAK,YACP,OAAO,KAAK;EAEd,KAAK,aAAaC,QAAeC,OAAcC,QAAeC,cAA6B,gBAAeC,eAA0B,KAAK,QAAQ;GAC/I,SAAS,KAAK;GACd,UAAU;EACZ,CAAC,CAAC,CAAC,CAAC;EACJ,KAAK,oBAAoBC,IAAW,KAAK,aAAY,MAAK,IAAI,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;EAC5F,OAAO,KAAK;CACd;CACA,IAAI,aAAa;EACf,OAAOL,QAAe,KAAK,IAAI;CACjC;CACA,IAAI,OAAO;EACT,OAAOE,QAAe,KAAK,OAAM,SAAQI,KAAW;GAClD,WAAW,SAAS,KAAK,O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