@dual-os/telegram 0.0.0-stage → 8.0.4
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/LICENSE +4 -0
- package/README.md +65 -2
- package/Runner.js +5773 -0
- package/Runner.js.map +63 -0
- package/bundle-inventory.json +1 -0
- package/dist/Telegram.d.ts +5291 -0
- package/dist/Telegram.d.ts.map +1 -0
- package/dist/TelegramClient.d.ts +203 -0
- package/dist/TelegramClient.d.ts.map +1 -0
- package/dist/TelegramClient.js +28 -0
- package/dist/TelegramClient.js.map +9 -0
- package/dist/TelegramDefinition.d.ts +1556 -0
- package/dist/TelegramDefinition.d.ts.map +1 -0
- package/dist/channel/telegram-bot-client.d.ts +45 -0
- package/dist/channel/telegram-bot-client.d.ts.map +1 -0
- package/dist/channel/telegram-bot-definition.d.ts +155 -0
- package/dist/channel/telegram-bot-definition.d.ts.map +1 -0
- package/dist/channel/telegram-bot-webhook.d.ts +62 -0
- package/dist/channel/telegram-bot-webhook.d.ts.map +1 -0
- package/dist/channel/telegram-bot.d.ts +111 -0
- package/dist/channel/telegram-bot.d.ts.map +1 -0
- package/dist/definition.d.ts +1114 -0
- package/dist/definition.d.ts.map +1 -0
- package/dist/definition.js +20 -0
- package/dist/definition.js.map +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +9 -0
- package/dist/internal/TelegramSchemas.d.ts +375 -0
- package/dist/internal/TelegramSchemas.d.ts.map +1 -0
- package/dist/plugin.d.ts +3282 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +26 -0
- package/dist/plugin.js.map +9 -0
- package/dual-plugin.json +1 -0
- package/index-3ysdpnc6.js +1301 -0
- package/index-3ysdpnc6.js.map +18 -0
- package/index-p2x5wnz4.js +251 -0
- package/index-p2x5wnz4.js.map +10 -0
- package/index-pm6k72es.js +847 -0
- package/index-pm6k72es.js.map +14 -0
- package/index-rakjqjpr.js +5524 -0
- package/index-rakjqjpr.js.map +56 -0
- package/index-s1hzpz14.js +224 -0
- package/index-s1hzpz14.js.map +11 -0
- package/index-wxqy9zdg.js +13978 -0
- package/index-wxqy9zdg.js.map +112 -0
- package/licenses/@dual-os_sdk@0.8.1/LICENSE +4 -0
- package/licenses/@effect_platform-node-shared@4.1.2/LICENSE +21 -0
- package/licenses/@effect_platform-node@4.1.2/LICENSE +21 -0
- package/licenses/effect@4.1.2/LICENSE +21 -0
- package/package.json +1 -6
- package/plugin.json +8 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/_virtual/_rolldown/runtime.js", "../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Number.js", "../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/String.js", "../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/encoding/Base64Url.js", "../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/hashMap.js", "../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/hashSet.js", "../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/HashSet.js", "../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/ConfigProvider.js", "../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/matcher.js", "../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Match.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/DefinitionError.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/identifier.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/proto.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AuthMethodBinding.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/OAuth2TokenRefresher.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AuthMethodExecution.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AuthMethod.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/ToolFile.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AgentChannel.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/auth-runtime.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/collection-utils.js", "../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/http/FetchHttpClient.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Action.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/handler-context.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/schema-runtime.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/ConnectionResolver.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/auth-execution.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/trigger-runtime-shared.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/trigger-runtime.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Trigger.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Group.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/children.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/capabilities.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/plugin-handlers.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Plugin.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AgentChannelRuntime.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/AiProvider.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/actions.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/triggers.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/registry.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/DualRegistry.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/internal/dual/invoke.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/DualRuntime.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Files.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/OAuthFlow.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/remote-runtime.js", "../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/PluginRuntime.js"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"// \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\nexport { __exportAll };\n",
|
|
6
|
+
"/**\n * Works with TypeScript `number` values.\n *\n * This module exposes the native `Number` constructor together with helpers for\n * checking, parsing, arithmetic, safe division, comparison, range checks,\n * clamping, rounding, ordering, equivalence, and numeric aggregation.\n *\n * @stability stable\n * @since 2.0.0\n */\nimport * as Equ from \"./Equivalence.js\";\nimport { dual } from \"./Function.js\";\nimport * as Option from \"./Option.js\";\nimport * as order from \"./Order.js\";\nimport * as predicate from \"./Predicate.js\";\nimport * as Reducer from \"./Reducer.js\";\n/**\n * Exposes the global number constructor.\n *\n * **When to use**\n *\n * Use to access native JavaScript numeric coercion from the Effect module\n * namespace.\n *\n * **Gotchas**\n *\n * This follows native `Number` coercion rules, including empty strings\n * becoming `0` and invalid numeric strings becoming `NaN`.\n *\n * @see {@link parse} for parsing strings into an `Option`\n *\n * **Example** (Coercing values to numbers)\n *\n * ```ts import.meta.vitest\n * import { Number as N } from \"effect\"\n *\n * N.Number(\"42\") // => 42\n * N.Number(\"3.14\") // => 3.14\n * ```\n *\n * @stability stable\n * @category constructors\n * @since 4.0.0\n */\nexport const Number = globalThis.Number;\n/**\n * Checks whether a value is a `number`.\n *\n * **When to use**\n *\n * Use to validate unknown input and narrow it to `number`.\n *\n * **Example** (Checking for numbers)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.isNumber(2) // => true\n * Number.isNumber(\"2\") // => false\n * ```\n *\n * @stability stable\n * @category guards\n * @since 2.0.0\n */\nexport const isNumber = predicate.isNumber;\n/**\n * Provides an addition operation on `number`s.\n *\n * **When to use**\n *\n * Use to add two numbers.\n *\n * **Example** (Adding numbers)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.sum(2, 3) // => 5\n * ```\n *\n * @see {@link sumAll} for summing an iterable of numbers\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const sum = /*#__PURE__*/dual(2, (self, that) => self + that);\n/**\n * Provides a multiplication operation on `number`s.\n *\n * **When to use**\n *\n * Use to multiply two numbers.\n *\n * **Example** (Multiplying numbers)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.multiply(2, 3) // => 6\n * ```\n *\n * @see {@link multiplyAll} for multiplying an iterable of numbers\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const multiply = /*#__PURE__*/dual(2, (self, that) => self * that);\n/**\n * Provides a subtraction operation on `number`s.\n *\n * **When to use**\n *\n * Use to subtract one number from another.\n *\n * **Example** (Subtracting numbers)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.subtract(2, 3) // => -1\n * ```\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const subtract = /*#__PURE__*/dual(2, (self, that) => self - that);\n/**\n * Divides `number`s safely, returning `Option.none()` if the divisor is `0`.\n *\n * **When to use**\n *\n * Use to divide numbers while representing division by zero as `Option.none`.\n *\n * **Example** (Dividing numbers safely)\n *\n * ```ts import.meta.vitest\n * import { Number, Option } from \"effect\"\n *\n * Number.divide(6, 3) // => Option.some(2)\n * Number.divide(6, 0) // => Option.none()\n * ```\n *\n * @see {@link divideUnsafe} for division that throws when the divisor is zero\n * @see {@link remainder} for the numeric remainder operation\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const divide = /*#__PURE__*/dual(2, (self, that) => that === 0 ? Option.none() : Option.some(self / that));\n/**\n * Divides two `number` values without returning an `Option`.\n *\n * **When to use**\n *\n * Use to divide `number` values where the divisor is known to be non-zero and\n * a plain `number` result is preferred over handling `Option.none`.\n *\n * **Gotchas**\n *\n * Throws a `RangeError` if the divisor is `0`.\n *\n * **Example** (Dividing numbers unsafely)\n *\n * ```ts import.meta.vitest\n * import { Number, Result } from \"effect\"\n *\n * Number.divideUnsafe(6, 3) // => 2\n *\n * const failure = Result.try({\n * try: () => Number.divideUnsafe(6, 0),\n * catch: (error) => (error as Error).message\n * })\n * Result.merge(failure) // => \"Division by zero\"\n * ```\n *\n * @see {@link divide} for division that returns `Option.none` when the divisor is zero\n *\n * @stability stable\n * @category math\n * @since 4.0.0\n */\nexport const divideUnsafe = /*#__PURE__*/dual(2, (self, that) => Option.getOrThrowWith(divide(self, that), () => new RangeError(\"Division by zero\")));\n/**\n * Returns the result of adding `1` to a given number.\n *\n * **When to use**\n *\n * Use to increment a numeric counter by one.\n *\n * **Example** (Incrementing a number)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.increment(2) // => 3\n * ```\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const increment = n => n + 1;\n/**\n * Decrements a number by `1`.\n *\n * **When to use**\n *\n * Use to decrement a numeric counter by one.\n *\n * **Example** (Decrementing a number)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.decrement(3) // => 2\n * ```\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const decrement = n => n - 1;\n/**\n * Order instance for `number` values.\n *\n * **When to use**\n *\n * Use when you need to sort or compare numbers through APIs that accept an\n * ordering instance.\n *\n * **Example** (Comparing numbers)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.Order(1, 2) // => -1\n * Number.Order(2, 1) // => 1\n * Number.Order(1, 1) // => 0\n * ```\n *\n * @stability stable\n * @category instances\n * @since 2.0.0\n */\nexport const Order = order.Number;\n/**\n * Equivalence instance for numbers where `NaN` is considered equal to `NaN`.\n *\n * **When to use**\n *\n * Use when checking numeric equality through APIs that accept an equivalence\n * relation.\n *\n * **Example** (Comparing numbers for equivalence)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.Equivalence(1, 1) // => true\n * Number.Equivalence(1, 2) // => false\n * Number.Equivalence(NaN, NaN) // => true\n * ```\n *\n * @stability stable\n * @category instances\n * @since 2.0.0\n */\nexport const Equivalence = Equ.Number;\n/**\n * Returns `true` if the first argument is less than the second, otherwise `false`.\n *\n * **When to use**\n *\n * Use to test whether one number is strictly less than another.\n *\n * **Example** (Checking less-than comparisons)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.isLessThan(2, 3) // => true\n * Number.isLessThan(3, 3) // => false\n * Number.isLessThan(4, 3) // => false\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 4.0.0\n */\nexport const isLessThan = /*#__PURE__*/order.isLessThan(Order);\n/**\n * Returns a function that checks if a given `number` is less than or equal to the provided one.\n *\n * **When to use**\n *\n * Use to test whether one number is less than or equal to another.\n *\n * **Example** (Checking less-than-or-equal comparisons)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.isLessThanOrEqualTo(2, 3) // => true\n * Number.isLessThanOrEqualTo(3, 3) // => true\n * Number.isLessThanOrEqualTo(4, 3) // => false\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 4.0.0\n */\nexport const isLessThanOrEqualTo = /*#__PURE__*/order.isLessThanOrEqualTo(Order);\n/**\n * Returns `true` if the first argument is greater than the second, otherwise `false`.\n *\n * **When to use**\n *\n * Use to test whether one number is strictly greater than another.\n *\n * **Example** (Checking greater-than comparisons)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.isGreaterThan(2, 3) // => false\n * Number.isGreaterThan(3, 3) // => false\n * Number.isGreaterThan(4, 3) // => true\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 4.0.0\n */\nexport const isGreaterThan = /*#__PURE__*/order.isGreaterThan(Order);\n/**\n * Returns a function that checks if a given `number` is greater than or equal to the provided one.\n *\n * **When to use**\n *\n * Use to test whether one number is greater than or equal to another.\n *\n * **Example** (Checking greater-than-or-equal comparisons)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.isGreaterThanOrEqualTo(2, 3) // => false\n * Number.isGreaterThanOrEqualTo(3, 3) // => true\n * Number.isGreaterThanOrEqualTo(4, 3) // => true\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 4.0.0\n */\nexport const isGreaterThanOrEqualTo = /*#__PURE__*/order.isGreaterThanOrEqualTo(Order);\n/**\n * Checks whether a `number` is between a `minimum` and `maximum` value (inclusive).\n *\n * **When to use**\n *\n * Use to test whether a number falls inside an inclusive range.\n *\n * **Example** (Checking inclusive ranges)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * const between = Number.between({ minimum: 0, maximum: 5 })\n *\n * between(3) // => true\n * between(-1) // => false\n * between(6) // => false\n * ```\n *\n * @see {@link clamp} for forcing a number into an inclusive range\n *\n * @stability stable\n * @category predicates\n * @since 2.0.0\n */\nexport const between = /*#__PURE__*/order.isBetween(Order);\n/**\n * Restricts the given `number` to be within the range specified by the `minimum` and `maximum` values.\n *\n * **When to use**\n *\n * Use to force a number into an inclusive range.\n *\n * **Details**\n *\n * - If the `number` is less than the `minimum` value, the function returns the `minimum` value.\n * - If the `number` is greater than the `maximum` value, the function returns the `maximum` value.\n * - Otherwise, it returns the original `number`.\n * - `NaN` is ordered below every non-`NaN` number by `Number.Order`, so it is\n * clamped to `minimum`.\n *\n * **Example** (Clamping to a range)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * const clamp = Number.clamp({ minimum: 1, maximum: 5 })\n *\n * clamp(3) // => 3\n * clamp(0) // => 1\n * clamp(6) // => 5\n * ```\n *\n * @see {@link between} for checking whether a number is already inside a range\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const clamp = /*#__PURE__*/order.clamp(Order);\n/**\n * Returns the minimum between two `number`s.\n *\n * **When to use**\n *\n * Use to select the smaller of two numbers.\n *\n * **Example** (Finding the minimum)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.min(2, 3) // => 2\n * ```\n *\n * @see {@link max} for selecting the larger value\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const min = /*#__PURE__*/order.min(Order);\n/**\n * Returns the maximum between two `number`s.\n *\n * **When to use**\n *\n * Use to select the larger of two numbers.\n *\n * **Example** (Finding the maximum)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.max(2, 3) // => 3\n * ```\n *\n * @see {@link min} for selecting the smaller value\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const max = /*#__PURE__*/order.max(Order);\n/**\n * Determines the sign of a given `number`.\n *\n * **When to use**\n *\n * Use to classify a number as negative, zero, or positive.\n *\n * **Example** (Determining the sign)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.sign(-5) // => -1\n * Number.sign(0) // => 0\n * Number.sign(5) // => 1\n * ```\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const sign = n => Order(n, 0);\n/**\n * Takes an `Iterable` of `number`s and returns their sum as a single `number`.\n *\n * **When to use**\n *\n * Use to sum all numbers in an iterable.\n *\n * **Example** (Summing an iterable)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.sumAll([2, 3, 4]) // => 9\n * ```\n *\n * @see {@link sum} for adding two numbers\n * @see {@link ReducerSum} for summing through APIs that consume a `Reducer`\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const sumAll = collection => {\n let out = 0;\n for (const n of collection) {\n out += n;\n }\n return out;\n};\n/**\n * Takes an `Iterable` of `number`s and returns their multiplication as a single `number`.\n *\n * **When to use**\n *\n * Use to multiply all numbers in an iterable.\n *\n * **Example** (Multiplying an iterable)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.multiplyAll([2, 3, 4]) // => 24\n * ```\n *\n * @see {@link multiply} for multiplying two numbers\n * @see {@link ReducerMultiply} for multiplying through APIs that consume a `Reducer`\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const multiplyAll = collection => {\n let out = 1;\n for (const n of collection) {\n if (n === 0) {\n return 0;\n }\n out *= n;\n }\n return out;\n};\n/**\n * Returns the remainder left over when one operand is divided by a second operand, always taking the sign of the dividend.\n *\n * **When to use**\n *\n * Use to compute a numeric remainder while preserving decimal precision better\n * than direct JavaScript `%` for decimal operands.\n *\n * **Example** (Calculating remainders)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.remainder(2, 2) // => 0\n * Number.remainder(3, 2) // => 1\n * Number.remainder(-4, 2) // => -0\n * ```\n *\n * @see {@link divide} for quotient calculation with division-by-zero represented as `Option.none`\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const remainder = /*#__PURE__*/dual(2, (self, divisor) => {\n if (!globalThis.Number.isFinite(self) || !globalThis.Number.isFinite(divisor) || divisor === 0) {\n return NaN;\n }\n if (globalThis.Number.isInteger(self) && globalThis.Number.isInteger(divisor)) {\n return self % divisor;\n }\n const [selfCoefficient, selfExponent] = toScientificInteger(self);\n const [divisorCoefficient, divisorExponent] = toScientificInteger(divisor);\n const exponent = Math.min(selfExponent, divisorExponent);\n const selfInteger = selfCoefficient * BigInt(10) ** BigInt(selfExponent - exponent);\n const divisorInteger = divisorCoefficient * BigInt(10) ** BigInt(divisorExponent - exponent);\n const out = selfInteger % divisorInteger;\n if (out === BigInt(0)) {\n return self < 0 || Object.is(self, -0) ? -0 : 0;\n }\n const remainder = globalThis.Number(`${out}e${exponent}`);\n return remainder === 0 ? Math.sign(self) * globalThis.Number.MIN_VALUE : remainder;\n});\nfunction toScientificInteger(n) {\n if (globalThis.Number.isInteger(n)) {\n return [BigInt(n), 0];\n }\n const scientific = Math.abs(n).toExponential();\n const eIndex = scientific.indexOf(\"e\");\n const digits = scientific.slice(0, eIndex).replace(\".\", \"\");\n const coefficient = BigInt(digits) * (n < 0 ? -BigInt(1) : BigInt(1));\n return [coefficient, globalThis.Number(scientific.slice(eIndex + 1)) - digits.length + 1];\n}\n/**\n * Returns the next power of 2 from the given number.\n *\n * **When to use**\n *\n * Use to round a number up to the next power of two.\n *\n * **Example** (Finding the next power of two)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.nextPow2(5) // => 8\n * Number.nextPow2(17) // => 32\n * ```\n *\n * @stability stable\n * @category math\n * @since 2.0.0\n */\nexport const nextPow2 = n => {\n const nextPow = Math.pow(2, Math.ceil(Math.log2(n)));\n return Math.max(nextPow < n ? nextPow * 2 : nextPow, 2);\n};\n/**\n * Parses a `number` from a `string` safely using the `Number()` function.\n * The following special string values are supported: \"NaN\", \"Infinity\", \"-Infinity\".\n *\n * **When to use**\n *\n * Use to parse numeric text without throwing on invalid input.\n *\n * **Example** (Parsing numbers from strings)\n *\n * ```ts import.meta.vitest\n * import { Number, Option } from \"effect\"\n *\n * Number.parse(\"42\") // => Option.some(42)\n * Number.parse(\"3.14\") // => Option.some(3.14)\n * Number.parse(\"NaN\") // => Option.some(NaN)\n * Number.parse(\"Infinity\") // => Option.some(Infinity)\n * Number.parse(\"-Infinity\") // => Option.some(-Infinity)\n * Number.parse(\"not a number\") // => Option.none()\n * ```\n *\n * @see {@link Number} for native constructor coercion\n *\n * @stability stable\n * @category constructors\n * @since 2.0.0\n */\nexport const parse = s => {\n if (s === \"NaN\") {\n return Option.some(NaN);\n }\n if (s === \"Infinity\") {\n return Option.some(Infinity);\n }\n if (s === \"-Infinity\") {\n return Option.some(-Infinity);\n }\n if (s.trim() === \"\") {\n return Option.none();\n }\n const n = Number(s);\n return Number.isNaN(n) ? Option.none() : Option.some(n);\n};\n/**\n * Returns the number rounded with the given precision.\n *\n * **When to use**\n *\n * Use to round a number to a fixed number of decimal places.\n *\n * **Example** (Rounding with precision)\n *\n * ```ts import.meta.vitest\n * import { Number } from \"effect\"\n *\n * Number.round(1.1234, 2) // => 1.12\n * Number.round(1.567, 2) // => 1.57\n * ```\n *\n * @stability stable\n * @category math\n * @since 3.8.0\n */\nexport const round = /*#__PURE__*/dual(2, (self, precision) => {\n const factor = Math.pow(10, precision);\n return Math.round(self * factor) / factor;\n});\n/**\n * Reducer for combining `number`s using addition.\n *\n * **When to use**\n *\n * Use to sum many numbers through APIs that consume a `Reducer`.\n *\n * **Details**\n *\n * The reducer starts from `0`, so `combineAll([])` returns `0`.\n *\n * @see {@link sumAll} for summing an iterable directly\n * @see {@link ReducerMultiply} for multiplying number values\n *\n * @stability stable\n * @category math\n * @since 4.0.0\n */\nexport const ReducerSum = /*#__PURE__*/Reducer.make((a, b) => a + b, 0);\n/**\n * Reducer for combining `number`s using multiplication.\n *\n * **When to use**\n *\n * Use to multiply many numbers through APIs that consume a `Reducer`.\n *\n * **Details**\n *\n * The reducer starts from `1`, so reducing an empty collection returns `1`.\n *\n * **Gotchas**\n *\n * Reducing an iterable short-circuits when it sees `0`, so later elements are\n * not consumed.\n *\n * @see {@link multiplyAll} for multiplying an iterable directly\n *\n * @stability stable\n * @category math\n * @since 4.0.0\n */\nexport const ReducerMultiply = /*#__PURE__*/Reducer.make((a, b) => a * b, 1, collection => {\n let acc = 1;\n for (const n of collection) {\n if (n === 0) return 0;\n acc *= n;\n }\n return acc;\n});\n/**\n * Reducer for reducing `number`s by keeping the maximum value.\n *\n * **When to use**\n *\n * Use to keep the largest number through APIs that consume a `Reducer`.\n *\n * **Details**\n *\n * The reducer starts from `-Infinity`, so reducing an empty collection returns\n * `-Infinity`.\n *\n * **Gotchas**\n *\n * `NaN` values propagate through `Math.max`.\n *\n * @see {@link ReducerMin} for keeping the smallest number\n * @see {@link max} for comparing two numbers directly\n *\n * @stability stable\n * @category math\n * @since 4.0.0\n */\nexport const ReducerMax = /*#__PURE__*/Reducer.make((a, b) => Math.max(a, b), -Infinity);\n/**\n * Reducer for reducing `number`s by keeping the minimum value.\n *\n * **When to use**\n *\n * Use to keep the smallest number through APIs that consume a `Reducer`.\n *\n * **Details**\n *\n * The reducer starts from `Infinity`, so reducing an empty collection returns\n * `Infinity`.\n *\n * **Gotchas**\n *\n * `NaN` values propagate through `Math.min`.\n *\n * @see {@link ReducerMax} for keeping the largest number\n * @see {@link min} for comparing two numbers directly\n *\n * @stability stable\n * @category math\n * @since 4.0.0\n */\nexport const ReducerMin = /*#__PURE__*/Reducer.make((a, b) => Math.min(a, b), Infinity);\n//# sourceMappingURL=Number.js.map",
|
|
7
|
+
"/**\n * Works with TypeScript `string` values.\n *\n * This module exposes common string operations in a pipe-friendly style. The\n * helpers cover checks, comparison, concatenation, trimming, casing, slicing,\n * padding, replacement, normalization, safe character access, search helpers\n * that return `Option`, and joining strings through a reducer.\n *\n * @stability stable\n * @since 2.0.0\n */\nimport * as Equ from \"./Equivalence.js\";\nimport { dual } from \"./Function.js\";\nimport * as readonlyArray from \"./internal/array.js\";\nimport * as Count from \"./internal/count.js\";\nimport * as number from \"./Number.js\";\nimport * as Option from \"./Option.js\";\nimport * as order from \"./Order.js\";\nimport * as predicate from \"./Predicate.js\";\nimport * as Reducer from \"./Reducer.js\";\n/**\n * Exposes the global string constructor.\n *\n * **When to use**\n *\n * Use to access native JavaScript string coercion or constructor behavior from\n * the Effect module namespace.\n *\n * **Gotchas**\n *\n * Calling `String(value)` returns a primitive string. Calling\n * `new String(value)` creates a boxed `String` object.\n *\n * @see {@link isString} for checking whether a value is a primitive string\n *\n * @stability stable\n * @category constructors\n * @since 4.0.0\n */\nexport const String = globalThis.String;\n/**\n * Checks whether a value is a `string`.\n *\n * **Example** (Checking for strings)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.isString(\"a\") // => true\n * String.isString(1) // => false\n * ```\n *\n * @stability stable\n * @category guards\n * @since 2.0.0\n */\nexport const isString = predicate.isString;\n/**\n * Provides an `Order` instance for comparing strings using lexicographic\n * ordering.\n *\n * **Example** (Comparing strings lexicographically)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.Order(\"apple\", \"banana\") // => -1\n * String.Order(\"banana\", \"apple\") // => 1\n * String.Order(\"apple\", \"apple\") // => 0\n * ```\n *\n * @stability stable\n * @category instances\n * @since 2.0.0\n */\nexport const Order = order.String;\n/**\n * Provides an `Equivalence` instance for strings using strict equality (`===`).\n *\n * **Example** (Comparing strings for equality)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.Equivalence(\"hello\", \"hello\") // => true\n * String.Equivalence(\"hello\", \"world\") // => false\n * ```\n *\n * @stability stable\n * @category instances\n * @since 2.0.0\n */\nexport const Equivalence = Equ.String;\n/**\n * Provides the empty string `\"\"`.\n *\n * **When to use**\n *\n * Use when you need the canonical empty string value from the `String` module.\n *\n * **Example** (Referencing the empty string)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.empty // => \"\"\n * String.isEmpty(String.empty) // => true\n * ```\n *\n * @stability stable\n * @category constants\n * @since 2.0.0\n */\nexport const empty = \"\";\n/**\n * Concatenates two strings at runtime.\n *\n * **Example** (Concatenating strings)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * String.concat(\"hello\", \"world\") // => \"helloworld\"\n * pipe(\"hello\", String.concat(\"world\")) // => \"helloworld\"\n * ```\n *\n * @stability stable\n * @category combining\n * @since 2.0.0\n */\nexport const concat = /*#__PURE__*/dual(2, (self, that) => self + that);\n/**\n * Converts a string to uppercase.\n *\n * **Example** (Converting strings to uppercase)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"a\", String.toUpperCase) // => \"A\"\n * String.toUpperCase(\"hello\") // => \"HELLO\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const toUpperCase = self => self.toUpperCase();\n/**\n * Converts a string to lowercase.\n *\n * **Example** (Converting strings to lowercase)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"A\", String.toLowerCase) // => \"a\"\n * String.toLowerCase(\"HELLO\") // => \"hello\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const toLowerCase = self => self.toLowerCase();\n/**\n * Capitalizes the first character (Unicode code point) of a string.\n *\n * **Example** (Capitalizing a string)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"abc\", String.capitalize) // => \"Abc\"\n * String.capitalize(\"hello\") // => \"Hello\"\n * String.capitalize(\"𐐨foo\") // => \"𐐀foo\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const capitalize = self => {\n const [first = \"\"] = self;\n return toUpperCase(first) + self.slice(first.length);\n};\n/**\n * Uncapitalizes the first character (Unicode code point) of a string.\n *\n * **Example** (Uncapitalizing a string)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"ABC\", String.uncapitalize) // => \"aBC\"\n * String.uncapitalize(\"Hello\") // => \"hello\"\n * String.uncapitalize(\"𐐀FOO\") // => \"𐐨FOO\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const uncapitalize = self => {\n const [first = \"\"] = self;\n return toLowerCase(first) + self.slice(first.length);\n};\n/**\n * Replaces matches in a string using `String.prototype.replace`.\n *\n * **Details**\n *\n * String search values and non-global regular expressions replace the first\n * match; global regular expressions replace every match.\n *\n * **Example** (Replacing a substring)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"abc\", String.replace(\"b\", \"d\")) // => \"adc\"\n * pipe(\"hello world\", String.replace(\"world\", \"Effect\")) // => \"hello Effect\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const replace = (searchValue, replaceValue) => self => self.replace(searchValue, replaceValue);\n/**\n * Removes whitespace from both ends of a string.\n *\n * **Example** (Trimming whitespace)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.trim(\" a \") // => \"a\"\n * String.trim(\" hello world \") // => \"hello world\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const trim = self => self.trim();\n/**\n * Removes whitespace from the start of a string.\n *\n * **Example** (Trimming leading whitespace)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.trimStart(\" a \") // => \"a \"\n * String.trimStart(\" hello world\") // => \"hello world\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const trimStart = self => self.trimStart();\n/**\n * Removes whitespace from the end of a string.\n *\n * **Example** (Trimming trailing whitespace)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.trimEnd(\" a \") // => \" a\"\n * String.trimEnd(\"hello world \") // => \"hello world\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const trimEnd = self => self.trimEnd();\n/**\n * Extracts a section of a string and returns it as a new string.\n *\n * **Example** (Slicing strings)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"abcd\", String.slice(1, 3)) // => \"bc\"\n * pipe(\"hello world\", String.slice(0, 5)) // => \"hello\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const slice = (start, end) => self => self.slice(start, end);\n/**\n * Checks whether a `string` is empty.\n *\n * **Example** (Checking for empty strings)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.isEmpty(\"\") // => true\n * String.isEmpty(\"a\") // => false\n * ```\n *\n * @stability stable\n * @category guards\n * @since 2.0.0\n */\nexport const isEmpty = self => self.length === 0;\n/**\n * Checks whether a `string` is non-empty.\n *\n * **Example** (Checking for non-empty strings)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.isNonEmpty(\"\") // => false\n * String.isNonEmpty(\"a\") // => true\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 2.0.0\n */\nexport const isNonEmpty = self => self.length > 0;\n/**\n * Returns the JavaScript string length, measured in UTF-16 code units.\n *\n * **Example** (Getting string length)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.length(\"abc\") // => 3\n * ```\n *\n * @stability stable\n * @category getters\n * @since 2.0.0\n */\nexport const length = self => self.length;\n/**\n * Splits a string into an array of substrings using a separator.\n *\n * **Example** (Splitting strings)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"abc\", String.split(\"\")) // => [\"a\", \"b\", \"c\"]\n * pipe(\"\", String.split(\"\")) // => [\"\"]\n * String.split(\"hello,world\", \",\") // => [\"hello\", \"world\"]\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const split = /*#__PURE__*/dual(2, (self, separator) => {\n const out = self.split(separator);\n return readonlyArray.isArrayNonEmpty(out) ? out : [self];\n});\n/**\n * Returns `true` if `searchString` appears as a substring of `self`, at one or more positions that are\n * greater than or equal to `position`; otherwise, returns `false`.\n *\n * **Example** (Checking for substrings)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"hello world\", String.includes(\"world\")) // => true\n * pipe(\"hello world\", String.includes(\"foo\")) // => false\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 2.0.0\n */\nexport const includes = (searchString, position) => self => self.includes(searchString, position);\n/**\n * Returns `true` if the string starts with the specified search string.\n *\n * **Example** (Checking string prefixes)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"hello world\", String.startsWith(\"hello\")) // => true\n * pipe(\"hello world\", String.startsWith(\"world\")) // => false\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 2.0.0\n */\nexport const startsWith = (searchString, position) => self => self.startsWith(searchString, position);\n/**\n * Returns `true` if the string ends with the specified search string.\n *\n * **Example** (Checking string suffixes)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"hello world\", String.endsWith(\"world\")) // => true\n * pipe(\"hello world\", String.endsWith(\"hello\")) // => false\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 2.0.0\n */\nexport const endsWith = (searchString, position) => self => self.endsWith(searchString, position);\n/**\n * Returns the character code at the specified index safely, or `None` if the index is out of bounds.\n *\n * **Example** (Reading character codes)\n *\n * ```ts import.meta.vitest\n * import { Option, String } from \"effect\"\n *\n * String.charCodeAt(\"abc\", 1) // => Option.some(98)\n * String.charCodeAt(\"abc\", 4) // => Option.none()\n * ```\n *\n * @stability stable\n * @category getters\n * @since 2.0.0\n */\nexport const charCodeAt = /*#__PURE__*/dual(2, (self, index) => Option.filter(Option.some(self.charCodeAt(index)), charCode => !isNaN(charCode)));\n/**\n * Extracts characters from a string between two specified indices.\n *\n * **Example** (Extracting substrings)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"abcd\", String.substring(1)) // => \"bcd\"\n * pipe(\"abcd\", String.substring(1, 3)) // => \"bc\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const substring = (start, end) => self => self.substring(start, end);\n/**\n * Returns the character at the specified relative index safely, or `None` if the index is out of bounds.\n *\n * **Example** (Accessing characters safely)\n *\n * ```ts import.meta.vitest\n * import { Option, pipe, String } from \"effect\"\n *\n * pipe(\"abc\", String.at(1)) // => Option.some(\"b\")\n * pipe(\"abc\", String.at(4)) // => Option.none()\n * ```\n *\n * @stability stable\n * @category getters\n * @since 2.0.0\n */\nexport const at = /*#__PURE__*/dual(2, (self, index) => Option.fromUndefinedOr(self.at(index)));\n/**\n * Returns the character at the specified non-negative index safely, or `None` if the index is out of bounds.\n *\n * **Example** (Reading characters safely)\n *\n * ```ts import.meta.vitest\n * import { Option, pipe, String } from \"effect\"\n *\n * pipe(\"abc\", String.charAt(1)) // => Option.some(\"b\")\n * pipe(\"abc\", String.charAt(4)) // => Option.none()\n * ```\n *\n * @stability stable\n * @category getters\n * @since 2.0.0\n */\nexport const charAt = /*#__PURE__*/dual(2, (self, index) => Option.filter(Option.some(self.charAt(index)), isNonEmpty));\n/**\n * Returns the Unicode code point at the specified index safely, or `None` if the index is out of bounds.\n *\n * **Example** (Reading code points)\n *\n * ```ts import.meta.vitest\n * import { Option, pipe, String } from \"effect\"\n *\n * pipe(\"abc\", String.codePointAt(1)) // => Option.some(98)\n * pipe(\"abc\", String.codePointAt(10)) // => Option.none()\n * ```\n *\n * @stability stable\n * @category getters\n * @since 2.0.0\n */\nexport const codePointAt = /*#__PURE__*/dual(2, (self, index) => Option.fromUndefinedOr(self.codePointAt(index)));\n/**\n * Returns the index of the first occurrence of a substring safely, or `None` if not found.\n *\n * **Example** (Finding the first substring index)\n *\n * ```ts import.meta.vitest\n * import { Option, pipe, String } from \"effect\"\n *\n * pipe(\"abbbc\", String.indexOf(\"b\")) // => Option.some(1)\n * pipe(\"abbbc\", String.indexOf(\"z\")) // => Option.none()\n * ```\n *\n * @stability stable\n * @category searching\n * @since 2.0.0\n */\nexport const indexOf = searchString => self => Option.filter(Option.some(self.indexOf(searchString)), number.isGreaterThanOrEqualTo(0));\n/**\n * Returns the index of the last occurrence of a substring safely, or `None` if not found.\n *\n * **Example** (Finding the last substring index)\n *\n * ```ts import.meta.vitest\n * import { Option, pipe, String } from \"effect\"\n *\n * pipe(\"abbbc\", String.lastIndexOf(\"b\")) // => Option.some(3)\n * pipe(\"abbbc\", String.lastIndexOf(\"d\")) // => Option.none()\n * ```\n *\n * @stability stable\n * @category searching\n * @since 2.0.0\n */\nexport const lastIndexOf = searchString => self => Option.filter(Option.some(self.lastIndexOf(searchString)), number.isGreaterThanOrEqualTo(0));\n/**\n * Computes locale-aware ordering for two strings, with optional locales and\n * collator options, and returns the result as an `Ordering` (`-1`, `0`, or\n * `1`).\n *\n * **Example** (Comparing strings by locale)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"a\", String.localeCompare(\"b\")) // => -1\n * pipe(\"b\", String.localeCompare(\"a\")) // => 1\n * pipe(\"a\", String.localeCompare(\"a\")) // => 0\n * ```\n *\n * @stability stable\n * @category comparisons\n * @since 2.0.0\n */\nexport const localeCompare = (that, locales, options) => self => number.sign(self.localeCompare(that, locales, options));\n/**\n * Matches a string against a pattern safely and returns `Option.some` with the match\n * array, or `Option.none` when the pattern does not match.\n *\n * **Example** (Matching regular expressions)\n *\n * ```ts import.meta.vitest\n * import { Option, pipe, String } from \"effect\"\n *\n * pipe(\n * \"hello\",\n * String.match(/l+/),\n * Option.map((match) => [match[0], match.index])\n * ) // => Option.some([\"ll\", 2])\n * pipe(\"hello\", String.match(/x/)) // => Option.none()\n * ```\n *\n * @stability stable\n * @category searching\n * @since 2.0.0\n */\nexport const match = regExp => self => Option.fromNullOr(self.match(regExp));\n/**\n * Returns an iterator over all regular expression matches in the string using\n * native `String.prototype.matchAll` semantics.\n *\n * **Example** (Iterating regular expression matches)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * const matches = pipe(\"hello world\", String.matchAll(/l/g))\n *\n * Array.from(matches, (match) => [match[0], match.index]) // => [[\"l\", 2], [\"l\", 3], [\"l\", 9]]\n * ```\n *\n * @stability stable\n * @category searching\n * @since 2.0.0\n */\nexport const matchAll = regExp => self => self.matchAll(regExp);\n/**\n * Normalizes a string according to the specified Unicode normalization form.\n *\n * **Example** (Normalizing Unicode strings)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * const str = \"\\u1E9B\\u0323\"\n * Array.from(pipe(str, String.normalize()), (character) => character.codePointAt(0)) // => [0x1e9b, 0x323]\n * Array.from(pipe(str, String.normalize(\"NFC\")), (character) => character.codePointAt(0)) // => [0x1e9b, 0x323]\n * Array.from(\n * pipe(str, String.normalize(\"NFD\")),\n * (character) => character.codePointAt(0)\n * ) // => [0x17f, 0x323, 0x307]\n * Array.from(pipe(str, String.normalize(\"NFKC\")), (character) => character.codePointAt(0)) // => [0x1e69]\n * Array.from(\n * pipe(str, String.normalize(\"NFKD\")),\n * (character) => character.codePointAt(0)\n * ) // => [0x73, 0x323, 0x307]\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const normalize = form => self => self.normalize(form);\n/**\n * Pads the string from the end with a given fill string to a specified length.\n *\n * **Example** (Padding strings at the end)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"a\", String.padEnd(5)) // => \"a \"\n * pipe(\"a\", String.padEnd(5, \"_\")) // => \"a____\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const padEnd = (maxLength, fillString) => self => self.padEnd(maxLength, fillString);\n/**\n * Pads the string from the start with a given fill string to a specified length.\n *\n * **Example** (Padding strings at the start)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"a\", String.padStart(5)) // => \" a\"\n * pipe(\"a\", String.padStart(5, \"_\")) // => \"____a\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const padStart = (maxLength, fillString) => self => self.padStart(maxLength, fillString);\n/**\n * Repeats the string the specified number of times.\n *\n * **Details**\n *\n * `count` is rounded down. `NaN` and non-positive values are treated as `0`.\n *\n * **Example** (Repeating strings)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"a\", String.repeat(5)) // => \"aaaaa\"\n * pipe(\"hello\", String.repeat(3)) // => \"hellohellohello\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const repeat = count => self => self.repeat(Count.normalize(count));\n/**\n * Replaces all occurrences of a substring or pattern in a string.\n *\n * **Example** (Replacing all matches)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * pipe(\"ababb\", String.replaceAll(\"b\", \"c\")) // => \"acacc\"\n * pipe(\"ababb\", String.replaceAll(/ba/g, \"cc\")) // => \"accbb\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const replaceAll = (searchValue, replaceValue) => self => self.replaceAll(searchValue, replaceValue);\n/**\n * Returns the index of the first match for a string or regular expression safely, or\n * `Option.none` when no match is found.\n *\n * **Example** (Searching strings)\n *\n * ```ts import.meta.vitest\n * import { Option, String } from \"effect\"\n *\n * String.search(\"ababb\", \"b\") // => Option.some(1)\n * String.search(\"ababb\", /abb/) // => Option.some(2)\n * String.search(\"ababb\", \"d\") // => Option.none()\n * ```\n *\n * @stability stable\n * @category searching\n * @since 2.0.0\n */\nexport const search = /*#__PURE__*/dual(2, (self, regExp) => Option.filter(Option.some(self.search(regExp)), number.isGreaterThanOrEqualTo(0)));\n/**\n * Converts the string to lowercase according to the specified locale.\n *\n * **Example** (Lowercasing strings by locale)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * const str = \"\\u0130\"\n * pipe(str, String.toLocaleLowerCase(\"tr\")) // => \"i\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const toLocaleLowerCase = locale => self => self.toLocaleLowerCase(locale);\n/**\n * Converts the string to uppercase according to the specified locale.\n *\n * **Example** (Uppercasing strings by locale)\n *\n * ```ts import.meta.vitest\n * import { pipe, String } from \"effect\"\n *\n * const str = \"i\\u0307\"\n * pipe(str, String.toLocaleUpperCase(\"lt-LT\")) // => \"I\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const toLocaleUpperCase = locale => self => self.toLocaleUpperCase(locale);\n/**\n * Keeps the specified number of characters from the start of a string.\n *\n * **Details**\n *\n * If `n` is larger than the available number of characters, the string will\n * be returned whole.\n *\n * If `n` is not a positive number, including `NaN`, an empty string will be\n * returned.\n *\n * If `n` is a float, it will be rounded down to the nearest integer.\n *\n * **Example** (Taking characters from the start)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.takeLeft(\"Hello World\", 5) // => \"Hello\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const takeLeft = /*#__PURE__*/dual(2, (self, n) => self.slice(0, Count.normalize(n)));\n/**\n * Keeps the specified number of characters from the end of a string.\n *\n * **Details**\n *\n * If `n` is larger than the available number of characters, the string will\n * be returned whole.\n *\n * If `n` is not a positive number, including `NaN`, an empty string will be\n * returned.\n *\n * If `n` is a float, it will be rounded down to the nearest integer.\n *\n * **Example** (Taking characters from the end)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.takeRight(\"Hello World\", 5) // => \"World\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const takeRight = /*#__PURE__*/dual(2, (self, n) => self.slice(self.length - Math.min(Count.normalize(n), self.length), Infinity));\nconst CR = 0x0d;\nconst LF = 0x0a;\n/**\n * Returns an `IterableIterator` which yields each line contained within the\n * string, trimming off the trailing newline character.\n *\n * **Example** (Iterating lines without separators)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * Array.from(String.linesIterator(\"hello\\nworld\\n\")) // => [\"hello\", \"world\"]\n * ```\n *\n * @stability stable\n * @category splitting\n * @since 2.0.0\n */\nexport const linesIterator = self => linesSeparated(self, true);\n/**\n * Returns an `IterableIterator` which yields each line contained within the\n * string as well as the trailing newline character.\n *\n * **Example** (Iterating lines with separators)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * Array.from(String.linesWithSeparators(\"hello\\nworld\\n\")) // => [\"hello\\n\", \"world\\n\"]\n * ```\n *\n * @stability stable\n * @category splitting\n * @since 2.0.0\n */\nexport const linesWithSeparators = s => linesSeparated(s, false);\n/**\n * Strips a leading margin prefix from every line using the supplied margin\n * character.\n *\n * **Example** (Stripping custom margins)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.stripMarginWith(\" |hello\\n |world\", \"|\") // => \"hello\\nworld\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const stripMarginWith = /*#__PURE__*/dual(2, (self, marginChar) => {\n let out = \"\";\n for (const line of linesWithSeparators(self)) {\n let index = 0;\n while (index < line.length && line.charAt(index) <= \" \") {\n index = index + 1;\n }\n const stripped = index < line.length && line.charAt(index) === marginChar ? line.substring(index + 1) : line;\n out = out + stripped;\n }\n return out;\n});\n/**\n * Strips a leading `|` margin prefix from every line.\n *\n * **Example** (Stripping pipe margins)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.stripMargin(\" |hello\\n |world\") // => \"hello\\nworld\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const stripMargin = self => stripMarginWith(self, \"|\");\n/**\n * Converts a snake_case string to camelCase.\n *\n * **Details**\n *\n * Keeps the first character, then replaces each later underscore and the\n * character after it with that character uppercased. A trailing underscore is\n * dropped. Input made only of an even number of underscores returns `\"\"`.\n *\n * **Example** (Converting snake_case to camelCase)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.snakeToCamel(\"hello_world\") // => \"helloWorld\"\n * String.snakeToCamel(\"foo_bar_baz\") // => \"fooBarBaz\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const snakeToCamel = self => {\n if (self.length === 0 || self.length % 2 === 0 && self[0] === \"_\" && /^_+$/.test(self)) return \"\";\n let str = self[0];\n for (let i = 1; i < self.length; i++) {\n str += self[i] === \"_\" ? self.charAt(++i).toUpperCase() : self[i];\n }\n return str;\n};\n/**\n * Converts a snake_case string to PascalCase.\n *\n * **Details**\n *\n * Uppercases the first character, then replaces each later underscore and the\n * character after it with that character uppercased. A trailing underscore is\n * dropped. Input made only of an even number of underscores returns `\"\"`.\n *\n * **Example** (Converting snake_case to PascalCase)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.snakeToPascal(\"hello_world\") // => \"HelloWorld\"\n * String.snakeToPascal(\"foo_bar_baz\") // => \"FooBarBaz\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const snakeToPascal = self => {\n if (self.length === 0 || self.length % 2 === 0 && self[0] === \"_\" && /^_+$/.test(self)) return \"\";\n let str = self[0].toUpperCase();\n for (let i = 1; i < self.length; i++) {\n str += self[i] === \"_\" ? self.charAt(++i).toUpperCase() : self[i];\n }\n return str;\n};\n/**\n * Converts a snake_case string to kebab-case.\n *\n * **Example** (Converting snake_case to kebab-case)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.snakeToKebab(\"hello_world\") // => \"hello-world\"\n * String.snakeToKebab(\"foo_bar_baz\") // => \"foo-bar-baz\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const snakeToKebab = self => self.replace(/_/g, \"-\");\n/**\n * Converts a camelCase string to snake_case.\n *\n * **Example** (Converting camelCase to snake_case)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.camelToSnake(\"helloWorld\") // => \"hello_world\"\n * String.camelToSnake(\"fooBarBaz\") // => \"foo_bar_baz\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const camelToSnake = self => self.replace(/([A-Z])/g, \"_$1\").toLowerCase();\n/**\n * Converts a PascalCase string to snake_case.\n *\n * **Example** (Converting PascalCase to snake_case)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.pascalToSnake(\"HelloWorld\") // => \"hello_world\"\n * String.pascalToSnake(\"FooBarBaz\") // => \"foo_bar_baz\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const pascalToSnake = self => (self.slice(0, 1) + self.slice(1).replace(/([A-Z])/g, \"_$1\")).toLowerCase();\n/**\n * Converts a kebab-case string to snake_case.\n *\n * **Example** (Converting kebab-case to snake_case)\n *\n * ```ts import.meta.vitest\n * import { String } from \"effect\"\n *\n * String.kebabToSnake(\"hello-world\") // => \"hello_world\"\n * String.kebabToSnake(\"foo-bar-baz\") // => \"foo_bar_baz\"\n * ```\n *\n * @stability stable\n * @category transforming\n * @since 2.0.0\n */\nexport const kebabToSnake = self => self.replace(/-/g, \"_\");\nclass LinesIterator {\n index;\n length;\n s;\n stripped;\n constructor(s, stripped = false) {\n this.s = s;\n this.stripped = stripped;\n this.index = 0;\n this.length = s.length;\n }\n next() {\n if (this.done) {\n return {\n done: true,\n value: undefined\n };\n }\n const start = this.index;\n while (!this.done && !isLineBreak(this.s[this.index])) {\n this.index = this.index + 1;\n }\n let end = this.index;\n if (!this.done) {\n const char = this.s[this.index];\n this.index = this.index + 1;\n if (!this.done && isLineBreak2(char, this.s[this.index])) {\n this.index = this.index + 1;\n }\n if (!this.stripped) {\n end = this.index;\n }\n }\n return {\n done: false,\n value: this.s.substring(start, end)\n };\n }\n [Symbol.iterator]() {\n return new LinesIterator(this.s, this.stripped);\n }\n get done() {\n return this.index >= this.length;\n }\n}\n/**\n * Checks whether the provided character is a line break character (i.e. either `\"\\r\"`\n * or `\"\\n\"`).\n */\nconst isLineBreak = char => {\n const code = char.charCodeAt(0);\n return code === CR || code === LF;\n};\n/**\n * Checks whether the provided characters combine to form a carriage return/line-feed\n * (i.e. `\"\\r\\n\"`).\n */\nconst isLineBreak2 = (char0, char1) => char0.charCodeAt(0) === CR && char1.charCodeAt(0) === LF;\nconst linesSeparated = (self, stripped) => new LinesIterator(self, stripped);\n/**\n * Normalizes a string by splitting it into word parts, transforming each part,\n * and joining the parts with a configurable delimiter.\n *\n * **When to use**\n *\n * Use when you need custom word-case output with a delimiter or part transform\n * that the fixed case helpers do not provide.\n *\n * @see {@link pascalCase} for fixed PascalCase output\n * @see {@link camelCase} for fixed lower-initial camelCase output\n * @see {@link constantCase} for fixed uppercase underscore-separated output\n * @see {@link kebabCase} for fixed lowercase hyphen-separated output\n * @see {@link snakeCase} for fixed lowercase underscore-separated output\n *\n * @stability stable\n * @category transforming\n * @since 4.0.0\n */\nexport const noCase = /*#__PURE__*/dual(args => typeof args[0] === \"string\", (input, options) => {\n const splitRegExp = toRegExpArray(options?.splitRegExp ?? SPLIT_REGEXP);\n const stripRegExp = toRegExpArray(options?.stripRegExp ?? STRIP_REGEXP);\n const delimiter = options?.delimiter ?? \" \";\n const transform = options?.transform ?? toLowerCase;\n return normalizeCase(input, splitRegExp, stripRegExp, delimiter, transform);\n});\nconst toRegExpArray = regexp => predicate.isRegExp(regexp) ? [regexp] : regexp;\nconst normalizeCase = (input, splitRegExp, stripRegExp, delimiter, transform) => {\n let result = input;\n for (const regexp of splitRegExp) {\n result = result.replace(regexp, \"$1\\0$2\");\n }\n for (const regexp of stripRegExp) {\n result = result.replace(regexp, \"\\0\");\n }\n let start = 0;\n let end = result.length;\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\") {\n start++;\n }\n while (result.charAt(end - 1) === \"\\0\") {\n end--;\n }\n if (start >= end) return \"\";\n // Transform each token independently.\n return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n};\n// Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\")\n// and digit boundaries (\"camel2case\" -> \"camel 2 case\").\nconst SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g, /([A-Z])([0-9])/gi, /([0-9])([A-Z])/gi];\n// Config paths preserve digit groups such as \"v2\" while still supporting camel case.\nconst CONFIG_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];\n// Remove all non-word characters.\nconst STRIP_REGEXP = /[^A-Z0-9]+/gi;\nconst pascalCaseTransform = input => {\n const firstChar = input.charAt(0);\n const lowerChars = input.substring(1).toLowerCase();\n return `${firstChar.toUpperCase()}${lowerChars}`;\n};\n/**\n * Converts a string to PascalCase.\n *\n * **When to use**\n *\n * Use to normalize strings from spaces, separators, or camel/Pascal word\n * boundaries into PascalCase.\n *\n * @see {@link camelCase} for lower-initial camelCase output\n * @see {@link noCase} for configurable delimiters and part transforms\n * @see {@link snakeToPascal} for converting known snake_case input only\n *\n * @stability stable\n * @category transforming\n * @since 4.0.0\n */\nexport const pascalCase = /*#__PURE__*/noCase({\n delimiter: \"\",\n transform: pascalCaseTransform\n});\nconst camelCaseTransform = (input, index) => index === 0 ? input.toLowerCase() : pascalCaseTransform(input);\n/**\n * Converts a string to camelCase.\n *\n * **When to use**\n *\n * Use to normalize mixed word separators or existing PascalCase/camelCase text\n * into lower-initial camelCase identifiers.\n *\n * @see {@link noCase} for configurable delimiters and part transforms\n * @see {@link pascalCase} for upper-initial PascalCase output\n * @see {@link snakeCase} for lowercase underscore-separated output\n * @see {@link kebabCase} for lowercase hyphen-separated output\n * @see {@link constantCase} for uppercase underscore-separated output\n *\n * @stability stable\n * @category transforming\n * @since 4.0.0\n */\nexport const camelCase = /*#__PURE__*/noCase({\n delimiter: \"\",\n transform: camelCaseTransform\n});\n/**\n * Converts a string to CONSTANT_CASE (uppercase with underscores).\n *\n * **When to use**\n *\n * Use to normalize words from mixed input formats into uppercase,\n * underscore-separated identifiers.\n *\n * @see {@link snakeCase} for lowercase underscore-separated output\n * @see {@link kebabCase} for lowercase hyphen-separated output\n * @see {@link camelCase} for lower-initial camelCase output\n * @see {@link pascalCase} for upper-initial PascalCase output\n * @see {@link configCase} for configuration key casing that preserves numeric word groups\n * @see {@link noCase} for configurable delimiters and part transforms\n *\n * @stability stable\n * @category transforming\n * @since 4.0.0\n */\nexport const constantCase = /*#__PURE__*/noCase({\n delimiter: \"_\",\n transform: toUpperCase\n});\n/**\n * Converts a string to CONFIG_CASE (uppercase with underscores) for\n * configuration keys.\n *\n * **When to use**\n *\n * Use to normalize configuration path segments into environment-variable-like\n * keys while preserving numeric word groups such as `v2`.\n *\n * **Details**\n *\n * Unlike {@link constantCase}, digit-letter boundaries are not split. For\n * example, `\"api-v2 xml\"` becomes `\"API_V2_XML\"`.\n *\n * `configCase` is not idempotent: `\"field2value\"` becomes `\"FIELD2VALUE\"`, and\n * applying it again gives `\"FIELD2_VALUE\"`.\n *\n * @see {@link constantCase} for standard uppercase underscore-separated output\n * @stability stable\n * @category transforming\n * @since 4.0.0\n */\nexport const configCase = self => normalizeCase(self, CONFIG_SPLIT_REGEXP, [STRIP_REGEXP], \"_\", toUpperCase);\n/**\n * Converts a string to kebab-case (lowercase with hyphens).\n *\n * **When to use**\n *\n * Use to normalize free-form labels, identifiers, or keys into lowercase\n * hyphen-separated text.\n *\n * @see {@link noCase} for configurable delimiters and part transforms\n * @see {@link snakeCase} for lowercase underscore-separated output\n * @see {@link constantCase} for uppercase underscore-separated output\n * @see {@link camelCase} for lower-initial camelCase output\n * @see {@link pascalCase} for upper-initial PascalCase output\n *\n * @stability stable\n * @category transforming\n * @since 4.0.0\n */\nexport const kebabCase = /*#__PURE__*/noCase({\n delimiter: \"-\"\n});\n/**\n * Converts a string to snake_case (lowercase with underscores).\n *\n * **When to use**\n *\n * Use to normalize mixed-case or separator-delimited text into lowercase words\n * joined with underscores.\n *\n * @see {@link noCase} for configurable lower-level normalization\n * @see {@link kebabCase} for lowercase hyphen-separated output\n * @see {@link constantCase} for uppercase underscore-separated output\n *\n * @stability stable\n * @category transforming\n * @since 4.0.0\n */\nexport const snakeCase = /*#__PURE__*/noCase({\n delimiter: \"_\"\n});\n/**\n * Reducer for concatenating `string`s.\n *\n * **When to use**\n *\n * Use to concatenate many strings through APIs that consume a `Reducer`.\n *\n * **Details**\n *\n * The reducer starts from `\"\"`, so combining an empty collection returns `\"\"`.\n *\n * @see {@link concat} for concatenating two strings directly\n *\n * @stability stable\n * @category combining\n * @since 4.0.0\n */\nexport const ReducerConcat = /*#__PURE__*/Reducer.make((a, b) => a + b, \"\");\n//# sourceMappingURL=String.js.map",
|
|
8
|
+
"/**\n * URL-safe Base64 encoding and decoding helpers.\n *\n * @stability stable\n * @since 4.0.0\n */\nimport * as Result from \"../Result.js\";\nimport * as Base64 from \"./Base64.js\";\nimport { EncodingError } from \"./EncodingError.js\";\n/**\n * Encodes the given value into an unpadded URL-safe Base64 string.\n *\n * **When to use**\n *\n * Use to encode text or bytes in contexts that require the URL-safe alphabet.\n *\n * **Details**\n *\n * String inputs are encoded as UTF-8 bytes before Base64Url encoding.\n * `Uint8Array` inputs are encoded directly. The output removes `=` padding\n * and replaces `+` with `-` and `/` with `_`.\n *\n * **Example** (Encoding URL-safe Base64)\n *\n * ```ts import.meta.vitest\n * import { Base64Url } from \"effect/encoding\"\n *\n * Base64Url.encode(\"hello?\") // => \"aGVsbG8_\"\n *\n * const bytes = new Uint8Array([72, 101, 108, 108, 111, 63])\n * Base64Url.encode(bytes) // => \"SGVsbG8_\"\n * ```\n *\n * @see {@link encodePadded} for output that keeps `=` padding\n * @see {@link decode} for decoding URL-safe Base64 to bytes\n * @see {@link decodeString} for decoding URL-safe Base64 to UTF-8 text\n *\n * @stability stable\n * @category encoding\n * @since 4.0.0\n */\nexport const encode = input => Base64.encode(input).replace(/=/g, \"\").replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\n/**\n * Encodes the given value into a padded URL-safe Base64 string.\n *\n * **When to use**\n *\n * Use when a consumer requires `=` padding on URL-safe Base64, such as Go's\n * `base64.URLEncoding`.\n *\n * **Details**\n *\n * Same as {@link encode}, but keeps the `=` padding. {@link decode} accepts\n * both forms.\n *\n * **Example** (Encoding padded URL-safe Base64)\n *\n * ```ts import.meta.vitest\n * import { Base64Url } from \"effect/encoding\"\n *\n * Base64Url.encodePadded(\"fo\") // => \"Zm8=\"\n * ```\n *\n * @see {@link encode} for unpadded output\n *\n * @stability stable\n * @category encoding\n * @since 4.0.6\n */\nexport const encodePadded = input => Base64.encode(input).replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\n/**\n * Decodes a padded or unpadded URL-safe Base64 string into bytes safely.\n *\n * **When to use**\n *\n * Use to decode Base64Url text into bytes without throwing on invalid input.\n *\n * **Details**\n *\n * Returns `Result.succeed` with a `Uint8Array` when decoding succeeds, or\n * `Result.fail` with an `EncodingError` when the input is not valid\n * Base64Url. Both padded and unpadded forms are accepted when otherwise valid.\n *\n * **Example** (Decoding URL-safe Base64 bytes)\n *\n * ```ts import.meta.vitest\n * import { Result } from \"effect\"\n * import { Base64Url } from \"effect/encoding\"\n *\n * Base64Url.decode(\"SGVsbG8_\") // => Result.succeed(new Uint8Array([72, 101, 108, 108, 111, 63]))\n * ```\n *\n * @stability stable\n * @category decoding\n * @since 4.0.0\n */\nexport const decode = str => {\n const stripped = str.replace(/[\\n\\r]/g, \"\");\n const length = stripped.length;\n const padded = stripped.endsWith(\"=\");\n if (padded ? length % 4 !== 0 : length % 4 === 1) {\n return Result.fail(new EncodingError({\n module: \"Base64Url\",\n kind: \"Decode\",\n input: stripped,\n message: padded ? `Padded length should be a multiple of 4, but is ${length}` : `Unpadded length should not be 1 more than a multiple of 4, but is ${length}`\n }));\n }\n // Validating up front keeps failures as cheap as the scan, without allocating the output.\n if (!/^[-_A-Z0-9]*?={0,2}$/i.test(stripped)) {\n return Result.fail(new EncodingError({\n module: \"Base64Url\",\n kind: \"Decode\",\n input: stripped,\n message: \"Invalid input\"\n }));\n }\n const end = !padded ? length : stripped.charCodeAt(length - 2) === 61 ? length - 2 : length - 1;\n const fullEnd = end & ~3;\n // Not `(end * 3) >> 2`: engines that allow strings over 2^31 / 3 characters would overflow int32.\n const result = new Uint8Array(Math.floor(end * 3 / 4));\n let j = 0;\n for (let i = 0; i < fullEnd; i += 4) {\n const a = codes[stripped.charCodeAt(i)];\n const b = codes[stripped.charCodeAt(i + 1)];\n const c = codes[stripped.charCodeAt(i + 2)];\n const d = codes[stripped.charCodeAt(i + 3)];\n result[j++] = a << 2 | b >> 4;\n result[j++] = b << 4 | c >> 2;\n result[j++] = c << 6 | d;\n }\n // Non-zero trailing bits in the final character are ignored.\n if (end > fullEnd) {\n const a = codes[stripped.charCodeAt(fullEnd)];\n const b = codes[stripped.charCodeAt(fullEnd + 1)];\n result[j++] = a << 2 | b >> 4;\n if (end - fullEnd === 3) result[j] = b << 4 | codes[stripped.charCodeAt(fullEnd + 2)] >> 2;\n }\n return Result.succeed(result);\n};\nconst alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\";\nconst codes = /*#__PURE__*/new Uint8Array(128);\nfor (let i = 0; i < alphabet.length; i++) codes[/*#__PURE__*/alphabet.charCodeAt(i)] = i;\n/**\n * Decodes a padded or unpadded URL-safe Base64 string into UTF-8 text safely.\n *\n * **When to use**\n *\n * Use to decode Base64Url text into UTF-8 text without throwing on invalid\n * input.\n *\n * **Details**\n *\n * Returns `Result.succeed` with the decoded text when decoding succeeds, or\n * `Result.fail` with an `EncodingError` when the input is not valid\n * Base64Url.\n *\n * **Example** (Decoding URL-safe Base64 strings)\n *\n * ```ts import.meta.vitest\n * import { Result } from \"effect\"\n * import { Base64Url } from \"effect/encoding\"\n *\n * Base64Url.decodeString(\"aGVsbG8_\") // => Result.succeed(\"hello?\")\n * ```\n *\n * @stability stable\n * @category decoding\n * @since 4.0.0\n */\nexport const decodeString = str => Result.map(decode(str), _ => decoder.decode(_));\nconst decoder = /*#__PURE__*/new TextDecoder();\n//# sourceMappingURL=Base64Url.js.map",
|
|
9
|
+
"/**\n * @since 2.0.0\n */\nimport * as Equal_ from \"../Equal.js\";\nimport { format } from \"../Formatter.js\";\nimport { dual, identity, pipe } from \"../Function.js\";\nimport * as Hash from \"../Hash.js\";\nimport { NodeInspectSymbol, toJson } from \"../Inspectable.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport * as Result from \"../Result.js\";\nimport { backEdges } from \"./hash.js\";\n/** @internal */\nexport const HashMapTypeId = \"~effect/HashMap\";\n// HAMT Implementation\n/** @internal */\nconst SHIFT = 5;\n/** @internal */\nconst BUCKET_SIZE = 1 << SHIFT; // 32\n/** @internal */\n// const BITMAP_SIZE = 1 << SHIFT // 32\n/** @internal */\nconst MIN_ARRAY_NODE = BUCKET_SIZE / 4; // 8\n/** @internal */\nconst MAX_INDEX_NODE = BUCKET_SIZE / 2; // 16\n/** @internal */\nconst BITMAP_INDEX_MASK = BUCKET_SIZE - 1; // 31\n/** @internal */\nconst popcount = n => {\n n = n - (n >>> 1 & 0x55555555);\n n = (n & 0x33333333) + (n >>> 2 & 0x33333333);\n return (n + (n >>> 4) & 0xF0F0F0F) * 0x1010101 >>> 24;\n};\n/** @internal */\nconst mask = (hash, shift) => hash >>> shift & BITMAP_INDEX_MASK;\n/** @internal */\nconst bitpos = (hash, shift) => 1 << mask(hash, shift);\n/** @internal */\nconst index = (bitmap, bit) => popcount(bitmap & bit - 1);\n/** @internal */\nfunction mergeLeaves(edit, shift, hash1, node1, hash2, node2) {\n if (shift > 32) {\n throw new Error(\"HashMap: max depth exceeded\");\n }\n const bit1 = bitpos(hash1, shift);\n const bit2 = bitpos(hash2, shift);\n if (bit1 === bit2) {\n const child = mergeLeaves(edit, shift + SHIFT, hash1, node1, hash2, node2);\n return new IndexedNode(edit, bit1, [child]);\n }\n const bitmap = bit1 | bit2;\n const children = bit1 >>> 0 < bit2 >>> 0 ? [node1, node2] : [node2, node1];\n return new IndexedNode(edit, bitmap, children);\n}\nconst hashMapSeed = /*#__PURE__*/Hash.string(\"HashMap\");\nconst entryHash = (key, value) => Hash.combine(Hash.hash(key), Hash.hash(value));\nconst childrenHash = children => {\n let h = 0;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (child) h ^= child.subtreeHash();\n }\n return h;\n};\n/** @internal */\nclass Node {\n canEdit(edit) {\n return this.edit === edit;\n }\n subtreeHash() {\n let h = this._hash;\n if (h === undefined) {\n const seen = backEdges;\n h = this.computeHash();\n // Cycle hashes depend on the entry point.\n if (seen === backEdges) {\n this._hash = h;\n }\n }\n return h;\n }\n}\n/** @internal */\nclass EmptyNode extends Node {\n _tag = \"EmptyNode\";\n edit = 0;\n get size() {\n return 0;\n }\n get(_shift, _hash, _key) {\n return Option.none();\n }\n has(_shift, _hash, _key) {\n return false;\n }\n set(edit, _shift, hash, key, value, added) {\n added.value = true;\n return new LeafNode(edit, hash, key, value);\n }\n remove(_edit, _shift, _hash, _key, _removed) {\n return this;\n }\n canEdit(_edit) {\n return false;\n }\n computeHash() {\n return 0;\n }\n}\n/** @internal */\nclass LeafNode extends Node {\n _tag = \"LeafNode\";\n edit;\n hash;\n key;\n value;\n constructor(edit, hash, key, value) {\n super();\n this.edit = edit;\n this.hash = hash;\n this.key = key;\n this.value = value;\n }\n get size() {\n return 1;\n }\n get(_shift, hash, key) {\n if (this.hash === hash && Equal_.equals(this.key, key)) {\n return Option.some(this.value);\n }\n return Option.none();\n }\n has(_shift, hash, key) {\n return this.hash === hash && Equal_.equals(this.key, key);\n }\n set(edit, shift, hash, key, value, added) {\n if (this.canEdit(edit)) this._hash = undefined;\n if (this.hash === hash && Equal_.equals(this.key, key)) {\n if (Object.is(this.value, value)) {\n return this;\n }\n // Can mutate in-place if edit matches\n if (this.canEdit(edit)) {\n this.value = value;\n return this;\n }\n return new LeafNode(edit, hash, key, value);\n }\n added.value = true;\n if (this.hash === hash) {\n return new CollisionNode(edit, hash, [[this.key, this.value], [key, value]]);\n }\n const newBit = bitpos(hash, shift);\n const existingBit = bitpos(this.hash, shift);\n if (newBit === existingBit) {\n return new IndexedNode(edit, newBit, [this.set(edit, shift + SHIFT, hash, key, value, added)]);\n }\n const bitmap = newBit | existingBit;\n const nodes = newBit >>> 0 < existingBit >>> 0 ? [new LeafNode(edit, hash, key, value), this] : [this, new LeafNode(edit, hash, key, value)];\n return new IndexedNode(edit, bitmap, nodes);\n }\n remove(_edit, _shift, hash, key, removed) {\n if (this.hash === hash && Equal_.equals(this.key, key)) {\n removed.value = true;\n return undefined;\n }\n return this;\n }\n computeHash() {\n // `setHash` allows the stored hash to differ from `Hash.hash(key)`.\n return entryHash(this.key, this.value);\n }\n}\n/** @internal */\nclass CollisionNode extends Node {\n _tag = \"CollisionNode\";\n edit;\n hash;\n entries;\n constructor(edit, hash, entries) {\n super();\n this.edit = edit;\n this.hash = hash;\n this.entries = entries;\n }\n get size() {\n return this.entries.length;\n }\n get(_shift, hash, key) {\n if (this.hash !== hash) {\n return Option.none();\n }\n for (const [k, v] of this.entries) {\n if (Equal_.equals(k, key)) {\n return Option.some(v);\n }\n }\n return Option.none();\n }\n has(_shift, hash, key) {\n if (this.hash !== hash) {\n return false;\n }\n for (const [k] of this.entries) {\n if (Equal_.equals(k, key)) {\n return true;\n }\n }\n return false;\n }\n set(edit, shift, hash, key, value, added) {\n if (this.canEdit(edit)) this._hash = undefined;\n if (this.hash !== hash) {\n added.value = true;\n // Need to merge this collision node with new leaf\n return mergeLeaves(edit, shift, this.hash, this, hash, new LeafNode(edit, hash, key, value));\n }\n // Same hash - update or add to collision list\n for (let i = 0; i < this.entries.length; i++) {\n if (Equal_.equals(this.entries[i][0], key)) {\n if (Object.is(this.entries[i][1], value)) {\n return this;\n }\n if (this.canEdit(edit)) {\n this.entries[i] = [key, value];\n return this;\n }\n const newEntries = [...this.entries];\n newEntries[i] = [key, value];\n return new CollisionNode(edit, this.hash, newEntries);\n }\n }\n added.value = true;\n if (this.canEdit(edit)) {\n this.entries.push([key, value]);\n return this;\n }\n return new CollisionNode(edit, this.hash, [...this.entries, [key, value]]);\n }\n remove(edit, _shift, hash, key, removed) {\n if (this.canEdit(edit)) this._hash = undefined;\n if (this.hash !== hash) {\n return this;\n }\n const idx = this.entries.findIndex(([k]) => Equal_.equals(k, key));\n if (idx === -1) {\n return this;\n }\n removed.value = true;\n if (this.entries.length === 1) {\n return undefined;\n }\n if (this.entries.length === 2) {\n const remaining = this.entries[idx === 0 ? 1 : 0];\n return new LeafNode(edit, this.hash, remaining[0], remaining[1]);\n }\n if (this.canEdit(edit)) {\n this.entries.splice(idx, 1);\n return this;\n }\n const newEntries = [...this.entries];\n newEntries.splice(idx, 1);\n return new CollisionNode(edit, this.hash, newEntries);\n }\n computeHash() {\n let h = 0;\n const entries = this.entries;\n for (let i = 0; i < entries.length; i++) {\n h ^= entryHash(entries[i][0], entries[i][1]);\n }\n return h;\n }\n}\n/** @internal */\nclass IndexedNode extends Node {\n _tag = \"IndexedNode\";\n edit;\n _size;\n bitmap;\n children;\n constructor(edit, bitmap, children) {\n super();\n this.edit = edit;\n this.bitmap = bitmap;\n this.children = children;\n }\n get size() {\n if (this._size === undefined) {\n this._size = this.children.reduce((acc, child) => acc + child.size, 0);\n }\n return this._size;\n }\n get(shift, hash, key) {\n const bit = bitpos(hash, shift);\n if ((this.bitmap & bit) === 0) {\n return Option.none();\n }\n const idx = index(this.bitmap, bit);\n return this.children[idx].get(shift + SHIFT, hash, key);\n }\n has(shift, hash, key) {\n const bit = bitpos(hash, shift);\n if ((this.bitmap & bit) === 0) {\n return false;\n }\n const idx = index(this.bitmap, bit);\n return this.children[idx].has(shift + SHIFT, hash, key);\n }\n set(edit, shift, hash, key, value, added) {\n if (this.canEdit(edit)) this._hash = undefined;\n const bit = bitpos(hash, shift);\n const idx = index(this.bitmap, bit);\n if ((this.bitmap & bit) !== 0) {\n // Existing child - update it\n const child = this.children[idx];\n const newChild = child.set(edit, shift + SHIFT, hash, key, value, added);\n if (child === newChild) {\n return this;\n }\n if (this.canEdit(edit)) {\n this.children[idx] = newChild;\n return this;\n }\n const newChildren = [...this.children];\n newChildren[idx] = newChild;\n return new IndexedNode(edit, this.bitmap, newChildren);\n } else {\n // New child - insert\n added.value = true;\n const newChild = new LeafNode(edit, hash, key, value);\n const newBitmap = this.bitmap | bit;\n if (this.canEdit(edit)) {\n this.children.splice(idx, 0, newChild);\n this.bitmap = newBitmap;\n this._size = undefined;\n if (this.children.length > MAX_INDEX_NODE) {\n return this.expand(edit, newBitmap, this.children);\n }\n return this;\n }\n const newChildren = [...this.children];\n newChildren.splice(idx, 0, newChild);\n if (newChildren.length > MAX_INDEX_NODE) {\n return this.expand(edit, newBitmap, newChildren);\n }\n return new IndexedNode(edit, newBitmap, newChildren);\n }\n }\n remove(edit, shift, hash, key, removed) {\n if (this.canEdit(edit)) this._hash = undefined;\n const bit = bitpos(hash, shift);\n if ((this.bitmap & bit) === 0) {\n return this;\n }\n const idx = index(this.bitmap, bit);\n const child = this.children[idx];\n const newChild = child.remove(edit, shift + SHIFT, hash, key, removed);\n if (!removed.value) {\n return this;\n }\n if (newChild === undefined) {\n const newBitmap = this.bitmap ^ bit;\n if (newBitmap === 0) {\n return undefined;\n }\n if (this.children.length === 2) {\n const remaining = this.children[idx === 0 ? 1 : 0];\n if (remaining._tag === \"LeafNode\") {\n return remaining;\n }\n }\n if (this.canEdit(edit)) {\n this.children.splice(idx, 1);\n this.bitmap = newBitmap;\n this._size = undefined;\n return this;\n }\n const newChildren = [...this.children];\n newChildren.splice(idx, 1);\n return new IndexedNode(edit, newBitmap, newChildren);\n }\n if (child === newChild) {\n return this;\n }\n if (this.canEdit(edit)) {\n this.children[idx] = newChild;\n return this;\n }\n const newChildren = [...this.children];\n newChildren[idx] = newChild;\n return new IndexedNode(edit, this.bitmap, newChildren);\n }\n expand(edit, bitmap, children) {\n const nodes = new globalThis.Array(BUCKET_SIZE);\n let j = 0;\n for (let i = 0; i < BUCKET_SIZE; i++) {\n if ((bitmap & 1 << i) !== 0) {\n nodes[i] = children[j++];\n }\n }\n return new ArrayNode(edit, children.length, nodes);\n }\n computeHash() {\n return childrenHash(this.children);\n }\n}\n/** @internal */\nclass ArrayNode extends Node {\n _tag = \"ArrayNode\";\n edit;\n _size;\n count;\n children;\n constructor(edit, count, children) {\n super();\n this.edit = edit;\n this.count = count;\n this.children = children;\n }\n get size() {\n if (this._size === undefined) {\n this._size = this.children.reduce((acc, child) => acc + (child?.size ?? 0), 0);\n }\n return this._size;\n }\n get(shift, hash, key) {\n const idx = mask(hash, shift);\n const child = this.children[idx];\n return child ? child.get(shift + SHIFT, hash, key) : Option.none();\n }\n has(shift, hash, key) {\n const idx = mask(hash, shift);\n const child = this.children[idx];\n return child ? child.has(shift + SHIFT, hash, key) : false;\n }\n set(edit, shift, hash, key, value, added) {\n if (this.canEdit(edit)) this._hash = undefined;\n const idx = mask(hash, shift);\n const child = this.children[idx];\n if (child) {\n const newChild = child.set(edit, shift + SHIFT, hash, key, value, added);\n if (child === newChild) {\n return this;\n }\n if (this.canEdit(edit)) {\n this.children[idx] = newChild;\n return this;\n }\n const newChildren = [...this.children];\n newChildren[idx] = newChild;\n return new ArrayNode(edit, this.count, newChildren);\n } else {\n added.value = true;\n const newChild = new LeafNode(edit, hash, key, value);\n if (this.canEdit(edit)) {\n this.children[idx] = newChild;\n this.count++;\n this._size = undefined;\n return this;\n }\n const newChildren = [...this.children];\n newChildren[idx] = newChild;\n return new ArrayNode(edit, this.count + 1, newChildren);\n }\n }\n remove(edit, shift, hash, key, removed) {\n if (this.canEdit(edit)) this._hash = undefined;\n const idx = mask(hash, shift);\n const child = this.children[idx];\n if (!child) {\n return this;\n }\n const newChild = child.remove(edit, shift + SHIFT, hash, key, removed);\n if (!removed.value) {\n return this;\n }\n const newCount = this.count - (newChild ? 0 : 1);\n if (newCount < MIN_ARRAY_NODE) {\n return this.pack(edit, idx, newChild);\n }\n if (child === newChild) {\n return this;\n }\n if (this.canEdit(edit)) {\n this.children[idx] = newChild;\n if (!newChild) {\n this.count = newCount;\n }\n this._size = undefined;\n return this;\n }\n const newChildren = [...this.children];\n newChildren[idx] = newChild;\n return new ArrayNode(edit, newCount, newChildren);\n }\n pack(edit, excludeIdx, newChild) {\n const children = [];\n let bitmap = 0;\n let bit = 1;\n for (let i = 0; i < this.children.length; i++) {\n const child = i === excludeIdx ? newChild : this.children[i];\n if (child) {\n children.push(child);\n bitmap |= bit;\n }\n bit <<= 1;\n }\n return new IndexedNode(edit, bitmap, children);\n }\n computeHash() {\n return childrenHash(this.children);\n }\n}\nclass HashMapIterator {\n stack;\n project;\n entries = [];\n index = 0;\n constructor(root, project) {\n this.stack = [root];\n this.project = project;\n }\n next() {\n while (true) {\n if (this.index < this.entries.length) {\n const entry = this.entries[this.index++];\n return {\n done: false,\n value: this.project(entry[0], entry[1])\n };\n }\n if (this.stack.length === 0) {\n return {\n done: true,\n value: undefined\n };\n }\n const node = this.stack.pop();\n switch (node._tag) {\n case \"LeafNode\":\n {\n const leaf = node;\n return {\n done: false,\n value: this.project(leaf.key, leaf.value)\n };\n }\n case \"CollisionNode\":\n {\n this.entries = node.entries;\n this.index = 0;\n break;\n }\n case \"IndexedNode\":\n case \"ArrayNode\":\n {\n const children = node.children;\n for (let i = children.length - 1; i >= 0; i--) {\n const child = children[i];\n if (child) this.stack.push(child);\n }\n }\n }\n }\n }\n [Symbol.iterator]() {\n return this;\n }\n}\nconst toEntry = (key, value) => [key, value];\nconst toValue = (_, value) => value;\n/** @internal */\nclass HashMapImpl {\n [HashMapTypeId] = HashMapTypeId;\n _editable;\n _edit;\n _root;\n _size;\n constructor(editable, edit, root, size) {\n this._editable = editable;\n this._edit = edit;\n this._root = root;\n this._size = size;\n }\n get size() {\n return this._size;\n }\n [Symbol.iterator]() {\n return new HashMapIterator(this._root, toEntry);\n }\n [Equal_.symbol](that) {\n if (isHashMap(that)) {\n const thatImpl = that;\n if (this.size !== thatImpl.size) {\n return false;\n }\n for (const [key, value] of this) {\n const otherValue = pipe(that, get(key));\n if (Option.isNone(otherValue) || !Equal_.equals(value, otherValue.value)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n [Hash.symbol]() {\n return Hash.optimize(hashMapSeed ^ this._root.subtreeHash());\n }\n [NodeInspectSymbol]() {\n return toJson(this);\n }\n toString() {\n return `HashMap(${format(Array.from(this))})`;\n }\n toJSON() {\n return {\n _id: \"HashMap\",\n values: Array.from(this).map(([k, v]) => [toJson(k), toJson(v)])\n };\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nconst emptyNode = /*#__PURE__*/new EmptyNode();\n/** @internal */\nexport const isHashMap = u => hasProperty(u, HashMapTypeId);\n/** @internal */\nexport const empty = () => new HashMapImpl(false, 0, emptyNode, 0);\n/** @internal */\nexport const make = (...entries) => fromIterable(entries);\n/** @internal */\nexport const fromIterable = entries => {\n let root = emptyNode;\n let size = 0;\n const added = {\n value: false\n };\n for (const [key, value] of entries) {\n const hash = Hash.hash(key);\n added.value = false;\n root = root.set(NaN, 0, hash, key, value, added);\n if (added.value) {\n size++;\n }\n }\n return new HashMapImpl(false, 0, root, size);\n};\n/** @internal */\nexport const isEmpty = self => self.size === 0;\n/** @internal */\nexport const get = /*#__PURE__*/dual(2, (self, key) => {\n const impl = self;\n return impl._root.get(0, Hash.hash(key), key);\n});\n/** @internal */\nexport const getHash = /*#__PURE__*/dual(3, (self, key, hash) => {\n const impl = self;\n return impl._root.get(0, hash, key);\n});\n/** @internal */\nexport const getUnsafe = /*#__PURE__*/dual(2, (self, key) => {\n const result = get(self, key);\n if (Option.isSome(result)) {\n return result.value;\n }\n throw new Error(`HashMap.getUnsafe: key not found: ${key}`);\n});\n/** @internal */\nexport const has = /*#__PURE__*/dual(2, (self, key) => {\n const impl = self;\n return impl._root.has(0, Hash.hash(key), key);\n});\n/** @internal */\nexport const hasHash = /*#__PURE__*/dual(3, (self, key, hash) => {\n const impl = self;\n return impl._root.has(0, hash, key);\n});\n/** @internal */\nexport const hasBy = /*#__PURE__*/dual(2, (self, predicate) => {\n for (const [key, value] of self) {\n if (predicate(value, key)) {\n return true;\n }\n }\n return false;\n});\nconst setHash = (self, key, hash, value) => {\n const impl = self;\n const added = {\n value: false\n };\n // Pass edit context: use current edit if editable, otherwise NaN (never matches any edit)\n const edit = impl._editable ? impl._edit : NaN;\n const newRoot = impl._root.set(edit, 0, hash, key, value, added);\n if (impl._editable) {\n // In-place mutation\n impl._root = newRoot;\n if (added.value) {\n impl._size++;\n }\n return self;\n }\n // Immutable: create new instance if changed\n if (impl._root === newRoot) {\n return self;\n }\n return new HashMapImpl(false, impl._edit, newRoot, impl._size + (added.value ? 1 : 0));\n};\n/** @internal */\nexport const set = /*#__PURE__*/dual(3, (self, key, value) => {\n return setHash(self, key, Hash.hash(key), value);\n});\n/** @internal */\nexport const keys = self => new HashMapIterator(self._root, identity);\n/** @internal */\nexport const values = self => new HashMapIterator(self._root, toValue);\n/** @internal */\nexport const entries = self => self[Symbol.iterator]();\n/** @internal */\nexport const size = self => self.size;\n/** @internal */\nexport const beginMutation = self => {\n const impl = self;\n return new HashMapImpl(true, impl._edit + 1, impl._root, impl._size);\n};\n/** @internal */\nexport const endMutation = self => {\n const impl = self;\n impl._editable = false;\n return self;\n};\n/** @internal */\nexport const mutate = /*#__PURE__*/dual(2, (self, f) => {\n const mutable = beginMutation(self);\n f(mutable);\n return endMutation(mutable);\n});\n/** @internal */\nexport const modifyAt = /*#__PURE__*/dual(3, (self, key, f) => {\n const current = get(self, key);\n const updated = f(current);\n if (Option.isNone(updated)) {\n return has(self, key) ? remove(self, key) : self;\n }\n return set(self, key, updated.value);\n});\n/** @internal */\nexport const modifyHash = /*#__PURE__*/dual(4, (self, key, hash, f) => {\n const current = getHash(self, key, hash);\n const updated = f(current);\n if (Option.isNone(updated)) {\n return hasHash(self, key, hash) ? removeHash(self, key, hash) : self;\n }\n return setHash(self, key, hash, updated.value);\n});\n/** @internal */\nexport const modify = /*#__PURE__*/dual(3, (self, key, f) => {\n return modifyAt(self, key, Option.map(f));\n});\n/** @internal */\nexport const union = /*#__PURE__*/dual(2, (self, that) => {\n let result = self;\n for (const [key, value] of that) {\n result = set(result, key, value);\n }\n return result;\n});\nconst removeHash = (self, key, hash) => {\n const impl = self;\n const removed = {\n value: false\n };\n const edit = impl._editable ? impl._edit : NaN;\n const newRoot = impl._root.remove(edit, 0, hash, key, removed);\n if (!removed.value) {\n return self;\n }\n if (impl._editable) {\n impl._root = newRoot ?? emptyNode;\n impl._size--;\n return self;\n }\n if (newRoot === undefined) {\n return empty();\n }\n return new HashMapImpl(false, impl._edit, newRoot, impl._size - 1);\n};\n/** @internal */\nexport const remove = /*#__PURE__*/dual(2, (self, key) => {\n return removeHash(self, key, Hash.hash(key));\n});\n/** @internal */\nexport const removeMany = /*#__PURE__*/dual(2, (self, keys) => {\n let result = self;\n for (const key of keys) {\n result = remove(result, key);\n }\n return result;\n});\n/** @internal */\nexport const setMany = /*#__PURE__*/dual(2, (self, entries) => {\n let result = self;\n for (const [key, value] of entries) {\n result = set(result, key, value);\n }\n return result;\n});\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => {\n let result = empty();\n for (const [key, value] of self) {\n result = set(result, key, f(value, key));\n }\n return result;\n});\n/** @internal */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => {\n let result = empty();\n for (const [key, value] of self) {\n result = union(result, f(value, key));\n }\n return result;\n});\n/** @internal */\nexport const forEach = /*#__PURE__*/dual(2, (self, f) => {\n for (const [key, value] of self) {\n f(value, key);\n }\n});\n/** @internal */\nexport const reduce = /*#__PURE__*/dual(3, (self, zero, f) => {\n let result = zero;\n for (const [key, value] of self) {\n result = f(result, value, key);\n }\n return result;\n});\n/** @internal */\nexport const filter = /*#__PURE__*/dual(2, (self, f) => {\n let result = empty();\n for (const [key, value] of self) {\n if (f(value, key)) {\n result = set(result, key, value);\n }\n }\n return result;\n});\n/** @internal */\nexport const compact = self => {\n let result = empty();\n for (const [key, value] of self) {\n if (Option.isSome(value)) {\n result = set(result, key, value.value);\n }\n }\n return result;\n};\n/** @internal */\nexport const filterMap = /*#__PURE__*/dual(2, (self, f) => {\n let result = empty();\n for (const [key, value] of self) {\n const mapped = f(value, key);\n if (Result.isSuccess(mapped)) {\n result = set(result, key, mapped.success);\n }\n }\n return result;\n});\n/** @internal */\nexport const findFirst = /*#__PURE__*/dual(2, (self, predicate) => {\n for (const [key, value] of self) {\n if (predicate(value, key)) {\n return Option.some([key, value]);\n }\n }\n return Option.none();\n});\n/** @internal */\nexport const some = /*#__PURE__*/dual(2, (self, predicate) => {\n for (const [key, value] of self) {\n if (predicate(value, key)) {\n return true;\n }\n }\n return false;\n});\n/** @internal */\nexport const every = /*#__PURE__*/dual(2, (self, predicate) => {\n for (const [key, value] of self) {\n if (!predicate(value, key)) {\n return false;\n }\n }\n return true;\n});\n//# sourceMappingURL=hashMap.js.map",
|
|
10
|
+
"/**\n * @since 2.0.0\n */\nimport * as Equal from \"../Equal.js\";\nimport { format } from \"../Formatter.js\";\nimport * as Hash from \"../Hash.js\";\nimport { NodeInspectSymbol, toJson } from \"../Inspectable.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport * as HashMap from \"./hashMap.js\";\n/** @internal */\nexport const HashSetTypeId = \"~effect/HashSet\";\nconst hashSetSeed = /*#__PURE__*/Hash.string(HashSetTypeId);\nconst HashSetProto = {\n [Hash.symbol]() {\n return Hash.optimize(Hash.combine(hashSetSeed, Hash.hash(keyMap(this))));\n },\n [Equal.symbol](that) {\n return isHashSet(that) && size(this) === size(that) && every(this, value => has(that, value));\n },\n [Symbol.iterator]() {\n return HashMap.keys(keyMap(this));\n },\n toString() {\n return `HashSet(${format(Array.from(this))})`;\n },\n toJSON() {\n return {\n _id: \"HashSet\",\n values: toJson(Array.from(this))\n };\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nconst makeImpl = keyMap => {\n const set = Object.create(HashSetProto);\n set[HashSetTypeId] = HashSetTypeId;\n set.keyMap = keyMap;\n return set;\n};\n/** @internal */\nexport const isHashSet = u => hasProperty(u, HashSetTypeId);\n/** @internal */\nexport const keyMap = self => self.keyMap;\n/** @internal */\nexport const empty = () => makeImpl(HashMap.empty());\n/** @internal */\nexport const make = (...values) => fromIterable(values);\n/** @internal */\nexport const fromIterable = values => {\n let map = HashMap.empty();\n for (const value of values) {\n map = HashMap.set(map, value, true);\n }\n return makeImpl(map);\n};\n/** @internal */\nexport const has = (self, value) => HashMap.has(keyMap(self), value);\n/** @internal */\nexport const add = (self, value) => {\n const map = keyMap(self);\n return HashMap.has(map, value) ? self : makeImpl(HashMap.set(map, value, true));\n};\n/** @internal */\nexport const remove = (self, value) => {\n const map = keyMap(self);\n return HashMap.has(map, value) ? makeImpl(HashMap.remove(map, value)) : self;\n};\n/** @internal */\nexport const size = self => HashMap.size(keyMap(self));\n/** @internal */\nexport const isEmpty = self => HashMap.isEmpty(keyMap(self));\n// Helper function for building new HashSets from iteration\nconst fromPredicate = (self, predicate) => {\n let result = HashMap.empty();\n for (const value of self) {\n if (predicate(value)) {\n result = HashMap.set(result, value, true);\n }\n }\n return makeImpl(result);\n};\n/** @internal */\nexport const union = (self, that) => {\n const map = keyMap(self);\n let result = map;\n for (const value of that) {\n result = HashMap.set(result, value, true);\n }\n return makeImpl(result);\n};\n/** @internal */\nexport const intersection = (self, that) => {\n let result = HashMap.empty();\n for (const value of self) {\n if (has(that, value)) {\n result = HashMap.set(result, value, true);\n }\n }\n return makeImpl(result);\n};\n/** @internal */\nexport const difference = (self, that) => fromPredicate(self, value => !has(that, value));\n/** @internal */\nexport const isSubset = (self, that) => {\n for (const value of self) {\n if (!has(that, value)) {\n return false;\n }\n }\n return true;\n};\n/** @internal */\nexport const map = (self, f) => {\n let result = HashMap.empty();\n for (const value of self) {\n result = HashMap.set(result, f(value), true);\n }\n return makeImpl(result);\n};\n/** @internal */\nexport const filter = (self, predicate) => fromPredicate(self, predicate);\n/** @internal */\nexport const some = (self, predicate) => {\n for (const value of self) {\n if (predicate(value)) {\n return true;\n }\n }\n return false;\n};\n/** @internal */\nexport const every = (self, predicate) => {\n for (const value of self) {\n if (!predicate(value)) {\n return false;\n }\n }\n return true;\n};\n/** @internal */\nexport const reduce = (self, zero, f) => {\n let result = zero;\n for (const value of self) {\n result = f(result, value);\n }\n return result;\n};\n//# sourceMappingURL=hashSet.js.map",
|
|
11
|
+
"/**\n * Stores unique values in an immutable hash set.\n *\n * A `HashSet<A>` contains at most one value for each equality class according\n * to Effect's `Equal` and `Hash` rules. Membership checks, additions, removals,\n * and set operations return new sets. This module also includes constructors,\n * union, intersection, difference, subset checks, mapping, filtering, and\n * reducing helpers.\n *\n * @stability stable\n * @since 2.0.0\n */\nimport * as Dual from \"./Function.js\";\nimport * as internal from \"./internal/hashSet.js\";\nconst TypeId = internal.HashSetTypeId;\n/**\n * Creates an empty HashSet.\n *\n * **Example** (Creating an empty HashSet)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * const set = HashSet.empty<string>()\n *\n * HashSet.size(set) // => 0\n * HashSet.isEmpty(set) // => true\n *\n * // Add some values\n * const withValues = HashSet.add(HashSet.add(set, \"hello\"), \"world\")\n * withValues // => HashSet.make(\"hello\", \"world\")\n * ```\n *\n * @stability stable\n * @category constructors\n * @since 2.0.0\n */\nexport const empty = internal.empty;\n/**\n * Creates a HashSet from a variable number of values.\n *\n * **Example** (Creating a HashSet from values)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * HashSet.make(\"apple\", \"banana\", \"cherry\") // => HashSet.make(\"apple\", \"banana\", \"cherry\")\n *\n * HashSet.make(1, 2, 3, 2, 1) // => HashSet.make(1, 2, 3)\n *\n * HashSet.make(\"hello\", 42, true) // => HashSet.make(\"hello\", 42, true)\n * ```\n *\n * @stability stable\n * @category constructors\n * @since 2.0.0\n */\nexport const make = internal.make;\n/**\n * Creates a HashSet from an iterable collection of values.\n *\n * **Example** (Creating a HashSet from an iterable)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * HashSet.fromIterable([\"a\", \"b\", \"c\", \"b\", \"a\"]) // => HashSet.make(\"a\", \"b\", \"c\")\n *\n * HashSet.fromIterable(new Set([1, 2, 3])) // => HashSet.make(1, 2, 3)\n *\n * HashSet.fromIterable(\"hello\") // => HashSet.make(\"h\", \"e\", \"l\", \"o\")\n * ```\n *\n * @stability stable\n * @category constructors\n * @since 2.0.0\n */\nexport const fromIterable = internal.fromIterable;\n/**\n * Checks whether a value is a HashSet.\n *\n * **Example** (Checking for a HashSet)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * const set = HashSet.make(1, 2, 3)\n * const array = [1, 2, 3]\n *\n * HashSet.isHashSet(set) // => true\n * HashSet.isHashSet(array) // => false\n * HashSet.isHashSet(null) // => false\n * ```\n *\n * @stability stable\n * @category guards\n * @since 2.0.0\n */\nexport const isHashSet = internal.isHashSet;\n/**\n * Adds a value to the HashSet, returning a new HashSet.\n *\n * **Example** (Adding values to a HashSet)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * const set = HashSet.make(\"a\", \"b\")\n * const withC = HashSet.add(set, \"c\")\n *\n * set // => HashSet.make(\"a\", \"b\")\n * withC // => HashSet.make(\"a\", \"b\", \"c\")\n * HashSet.has(withC, \"c\") // => true\n *\n * // Adding existing value has no effect\n * HashSet.add(set, \"a\") // => HashSet.make(\"a\", \"b\")\n * ```\n *\n * @stability stable\n * @category mutations\n * @since 2.0.0\n */\nexport const add = /*#__PURE__*/Dual.dual(2, internal.add);\n/**\n * Checks whether the HashSet contains the specified value.\n *\n * **Example** (Checking HashSet membership)\n *\n * ```ts import.meta.vitest\n * import { Equal, Hash, HashSet } from \"effect\"\n *\n * // Works with any type that implements Equal\n *\n * const set = HashSet.make(\"apple\", \"banana\", \"cherry\")\n *\n * HashSet.has(set, \"apple\") // => true\n * HashSet.has(set, \"grape\") // => false\n *\n * class Person implements Equal.Equal {\n * constructor(readonly name: string) {}\n *\n * [Equal.symbol](other: unknown) {\n * return other instanceof Person && this.name === other.name\n * }\n *\n * [Hash.symbol](): number {\n * return Hash.string(this.name)\n * }\n * }\n *\n * const people = HashSet.make(new Person(\"Alice\"), new Person(\"Bob\"))\n * HashSet.has(people, new Person(\"Alice\")) // => true\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 2.0.0\n */\nexport const has = /*#__PURE__*/Dual.dual(2, internal.has);\n/**\n * Removes a value from the HashSet, returning a new HashSet.\n *\n * **Example** (Removing values from a HashSet)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * const set = HashSet.make(\"a\", \"b\", \"c\")\n * const withoutB = HashSet.remove(set, \"b\")\n *\n * set // => HashSet.make(\"a\", \"b\", \"c\")\n * withoutB // => HashSet.make(\"a\", \"c\")\n * HashSet.has(withoutB, \"b\") // => false\n *\n * // Removing non-existent value has no effect\n * HashSet.remove(set, \"d\") // => HashSet.make(\"a\", \"b\", \"c\")\n * ```\n *\n * @stability stable\n * @category mutations\n * @since 2.0.0\n */\nexport const remove = /*#__PURE__*/Dual.dual(2, internal.remove);\n/**\n * Returns the number of values in the HashSet.\n *\n * **Example** (Getting the HashSet size)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * HashSet.size(HashSet.empty<string>()) // => 0\n *\n * HashSet.size(HashSet.make(\"a\", \"b\")) // => 2\n *\n * HashSet.size(HashSet.fromIterable([\"x\", \"y\", \"z\", \"x\", \"y\"])) // => 3\n * ```\n *\n * @stability stable\n * @category getters\n * @since 2.0.0\n */\nexport const size = internal.size;\n/**\n * Checks whether the HashSet is empty.\n *\n * **Example** (Checking whether a HashSet is empty)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * HashSet.isEmpty(HashSet.empty<string>()) // => true\n *\n * HashSet.isEmpty(HashSet.make(\"a\")) // => false\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 4.0.0\n */\nexport const isEmpty = internal.isEmpty;\n/**\n * Creates the union of two HashSets.\n *\n * **Example** (Combining HashSets)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * HashSet.union(HashSet.make(\"a\", \"b\"), HashSet.make(\"b\", \"c\")) // => HashSet.make(\"a\", \"b\", \"c\")\n * ```\n *\n * @stability stable\n * @category combinators\n * @since 2.0.0\n */\nexport const union = /*#__PURE__*/Dual.dual(2, internal.union);\n/**\n * Creates the intersection of two HashSets.\n *\n * **Example** (Finding common HashSet values)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * HashSet.intersection(HashSet.make(\"a\", \"b\", \"c\"), HashSet.make(\"b\", \"c\", \"d\")) // => HashSet.make(\"b\", \"c\")\n * ```\n *\n * @stability stable\n * @category combinators\n * @since 2.0.0\n */\nexport const intersection = /*#__PURE__*/Dual.dual(2, internal.intersection);\n/**\n * Creates the difference of two HashSets (elements in the first set that are not in the second).\n *\n * **Example** (Finding HashSet differences)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * HashSet.difference(HashSet.make(\"a\", \"b\", \"c\"), HashSet.make(\"b\", \"d\")) // => HashSet.make(\"a\", \"c\")\n * ```\n *\n * @stability stable\n * @category combinators\n * @since 2.0.0\n */\nexport const difference = /*#__PURE__*/Dual.dual(2, internal.difference);\n/**\n * Checks whether a HashSet is a subset of another HashSet.\n *\n * **Example** (Checking subset relationships)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * const small = HashSet.make(\"a\", \"b\")\n * const large = HashSet.make(\"a\", \"b\", \"c\", \"d\")\n * const other = HashSet.make(\"x\", \"y\")\n *\n * HashSet.isSubset(small, large) // => true\n * HashSet.isSubset(large, small) // => false\n * HashSet.isSubset(small, other) // => false\n * HashSet.isSubset(small, small) // => true\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 2.0.0\n */\nexport const isSubset = /*#__PURE__*/Dual.dual(2, internal.isSubset);\n/**\n * Maps each value in the HashSet using the provided function.\n *\n * **Example** (Mapping HashSet values)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * const numbers = HashSet.make(1, 2, 3)\n * const doubled = HashSet.map(numbers, (n) => n * 2)\n *\n * doubled // => HashSet.make(2, 4, 6)\n *\n * // Mapping can reduce size if function produces duplicates\n * const strings = HashSet.make(\"apple\", \"banana\", \"cherry\")\n * const lengths = HashSet.map(strings, (s) => s.length)\n * lengths // => HashSet.make(5, 6)\n * ```\n *\n * @stability stable\n * @category mapping\n * @since 2.0.0\n */\nexport const map = /*#__PURE__*/Dual.dual(2, internal.map);\n/**\n * Filters the HashSet keeping only values that satisfy the predicate.\n *\n * **Example** (Filtering HashSet values)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * HashSet.filter(HashSet.make(1, 2, 3, 4, 5, 6), (n) => n % 2 === 0) // => HashSet.make(2, 4, 6)\n * ```\n *\n * @stability stable\n * @category filtering\n * @since 2.0.0\n */\nexport const filter = /*#__PURE__*/Dual.dual(2, internal.filter);\n/**\n * Checks whether at least one value in the HashSet satisfies the predicate.\n *\n * **Example** (Testing whether some values match)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * const numbers = HashSet.make(1, 2, 3, 4, 5)\n *\n * HashSet.some(numbers, (n) => n > 3) // => true\n * HashSet.some(numbers, (n) => n > 10) // => false\n *\n * HashSet.some(HashSet.empty<number>(), (n) => n > 0) // => false\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 2.0.0\n */\nexport const some = /*#__PURE__*/Dual.dual(2, internal.some);\n/**\n * Checks whether all values in the HashSet satisfy the predicate.\n *\n * **Example** (Testing whether every value matches)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * const numbers = HashSet.make(2, 4, 6, 8)\n *\n * HashSet.every(numbers, (n) => n % 2 === 0) // => true\n * HashSet.every(numbers, (n) => n > 5) // => false\n *\n * HashSet.every(HashSet.empty<number>(), (n) => n > 0) // => true\n * ```\n *\n * @stability stable\n * @category predicates\n * @since 2.0.0\n */\nexport const every = /*#__PURE__*/Dual.dual(2, internal.every);\n/**\n * Reduces the HashSet to a single value by iterating through the values and applying an accumulator function.\n *\n * **Example** (Reducing HashSet values)\n *\n * ```ts import.meta.vitest\n * import { HashSet } from \"effect\"\n *\n * const numbers = HashSet.make(1, 2, 3, 4, 5)\n * HashSet.reduce(numbers, 0, (acc, n) => acc + n) // => 15\n * ```\n *\n * @stability stable\n * @category folding\n * @since 2.0.0\n */\nexport const reduce = /*#__PURE__*/Dual.dual(3, internal.reduce);\n//# sourceMappingURL=HashSet.js.map",
|
|
12
|
+
"/**\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 * @stability stable\n * @since 4.0.0\n */\nimport * as Arr from \"./Array.js\";\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 } 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 * @stability stable\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 * @stability stable\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 * @stability stable\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 * @stability stable\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 * @stability stable\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, path => f(transform(path))));\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 * @stability stable\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 * @stability stable\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 * @stability stable\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 * @stability stable\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 * @stability stable\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 * @stability stable\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 * @stability stable\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 * @stability stable\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 an explicit environment record.\n *\n * **When to use**\n *\n * Use when a restricted runtime cannot evaluate the automatic environment\n * detection performed by {@link fromEnv}, or whenever the environment record\n * must be supplied explicitly.\n *\n * **Details**\n *\n * `undefined` values are ignored. Path lookup and child discovery otherwise\n * use the same environment-variable semantics as {@link fromEnv}.\n *\n * Environment variable names are captured at construction time to establish\n * record keys and array lengths. The supplied record remains live for value\n * lookups, so updates to known paths are observed by later loads. Keys added\n * after construction can be loaded directly, but do not appear in captured\n * parent record keys or array lengths.\n *\n * Literal empty strings are treated as missing values by default. Pass\n * `{ preserveEmptyStrings: true }` to keep empty strings as explicit values.\n *\n * @see {@link fromEnv} – automatically reads the runtime environment\n *\n * @stability stable\n * @category constructors\n * @since 4.0.0\n */\nexport function fromEnvRecord(env, options) {\n const preserveEmptyStrings = options?.preserveEmptyStrings === true;\n const trie = buildEnvTrie(env);\n return make(path => Effect.succeed(nodeAtEnv(trie, env, path, preserveEmptyStrings)));\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.\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 fromEnvRecord} – for explicit records in restricted runtimes\n * @see {@link constantCase} – bridge camelCase keys to SCREAMING_SNAKE_CASE\n *\n * @stability stable\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 return fromEnvRecord(env, {\n preserveEmptyStrings: options?.preserveEmptyStrings\n });\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}\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(Arr.isCanonicalArrayIndex);\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 fromEnvRecord} 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 fromEnvRecord} – for explicit environment records\n * @see {@link fromEnv} – for raw environment variable access\n *\n * @stability stable\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 fromEnvRecord(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, new Set([configKey])).replace(/\\\\\\$/g, \"$\");\n }\n return newParsed;\n}\nfunction interpolate(envValue, parsed, seen) {\n const reference = /\\${?(\\w+)/g;\n let result = \"\";\n let cursor = 0;\n let match;\n while ((match = reference.exec(envValue)) != null) {\n if (match.index > 0 && envValue[match.index - 1] === \"\\\\\") continue;\n const [, name] = match;\n let end = reference.lastIndex;\n let defaultValue = \"\";\n if (envValue.startsWith(\":-\", end)) {\n end += 2;\n const start = end;\n let depth = 0;\n // Match default braces in the source, not in substituted values.\n for (; end < envValue.length; end++) {\n if (envValue.startsWith(\"${\", end)) {\n depth++;\n end++;\n } else if (envValue[end] === \"}\") {\n if (depth === 0) break;\n depth--;\n }\n }\n defaultValue = envValue.slice(start, end);\n }\n if (envValue[end] === \"}\") end++;\n // References already being expanded resolve as unset.\n const expanded = Object.hasOwn(parsed, name) && !seen.has(name) ? interpolate(parsed[name], parsed, new Set([...seen, name])) : \"\";\n result += envValue.slice(cursor, match.index) + (expanded || interpolate(defaultValue, parsed, seen));\n cursor = end;\n reference.lastIndex = end;\n }\n return result + envValue.slice(cursor);\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 * @stability unstable\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 * @stability unstable\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",
|
|
13
|
+
"import { dual, identity } from \"../Function.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport * as Result from \"../Result.js\";\n/** @internal */\nexport const TypeId = \"~effect/Match/Matcher\";\nconst TypeMatcherProto = {\n [TypeId]: {\n _input: identity,\n _filters: identity,\n _remaining: identity,\n _result: identity,\n _return: identity,\n _args: identity\n },\n _tag: \"TypeMatcher\",\n add(_case) {\n return makeTypeMatcher(this.select, [...this.cases, _case]);\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nfunction makeTypeMatcher(select, cases) {\n const matcher = Object.create(TypeMatcherProto);\n matcher.select = select;\n matcher.cases = cases;\n return matcher;\n}\nconst ValueMatcherProto = {\n [TypeId]: {\n _input: identity,\n _filters: identity,\n _result: identity,\n _return: identity,\n _flavor: identity\n },\n _tag: \"ValueMatcher\",\n add(_case) {\n if (Result.isSuccess(this.value)) {\n return this;\n }\n if (_case._tag === \"When\" && _case.guard(this.provided) === true) {\n return makeValueMatcher(this.provided, Result.succeed(_case.evaluate(this.provided)));\n } else if (_case._tag === \"Not\" && _case.guard(this.provided) === false) {\n return makeValueMatcher(this.provided, Result.succeed(_case.evaluate(this.provided)));\n }\n return this;\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nfunction makeValueMatcher(provided, value) {\n const matcher = Object.create(ValueMatcherProto);\n matcher.provided = provided;\n matcher.value = value;\n return matcher;\n}\nconst makeWhen = (guard, evaluate) => ({\n _tag: \"When\",\n guard,\n evaluate\n});\nconst makeNot = (guard, evaluate) => ({\n _tag: \"Not\",\n guard,\n evaluate\n});\nconst makePredicate = pattern => {\n if (typeof pattern === \"function\") {\n return pattern;\n } else if (Array.isArray(pattern)) {\n const predicates = pattern.map(makePredicate);\n const len = predicates.length;\n return u => {\n if (!Array.isArray(u) || u.length < len) {\n return false;\n }\n for (let i = 0; i < len; i++) {\n if (predicates[i](u[i]) === false) {\n return false;\n }\n }\n return true;\n };\n } else if (pattern !== null && typeof pattern === \"object\") {\n const keysAndPredicates = Reflect.ownKeys(pattern).map(key => [key, makePredicate(pattern[key])]);\n const len = keysAndPredicates.length;\n return u => {\n if (typeof u !== \"object\" || u === null) {\n return false;\n }\n for (let i = 0; i < len; i++) {\n const [key, predicate] = keysAndPredicates[i];\n if (!(key in u) || predicate(u[key]) === false) {\n return false;\n }\n }\n return true;\n };\n }\n return u => u === pattern;\n};\nconst makeOrPredicate = patterns => {\n const predicates = patterns.map(makePredicate);\n const len = predicates.length;\n return u => {\n for (let i = 0; i < len; i++) {\n if (predicates[i](u) === true) {\n return true;\n }\n }\n return false;\n };\n};\nconst makeAndPredicate = patterns => {\n const predicates = patterns.map(makePredicate);\n const len = predicates.length;\n return u => {\n for (let i = 0; i < len; i++) {\n if (predicates[i](u) === false) {\n return false;\n }\n }\n return true;\n };\n};\n/** @internal */\nexport const type = () => makeTypeMatcher(identity, []);\n/** @internal */\nexport const fn = select => makeTypeMatcher(select, []);\n/** @internal */\nexport const value = i => makeValueMatcher(i, Result.fail(i));\n/** @internal */\nexport const valueTags = /*#__PURE__*/dual(2, (input, fields) => {\n const match = tagsExhaustive(fields)(makeTypeMatcher(identity, []));\n return match(input);\n});\n/** @internal */\nexport const typeTags = () => fields => {\n const match = tagsExhaustive(fields)(makeTypeMatcher(identity, []));\n return input => match(input);\n};\n/** @internal */\nexport const withReturnType = () => self => self;\n/** @internal */\nexport const when = (pattern, f) => self => self.add(makeWhen(makePredicate(pattern), f));\n/** @internal */\nexport const whenOr = (...args) => self => {\n const onMatch = args[args.length - 1];\n const patterns = args.slice(0, -1);\n return self.add(makeWhen(makeOrPredicate(patterns), onMatch));\n};\n/** @internal */\nexport const whenAnd = (...args) => self => {\n const onMatch = args[args.length - 1];\n const patterns = args.slice(0, -1);\n return self.add(makeWhen(makeAndPredicate(patterns), onMatch));\n};\n/** @internal */\nexport const discriminator = field => (...pattern) => {\n const f = pattern[pattern.length - 1];\n const values = pattern.slice(0, -1);\n const pred = values.length === 1 ? _ => _ != null && _[field] === values[0] : _ => _ != null && values.includes(_[field]);\n return self => self.add(makeWhen(pred, f));\n};\n/** @internal */\nexport const discriminatorStartsWith = field => (pattern, f) => {\n const pred = _ => _ != null && typeof _[field] === \"string\" && _[field].startsWith(pattern);\n return self => self.add(makeWhen(pred, f));\n};\n/** @internal */\nexport const discriminators = field => fields => {\n const predicate = makeWhen(arg => arg != null && Object.hasOwn(fields, arg[field]), data => fields[data[field]](data));\n return self => self.add(predicate);\n};\n/** @internal */\nexport const discriminatorsExhaustive = field => fields => {\n const addCases = discriminators(field)(fields);\n return matcher => exhaustive(addCases(matcher));\n};\n/** @internal */\nexport const tag = /*#__PURE__*/discriminator(\"_tag\");\n/** @internal */\nexport const tagStartsWith = /*#__PURE__*/discriminatorStartsWith(\"_tag\");\n/** @internal */\nexport const tags = /*#__PURE__*/discriminators(\"_tag\");\n/** @internal */\nexport const tagsExhaustive = /*#__PURE__*/discriminatorsExhaustive(\"_tag\");\n/** @internal */\nexport const literals = fields => {\n const predicate = makeWhen(arg => (typeof arg === \"string\" || typeof arg === \"number\") && Object.hasOwn(fields, arg) && fields[arg] !== undefined, data => fields[data](data));\n return self => self.add(predicate);\n};\n/** @internal */\nexport const literalsExhaustive = fields => {\n const addCases = literals(fields);\n return matcher => exhaustive(addCases(matcher));\n};\n/** @internal */\nexport const not = (pattern, f) => self => self.add(makeNot(makePredicate(pattern), f));\n/** @internal */\nexport const nonEmptyString = u => typeof u === \"string\" && u.length > 0;\n/** @internal */\nexport const is = (...literals) => {\n const len = literals.length;\n return u => {\n for (let i = 0; i < len; i++) {\n if (u === literals[i]) {\n return true;\n }\n }\n return false;\n };\n};\n/** @internal */\nexport const any = () => true;\n/** @internal */\nexport const defined = u => u !== undefined && u !== null;\n/** @internal */\nexport const instanceOf = constructor => u => u instanceof constructor;\n/** @internal */\nexport const orElse = f => self => {\n const toResult = result(self);\n if (Result.isResult(toResult)) {\n return toResult._tag === \"Success\" ? toResult.success : f(toResult.failure);\n }\n // @ts-expect-error\n return (...args) => {\n const a = toResult(...args);\n return Result.isSuccess(a) ? a.success : f(a.failure, ...args);\n };\n};\n/** @internal */\nexport const orElseAbsurd = self => orElse(() => {\n throw new Error(\"effect/Match/orElseAbsurd: absurd\");\n})(self);\n/** @internal */\nexport const result = self => {\n if (self._tag === \"ValueMatcher\") {\n return self.value;\n }\n const len = self.cases.length;\n if (len === 1) {\n const _case = self.cases[0];\n return (...args) => {\n const input = self.select(...args);\n if (_case._tag === \"When\" && _case.guard(input) === true) {\n return Result.succeed(_case.evaluate(input, ...args));\n } else if (_case._tag === \"Not\" && _case.guard(input) === false) {\n return Result.succeed(_case.evaluate(input, ...args));\n }\n return Result.fail(input);\n };\n }\n return (...args) => {\n const input = self.select(...args);\n for (let i = 0; i < len; i++) {\n const _case = self.cases[i];\n if (_case._tag === \"When\" && _case.guard(input) === true) {\n return Result.succeed(_case.evaluate(input, ...args));\n } else if (_case._tag === \"Not\" && _case.guard(input) === false) {\n return Result.succeed(_case.evaluate(input, ...args));\n }\n }\n return Result.fail(input);\n };\n};\n/** @internal */\nexport const option = self => {\n const toResult = result(self);\n if (Result.isResult(toResult)) {\n return Result.match(toResult, {\n onFailure: () => Option.none(),\n onSuccess: Option.some\n });\n }\n return (...args) => Result.match(toResult(...args), {\n onFailure: () => Option.none(),\n onSuccess: Option.some\n });\n};\nconst getExhaustiveAbsurdErrorMessage = \"effect/match/Match/exhaustive: absurd\";\n/** @internal */\nexport const exhaustive = self => {\n const toResult = result(self);\n if (Result.isResult(toResult)) {\n if (Result.isSuccess(toResult)) {\n return toResult.success;\n }\n throw new Error(getExhaustiveAbsurdErrorMessage);\n }\n return (...args) => {\n // @ts-expect-error\n const result = toResult(...args);\n if (Result.isSuccess(result)) {\n return result.success;\n }\n throw new Error(getExhaustiveAbsurdErrorMessage);\n };\n};\n//# sourceMappingURL=matcher.js.map",
|
|
14
|
+
"/**\n * Builds pattern matchers for TypeScript values.\n *\n * `Match` lets you add ordered cases and then finish them with a result,\n * fallback, `Option`, or exhaustive check. Use `Match.type` to define a\n * reusable matcher for a type, or `Match.value` to match one value immediately.\n * Cases can match literal values, predicates, object shapes, tags, negated\n * patterns, and common checks such as strings, numbers, records, and class\n * instances.\n *\n * @stability stable\n * @since 4.0.0\n */\nimport * as internal from \"./internal/matcher.js\";\nimport * as Predicate from \"./Predicate.js\";\nconst TypeId = internal.TypeId;\n/**\n * Creates a matcher for a specific type.\n *\n * **When to use**\n *\n * Use to build a reusable matcher function for values of a known input type.\n *\n * **Details**\n *\n * This function defines a `Matcher` that operates on a given type, allowing you\n * to specify conditions for handling different cases. Once the matcher is\n * created, you can use pattern-matching functions like {@link when} to define\n * how different values should be processed.\n *\n * **Example** (Matching Numbers and Strings)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * // Create a matcher for values that are either strings or numbers\n * //\n * // ┌─── (u: string | number) => string\n * // ▼\n * const match = Match.type<string | number>().pipe(\n * // Match when the value is a number\n * Match.when(Match.number, (n) => `number: ${n}`),\n * // Match when the value is a string\n * Match.when(Match.string, (s) => `string: ${s}`),\n * // Ensure all possible cases are handled\n * Match.exhaustive\n * )\n *\n * match(0) // => \"number: 0\"\n *\n * match(\"hello\") // => \"string: hello\"\n * ```\n *\n * @see {@link value} for creating a matcher from a specific value.\n *\n * @stability stable\n * @category constructors\n * @since 4.0.0\n */\nexport const type = internal.type;\n/**\n * Creates a reusable matcher from a function that selects the value to match.\n *\n * **Details**\n *\n * The compiled matcher keeps the selector's original argument list. Case\n * handlers receive the narrowed selected value followed by those arguments.\n *\n * **Example** (Creating a reusable matcher)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const format = Match.fn((prefix: string, value: \"a\" | \"b\") => value).pipe(\n * Match.when(\"a\", (_value, prefix) => `${prefix}: A`),\n * Match.when(\"b\", (_value, prefix) => `${prefix}: B`),\n * Match.exhaustive\n * )\n *\n * format(\"status\", \"a\") // => \"status: A\"\n * ```\n *\n * @stability stable\n * @category constructors\n * @since 4.0.0\n */\nexport const fn = internal.fn;\n/**\n * Creates a matcher from a specific value.\n *\n * **When to use**\n *\n * Use to match one concrete input immediately.\n *\n * **Details**\n *\n * This function allows you to define a `Matcher` directly from a given value,\n * rather than from a type. This is useful when working with known values,\n * enabling structured pattern matching on objects, primitives, or any data\n * structure.\n *\n * Once the matcher is created, you can use pattern-matching functions like\n * {@link when} to define how different cases should be handled.\n *\n * **Example** (Matching an Object by Property)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const input = { name: \"John\", age: 30 }\n *\n * // Create a matcher for the specific object\n * const result = Match.value(input).pipe(\n * // Match when the 'name' property is \"John\"\n * Match.when(\n * { name: \"John\" },\n * (user) => `${user.name} is ${user.age} years old`\n * ),\n * // Provide a fallback if no match is found\n * Match.orElse(() => \"Oh, not John\")\n * )\n *\n * result // => \"John is 30 years old\"\n * ```\n *\n * @see {@link type} for creating a matcher from a specific type.\n *\n * @stability stable\n * @category constructors\n * @since 4.0.0\n */\nexport const value = internal.value;\n/**\n * Creates a match function for a specific value with discriminated union handling.\n *\n * **Details**\n *\n * This function provides a convenient way to pattern match on discriminated unions\n * by providing an object that maps each `_tag` value to its corresponding handler.\n * It's similar to a switch statement but with better type safety and exhaustiveness checking.\n *\n * **Example** (Matching value tags)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * type Status = { readonly _tag: \"Success\"; readonly data: string }\n *\n * const success: Status = { _tag: \"Success\", data: \"Hello\" }\n *\n * // Simple valueTags usage\n * const message = Match.valueTags(success, {\n * Success: (result) => `Success: ${result.data}`\n * })\n *\n * message // => \"Success: Hello\"\n * ```\n *\n * @stability stable\n * @category constructors\n * @since 4.0.0\n */\nexport const valueTags = internal.valueTags;\n/**\n * Creates a type-safe match function for discriminated unions based on `_tag` field.\n *\n * **Details**\n *\n * This function allows you to define exhaustive pattern matching for discriminated unions\n * by providing handlers for each possible `_tag` value. It ensures type safety and\n * can optionally enforce a specific return type across all branches.\n *\n * **Example** (Matching type tags)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * type Result =\n * | { readonly _tag: \"Success\"; readonly data: string }\n * | { readonly _tag: \"Error\"; readonly message: string }\n * | { readonly _tag: \"Loading\" }\n *\n * // Create a matcher with specific return type\n * const formatResult = Match.typeTags<Result, string>()({\n * Success: (result) => `Data: ${result.data}`,\n * Error: (result) => `Error: ${result.message}`,\n * Loading: () => \"Loading...\"\n * })\n *\n * formatResult({ _tag: \"Success\", data: \"Hello World\" }) // => \"Data: Hello World\"\n *\n * formatResult({ _tag: \"Error\", message: \"Network failed\" }) // => \"Error: Network failed\"\n *\n * // Create a matcher with inferred return type\n * const processResult = Match.typeTags<Result>()({\n * Success: (result) => ({ type: \"ok\", value: result.data }),\n * Error: (result) => ({ type: \"error\", error: result.message }),\n * Loading: () => ({ type: \"pending\" })\n * })\n *\n * processResult({ _tag: \"Loading\" }) // => { type: \"pending\" }\n * ```\n *\n * @stability stable\n * @category constructors\n * @since 4.0.0\n */\nexport const typeTags = internal.typeTags;\n/**\n * Ensures that all branches of a matcher return a specific type.\n *\n * **Details**\n *\n * This function enforces a consistent return type across all pattern-matching\n * branches. By specifying a return type, TypeScript will check that every\n * matching condition produces a value of the expected type.\n *\n * **Important:** This function must be the first step in the matcher pipeline.\n * If used later, TypeScript will not enforce type consistency correctly.\n *\n * **Example** (Validating return type consistency)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const match = Match.type<{ a: number } | { b: string }>().pipe(\n * // Ensure all branches return a string\n * Match.withReturnType<string>(),\n * // ❌ Type error: 'number' is not assignable to type 'string'\n * // @ts-expect-error\n * Match.when({ a: Match.number }, (_) => _.a),\n * // ✅ Correct: returns a string\n * Match.when({ b: Match.string }, (_) => _.b),\n * Match.exhaustive\n * )\n * ```\n *\n * @stability stable\n * @category utility types\n * @since 4.0.0\n */\nexport const withReturnType = internal.withReturnType;\n/**\n * Defines a condition for matching values.\n *\n * **When to use**\n *\n * Use to add one positive pattern case to a `Match.type` or `Match.value`\n * pipeline when a direct value, predicate, or structured object pattern should\n * run a handler for matching input.\n *\n * **Details**\n *\n * Supports both direct value comparisons and predicate functions. If the\n * pattern matches, the associated function is executed and the matched input is\n * removed from the remaining cases tracked by the matcher.\n *\n * **Example** (Matching with values and predicates)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * // Create a matcher for objects with an \"age\" property\n * const match = Match.type<{ age: number }>().pipe(\n * // Match when age is greater than 18\n * Match.when(\n * { age: (age: number) => age > 18 },\n * (user: { age: number }) => `Age: ${user.age}`\n * ),\n * // Match when age is exactly 18\n * Match.when({ age: 18 }, () => \"You can vote\"),\n * // Fallback case for all other ages\n * Match.orElse((user: { age: number }) => `${user.age} is too young`)\n * )\n *\n * match({ age: 20 }) // => \"Age: 20\"\n *\n * match({ age: 18 }) // => \"You can vote\"\n *\n * match({ age: 4 }) // => \"4 is too young\"\n * ```\n *\n * @see {@link whenOr} for handling any one of several patterns with the same handler\n * @see {@link whenAnd} for requiring all provided patterns to match before running a handler\n * @see {@link not} for handling inputs that do not match a pattern\n * @see {@link orElse} for providing a fallback when no pattern case matches\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const when = internal.when;\n/**\n * Matches one of multiple patterns in a single condition.\n *\n * **Details**\n *\n * This function allows defining a condition where a value matches any of the\n * provided patterns. If a match is found, the associated function is executed.\n * It simplifies cases where multiple patterns share the same handling logic.\n *\n * Unlike {@link when}, which requires separate conditions for each pattern,\n * this function enables combining them into a single statement, making the\n * matcher more concise.\n *\n * **Example** (Matching one of several patterns)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * type ErrorType =\n * | { readonly _tag: \"NetworkError\"; readonly message: string }\n * | { readonly _tag: \"TimeoutError\"; readonly duration: number }\n * | { readonly _tag: \"ValidationError\"; readonly field: string }\n *\n * const handleError = Match.type<ErrorType>().pipe(\n * Match.whenOr(\n * { _tag: \"NetworkError\" },\n * { _tag: \"TimeoutError\" },\n * () => \"Retry the request\"\n * ),\n * Match.when({ _tag: \"ValidationError\" }, (_) => `Invalid field: ${_.field}`),\n * Match.exhaustive\n * )\n *\n * handleError({ _tag: \"NetworkError\", message: \"No connection\" }) // => \"Retry the request\"\n *\n * handleError({ _tag: \"ValidationError\", field: \"email\" }) // => \"Invalid field: email\"\n * ```\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const whenOr = (...args) => internal.whenOr(...args);\n/**\n * Matches a value that satisfies all provided patterns.\n *\n * **Details**\n *\n * This function allows defining a condition where a value must match all the\n * given patterns simultaneously. If the value satisfies every pattern, the\n * associated function is executed.\n *\n * Unlike {@link when}, which matches a single pattern at a time, this function\n * ensures that multiple conditions are met before executing the callback. It is\n * useful when checking for values that need to fulfill multiple criteria at\n * once.\n *\n * **Example** (Matching all provided patterns)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * type User = { readonly age: number; readonly role: \"admin\" | \"user\" }\n *\n * const checkUser = Match.type<User>().pipe(\n * Match.whenAnd(\n * { age: (n) => n >= 18 },\n * { role: \"admin\" },\n * () => \"Admin access granted\"\n * ),\n * Match.orElse(() => \"Access denied\")\n * )\n *\n * checkUser({ age: 20, role: \"admin\" }) // => \"Admin access granted\"\n *\n * checkUser({ age: 20, role: \"user\" }) // => \"Access denied\"\n * ```\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const whenAnd = (...args) => internal.whenAnd(...args);\n/**\n * Matches values based on a specified discriminant field.\n *\n * **When to use**\n *\n * Use to match one or more exact values of a discriminator field.\n *\n * **Details**\n *\n * This function is used to define pattern matching on objects that follow a\n * **discriminated union** structure, where a specific field (e.g., `type`,\n * `kind`, `_tag`) determines the variant of the object. It allows matching\n * multiple values of the discriminant and provides a function to handle the\n * matched cases.\n *\n * **Example** (Matching on a discriminator field)\n *\n * ```ts import.meta.vitest\n * import { Match, pipe } from \"effect\"\n *\n * const match = pipe(\n * Match.type<\n * { type: \"A\"; a: string } | { type: \"B\"; b: number } | {\n * type: \"C\"\n * c: boolean\n * }\n * >(),\n * Match.discriminator(\"type\")(\"A\", \"B\", (_) => `A or B: ${_.type}`),\n * Match.discriminator(\"type\")(\"C\", (_) => `C(${_.c})`),\n * Match.exhaustive\n * )\n * match({ type: \"A\", a: \"ok\" }) // => \"A or B: A\"\n * match({ type: \"C\", c: true }) // => \"C(true)\"\n * ```\n *\n * @see {@link discriminators} for defining several discriminator handlers at once\n * @see {@link discriminatorStartsWith} for matching string discriminator values by prefix\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const discriminator = internal.discriminator;\n/**\n * Matches values where a specified field starts with a given prefix.\n *\n * **When to use**\n *\n * Use to match string discriminator values by prefix instead of exact value.\n *\n * **Details**\n *\n * Instead of checking for exact matches, this helper matches values that share\n * a common prefix. For example, if the discriminant field contains hierarchical\n * names like `\"A\"`, `\"A.A\"`, and `\"B\"`, a single `\"A\"` rule can match both\n * `\"A\"` and `\"A.A\"`.\n *\n * **Example** (Matching discriminator prefixes)\n *\n * ```ts import.meta.vitest\n * import { Match, pipe } from \"effect\"\n *\n * const match = pipe(\n * Match.type<{ type: \"A\" } | { type: \"B\" } | { type: \"A.A\" } | {}>(),\n * Match.discriminatorStartsWith(\"type\")(\"A\", (_) => 1 as const),\n * Match.discriminatorStartsWith(\"type\")(\"B\", (_) => 2 as const),\n * Match.orElse((_) => 3 as const)\n * )\n *\n * match({ type: \"A\" }) // => 1\n * match({ type: \"B\" }) // => 2\n * match({ type: \"A.A\" }) // => 1\n * ```\n *\n * @see {@link discriminator} for matching exact discriminator values\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const discriminatorStartsWith = internal.discriminatorStartsWith;\n/**\n * Matches values based on a field that serves as a discriminator, mapping each\n * possible value to a corresponding handler.\n *\n * **When to use**\n *\n * Use to define several discriminator handlers at once without finalizing the\n * matcher.\n *\n * **Details**\n *\n * This function simplifies working with discriminated unions by letting you\n * define a set of handlers for each possible value of a given field. Instead of\n * chaining multiple calls to {@link discriminator}, this function allows\n * defining all possible cases at once using an object where the keys are the\n * possible values of the field, and the values are the corresponding handler\n * functions.\n *\n * **Example** (Mapping discriminator handlers)\n *\n * ```ts import.meta.vitest\n * import { Match, pipe } from \"effect\"\n *\n * const match = pipe(\n * Match.type<\n * { type: \"A\"; a: string } | { type: \"B\"; b: number } | {\n * type: \"C\"\n * c: boolean\n * }\n * >(),\n * Match.discriminators(\"type\")({\n * A: (a) => a.a,\n * B: (b) => b.b,\n * C: (c) => c.c\n * }),\n * Match.exhaustive\n * )\n * match({ type: \"A\", a: \"ok\" }) // => \"ok\"\n * match({ type: \"B\", b: 42 }) // => 42\n * ```\n *\n * @see {@link discriminator} for adding one discriminator case to a matcher pipeline\n * @see {@link discriminatorsExhaustive} for handling every discriminator value and finalizing the matcher\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const discriminators = internal.discriminators;\n/**\n * Matches values by a discriminator field and requires every possible case to\n * be handled.\n *\n * **When to use**\n *\n * Use to define an exhaustive discriminator handler map that finalizes the\n * matcher.\n *\n * **Details**\n *\n * This is the exhaustive variant of {@link discriminators}. Each possible\n * discriminator value must have a corresponding handler, so the matcher is\n * finalized directly and does not require `Match.exhaustive` at the end of the\n * pipeline.\n *\n * **Example** (Handling all discriminator cases)\n *\n * ```ts import.meta.vitest\n * import { Match, pipe } from \"effect\"\n *\n * const match = pipe(\n * Match.type<\n * { type: \"A\"; a: string } | { type: \"B\"; b: number } | {\n * type: \"C\"\n * c: boolean\n * }\n * >(),\n * Match.discriminatorsExhaustive(\"type\")({\n * A: (a) => a.a,\n * B: (b) => b.b,\n * C: (c) => c.c\n * })\n * )\n * match({ type: \"C\", c: true }) // => true\n * ```\n *\n * @see {@link discriminators} for defining discriminator handlers without finalizing the matcher\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const discriminatorsExhaustive = internal.discriminatorsExhaustive;\n/**\n * Matches discriminated union members by their `_tag` field.\n *\n * **When to use**\n *\n * Use to handle one or more `_tag` cases with the same matcher branch.\n *\n * **Details**\n *\n * This helper follows the Effect convention that discriminated unions use\n * `\"_tag\"` as their discriminator field. Use {@link discriminator} for a\n * different discriminator field.\n *\n * **Example** (Matching a discriminated union by tag)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * type Event =\n * | { readonly _tag: \"fetch\" }\n * | { readonly _tag: \"success\"; readonly data: string }\n * | { readonly _tag: \"error\"; readonly error: Error }\n * | { readonly _tag: \"cancel\" }\n *\n * const match = Match.type<Event>().pipe(\n * // Match either \"fetch\" or \"success\"\n * Match.tag(\"fetch\", \"success\", () => `Ok!`),\n * // Match \"error\" and extract the error message\n * Match.tag(\"error\", (event) => `Error: ${event.error.message}`),\n * // Match \"cancel\"\n * Match.tag(\"cancel\", () => \"Cancelled\"),\n * Match.exhaustive\n * )\n *\n * match({ _tag: \"success\", data: \"Hello\" }) // => \"Ok!\"\n *\n * match({ _tag: \"error\", error: new Error(\"Oops!\") }) // => \"Error: Oops!\"\n * ```\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const tag = internal.tag;\n/**\n * Matches values where the `_tag` field starts with a given prefix.\n *\n * **Details**\n *\n * This function allows you to match on values in a **discriminated union**\n * based on whether the `_tag` field starts with a specified prefix. It is\n * useful for handling hierarchical or namespaced tags, where multiple related\n * cases share a common prefix.\n *\n * **Example** (Matching tag prefixes)\n *\n * ```ts import.meta.vitest\n * import { Match, pipe } from \"effect\"\n *\n * const match = pipe(\n * Match.type<{ _tag: \"A\" } | { _tag: \"B\" } | { _tag: \"A.A\" } | {}>(),\n * Match.tagStartsWith(\"A\", (_) => 1 as const),\n * Match.tagStartsWith(\"B\", (_) => 2 as const),\n * Match.orElse((_) => 3 as const)\n * )\n *\n * match({ _tag: \"A\" }) // => 1\n * match({ _tag: \"B\" }) // => 2\n * match({ _tag: \"A.A\" }) // => 1\n * ```\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const tagStartsWith = internal.tagStartsWith;\n/**\n * Matches values based on their `_tag` field, mapping each tag to a\n * corresponding handler.\n *\n * **Details**\n *\n * This function provides a way to handle discriminated unions by mapping `_tag`\n * values to specific functions. Each handler receives the matched value and\n * returns a transformed result. If all possible tags are handled, you can\n * enforce exhaustiveness using `Match.exhaustive` to ensure no case is missed.\n *\n * **Example** (Mapping tag handlers)\n *\n * ```ts import.meta.vitest\n * import { Match, pipe } from \"effect\"\n *\n * const match = pipe(\n * Match.type<\n * { _tag: \"A\"; a: string } | { _tag: \"B\"; b: number } | {\n * _tag: \"C\"\n * c: boolean\n * }\n * >(),\n * Match.tags({\n * A: (a) => a.a,\n * B: (b) => b.b,\n * C: (c) => c.c\n * }),\n * Match.exhaustive\n * )\n * match({ _tag: \"A\", a: \"ok\" }) // => \"ok\"\n * ```\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const tags = internal.tags;\n/**\n * Matches values based on their `_tag` field and requires handling of all\n * possible cases.\n *\n * **Details**\n *\n * This function is designed for **discriminated unions** where every possible\n * `_tag` value must have a corresponding handler. Unlike {@link tags}, this\n * function ensures **exhaustiveness**, meaning all cases must be explicitly\n * handled. If a `_tag` value is missing from the mapping, TypeScript will\n * report an error.\n *\n * **Example** (Handling all tag cases)\n *\n * ```ts import.meta.vitest\n * import { Match, pipe } from \"effect\"\n *\n * const match = pipe(\n * Match.type<\n * { _tag: \"A\"; a: string } | { _tag: \"B\"; b: number } | {\n * _tag: \"C\"\n * c: boolean\n * }\n * >(),\n * Match.tagsExhaustive({\n * A: (a) => a.a,\n * B: (b) => b.b,\n * C: (c) => c.c\n * })\n * )\n * match({ _tag: \"B\", b: 42 }) // => 42\n * ```\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const tagsExhaustive = internal.tagsExhaustive;\n/**\n * Matches string and number literal values, mapping each literal to a\n * corresponding handler.\n *\n * **Details**\n *\n * Each handler receives the matched literal. Handled literals are removed from\n * the remaining input, while unhandled literals and any other members (such as\n * `null`, objects, or widened `string` / `number` types) are left for later\n * cases. Keys must be finite string or number literals of the remaining input;\n * unions containing both a number and its string spelling, such as\n * `1 | \"1\"`, are rejected because both share the same runtime key.\n *\n * **Example** (Mapping literal handlers)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * type Status = \"draft\" | \"review\" | \"published\"\n *\n * const isEditable = Match.type<Status>().pipe(\n * Match.literals({ draft: () => true, review: () => true }),\n * Match.orElse(() => false)\n * )\n *\n * isEditable(\"review\") // => true\n * isEditable(\"published\") // => false\n * ```\n *\n * @see {@link literalsExhaustive} for handling every literal and finalizing the matcher\n *\n * @stability unstable\n * @category defining patterns\n * @since 4.1.0\n */\nexport const literals = internal.literals;\n/**\n * Matches string and number literal values and requires handling of all\n * remaining cases.\n *\n * **Details**\n *\n * This is the exhaustive variant of {@link literals}. Every remaining member\n * must be a finite string or number literal with a corresponding handler, so a\n * missing literal, a widened `string` / `number` type, or any other unhandled\n * member is reported by TypeScript.\n *\n * **Example** (Handling all literal cases)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * type Status = \"draft\" | \"review\" | \"published\"\n *\n * const label = Match.type<Status>().pipe(\n * Match.literalsExhaustive({\n * draft: () => \"Draft\",\n * review: () => \"In review\",\n * published: () => \"Live\"\n * })\n * )\n *\n * label(\"review\") // => \"In review\"\n * ```\n *\n * @see {@link literals} for defining literal handlers without finalizing the matcher\n *\n * @stability unstable\n * @category defining patterns\n * @since 4.1.0\n */\nexport const literalsExhaustive = internal.literalsExhaustive;\n/**\n * Creates a pattern that excludes a specific value while allowing all others.\n *\n * **When to use**\n *\n * Use to add a negative pattern case for inputs that should match when another\n * pattern does not.\n *\n * **Details**\n *\n * Any excluded value bypasses the provided function and continues matching\n * through later cases.\n *\n * **Example** (Ignoring a specific value)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * // Create a matcher for string or number values\n * const match = Match.type<string | number>().pipe(\n * // Match any value except \"hi\", returning \"ok\"\n * Match.not(\"hi\", () => \"ok\"),\n * // Fallback case for when the value is \"hi\"\n * Match.orElse(() => \"fallback\")\n * )\n *\n * match(\"hello\") // => \"ok\"\n *\n * match(\"hi\") // => \"fallback\"\n * ```\n *\n * @see {@link when} for adding a positive pattern case\n *\n * @stability stable\n * @category defining patterns\n * @since 4.0.0\n */\nexport const not = internal.not;\n/**\n * Matches non-empty strings.\n *\n * **When to use**\n *\n * Use to match strings whose length is greater than zero.\n *\n * **Details**\n *\n * This predicate matches any string that contains at least one character,\n * effectively filtering out empty strings (\"\").\n *\n * **Example** (Matching non-empty strings)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const processInput = Match.type<string>()\n * .pipe(\n * Match.when(Match.nonEmptyString, (str) => `Valid input: ${str}`),\n * Match.orElse(() => \"Input cannot be empty\")\n * )\n *\n * processInput(\"hello\") // => \"Valid input: hello\"\n *\n * processInput(\"\") // => \"Input cannot be empty\"\n *\n * processInput(\" \") // => \"Valid input: \"\n * ```\n *\n * @see {@link string} for matching any string\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const nonEmptyString = internal.nonEmptyString;\n/**\n * Matches a specific set of literal values (e.g., `Match.is(\"a\", 42, true)`).\n *\n * **When to use**\n *\n * Use to match one of several literal primitive or null values.\n *\n * **Details**\n *\n * This function creates a predicate that matches any of the provided literal values.\n * It's useful for matching against multiple specific values in a single pattern.\n *\n * **Example** (Matching literal values)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const handleStatus = Match.type<string | number>()\n * .pipe(\n * Match.when(Match.is(\"success\", \"ok\", 200), () => \"Operation successful\"),\n * Match.when(Match.is(\"error\", \"failed\", 500), () => \"Operation failed\"),\n * Match.when(Match.is(0, false, null), () => \"Falsy value\"),\n * Match.orElse((value) => `Unknown status: ${value}`)\n * )\n *\n * handleStatus(\"success\") // => \"Operation successful\"\n *\n * handleStatus(200) // => \"Operation successful\"\n *\n * handleStatus(\"failed\") // => \"Operation failed\"\n *\n * handleStatus(0) // => \"Falsy value\"\n *\n * handleStatus(\"pending\") // => \"Unknown status: pending\"\n * ```\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const is = internal.is;\n/**\n * Matches values of type `string`.\n *\n * **Details**\n *\n * This predicate refines unknown values to strings, allowing pattern matching\n * on string types. It's commonly used in type-based matchers to handle string cases.\n *\n * **Example** (Matching string values)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const processValue = Match.type<string | number | boolean>().pipe(\n * Match.when(Match.string, (str) => `String: ${str.toUpperCase()}`),\n * Match.when(Match.number, (num) => `Number: ${num * 2}`),\n * Match.when(Match.boolean, (bool) => `Boolean: ${bool ? \"yes\" : \"no\"}`),\n * Match.exhaustive\n * )\n *\n * processValue(\"hello\") // => \"String: HELLO\"\n * processValue(42) // => \"Number: 84\"\n * processValue(true) // => \"Boolean: yes\"\n * ```\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const string = Predicate.isString;\n/**\n * Matches values of type `number`.\n *\n * **When to use**\n *\n * Use to match primitive number values, including `NaN` and infinities.\n *\n * **Details**\n *\n * This predicate refines unknown values to numbers, allowing pattern matching\n * on numeric types. It matches all number values including integers, floats,\n * `Infinity`, `-Infinity`, and `NaN`.\n *\n * **Example** (Matching number values)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const categorizeNumber = Match.type<unknown>().pipe(\n * Match.when(Match.number, (num) => {\n * if (Number.isNaN(num)) return \"Not a number\"\n * if (!Number.isFinite(num)) return \"Infinite\"\n * if (Number.isInteger(num)) return `Integer: ${num}`\n * return `Float: ${num.toFixed(2)}`\n * }),\n * Match.orElse(() => \"Not a number type\")\n * )\n *\n * categorizeNumber(42) // => \"Integer: 42\"\n * categorizeNumber(3.14) // => \"Float: 3.14\"\n * categorizeNumber(NaN) // => \"Not a number\"\n * categorizeNumber(\"hello\") // => \"Not a number type\"\n * ```\n *\n * @see {@link bigint} for matching primitive bigint values\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const number = Predicate.isNumber;\n/**\n * Matches any value without restrictions.\n *\n * **When to use**\n *\n * Use to define an explicit catch-all pattern when the handler should receive\n * the unmatched value.\n *\n * **Details**\n *\n * This predicate matches every input, including `undefined`, `null`, objects,\n * primitives, and functions.\n *\n * **Gotchas**\n *\n * `Match.any` should usually be last because cases are checked in order and\n * the first matching case wins.\n *\n * **Example** (Matching any remaining value)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const describeValue = Match.type<unknown>()\n * .pipe(\n * Match.when(Match.string, (str) => `String: ${str}`),\n * Match.when(Match.number, (num) => `Number: ${num}`),\n * Match.when(Match.boolean, (bool) => `Boolean: ${bool}`),\n * Match.when(Match.any, (value) => `Other: ${typeof value}`),\n * Match.exhaustive\n * )\n *\n * describeValue(\"hello\") // => \"String: hello\"\n *\n * describeValue(42) // => \"Number: 42\"\n *\n * describeValue([1, 2, 3]) // => \"Other: object\"\n *\n * describeValue(null) // => \"Other: object\"\n * ```\n *\n * @see {@link defined} for matching only non-nullish values\n * @see {@link orElse} for providing a fallback after earlier cases\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const any = internal.any;\n/**\n * Matches any defined (non-null and non-undefined) value.\n *\n * **When to use**\n *\n * Use to exclude only `null` and `undefined` from a match branch.\n *\n * **Details**\n *\n * This predicate matches values that are neither `null` nor `undefined`,\n * effectively filtering out nullish values while preserving all other types.\n *\n * **Example** (Matching defined values)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const processValue = Match.type<string | number | null | undefined>()\n * .pipe(\n * Match.when(Match.defined, (value) => `Defined value: ${value}`),\n * Match.orElse(() => \"Value is null or undefined\")\n * )\n *\n * processValue(\"hello\") // => \"Defined value: hello\"\n *\n * processValue(42) // => \"Defined value: 42\"\n *\n * processValue(0) // => \"Defined value: 0\"\n *\n * processValue(\"\") // => \"Defined value: \"\n *\n * processValue(null) // => \"Value is null or undefined\"\n *\n * processValue(undefined) // => \"Value is null or undefined\"\n * ```\n *\n * @see {@link any} for matching every value without excluding nullish inputs\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const defined = internal.defined;\n/**\n * Matches values of type `boolean`.\n *\n * **When to use**\n *\n * Use to match primitive boolean values.\n *\n * **Details**\n *\n * This predicate refines unknown values to booleans, allowing pattern matching\n * on boolean types. It only matches the primitive boolean values `true` and `false`.\n *\n * **Example** (Matching boolean values)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const describeTruthiness = Match.type<unknown>().pipe(\n * Match.when(\n * Match.boolean,\n * (bool) => bool ? \"Definitely true\" : \"Definitely false\"\n * ),\n * Match.when(0, () => \"Falsy number\"),\n * Match.when(\"\", () => \"Empty string\"),\n * Match.when(Match.null, () => \"Null value\"),\n * Match.orElse(() => \"Some other truthy value\")\n * )\n *\n * describeTruthiness(true) // => \"Definitely true\"\n * describeTruthiness(false) // => \"Definitely false\"\n * describeTruthiness(0) // => \"Falsy number\"\n * describeTruthiness(1) // => \"Some other truthy value\"\n * ```\n *\n * @see {@link is} for matching specific literal boolean values\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const boolean = Predicate.isBoolean;\nconst _undefined = Predicate.isUndefined;\nexport {\n/**\n * Matches the value `undefined`.\n *\n * **When to use**\n *\n * Use when a matcher should handle only inputs with no defined value.\n *\n * **Details**\n *\n * This refinement is backed by `Predicate.isUndefined`, which checks\n * `input === undefined`.\n *\n * @see {@link defined} for matching non-nullish values\n * @see {@link is} for matching literal values\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\n_undefined as undefined };\nconst _null = Predicate.isNull;\nexport {\n/**\n * Matches the value `null`.\n *\n * **When to use**\n *\n * Use to handle only the `null` literal in a match branch.\n *\n * **Details**\n *\n * This refinement is backed by `Predicate.isNull`, which checks\n * `input === null`.\n *\n * @see {@link defined} for matching non-nullish values\n * @see {@link is} for matching literal values\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\n_null as null };\n/**\n * Matches values of type `bigint`.\n *\n * **When to use**\n *\n * Use to match primitive bigint values.\n *\n * **Details**\n *\n * This predicate refines unknown values to bigints, allowing pattern matching\n * on bigint types. BigInts are used for representing integers with arbitrary precision.\n *\n * **Example** (Matching bigint values)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const processLargeNumber = Match.type<unknown>().pipe(\n * Match.when(Match.bigint, (big) => {\n * if (big > 9007199254740991n) {\n * return `Large integer: ${big.toString()}`\n * }\n * return `BigInt: ${big.toString()}`\n * }),\n * Match.when(Match.number, (num) => `Regular number: ${num}`),\n * Match.orElse(() => \"Not a numeric type\")\n * )\n *\n * processLargeNumber(123n) // => \"BigInt: 123\"\n * processLargeNumber(9007199254740992n) // => \"Large integer: 9007199254740992\"\n * processLargeNumber(123) // => \"Regular number: 123\"\n * processLargeNumber(\"123\") // => \"Not a numeric type\"\n * ```\n *\n * @see {@link number} for matching primitive number values\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const bigint = Predicate.isBigInt;\n/**\n * Matches values of type `symbol`.\n *\n * **Details**\n *\n * This predicate refines unknown values to symbols, allowing pattern matching\n * on symbol types. Symbols are unique identifiers that are often used as\n * object keys or for creating private properties.\n *\n * **Example** (Matching symbol values)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const mySymbol = Symbol(\"my-symbol\")\n * const globalSymbol = Symbol.for(\"global-symbol\")\n *\n * const handleSymbol = Match.type<unknown>().pipe(\n * Match.when(Match.symbol, (sym) => {\n * const description = sym.description\n * if (description) {\n * return `Symbol with description: ${description}`\n * }\n * return \"Symbol without description\"\n * }),\n * Match.orElse(() => \"Not a symbol\")\n * )\n *\n * handleSymbol(mySymbol) // => \"Symbol with description: my-symbol\"\n * handleSymbol(Symbol()) // => \"Symbol without description\"\n * handleSymbol(\"string\") // => \"Not a symbol\"\n * ```\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const symbol = Predicate.isSymbol;\n/**\n * Matches values that are instances of `Date`.\n *\n * **When to use**\n *\n * Use to match `Date` instances.\n *\n * **Details**\n *\n * This predicate refines unknown values to Date instances, allowing pattern\n * matching on Date objects. It only matches actual Date instances, not\n * date strings or timestamps.\n *\n * **Example** (Matching Date instances)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const processDateValue = Match.type<unknown>().pipe(\n * Match.when(Match.date, (date) => {\n * if (isNaN(date.getTime())) {\n * return \"Invalid date\"\n * }\n * return `Date: ${date.toISOString().split(\"T\")[0]}`\n * }),\n * Match.when(Match.string, (str) => `Date string: ${str}`),\n * Match.orElse(() => \"Not a date-related value\")\n * )\n *\n * processDateValue(new Date(\"2024-01-01\")) // => \"Date: 2024-01-01\"\n * processDateValue(new Date(\"invalid\")) // => \"Invalid date\"\n * processDateValue(\"2024-01-01\") // => \"Date string: 2024-01-01\"\n * processDateValue(1704067200000) // => \"Not a date-related value\"\n * ```\n *\n * @see {@link instanceOf} for matching instances of any constructor\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const date = Predicate.isDate;\n/**\n * Matches non-null objects other than arrays.\n *\n * **When to use**\n *\n * Use to match broad non-null, non-array object values.\n *\n * **Details**\n *\n * This predicate uses `Predicate.isObject`: it returns `true` for values whose\n * runtime type is `\"object\"`, are not `null`, and are not arrays. It can match\n * `Date`, `RegExp`, and class instances; use `instanceOf` or a more specific\n * pattern when those cases need to be distinguished.\n *\n * **Example** (Matching record objects)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const analyzeValue = Match.type<unknown>().pipe(\n * Match.when(Match.record, (obj) => {\n * const keys = Object.keys(obj)\n * const valueCount = keys.length\n * return `Object with ${valueCount} properties: [${keys.join(\", \")}]`\n * }),\n * Match.when(\n * Match.instanceOf(Array),\n * (arr) => `Array with ${arr.length} items`\n * ),\n * Match.orElse(() => \"Not an object\")\n * )\n *\n * analyzeValue({ name: \"Alice\", age: 30 }) // => \"Object with 2 properties: [name, age]\"\n * analyzeValue([1, 2, 3]) // => \"Array with 3 items\"\n * analyzeValue(null) // => \"Not an object\"\n * analyzeValue(\"hello\") // => \"Not an object\"\n * ```\n *\n * @see {@link instanceOf} for matching a specific constructor\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const record = Predicate.isObject;\n/**\n * Matches instances of a given class.\n *\n * **When to use**\n *\n * Use to match values that are instances of a constructor with type-safe\n * narrowing.\n *\n * **Details**\n *\n * This predicate checks if a value is an instance of the specified constructor,\n * providing type-safe matching for class instances and built-in objects.\n *\n * **Example** (Matching class instances)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * class CustomError extends Error {\n * constructor(message: string, public code: number) {\n * super(message)\n * }\n * }\n *\n * const handleValue = Match.type<unknown>()\n * .pipe(\n * Match.when(\n * Match.instanceOf(CustomError),\n * (err) => `Custom error: ${err.message} (code: ${err.code})`\n * ),\n * Match.when(\n * Match.instanceOf(Error),\n * (err) => `Standard error: ${err.message}`\n * ),\n * Match.when(\n * Match.instanceOf(Array),\n * (arr) => `Array with ${arr.length} items`\n * ),\n * Match.when(\n * Match.instanceOf(Map),\n * (map) => `Map with ${map.size} entries`\n * ),\n * Match.orElse((value) => `Other: ${typeof value}`)\n * )\n *\n * handleValue(new CustomError(\"Failed\", 404)) // => \"Custom error: Failed (code: 404)\"\n * handleValue(new Error(\"Generic error\")) // => \"Standard error: Generic error\"\n * handleValue([1, 2, 3]) // => \"Array with 3 items\"\n * handleValue(new Map([[\"count\", 1]])) // => \"Map with 1 entries\"\n * ```\n *\n * @see {@link instanceOfUnsafe} for constructor matching without the same type-safety guarantee\n * @see {@link record} for matching broad non-null, non-array objects\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const instanceOf = internal.instanceOf;\n/**\n * Checks whether a value is an instance of a constructor without type-safe narrowing.\n *\n * **When to use**\n *\n * Use when you need constructor matching to use the unsafe refinement type.\n *\n * **Details**\n *\n * This predicate checks if a value is an instance of the specified constructor\n * but doesn't provide the same type safety guarantees as the regular `instanceOf`.\n * Use this when you need more flexibility but understand the type safety implications.\n *\n * **Example** (Matching class instances unsafely)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * class CustomError extends Error {\n * constructor(message: string, public code: number) {\n * super(message)\n * }\n * }\n *\n * // When you need to match instances but handle type narrowing manually\n * const handleError = Match.type<unknown>().pipe(\n * Match.when(Match.instanceOfUnsafe(CustomError), (err: any) => {\n * // Manual type assertion needed\n * const customErr = err as CustomError\n * return `Custom error ${customErr.code}: ${customErr.message}`\n * }),\n * Match.orElse(() => \"Not a CustomError\")\n * )\n * handleError(new CustomError(\"failed\", 500)) // => \"Custom error 500: failed\"\n * ```\n *\n * @see {@link instanceOf} for type-safe constructor matching\n *\n * @stability stable\n * @category guards\n * @since 4.0.0\n */\nexport const instanceOfUnsafe = internal.instanceOf;\n/**\n * Provides a fallback value when no patterns match.\n *\n * **When to use**\n *\n * Use to finalize a matcher with a fallback for unmatched input.\n *\n * **Details**\n *\n * This function ensures that a matcher always returns a valid result, even if\n * no defined patterns match. It acts as a default case, similar to the\n * `default` clause in a `switch` statement or the final `else` in an `if-else`\n * chain.\n *\n * **Example** (Providing a default value when no patterns match)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * // Create a matcher for string or number values\n * const match = Match.type<string | number>().pipe(\n * // Match when the value is \"a\"\n * Match.when(\"a\", () => \"ok\"),\n * // Fallback when no patterns match\n * Match.orElse(() => \"fallback\")\n * )\n *\n * match(\"a\") // => \"ok\"\n *\n * match(\"b\") // => \"fallback\"\n * ```\n *\n * @see {@link option} for finalizing unmatched input as `Option.none`\n * @see {@link result} for returning unmatched input as a `Result` failure\n * @see {@link orElseAbsurd} for finalizing when unmatched input should be impossible\n *\n * @stability stable\n * @category completion\n * @since 4.0.0\n */\nexport const orElse = internal.orElse;\n// TODO(4.0): Rename to \"orThrow\"? Like Result.getOrThrow\n/**\n * Returns a matcher that throws an error if no pattern matches.\n *\n * **When to use**\n *\n * Use to finalize a matcher when every remaining unmatched case should be\n * impossible.\n *\n * **Details**\n *\n * This function finalizes a matcher by ensuring that if no patterns match, an\n * error is thrown. It is useful when all cases should be covered, and any\n * unexpected input should trigger an error instead of returning a default\n * value.\n *\n * When used, this function removes the need for an explicit fallback case and\n * ensures that an unmatched value is never silently ignored.\n *\n * **Example** (Throwing on unmatched input)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * const strictMatcher = Match.type<\"a\" | \"b\">().pipe(\n * Match.when(\"a\", () => \"Found A\"),\n * Match.when(\"b\", () => \"Found B\"),\n * // Will throw if input is neither \"a\" nor \"b\"\n * Match.orElseAbsurd\n * )\n *\n * strictMatcher(\"a\") // => \"Found A\"\n * strictMatcher(\"b\") // => \"Found B\"\n *\n * // This would throw an error at runtime:\n * // strictMatcher(\"c\" as any) // throws\n * ```\n *\n * @see {@link exhaustive} for compile-time exhaustive matcher finalization\n * @see {@link orElse} for providing a fallback for unmatched input\n *\n * @stability stable\n * @category completion\n * @since 4.0.0\n */\nexport const orElseAbsurd = internal.orElseAbsurd;\n/**\n * Wraps the match result in a `Result`, distinguishing matched and unmatched\n * cases.\n *\n * **Details**\n *\n * This function ensures that the result of a matcher is always wrapped in an\n * `Result`, allowing clear differentiation between successful matches\n * (`Ok(value)`) and cases where no pattern matched (`Err(unmatched\n * value)`).\n *\n * This approach is particularly useful when handling optional values or when an\n * unmatched case should be explicitly handled rather than returning a default\n * value or throwing an error.\n *\n * **Example** (Extracting a user role with `Match.result`)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * type User = { readonly role: \"admin\" | \"editor\" | \"viewer\" }\n *\n * // Create a matcher to extract user roles\n * const getRole = Match.type<User>().pipe(\n * Match.when({ role: \"admin\" }, () => \"Has full access\"),\n * Match.when({ role: \"editor\" }, () => \"Can edit content\"),\n * Match.result // Wrap the result in an Result\n * )\n *\n * getRole({ role: \"admin\" })._tag // => \"Success\"\n *\n * getRole({ role: \"viewer\" })._tag // => \"Failure\"\n * ```\n *\n * @stability stable\n * @category completion\n * @since 4.0.0\n */\nexport const result = internal.result;\n/**\n * Wraps the match result in an `Option`, representing an optional match.\n *\n * **When to use**\n *\n * Use to finalize a matcher when unmatched input is expected and should become\n * `Option.none`.\n *\n * **Details**\n *\n * This function ensures that the result of a matcher is wrapped in an `Option`,\n * making it easy to handle cases where no pattern matches. If a match is found,\n * it returns `Some(value)`, otherwise, it returns `None`.\n *\n * This is useful in cases where a missing match is expected and should be\n * handled explicitly rather than throwing an error or returning a default\n * value.\n *\n * **Example** (Extracting a user role with `Match.option`)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * type User = { readonly role: \"admin\" | \"editor\" | \"viewer\" }\n *\n * // Create a matcher to extract user roles\n * const getRole = Match.type<User>().pipe(\n * Match.when({ role: \"admin\" }, () => \"Has full access\"),\n * Match.when({ role: \"editor\" }, () => \"Can edit content\"),\n * Match.option // Wrap the result in an Option\n * )\n *\n * getRole({ role: \"admin\" })._tag // => \"Some\"\n *\n * getRole({ role: \"viewer\" })._tag // => \"None\"\n * ```\n *\n * @see {@link result} for preserving unmatched input as a `Result` failure\n * @see {@link orElse} for replacing unmatched input with a fallback value\n *\n * @stability stable\n * @category completion\n * @since 4.0.0\n */\nexport const option = internal.option;\n/**\n * Completes a matcher that handles every remaining input case.\n *\n * **When to use**\n *\n * Use to require TypeScript to reject incomplete matcher definitions before the\n * matcher is turned into a function.\n *\n * **Details**\n *\n * If any case is still unmatched, the matcher does not type-check as\n * exhaustive.\n *\n * **Example** (Ensuring all cases are covered)\n *\n * ```ts import.meta.vitest\n * import { Match } from \"effect\"\n *\n * // Create a matcher for string or number values\n * const match = Match.type<string | number>().pipe(\n * // Match when the value is a number\n * Match.when(Match.number, (n) => `number: ${n}`),\n * // Mark the match as exhaustive, ensuring all cases are handled\n * // TypeScript will throw an error if any case is missing\n * // @ts-expect-error Type 'string' is not assignable to type 'never'\n * Match.exhaustive\n * )\n * ```\n *\n * @stability stable\n * @category completion\n * @since 4.0.0\n */\nexport const exhaustive = internal.exhaustive;\nconst SafeRefinementId = \"~effect/Match/SafeRefinement\";\nconst Fail = /*#__PURE__*/Symbol.for(\"effect/Fail\");\n//# sourceMappingURL=Match.js.map",
|
|
15
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { Schema } from \"effect\";\n// src/DefinitionError.ts\n/**\n* Public SDK definition errors.\n*\n* @since 0.0.0\n*/\nvar DefinitionError_exports = /* @__PURE__ */ __exportAll({\n\tBuilderCollisionError: () => BuilderCollisionError,\n\tDuplicateAuthMethodIdentifierError: () => DuplicateAuthMethodIdentifierError,\n\tInvalidIdentifierError: () => InvalidIdentifierError\n});\nconst DefinitionIdentifierKindSchema = Schema.Literals([\n\t\"dual\",\n\t\"plugin\",\n\t\"provider\",\n\t\"group\",\n\t\"action\",\n\t\"trigger\",\n\t\"auth-method\",\n\t\"agent-channel\"\n]);\nconst DefinitionOwnerKindSchema = Schema.Literals([\n\t\"dual\",\n\t\"plugin\",\n\t\"group\"\n]);\nconst DefinitionChildKindSchema = Schema.Literals([\n\t\"agent-channel\",\n\t\"plugin\",\n\t\"provider\",\n\t\"group\",\n\t\"action\",\n\t\"trigger\"\n]);\nconst InvalidIdentifierReasonSchema = Schema.Literals([\n\t\"empty\",\n\t\"contains-reserved-separator\",\n\t\"invalid-format\"\n]);\n/**\n* Raised when a definition identifier does not satisfy SDK constraints.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar InvalidIdentifierError = class extends Schema.TaggedError()(\"InvalidIdentifierError\", {\n\tidentifier: Schema.String,\n\tkind: DefinitionIdentifierKindSchema,\n\treason: InvalidIdentifierReasonSchema,\n\treservedCharacter: Schema.optional(Schema.Literals([\"/\"]))\n}) {};\n/**\n* Raised when two sibling definitions reuse the same identifier.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar BuilderCollisionError = class extends Schema.TaggedError()(\"BuilderCollisionError\", {\n\tchildKind: DefinitionChildKindSchema,\n\tchildPluginIdentifier: Schema.optional(Schema.String),\n\texistingChildKind: DefinitionChildKindSchema,\n\texistingPluginIdentifier: Schema.optional(Schema.String),\n\tidentifier: Schema.String,\n\townerIdentifier: Schema.String,\n\townerKind: DefinitionOwnerKindSchema\n}) {};\n/**\n* Raised when a provider reuses an auth method identifier.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar DuplicateAuthMethodIdentifierError = class extends Schema.TaggedError()(\"DuplicateAuthMethodIdentifierError\", {\n\tidentifier: Schema.String,\n\tproviderIdentifier: Schema.String\n}) {};\nexport { BuilderCollisionError, DefinitionError_exports, DuplicateAuthMethodIdentifierError, InvalidIdentifierError };\n\n//# sourceMappingURL=DefinitionError.js.map",
|
|
16
|
+
"import { InvalidIdentifierError } from \"../DefinitionError.js\";\nimport { Schema } from \"effect\";\n// src/internal/identifier.ts\nconst MachineIdSeparator = \"/\";\nconst identifierSchema = Schema.String.check(Schema.isPattern(/^[a-z0-9]+(?:-[a-z0-9]+)*$/));\nconst isIdentifier = Schema.is(identifierSchema);\nconst validateIdentifier = (kind, identifier) => {\n\tif (identifier.length === 0) throw new InvalidIdentifierError({\n\t\tidentifier,\n\t\tkind,\n\t\treason: \"empty\"\n\t});\n\tif (identifier.includes(\"/\")) throw new InvalidIdentifierError({\n\t\tidentifier,\n\t\tkind,\n\t\treason: \"contains-reserved-separator\",\n\t\treservedCharacter: \"/\"\n\t});\n\tif (!isIdentifier(identifier)) throw new InvalidIdentifierError({\n\t\tidentifier,\n\t\tkind,\n\t\treason: \"invalid-format\"\n\t});\n};\nexport { MachineIdSeparator, validateIdentifier };\n\n//# sourceMappingURL=identifier.js.map",
|
|
17
|
+
"import { Pipeable } from \"effect\";\n// src/internal/proto.ts\n/** Shared prototype mixin for all SDK definition objects. */\nconst PipeableProto = { pipe() {\n\treturn Pipeable.pipeArguments(this, arguments);\n} };\nexport { PipeableProto };\n\n//# sourceMappingURL=proto.js.map",
|
|
18
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\n// src/AuthMethodBinding.ts\nvar AuthMethodBinding_exports = /* @__PURE__ */ __exportAll({\n\tAuthMethodBinding: () => AuthMethodBinding_exports,\n\tisBindingForMethod: () => isBindingForMethod,\n\tmakeBinding: () => makeBinding\n});\n/**\n* Create a resolved connection binding.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst makeBinding = (options) => ({\n\tconnectionId: options.connectionId,\n\tmethod: options.method,\n\tmethodId: options.method.identifier,\n\tproviderId: options.providerId,\n\tvalue: options.value\n});\n/**\n* Runtime type guard for matching a resolved binding against a provider-owned method.\n*\n* @since 0.0.0\n* @category guards\n*/\nconst isBindingForMethod = (binding, method) => binding.method === method;\nexport { AuthMethodBinding_exports as AuthMethodBinding, AuthMethodBinding_exports, isBindingForMethod, makeBinding };\n\n//# sourceMappingURL=AuthMethodBinding.js.map",
|
|
19
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport \"./OAuth2TokenRefresher.js\";\nimport { Context } from \"effect\";\n// src/OAuth2TokenRefresher.ts\n/**\n* Host service that refreshes OAuth2 tokens for SDK auth execution.\n*\n* @since 0.0.0\n*/\nvar OAuth2TokenRefresher_exports = /* @__PURE__ */ __exportAll({\n\tOAuth2TokenRefresher: () => OAuth2TokenRefresher_exports,\n\tService: () => Service\n});\n/** @since 0.0.0 @category services */\nvar Service = class extends Context.Service()(\"@dual-os/sdk/AuthMethod/OAuth2TokenRefresher\") {};\nexport { OAuth2TokenRefresher_exports as OAuth2TokenRefresher, OAuth2TokenRefresher_exports, Service };\n\n//# sourceMappingURL=OAuth2TokenRefresher.js.map",
|
|
20
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { Service } from \"./OAuth2TokenRefresher.js\";\nimport \"./AuthMethodExecution.js\";\nimport { AuthMethodHookError, ExpectedOAuth2MethodError, OAuth2RefreshTokenUnavailableError } from \"./AuthMethod.js\";\nimport { Effect, Schema } from \"effect\";\n// src/AuthMethodExecution.ts\n/**\n* Credential decoding, hook execution, material refresh, and value resolution.\n*\n* @since 0.0.0\n*/\nvar AuthMethodExecution_exports = /* @__PURE__ */ __exportAll({\n\tAuthMethodExecution: () => AuthMethodExecution_exports,\n\tJsonRequest: () => JsonRequest,\n\tdecodeInput: () => decodeInput,\n\tdecodeMaterial: () => decodeMaterial,\n\tdecodeSetup: () => decodeSetup,\n\tdecodeValue: () => decodeValue,\n\tdisplay: () => display,\n\texecuteJson: () => executeJson,\n\tprepare: () => prepare,\n\tprepareDecoded: () => prepareDecoded,\n\tprepareOAuth2Tokens: () => prepareOAuth2Tokens,\n\tprepareUnknown: () => prepareUnknown,\n\trefreshDecoded: () => refreshDecoded,\n\trefreshUnknown: () => refreshUnknown,\n\tresolve: () => resolve,\n\tresolveDecoded: () => resolveDecoded,\n\tresolveUnknown: () => resolveUnknown,\n\ttest: () => test\n});\nconst hookError = (methodIdentifier, operation, cause) => new AuthMethodHookError({\n\tcause,\n\tmethodIdentifier,\n\toperation\n});\nconst runHook = (methodIdentifier, operation, hook) => Effect.try({\n\tcatch: (cause) => hookError(methodIdentifier, operation, cause),\n\ttry: hook\n}).pipe(Effect.flatMap((result) => toEffect(result).pipe(Effect.mapError((cause) => hookError(methodIdentifier, operation, cause)))));\nconst toEffect = (value) => Effect.isEffect(value) ? value : Effect.succeed(value);\nconst hookContext = (context) => context ?? { setup: void 0 };\nconst toImpl = (method) => method;\n/**\n* Decode a runtime auth value using the selected method schema.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst decodeValue = (method, value) => Schema.decodeUnknownEffect(toImpl(method).schema)(value);\n/**\n* Decode organization/admin-level setup for a method, if it declares one.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst decodeSetup = (method, setup) => {\n\tconst impl = toImpl(method);\n\treturn impl.setup === void 0 ? Effect.void : Schema.decodeUnknownEffect(impl.setup)(setup);\n};\n/**\n* Decode submitted setup input using the method input schema, if any.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst decodeInput = (method, input) => {\n\tconst impl = toImpl(method);\n\treturn impl.input === void 0 ? Effect.void : Schema.decodeUnknownEffect(impl.input)(input);\n};\n/**\n* Decode encrypted stored material using the method material schema.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst decodeMaterial = (method, material) => Schema.decodeUnknownEffect(toImpl(method).material)(material);\n/**\n* Prepare already-decoded setup input into encrypted stored material.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst prepareDecoded = (method, input, context) => {\n\tconst impl = toImpl(method);\n\tconst prepare = impl.prepare;\n\tif (prepare === void 0) return impl.input === impl.material ? Effect.succeed(input) : Schema.decodeUnknownEffect(impl.material)(input);\n\treturn runHook(impl.identifier, \"prepare\", () => prepare(input, hookContext(context))).pipe(Effect.flatMap((material) => Schema.decodeUnknownEffect(impl.material)(material)));\n};\n/**\n* Decode and prepare submitted setup input into encrypted stored material.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst prepareUnknown = (method, input, context) => decodeInput(method, input).pipe(Effect.flatMap((decodedInput) => prepareDecoded(method, decodedInput, context)));\nconst oauth2ExpiresAt = (material) => typeof material === \"object\" && material !== null && \"expiresAt\" in material ? typeof material.expiresAt === \"number\" ? material.expiresAt : void 0 : void 0;\nconst oauth2RefreshToken = (material) => typeof material === \"object\" && material !== null && \"refreshToken\" in material ? typeof material.refreshToken === \"string\" && material.refreshToken.trim() !== \"\" ? material.refreshToken : void 0 : void 0;\nconst refreshOAuth2Decoded = Effect.fn(\"AuthMethod.refreshOAuth2Decoded\")(function* (method, material, context) {\n\tif (context.reason === \"before-use\" && (oauth2ExpiresAt(material) ?? Number.NEGATIVE_INFINITY) > context.now + context.minValidityMs) return;\n\tconst refreshToken = oauth2RefreshToken(material);\n\tif (refreshToken === void 0) return yield* new OAuth2RefreshTokenUnavailableError({ methodIdentifier: method.identifier });\n\tconst refresher = yield* Service;\n\tconst tokens = yield* runHook(method.identifier, \"oauth2TokenRefresh\", () => refresher.refresh({\n\t\tmethod,\n\t\trefreshToken,\n\t\tsetup: context.setup\n\t}));\n\treturn yield* prepareOAuth2Tokens(method, tokens, { setup: context.setup });\n});\n/**\n* Decode and prepare submitted setup input into encrypted stored material.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst prepare = prepareUnknown;\n/**\n* Refresh already-decoded stored material when the auth method supports it.\n*\n* A result of `undefined` means the material is still usable and should not be\n* persisted again.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst refreshDecoded = (method, material, context) => {\n\tconst impl = toImpl(method);\n\tif (impl.oauth2 !== void 0) return refreshOAuth2Decoded(method, material, context);\n\tconst refresh = impl.refresh;\n\tif (refresh === void 0) return Effect.void;\n\treturn runHook(impl.identifier, \"refresh\", () => refresh(material, context)).pipe(Effect.flatMap((refreshed) => refreshed === void 0 ? Effect.void : Schema.decodeUnknownEffect(impl.material)(refreshed)));\n};\n/**\n* Decode stored material and run the auth method refresh hook, if any.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst refreshUnknown = (method, material, context) => decodeMaterial(method, material).pipe(Effect.flatMap((decodedMaterial) => refreshDecoded(method, decodedMaterial, context)));\n/**\n* Prepare normalized OAuth2 token exchange output into encrypted stored material.\n*\n* OAuth2 has no frontend-submitted setup input. The platform owns redirect,\n* callback, state/PKCE, and token exchange, then calls this helper at the\n* token-response boundary.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst prepareOAuth2Tokens = (method, tokens, context) => {\n\tconst impl = toImpl(method);\n\tif (impl.oauth2 === void 0) return Effect.fail(new ExpectedOAuth2MethodError({ methodIdentifier: impl.identifier }));\n\tconst fromTokens = impl.oauth2.fromTokens;\n\treturn (fromTokens === void 0 ? Effect.succeed(tokens) : runHook(impl.identifier, \"prepareOAuth2Tokens\", () => fromTokens(tokens, hookContext(context)))).pipe(Effect.flatMap((value) => Schema.decodeUnknownEffect(impl.material)(value)));\n};\n/**\n* Resolve already-decoded stored material into the runtime value handlers receive.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst resolveDecoded = (method, material, context) => {\n\tconst impl = toImpl(method);\n\tconst resolve = impl.resolve;\n\tif (resolve === void 0) return impl.material === impl.value ? Effect.succeed(material) : Schema.decodeUnknownEffect(impl.schema)(material);\n\treturn runHook(impl.identifier, \"resolve\", () => resolve(material, hookContext(context))).pipe(Effect.flatMap((value) => Schema.decodeUnknownEffect(impl.schema)(value)));\n};\n/**\n* Decode stored material and resolve it into the runtime value handlers receive.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst resolve = (method, material, context) => decodeMaterial(method, material).pipe(Effect.flatMap((decodedMaterial) => resolveDecoded(method, decodedMaterial, context)));\n/**\n* Resolve untrusted persisted material into the runtime value handlers receive.\n*\n* This is the persistence-boundary variant of {@link resolve}: callers can pass\n* raw JSON from storage and the method material schema is decoded before any\n* provider hook runs.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst resolveUnknown = resolve;\nconst jsonAuth = {\n\tauthMethodId: Schema.NonEmptyString,\n\tproviderId: Schema.NonEmptyString,\n\tsetup: Schema.optionalKey(Schema.Json)\n};\nconst JsonRequest = Schema.Union([\n\tSchema.TaggedStruct(\"decodeSetup\", jsonAuth),\n\tSchema.TaggedStruct(\"prepare\", {\n\t\t...jsonAuth,\n\t\tinput: Schema.Json\n\t}),\n\tSchema.TaggedStruct(\"prepareOAuth2Tokens\", {\n\t\t...jsonAuth,\n\t\ttokens: Schema.Struct({\n\t\t\taccessToken: Schema.String,\n\t\t\texpiresAt: Schema.optionalKey(Schema.Number),\n\t\t\texpiresIn: Schema.optionalKey(Schema.Number),\n\t\t\traw: Schema.Record(Schema.String, Schema.Json),\n\t\t\trefreshToken: Schema.optionalKey(Schema.String),\n\t\t\tscope: Schema.optionalKey(Schema.String),\n\t\t\ttokenType: Schema.optionalKey(Schema.String)\n\t\t})\n\t}),\n\tSchema.TaggedStruct(\"refresh\", {\n\t\t...jsonAuth,\n\t\tmaterial: Schema.Json,\n\t\tminValidityMs: Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0)),\n\t\tnow: Schema.Finite,\n\t\treason: Schema.Literals([\"before-use\", \"forced\"])\n\t}),\n\tSchema.TaggedStruct(\"resolve\", {\n\t\t...jsonAuth,\n\t\tmaterial: Schema.Json\n\t}),\n\tSchema.TaggedStruct(\"display\", {\n\t\t...jsonAuth,\n\t\tmaterial: Schema.Json\n\t}),\n\tSchema.TaggedStruct(\"test\", {\n\t\t...jsonAuth,\n\t\tmaterial: Schema.Json\n\t})\n]);\n/** Decode canonical JSON once; executable hooks and codecs stay in the guest. */\nconst executeJson = Effect.fn(\"AuthMethod.executeJson\")(function* (method, request) {\n\tconst decode = (schema, value) => Schema.decodeUnknownEffect(Schema.toCodecJson(schema))(value);\n\tconst encode = (schema, value) => Schema.encodeEffect(Schema.toCodecJson(schema))(value);\n\tconst setup = method.setup === void 0 ? void 0 : yield* decode(method.setup, request.setup);\n\tif (request._tag === \"decodeSetup\") return method.setup === void 0 ? void 0 : yield* encode(method.setup, setup);\n\tif (request._tag === \"prepare\") {\n\t\tconst input = method.input === void 0 ? void 0 : yield* decode(method.input, request.input);\n\t\treturn yield* encode(method.material, yield* prepareDecoded(method, input, { setup }));\n\t}\n\tif (request._tag === \"prepareOAuth2Tokens\") return yield* encode(method.material, yield* prepareOAuth2Tokens(method, request.tokens, { setup }));\n\tconst material = yield* decode(method.material, request.material);\n\tif (request._tag === \"refresh\") {\n\t\tconst refreshed = yield* refreshDecoded(method, material, {\n\t\t\t...request,\n\t\t\tsetup\n\t\t});\n\t\treturn refreshed === void 0 ? void 0 : yield* encode(method.material, refreshed);\n\t}\n\tif (request._tag === \"resolve\") return {\n\t\tmethodId: method.identifier,\n\t\tproviderId: request.providerId,\n\t\tvalue: yield* encode(method.value, yield* resolveDecoded(method, material, { setup }))\n\t};\n\tconst impl = toImpl(method);\n\tif (request._tag === \"display\") {\n\t\tconst hook = impl.display;\n\t\treturn hook === void 0 ? void 0 : yield* runHook(method.identifier, \"display\", () => hook(material, { setup }));\n\t}\n\tconst hook = impl.test;\n\treturn hook === void 0 ? { ok: true } : yield* runHook(method.identifier, \"test\", () => hook(material, { setup }));\n});\n/** @since 0.0.0 @category constructors */\nconst display = (method, material, context) => {\n\tconst impl = toImpl(method);\n\tconst displayHook = impl.display;\n\treturn decodeMaterial(method, material).pipe(Effect.flatMap((decodedMaterial) => displayHook === void 0 ? Effect.void : runHook(impl.identifier, \"display\", () => displayHook(decodedMaterial, hookContext(context)))));\n};\n/** @since 0.0.0 @category constructors */\nconst test = (method, material, context) => {\n\tconst impl = toImpl(method);\n\tconst testHook = impl.test;\n\treturn decodeMaterial(method, material).pipe(Effect.flatMap((decodedMaterial) => testHook === void 0 ? Effect.succeed({ ok: true }) : runHook(impl.identifier, \"test\", () => testHook(decodedMaterial, hookContext(context)))));\n};\nexport { AuthMethodExecution_exports as AuthMethodExecution, AuthMethodExecution_exports, JsonRequest, decodeInput, decodeMaterial, decodeSetup, decodeValue, display, executeJson, prepare, prepareDecoded, prepareOAuth2Tokens, prepareUnknown, refreshDecoded, refreshUnknown, resolve, resolveDecoded, resolveUnknown, test };\n\n//# sourceMappingURL=AuthMethodExecution.js.map",
|
|
21
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { validateIdentifier } from \"./internal/identifier.js\";\nimport { PipeableProto } from \"./internal/proto.js\";\nimport { isBindingForMethod, makeBinding } from \"./AuthMethodBinding.js\";\nimport { OAuth2TokenRefresher_exports, Service } from \"./OAuth2TokenRefresher.js\";\nimport { decodeInput, decodeMaterial, decodeSetup, decodeValue, display, prepare, prepareDecoded, prepareOAuth2Tokens, prepareUnknown, refreshDecoded, refreshUnknown, resolve, resolveDecoded, resolveUnknown, test } from \"./AuthMethodExecution.js\";\nimport { Function, Predicate, Schema } from \"effect\";\n// src/AuthMethod.ts\n/**\n* Canonical auth-method definition builders and types for the Dual SDK.\n*\n* Providers own auth methods shared by all actions and triggers under them.\n*\n* @since 0.0.0\n*/\nvar AuthMethod_exports = /* @__PURE__ */ __exportAll({\n\tAuthMethodHookError: () => AuthMethodHookError,\n\tAuthMethodHookOperation: () => AuthMethodHookOperation,\n\tExpectedOAuth2MethodError: () => ExpectedOAuth2MethodError,\n\tOAuth2ProviderTokenResponse: () => OAuth2ProviderTokenResponse,\n\tOAuth2RefreshTokenUnavailableError: () => OAuth2RefreshTokenUnavailableError,\n\tOAuth2TokenMaterial: () => OAuth2TokenMaterial,\n\tOAuth2TokenRefresher: () => OAuth2TokenRefresher_exports,\n\tOAuth2TokenResponse: () => OAuth2TokenResponse,\n\tService: () => Service,\n\tTypeId: () => TypeId,\n\tauth: () => auth,\n\tdecodeInput: () => decodeInput,\n\tdecodeMaterial: () => decodeMaterial,\n\tdecodeSetup: () => decodeSetup,\n\tdecodeValue: () => decodeValue,\n\tdisplay: () => display,\n\tform: () => form,\n\tisAuthMethod: () => isAuthMethod,\n\tisBindingForMethod: () => isBindingForMethod,\n\tmake: () => make,\n\tmakeBinding: () => makeBinding,\n\toauth2: () => oauth2,\n\tprepare: () => prepare,\n\tprepareDecoded: () => prepareDecoded,\n\tprepareOAuth2Tokens: () => prepareOAuth2Tokens,\n\tprepareUnknown: () => prepareUnknown,\n\trefreshDecoded: () => refreshDecoded,\n\trefreshUnknown: () => refreshUnknown,\n\tresolve: () => resolve,\n\tresolveDecoded: () => resolveDecoded,\n\tresolveUnknown: () => resolveUnknown,\n\ttest: () => test\n});\n/**\n* @since 0.0.0\n* @category type ids\n*/\nconst TypeId = \"@dual-os/sdk/AuthMethod\";\n/** @since 0.0.0 @category errors */\nvar ExpectedOAuth2MethodError = class extends Schema.TaggedError()(\"ExpectedOAuth2MethodError\", { methodIdentifier: Schema.String }) {};\n/** @since 0.0.0 @category schemas */\nconst OAuth2ProviderTokenResponse = Schema.Struct({\n\taccess_token: Schema.optional(Schema.String),\n\texpires_at: Schema.optional(Schema.String),\n\texpires_in: Schema.optional(Schema.Union([Schema.Number, Schema.String])),\n\trefresh_token: Schema.optional(Schema.String),\n\tscope: Schema.optional(Schema.String),\n\ttoken_type: Schema.optional(Schema.String)\n});\n/** @since 0.0.0 @category schemas */\nconst OAuth2TokenResponse = Schema.Struct({\n\taccessToken: Schema.String,\n\texpiresAt: Schema.optional(Schema.Number),\n\texpiresIn: Schema.optional(Schema.Number),\n\traw: Schema.Record(Schema.String, Schema.Unknown),\n\trefreshToken: Schema.optional(Schema.String),\n\tscope: Schema.optional(Schema.String),\n\ttokenType: Schema.optional(Schema.String)\n});\n/** @since 0.0.0 @category errors */\nvar OAuth2RefreshTokenUnavailableError = class extends Schema.TaggedError()(\"OAuth2RefreshTokenUnavailableError\", { methodIdentifier: Schema.String }) {};\n/** @since 0.0.0 @category errors */\nconst AuthMethodHookOperation = Schema.Literals([\n\t\"prepare\",\n\t\"refresh\",\n\t\"prepareOAuth2Tokens\",\n\t\"resolve\",\n\t\"display\",\n\t\"test\",\n\t\"oauth2TokenRefresh\"\n]);\n/** @since 0.0.0 @category errors */\nvar AuthMethodHookError = class extends Schema.TaggedError()(\"AuthMethodHookError\", {\n\tcause: Schema.Defect(),\n\tmethodIdentifier: Schema.String,\n\toperation: AuthMethodHookOperation\n}) {};\n/** @since 0.0.0 @category schemas */\nconst OAuth2TokenMaterial = Schema.Struct({\n\taccessToken: Schema.String,\n\texpiresAt: Schema.optional(Schema.Number),\n\texpiresIn: Schema.optional(Schema.Number),\n\traw: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n\trefreshToken: Schema.optional(Schema.String),\n\tscope: Schema.optional(Schema.String),\n\ttokenType: Schema.optional(Schema.String)\n});\nconst Proto = {\n\t...PipeableProto,\n\t[TypeId]: { _Requirements: Function.identity }\n};\nconst makeAuthMethod = (identifier, options) => {\n\tvalidateIdentifier(\"auth-method\", identifier);\n\treturn Object.assign(Object.create(Proto), {\n\t\tdescription: options.description,\n\t\tdisplay: options.display,\n\t\tidentifier,\n\t\tinput: options.input,\n\t\tkind: options.kind,\n\t\tmaterial: options.material,\n\t\tname: options.name,\n\t\toauth2: options.oauth2,\n\t\tprepare: options.prepare,\n\t\trefresh: options.refresh,\n\t\tresolve: options.resolve,\n\t\tschema: options.value,\n\t\tsetup: options.setup,\n\t\ttest: options.test,\n\t\tvalue: options.value\n\t});\n};\n/**\n* Create an {@link AuthMethod} definition.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst make = (identifier, options) => form(identifier, options);\n/**\n* Create a simple form auth method where input, stored material, and runtime value share one schema.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst form = (identifier, options) => makeAuthMethod(identifier, {\n\tdescription: options.description,\n\tdisplay: void 0,\n\tinput: options.schema,\n\tkind: \"form\",\n\tmaterial: options.schema,\n\tname: options.name,\n\toauth2: void 0,\n\tprepare: void 0,\n\trefresh: void 0,\n\tresolve: void 0,\n\tsetup: options.setup,\n\ttest: void 0,\n\tvalue: options.schema\n});\nfunction auth(identifier, options) {\n\tconst material = options.material ?? options.input;\n\tif (material === void 0) throw new Error(`auth method \"${identifier}\" requires material when input is omitted`);\n\treturn makeAuthMethod(identifier, {\n\t\tdescription: options.description,\n\t\tdisplay: options.display,\n\t\tinput: options.input,\n\t\tkind: \"custom\",\n\t\tmaterial,\n\t\tname: options.name,\n\t\toauth2: void 0,\n\t\tprepare: options.prepare,\n\t\trefresh: options.refresh,\n\t\tresolve: options.resolve,\n\t\tsetup: options.setup,\n\t\ttest: options.test,\n\t\tvalue: options.value ?? material\n\t});\n}\n/**\n* Create an OAuth2 auth method over the same setup primitive.\n*\n* OAuth2 has no submitted form input; the platform owns the browser redirect,\n* callback, state/PKCE, and token exchange before storing mapped material.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst oauth2 = (identifier, options) => {\n\tconst oauth2Setup = {\n\t\tclient: options.client,\n\t\tscopes: options.scopes,\n\t\t...options.discoveryUrl === void 0 ? {} : { discoveryUrl: options.discoveryUrl },\n\t\t...options.authorizationUrl === void 0 ? {} : { authorizationUrl: options.authorizationUrl },\n\t\t...options.tokenUrl === void 0 ? {} : { tokenUrl: options.tokenUrl },\n\t\t...options.pkce === void 0 ? {} : { pkce: options.pkce },\n\t\t...options.authorizationParams === void 0 ? {} : { authorizationParams: options.authorizationParams },\n\t\t...options.tokenParams === void 0 ? {} : { tokenParams: options.tokenParams },\n\t\t...options.tokenHeaders === void 0 ? {} : { tokenHeaders: options.tokenHeaders },\n\t\t...options.tokenRequestEncoding === void 0 ? {} : { tokenRequestEncoding: options.tokenRequestEncoding },\n\t\t...options.tokenResponse === void 0 ? {} : { tokenResponse: options.tokenResponse },\n\t\t...options.fromTokens === void 0 ? {} : { fromTokens: options.fromTokens }\n\t};\n\treturn makeAuthMethod(identifier, {\n\t\tdescription: options.description,\n\t\tdisplay: options.display,\n\t\tinput: void 0,\n\t\tkind: \"oauth2\",\n\t\tmaterial: options.material,\n\t\tname: options.name,\n\t\toauth2: oauth2Setup,\n\t\tprepare: void 0,\n\t\trefresh: void 0,\n\t\tresolve: options.resolve,\n\t\tsetup: options.setup,\n\t\ttest: options.test,\n\t\tvalue: options.value ?? options.material\n\t});\n};\n/**\n* Check if a value is an {@link AuthMethod}.\n*\n* @since 0.0.0\n* @category guards\n*/\nconst isAuthMethod = (u) => Predicate.hasProperty(u, TypeId);\nexport { AuthMethodHookError, AuthMethodHookOperation, AuthMethod_exports, ExpectedOAuth2MethodError, OAuth2ProviderTokenResponse, OAuth2RefreshTokenUnavailableError, OAuth2TokenMaterial, OAuth2TokenRefresher_exports as OAuth2TokenRefresher, OAuth2TokenResponse, Service, TypeId, auth, decodeInput, decodeMaterial, decodeSetup, decodeValue, display, form, isAuthMethod, isBindingForMethod, make, makeBinding, oauth2, prepare, prepareDecoded, prepareOAuth2Tokens, prepareUnknown, refreshDecoded, refreshUnknown, resolve, resolveDecoded, resolveUnknown, test };\n\n//# sourceMappingURL=AuthMethod.js.map",
|
|
22
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport \"./ToolFile.js\";\nimport { Schema as Schema$1 } from \"effect\";\n// src/ToolFile.ts\n/**\n* JSON-safe file results that hosts can persist without reconstructing displayed text.\n*\n* @since 0.0.0\n*/\nvar ToolFile_exports = /* @__PURE__ */ __exportAll({\n\tSchema: () => Schema,\n\tToolFile: () => ToolFile_exports\n});\n/**\n* Complete file content and metadata. Hosts validate the bytes before saving them;\n* a filename is a suggestion, never a trusted destination path.\n*\n* @since 0.0.0\n* @category schemas\n*/\nconst Schema = Schema$1.TaggedStruct(\"ToolFile\", {\n\tcontentBase64: Schema$1.String.annotate({\n\t\tcontentEncoding: \"base64\",\n\t\tdescription: \"Complete file bytes in Base64. Preserve this field without truncation.\"\n\t}),\n\tcontentType: Schema$1.NullOr(Schema$1.String),\n\tfilename: Schema$1.NullOr(Schema$1.String),\n\tsizeBytes: Schema$1.Natural\n});\nexport { Schema, ToolFile_exports as ToolFile, ToolFile_exports };\n\n//# sourceMappingURL=ToolFile.js.map",
|
|
23
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { validateIdentifier } from \"./internal/identifier.js\";\nimport { PipeableProto } from \"./internal/proto.js\";\nimport { isAuthMethod } from \"./AuthMethod.js\";\nimport { Schema as Schema$1 } from \"./ToolFile.js\";\nimport \"./AgentChannel.js\";\nimport { Match, Predicate, Schema } from \"effect\";\n// src/AgentChannel.ts\nvar AgentChannel_exports = /* @__PURE__ */ __exportAll({\n\tAccessOutcome: () => AccessOutcome,\n\tAgentChannel: () => AgentChannel_exports,\n\tAsset: () => Asset,\n\tAssetFile: () => AssetFile,\n\tChannelError: () => ChannelError,\n\tCheckedResult: () => CheckedResult,\n\tContent: () => Content,\n\tContextMessage: () => ContextMessage,\n\tContract: () => Contract,\n\tDeliveryUpdate: () => DeliveryUpdate,\n\tDestination: () => Destination,\n\tEcho: () => Echo,\n\tErrorCode: () => ErrorCode,\n\tEvent: () => Event,\n\tExposure: () => Exposure,\n\tFailureCode: () => FailureCode,\n\tFeatures: () => Features,\n\tHandlerError: () => HandlerError,\n\tKey: () => Key,\n\tMessage: () => Message,\n\tOperation: () => Operation,\n\tOperationKind: () => OperationKind,\n\tPlan: () => Plan,\n\tPlanItem: () => PlanItem,\n\tReaction: () => Reaction,\n\tRequest: () => Request,\n\tRequiredChecks: () => RequiredChecks,\n\tStop: () => Stop,\n\tTimestamp: () => Timestamp,\n\tTypeId: () => TypeId,\n\tVerification: () => Verification,\n\tVerifiedIdentity: () => VerifiedIdentity,\n\tWebhookResponse: () => WebhookResponse,\n\tcommandSchema: () => commandSchema,\n\tcontextResult: () => contextResult,\n\thandlerKey: () => handlerKey,\n\tisAgentChannel: () => isAgentChannel,\n\tmake: () => make,\n\tprojectContract: () => projectContract,\n\tresultByteLimit: () => resultByteLimit,\n\tresultSchema: () => resultSchema,\n\tvalidateDefinition: () => validateDefinition\n});\nconst TypeId = \"@dual-os/sdk/AgentChannel\";\n/** Keys are opaque and installation-scoped. Never parse them into product identities. */\nconst Key = Schema.NonEmptyString.check(Schema.isMaxLength(512), Schema.isPattern(/^[^\\p{Cc}]+$/u));\n/** What a destination can show. Every channel shows `present_outcome`. */\nconst OperationKind = Schema.Literals([\n\t\"present_outcome\",\n\t\"create_message\",\n\t\"update_message\",\n\t\"delete_message\",\n\t\"set_reaction\",\n\t\"set_activity\",\n\t\"render_plan\"\n]);\nconst Features = Schema.Struct({\n\tassets: Schema.Boolean,\n\t/** Whether replaying one durable delivery key is safe at the provider boundary. */\n\tdeliveryMode: Schema.Literals([\"idempotent\", \"at-most-once\"]),\n\tdeliveryState: Schema.Boolean,\n\tdirectText: Schema.Literal(true),\n\tgroups: Schema.Boolean,\n\t/** Maximum Unicode code points per physical text message, including server-added prefixes. */\n\tmaxTextLength: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThan(0))),\n\tmentions: Schema.Boolean,\n\t/**\n\t* The output operations every destination of this version shows. Every definition declares\n\t* them; retired catalog contracts that predate them still decode.\n\t*/\n\toperations: Schema.optionalKey(Schema.Array(OperationKind)),\n\t/** Whether `read_context` returns the conversation's earlier messages. */\n\treadContext: Schema.optionalKey(Schema.Boolean),\n\treplies: Schema.Boolean,\n\t/** Maximum age of the original responding input before preparation and delivery. */\n\tresponseWindowMs: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThan(0))),\n\tthreads: Schema.Boolean\n});\nconst HttpUrl = Schema.String.check(Schema.isMaxLength(8192), Schema.makeFilter((value) => {\n\tconst url = URL.parse(value);\n\treturn url !== null && (url.protocol === \"https:\" || url.protocol === \"http:\") && url.username === \"\" && url.password === \"\";\n}));\nconst Text = Schema.String.check(Schema.isMaxLength(65536));\nconst ExtensionKey = Schema.String.check(Schema.isPattern(/^[a-z0-9]+(?:-[a-z0-9]+)*\\/[a-z0-9]+(?:-[a-z0-9]+)*$/));\nconst Extensions = Schema.Record(Schema.String, Schema.Json).check(Schema.makeFilter((values) => Object.keys(values).every(Schema.is(ExtensionKey))));\nconst Destination = Schema.Struct({\n\tconversationKey: Key,\n\tkind: Schema.Literals([\"direct\", \"group\"]),\n\tthreadKey: Schema.optionalKey(Key)\n});\nconst Asset = Schema.Struct({\n\tassetKey: Key,\n\tmediaType: Schema.NonEmptyString.check(Schema.isMaxLength(256)),\n\turl: HttpUrl\n});\nconst Content = Schema.Struct({\n\tassets: Schema.optionalKey(Schema.Array(Asset).check(Schema.isMaxLength(20))),\n\tmentions: Schema.optionalKey(Schema.Array(Key).check(Schema.isMaxLength(100))),\n\treplyToMessageKey: Schema.optionalKey(Key),\n\ttext: Text\n}).check(Schema.makeFilter((content) => content.text.length > 0 || (content.assets?.length ?? 0) > 0));\n/** The body is the unmodified UTF-8 provider body, before JSON parsing/signature verification. */\nconst Request = Schema.Struct({\n\tbody: Schema.String.check(Schema.isMaxLength(1048576), Schema.makeFilter((body) => new TextEncoder().encode(body).byteLength <= 1048576)),\n\theaders: Schema.Record(Schema.NonEmptyString.check(Schema.isMaxLength(256)), Schema.String.check(Schema.isMaxLength(8192))),\n\tmethod: Schema.Literals([\n\t\t\"GET\",\n\t\t\"POST\",\n\t\t\"PUT\",\n\t\t\"PATCH\",\n\t\t\"DELETE\"\n\t]),\n\turl: HttpUrl\n});\nconst ResponseHeaders = Schema.Record(Schema.NonEmptyString.check(Schema.isMaxLength(256), Schema.isPattern(/^[a-z0-9-]+$/)), Schema.String.check(Schema.isMaxLength(8192))).check(Schema.makeFilter((headers) => Object.keys(headers).every((name) => name === \"content-type\" || name === \"cache-control\")));\n/**\n* Bounded provider-required webhook response, returned only after request verification. A 204 or\n* 205 response has an empty body.\n*/\nconst WebhookResponse = Schema.Struct({\n\tbody: Schema.String.check(Schema.isMaxLength(65536), Schema.makeFilter((body) => new TextEncoder().encode(body).byteLength <= 65536)),\n\theaders: Schema.optionalKey(ResponseHeaders),\n\tstatus: Schema.Int.check(Schema.isBetween({\n\t\tmaximum: 299,\n\t\tminimum: 200\n\t}))\n}).check(Schema.makeFilter((response) => response.status !== 204 && response.status !== 205 || response.body === \"\"));\nconst Timestamp = Schema.String.check(Schema.isMaxLength(64), Schema.isPattern(/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$/), Schema.makeFilter((value) => {\n\tconst year = Number(value.slice(0, 4));\n\tconst month = Number(value.slice(5, 7));\n\tconst day = Number(value.slice(8, 10));\n\tconst leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n\tconst days = month === 2 ? leap ? 29 : 28 : [\n\t\t4,\n\t\t6,\n\t\t9,\n\t\t11\n\t].includes(month) ? 30 : 31;\n\treturn month >= 1 && month <= 12 && day >= 1 && day <= days && Number(value.slice(11, 13)) < 24 && Number(value.slice(14, 16)) < 60 && Number(value.slice(17, 19)) < 60 && Schema.decodeUnknownExit(Schema.DateTimeUtcFromString)(value)._tag === \"Success\";\n}));\nconst VerifiedIdentity = Schema.Struct({\n\tconversation: Destination,\n\tsenderKey: Key\n});\nconst AccessOutcome = Schema.Struct({ decision: Schema.Literals([\"allow\", \"deny\"]) });\nconst Verification = Schema.Struct({ verified: Schema.Literal(true) });\nconst Exposure = Schema.Literals([\"webhook\", \"host\"]);\nconst RequiredChecks = Schema.Tuple([Schema.Literal(\"access\")]);\nconst Message = Schema.Struct({\n\tcontent: Content,\n\tconversation: Destination,\n\teventKey: Key,\n\textensions: Schema.optionalKey(Extensions),\n\tkind: Schema.Literal(\"message\"),\n\tmessageKey: Key,\n\trespond: Schema.Boolean,\n\tsenderKey: Key,\n\ttimestamp: Timestamp\n});\nconst DeliveryUpdate = Schema.Struct({\n\tdeliveryKey: Key,\n\tdeliveryUpdateKey: Key,\n\teventKey: Key,\n\textensions: Schema.optionalKey(Extensions),\n\tkind: Schema.Literal(\"delivery_update\"),\n\tproviderDeliveryKey: Key,\n\tsequence: Schema.Natural,\n\tstatus: Schema.Literals([\"succeeded\", \"failed\"]),\n\ttimestamp: Timestamp\n});\n/** Provider-confirmed own output. No content is accepted or added to conversation history. */\nconst Echo = Schema.Struct({\n\t...VerifiedIdentity.fields,\n\teventKey: Key,\n\textensions: Schema.optionalKey(Extensions),\n\tkind: Schema.Literal(\"echo\"),\n\tmessageKey: Key,\n\ttimestamp: Timestamp\n});\n/** The sender asked the agent to stop working in this conversation. Access applies. */\nconst Stop = Schema.Struct({\n\t...VerifiedIdentity.fields,\n\teventKey: Key,\n\textensions: Schema.optionalKey(Extensions),\n\tkind: Schema.Literal(\"stop\"),\n\ttimestamp: Timestamp\n});\nconst Event = Schema.Union([\n\tMessage,\n\tEcho,\n\tDeliveryUpdate,\n\tStop\n]);\n/** The reactions every provider can show. Each provider maps them to its own emoji. */\nconst Reaction = Schema.Literals([\n\t\"thumbs_up\",\n\t\"thumbs_down\",\n\t\"laugh\",\n\t\"confused\",\n\t\"heart\",\n\t\"hooray\",\n\t\"rocket\",\n\t\"eyes\"\n]);\nconst ShortText = Schema.NonEmptyString.check(Schema.isMaxLength(200));\nconst PlanItem = Schema.Struct({\n\titemKey: Key,\n\tnote: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(2e3))),\n\tstate: Schema.Literals([\n\t\t\"pending\",\n\t\t\"in_progress\",\n\t\t\"completed\",\n\t\t\"failed\"\n\t]),\n\ttitle: Schema.NonEmptyString.check(Schema.isMaxLength(256))\n});\n/** A whole task list, always sent complete. Item keys are unique and stable across revisions. */\nconst Plan = Schema.Struct({\n\titems: Schema.Array(PlanItem).check(Schema.isMaxLength(50), Schema.makeFilter((items) => new Set(items.map((item) => item.itemKey)).size === items.length)),\n\ttitle: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(256)))\n});\n/**\n* One piece of output. A `reference` is the `providerDeliveryKey` the provider returned for\n* the message or plan it made; only that provider reads it.\n*/\nconst Operation = Schema.Union([\n\tSchema.Struct({\n\t\tkind: Schema.Literal(\"present_outcome\"),\n\t\toptions: Schema.optionalKey(Schema.Array(ShortText).check(Schema.isMaxLength(10))),\n\t\toutcome: Schema.Literals([\n\t\t\t\"completed\",\n\t\t\t\"failed\",\n\t\t\t\"awaiting_input\"\n\t\t]),\n\t\ttext: Text\n\t}).check(Schema.makeFilter((operation) => operation.options === void 0 || operation.outcome === \"awaiting_input\")),\n\tSchema.Struct({\n\t\tkind: Schema.Literal(\"create_message\"),\n\t\tmessageKey: Key,\n\t\ttext: Text.check(Schema.isMinLength(1))\n\t}),\n\tSchema.Struct({\n\t\tkind: Schema.Literal(\"update_message\"),\n\t\tmessageKey: Key,\n\t\treference: Key,\n\t\ttext: Text.check(Schema.isMinLength(1))\n\t}),\n\tSchema.Struct({\n\t\tkind: Schema.Literal(\"delete_message\"),\n\t\tmessageKey: Key,\n\t\treference: Key\n\t}),\n\tSchema.Struct({\n\t\tactive: Schema.Boolean,\n\t\tkind: Schema.Literal(\"set_reaction\"),\n\t\treaction: Reaction,\n\t\ttarget: Schema.Union([Schema.Struct({ kind: Schema.Literal(\"activation\") }), Schema.Struct({\n\t\t\tkind: Schema.Literal(\"message\"),\n\t\t\treference: Key\n\t\t})])\n\t}),\n\tSchema.Struct({\n\t\tactivity: Schema.Union([Schema.Struct({\n\t\t\tkind: Schema.Literal(\"working\"),\n\t\t\ttext: Schema.optionalKey(ShortText)\n\t\t}), Schema.Struct({ kind: Schema.Literal(\"idle\") })]),\n\t\tkind: Schema.Literal(\"set_activity\")\n\t}),\n\tSchema.Struct({\n\t\tkind: Schema.Literal(\"render_plan\"),\n\t\tplan: Plan,\n\t\treference: Schema.optionalKey(Key),\n\t\trevision: Schema.Int.check(Schema.isGreaterThan(0))\n\t})\n]);\nconst contextMessageFields = {\n\tmessageKey: Key,\n\t/** The agent's own message. */\n\town: Schema.Boolean,\n\tsenderKey: Key,\n\tsenderName: Schema.optionalKey(Schema.NonEmptyString.check(Schema.isMaxLength(256))),\n\ttext: Text,\n\ttimestamp: Timestamp\n};\n/** Published contracts of versions without both `assets` and `readContext` keep this shape. */\nconst TextContextMessage = Schema.Struct(contextMessageFields);\n/** A message read back from history; `assets` only where a version declares assets and context. */\nconst ContextMessage = Schema.Struct({\n\t...contextMessageFields,\n\tassets: Schema.optionalKey(Schema.Array(Asset).check(Schema.isMaxLength(20)))\n});\n/** Decoded originals are limited separately by the host; ordinary command JSON stays bounded. */\nconst AssetFile = Schema$1.check(Schema.makeFilter((file) => file.sizeBytes > 0 && file.sizeBytes <= 10485760 && file.contentBase64.length <= 13981016));\n/** Closed error vocabulary: provider messages, payloads, and causes never cross this seam. */\nconst FailureCode = Schema.Literals([\n\t\"rejected\",\n\t\"unauthorized\",\n\t\"rate_limited\",\n\t\"unavailable\",\n\t\"unknown_completion\",\n\t\"window_closed\"\n]);\nvar HandlerError = class extends Schema.TaggedError()(\"AgentChannelHandlerError\", { code: FailureCode }) {};\nconst ErrorCode = Schema.Literals([\n\t\"invalid_definition\",\n\t\"not_found\",\n\t\"invalid_input\",\n\t\"invalid_auth\",\n\t\"unsupported_feature\",\n\t\"invalid_result\",\n\t\"handler_unavailable\",\n\t\"provider_failure\"\n]);\nvar ChannelError = class extends Schema.TaggedError()(\"AgentChannelError\", {\n\tcode: ErrorCode,\n\tproviderCode: Schema.optionalKey(FailureCode)\n}) {\n\tget message() {\n\t\treturn `Agent Channel ${this.code}`;\n\t}\n};\nconst installedCommandSchema = (state) => {\n\tconst operation = {\n\t\textensions: Schema.optionalKey(Extensions),\n\t\toperationKey: Key\n\t};\n\tconst installed = {\n\t\t...operation,\n\t\tinstallationKey: Key,\n\t\tstate\n\t};\n\treturn Schema.Union([\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"activate\"),\n\t\t\t...operation,\n\t\t\tingressUrl: HttpUrl,\n\t\t\tstate: Schema.optionalKey(state)\n\t\t}),\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"deactivate\"),\n\t\t\t...installed\n\t\t}),\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"receive\"),\n\t\t\t...installed,\n\t\t\trequest: Request\n\t\t}),\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"deliver\"),\n\t\t\t...installed,\n\t\t\t/** The provider message that started the turn, when the host knows it. */\n\t\t\tactivationMessageKey: Schema.optionalKey(Key),\n\t\t\tdeliveryKey: Key,\n\t\t\tdestination: Destination,\n\t\t\toperation: Operation,\n\t\t\t/** Original responding input timestamp; retries must preserve this reference. */\n\t\t\tresponseToTimestamp: Schema.optionalKey(Timestamp)\n\t\t}),\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"read_context\"),\n\t\t\t...installed,\n\t\t\tdestination: Destination,\n\t\t\tlimit: Schema.Int.check(Schema.isBetween({\n\t\t\t\tmaximum: 200,\n\t\t\t\tminimum: 1\n\t\t\t}))\n\t\t})\n\t]);\n};\nconst installedResultSchema = (state, features) => {\n\tconst operation = {\n\t\textensions: Schema.optionalKey(Extensions),\n\t\toperationKey: Key\n\t};\n\treturn Schema.Union([\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"activate\"),\n\t\t\t...operation,\n\t\t\tinstallationKey: Key,\n\t\t\tstate,\n\t\t\t/** Durable read-only provider state that the host must persist before retrying activation. */\n\t\t\tcheckpoint: Schema.optionalKey(Schema.Literal(true)),\n\t\t\t/** The host must observe a verified webhook handshake before cutover. */\n\t\t\tverification: Schema.optionalKey(Schema.Literal(\"ingress\"))\n\t\t}),\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"deactivate\"),\n\t\t\t...operation\n\t\t}),\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"receive\"),\n\t\t\t...operation,\n\t\t\tverified: Schema.Literal(true),\n\t\t\tdeniedEventKeys: Schema.optionalKey(Schema.Array(Key).check(Schema.isMaxLength(100))),\n\t\t\tevents: Schema.Array(Event).check(Schema.isMaxLength(100)),\n\t\t\tresponse: Schema.optionalKey(WebhookResponse),\n\t\t\t/** A provider-native setup challenge or ping proved the configured ingress. */\n\t\t\tactivationProof: Schema.optionalKey(Schema.Literal(\"verified\"))\n\t\t}),\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"deliver\"),\n\t\t\t...operation,\n\t\t\tdeliveryKey: Key,\n\t\t\tstatus: Schema.Literal(\"succeeded\"),\n\t\t\tproviderDeliveryKey: Key\n\t\t}),\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"deliver\"),\n\t\t\t...operation,\n\t\t\tdeliveryKey: Key,\n\t\t\tstatus: Schema.Literal(\"pending\"),\n\t\t\tproviderDeliveryKey: Key\n\t\t}),\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"deliver\"),\n\t\t\t...operation,\n\t\t\tdeliveryKey: Key,\n\t\t\tstatus: Schema.Literal(\"failed\"),\n\t\t\tcode: Schema.Literals([\n\t\t\t\t\"rejected\",\n\t\t\t\t\"unauthorized\",\n\t\t\t\t\"rate_limited\",\n\t\t\t\t\"unavailable\",\n\t\t\t\t\"window_closed\"\n\t\t\t])\n\t\t}),\n\t\tSchema.Struct({\n\t\t\tkind: Schema.Literal(\"read_context\"),\n\t\t\t...operation,\n\t\t\tmessages: Schema.Array(features === void 0 || features.assets && features.readContext === true ? ContextMessage : TextContextMessage).check(Schema.isMaxLength(200))\n\t\t})\n\t]);\n};\nconst readAssetCommand = (state) => Schema.Struct({\n\tasset: Asset,\n\textensions: Schema.optionalKey(Extensions),\n\tidentity: VerifiedIdentity,\n\tinstallationKey: Key,\n\tkind: Schema.Literal(\"read_asset\"),\n\toperationKey: Key,\n\tstate\n});\nconst readAssetResult = Schema.Struct({\n\tassetKey: Key,\n\textensions: Schema.optionalKey(Extensions),\n\tfile: AssetFile,\n\tkind: Schema.Literal(\"read_asset\"),\n\toperationKey: Key\n});\nconst commandSchema = (state) => Schema.Union([installedCommandSchema(state), readAssetCommand(state)]);\n/** Pass a version's features to check its results against its own contract. */\nconst resultSchema = (state, features) => Schema.Union([installedResultSchema(state, features), readAssetResult]);\n/** Maximum UTF-8 bytes in an ordinary Channel command or result, including its JSON envelope. */\nconst resultByteLimit = 2097152;\n/** Keep the newest context messages within the checked result budget, oldest first. */\nfunction contextResult(operationKey, context) {\n\tconst messages = [];\n\tconst result = {\n\t\tkind: \"read_context\",\n\t\tmessages,\n\t\toperationKey\n\t};\n\tconst encoder = new TextEncoder();\n\tlet bytes = encoder.encode(JSON.stringify(result)).byteLength;\n\tfor (let index = context.length - 1; index >= 0; index--) {\n\t\tconst message = context[index];\n\t\tif (message === void 0) continue;\n\t\tconst size = encoder.encode(JSON.stringify(message)).byteLength + 1;\n\t\tif (bytes + size > 2097152) break;\n\t\tbytes += size;\n\t\tmessages.unshift(message);\n\t}\n\treturn result;\n}\n/** Encoded, JSON-safe runtime result suitable for host persistence. */\nconst CheckedResult = resultSchema(Schema.Json);\n/** Immutable catalog projection. Live schemas remain the execution validators. */\nconst Contract = Schema.Struct({\n\tdefinitionSettingsSchemaJson: Schema.Json,\n\tdeploymentSettingsSchemaJson: Schema.Json,\n\texposure: Exposure,\n\textensionsSchemaJson: Schema.Record(Schema.String, Schema.Json),\n\tfeaturesJson: Features.check(Schema.makeFilter((features) => (features.operations ?? []).includes(\"present_outcome\"))),\n\toperationInputSchemaJson: Schema.Json,\n\toperationOutputSchemaJson: Schema.Json,\n\trequiredChecks: RequiredChecks,\n\tstateSchemaJson: Schema.Json\n});\n/** Project the exact declaration once for SDK discovery and server contract comparison. */\nconst projectContract = (definition, project = (schema) => Schema.toJsonSchemaDocument(schema, { onExcessProperty: \"error\" })) => Schema.decodeUnknownSync(Contract)({\n\tdefinitionSettingsSchemaJson: project(definition.definitionSettings),\n\tdeploymentSettingsSchemaJson: project(definition.deploymentSettings),\n\texposure: definition.exposure,\n\textensionsSchemaJson: Object.fromEntries(Object.entries(definition.extensions ?? {}).map(([key, schema]) => [key, project(schema)])),\n\tfeaturesJson: definition.features,\n\toperationInputSchemaJson: project(commandSchema(definition.state)),\n\toperationOutputSchemaJson: project(resultSchema(definition.state, definition.features)),\n\trequiredChecks: definition.requiredChecks,\n\tstateSchemaJson: project(definition.state)\n}, { onExcessProperty: \"error\" });\nconst handlerKey = (channelId) => `@dual-os/sdk/AgentChannel/Handler/${channelId}`;\nconst SchemaDefinition = Schema.declare(Schema.isSchema);\nconst checkSchema = (schema, allowOpaque = false) => {\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst visit = (ast) => {\n\t\tif (seen.has(ast)) return;\n\t\tseen.add(ast);\n\t\tif (ast.annotations?.[\"parseOptions\"] !== void 0 || (ast.checks?.some((check) => check.annotations?.[\"parseOptions\"] !== void 0) ?? false)) throw new ChannelError({ code: \"invalid_definition\" });\n\t\tast.encoding?.forEach((link) => {\n\t\t\tvisit(link.to);\n\t\t});\n\t\tMatch.value(ast).pipe(Match.tag(\"Unknown\", \"Any\", \"ObjectKeyword\", () => {\n\t\t\tthrow new ChannelError({ code: \"invalid_definition\" });\n\t\t}), Match.tag(\"Declaration\", (declaration) => {\n\t\t\tif (!allowOpaque) throw new ChannelError({ code: \"invalid_definition\" });\n\t\t\tdeclaration.typeParameters.forEach(visit);\n\t\t}), Match.tag(\"Objects\", (objects) => {\n\t\t\tobjects.propertySignatures.forEach((property) => visit(property.type));\n\t\t\tobjects.indexSignatures.forEach((index) => {\n\t\t\t\tif (index.parameter._tag !== \"String\" || index.parameter.checks !== void 0 || index.parameter.encoding !== void 0) throw new ChannelError({ code: \"invalid_definition\" });\n\t\t\t\tvisit(index.parameter);\n\t\t\t\tvisit(index.type);\n\t\t\t});\n\t\t}), Match.tag(\"Arrays\", (arrays) => {\n\t\t\tarrays.elements.forEach(visit);\n\t\t\tarrays.rest.forEach(visit);\n\t\t}), Match.tag(\"Union\", (union) => {\n\t\t\tunion.types.forEach(visit);\n\t\t}), Match.tag(\"Suspend\", (suspend) => {\n\t\t\tvisit(suspend.thunk());\n\t\t}), Match.orElse(() => void 0));\n\t};\n\tvisit(schema.ast);\n};\nconst DefinitionSchema = Schema.Struct({\n\tauthMethods: Schema.Array(Schema.declare(isAuthMethod)),\n\tdefinitionSettings: SchemaDefinition,\n\tdeploymentSettings: SchemaDefinition,\n\texposure: Exposure,\n\textensions: Schema.optionalKey(Schema.Record(Schema.String, SchemaDefinition).check(Schema.makeFilter((values) => Object.keys(values).every(Schema.is(ExtensionKey))))),\n\tfeatures: Features,\n\trequiredChecks: RequiredChecks,\n\tstate: SchemaDefinition\n}).check(Schema.makeFilter(({ features }) => {\n\tconst operations = features.operations ?? [];\n\treturn operations.includes(\"present_outcome\") && new Set(operations).size === operations.length && (features.maxTextLength === void 0 || operations.includes(\"create_message\"));\n}));\n/** Validate declarations at registration as well as at builder time. */\nconst validateDefinition = (definition, providerId, methods) => {\n\ttry {\n\t\tSchema.decodeUnknownSync(DefinitionSchema)(definition, { onExcessProperty: \"error\" });\n\t\tfor (const schema of [\n\t\t\tdefinition.definitionSettings,\n\t\t\tdefinition.deploymentSettings,\n\t\t\tdefinition.state,\n\t\t\t...Object.values(definition.extensions ?? {})\n\t\t]) {\n\t\t\tcheckSchema(schema);\n\t\t\tSchema.toJsonSchemaDocument(schema);\n\t\t}\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tfor (const method of definition.authMethods) {\n\t\t\tif (seen.has(method.identifier) || methods !== void 0 && !methods.includes(method)) throw new ChannelError({ code: \"invalid_definition\" });\n\t\t\tseen.add(method.identifier);\n\t\t\tSchema.decodeUnknownSync(SchemaDefinition)(method.material);\n\t\t\tSchema.decodeUnknownSync(SchemaDefinition)(method.value);\n\t\t\tfor (const schema of [\n\t\t\t\tmethod.material,\n\t\t\t\tmethod.value,\n\t\t\t\t...method.setup === void 0 ? [] : [method.setup]\n\t\t\t]) checkSchema(schema, true);\n\t\t}\n\t\tif (providerId !== void 0 && Object.keys(definition.extensions ?? {}).some((key) => !key.startsWith(`${providerId}/`))) throw new ChannelError({ code: \"invalid_definition\" });\n\t} catch {\n\t\tthrow new ChannelError({ code: \"invalid_definition\" });\n\t}\n};\n/** Create a Channel from its contract. */\nconst make = (identifier, options) => {\n\tvalidateIdentifier(\"agent-channel\", identifier);\n\tconst { description, name, ...definition } = options;\n\tvalidateDefinition(definition);\n\treturn {\n\t\t...PipeableProto,\n\t\t[TypeId]: TypeId,\n\t\tdefinition: Object.freeze({\n\t\t\t...definition,\n\t\t\tauthMethods: Object.freeze([...definition.authMethods]),\n\t\t\tfeatures: Object.freeze({ ...definition.features }),\n\t\t\trequiredChecks: Object.freeze([...definition.requiredChecks]),\n\t\t\t...definition.extensions === void 0 ? {} : { extensions: Object.freeze({ ...definition.extensions }) }\n\t\t}),\n\t\tdescription,\n\t\tidentifier,\n\t\tname\n\t};\n};\nconst isAgentChannel = (value) => Predicate.hasProperty(value, TypeId);\nexport { AccessOutcome, AgentChannel_exports as AgentChannel, AgentChannel_exports, Asset, AssetFile, ChannelError, CheckedResult, Content, ContextMessage, Contract, DeliveryUpdate, Destination, Echo, ErrorCode, Event, Exposure, FailureCode, Features, HandlerError, Key, Message, Operation, OperationKind, Plan, PlanItem, Reaction, Request, RequiredChecks, Stop, Timestamp, TypeId, Verification, VerifiedIdentity, WebhookResponse, commandSchema, contextResult, handlerKey, isAgentChannel, make, projectContract, resultByteLimit, resultSchema, validateDefinition };\n\n//# sourceMappingURL=AgentChannel.js.map",
|
|
24
|
+
"import { DuplicateAuthMethodIdentifierError } from \"../DefinitionError.js\";\n// src/internal/auth-runtime.ts\nconst assertNoDuplicateAuthMethodIdentifiers = (providerIdentifier, methods) => {\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const method of methods) {\n\t\tif (seen.has(method.identifier)) throw new DuplicateAuthMethodIdentifierError({\n\t\t\tidentifier: method.identifier,\n\t\t\tproviderIdentifier\n\t\t});\n\t\tseen.add(method.identifier);\n\t}\n};\nexport { assertNoDuplicateAuthMethodIdentifiers };\n\n//# sourceMappingURL=auth-runtime.js.map",
|
|
25
|
+
"// src/internal/collection-utils.ts\nconst appendElements = (existing, additions) => [...existing, ...additions];\nexport { appendElements };\n\n//# sourceMappingURL=collection-utils.js.map",
|
|
26
|
+
"/**\n * Fetch-based implementation of the Effect HTTP client service.\n *\n * This module provides an `HttpClient` layer that executes requests through a\n * Web Fetch API implementation. It is the transport to use in browsers, edge\n * runtimes, and Node.js environments where `globalThis.fetch` is available, or\n * anywhere a compatible fetch function can be supplied.\n *\n * Requests with an `Upgrade` header fail with `TransportError` before anything\n * is sent because fetch cannot hand over the connection.\n *\n * @stability unstable\n * @since 4.0.0\n */\nimport * as Context from \"../Context.js\";\nimport * as Effect from \"../Effect.js\";\nimport * as Stream from \"../Stream.js\";\nimport * as Headers from \"./Headers.js\";\nimport * as HttpClient from \"./HttpClient.js\";\nimport * as HttpClientError from \"./HttpClientError.js\";\nimport * as HttpClientResponse from \"./HttpClientResponse.js\";\n/**\n * Context reference for the `fetch` implementation used by the fetch-based HTTP client.\n *\n * **Details**\n *\n * Defaults to `globalThis.fetch`.\n *\n * @stability unstable\n * @category services\n * @since 4.0.0\n */\nexport const Fetch = /*#__PURE__*/Context.Reference(\"effect/http/FetchHttpClient/Fetch\", {\n defaultValue: () => globalThis.fetch\n});\n/**\n * Context reference controlling stream bodies when the runtime does not support streaming requests.\n *\n * **Details**\n *\n * Defaults to `\"error\"`, which fails with an `EncodeError` without sending the\n * request. Set to `\"buffer\"` to collect the entire stream in memory and send it\n * as a single body instead. Runtimes with streaming support always send the stream.\n *\n * **Gotchas**\n *\n * Buffering keeps the entire upload in memory and can exhaust memory for large\n * or unbounded uploads. Support is detected once, on the first stream body sent,\n * using the global `Request` implementation even when a custom `Fetch` is provided.\n *\n * @stability unstable\n * @category services\n * @since 4.0.0\n */\nexport const StreamBodyFallback = /*#__PURE__*/Context.Reference(\"effect/http/FetchHttpClient/StreamBodyFallback\", {\n defaultValue: () => \"error\"\n});\n/**\n * Service that contains default fetch options for the fetch-based HTTP client.\n *\n * **When to use**\n *\n * Use to provide default credentials, cache, redirect, integrity, or other\n * fetch options for outgoing HTTP requests.\n *\n * **Details**\n *\n * Request-specific method, headers, body, and abort signal are supplied by the client when a request is executed.\n *\n * @see {@link HttpClient.followRedirects} for following redirects in the client, which needs `{ redirect: \"manual\" }` here\n *\n * @stability unstable\n * @category services\n * @since 4.0.0\n */\nexport class RequestInit extends /*#__PURE__*/Context.Service()(\"effect/http/FetchHttpClient/RequestInit\") {}\n// https://developer.chrome.com/docs/capabilities/web-apis/fetch-streaming-requests\nlet supportsStreamBody;\nconst detectStreamBodySupport = () => {\n try {\n let duplexAccessed = false;\n const body = new ReadableStream();\n const request = new Request(\"https://example.com\", {\n method: \"POST\",\n body,\n get duplex() {\n duplexAccessed = true;\n return \"half\";\n }\n });\n // Bun and Deno preserve the stream without reading the duplex option.\n return (duplexAccessed || request.body === body) && !request.headers.has(\"Content-Type\");\n } catch {\n return false;\n }\n};\nconst fetch = /*#__PURE__*/HttpClient.make((request, url, signal, fiber) => {\n if (request.headers.upgrade !== undefined) {\n return Effect.fail(new HttpClientError.HttpClientError({\n reason: new HttpClientError.TransportError({\n request,\n description: \"fetch cannot send an HTTP upgrade request\"\n })\n }));\n }\n const fetch = fiber.getRef(Fetch);\n const options = Context.getOrUndefined(fiber.context, RequestInit) ?? {};\n let headers = options.headers ? Headers.merge(Headers.fromInput(options.headers), request.headers) : request.headers;\n if (headers[\"content-length\"]) {\n headers = Headers.remove(headers, \"content-length\");\n }\n let uploadController;\n const stopUpload = Effect.sync(() => uploadController?.abort());\n const send = body => Effect.map(Effect.tryPromise({\n try: () => fetch(url, {\n ...options,\n method: request.method,\n headers,\n body,\n duplex: typeof ReadableStream !== \"undefined\" && body instanceof ReadableStream ? \"half\" : undefined,\n signal: uploadController ? AbortSignal.any([signal, uploadController.signal]) : signal\n }),\n catch: cause => new HttpClientError.HttpClientError({\n reason: new HttpClientError.TransportError({\n request,\n cause\n })\n })\n }), response => {\n const original = HttpClientResponse.fromWeb(request, response);\n if (!uploadController) return original;\n if (response.body === null) uploadController.abort();\n // Finishing or releasing either response reader ends the upload, not\n // merely receiving headers. Keep the original response and its caches,\n // and inherit its Web source so `toWeb` hands over the original body.\n return Object.create(original, {\n ...Object.fromEntries([\"arrayBuffer\", \"text\", \"json\", \"formData\", \"urlParamsBody\"].map(key => [key, {\n get: () => Effect.ensuring(original[key], stopUpload)\n }])),\n stream: {\n get: () => Stream.ensuring(original.stream, stopUpload)\n }\n });\n }).pipe(Effect.onError(() => stopUpload));\n switch (request.body._tag) {\n case \"Raw\":\n case \"Uint8Array\":\n return send(request.body.body);\n case \"FormData\":\n return send(request.body.formData);\n case \"Stream\":\n {\n supportsStreamBody ??= detectStreamBodySupport();\n if (supportsStreamBody) {\n uploadController = new AbortController();\n const uploadSignal = AbortSignal.any([signal, uploadController.signal]);\n const stopped = Effect.callback(resume => {\n const onAbort = () => resume(Effect.interrupt);\n if (uploadSignal.aborted) {\n onAbort();\n return;\n }\n uploadSignal.addEventListener(\"abort\", onAbort, {\n once: true\n });\n return Effect.sync(() => uploadSignal.removeEventListener(\"abort\", onAbort));\n });\n return Effect.flatMap(Stream.toReadableStreamEffect(Stream.interruptWhen(request.body.stream, stopped)), send);\n }\n if (fiber.getRef(StreamBodyFallback) === \"error\") {\n return Effect.fail(new HttpClientError.HttpClientError({\n reason: new HttpClientError.EncodeError({\n request,\n description: \"Streaming request bodies are not supported in this runtime\"\n })\n }));\n }\n return Stream.mkArrayBuffer(request.body.stream).pipe(Effect.mapError(cause => new HttpClientError.HttpClientError({\n reason: new HttpClientError.EncodeError({\n request,\n cause\n })\n })), Effect.flatMap(send));\n }\n }\n return send(undefined);\n});\n/**\n * Layer that provides an `HttpClient` implementation backed by the configured\n * `Fetch` function.\n *\n * **When to use**\n *\n * Use when an Effect program should execute `HttpClient` requests through the\n * platform `fetch` implementation, especially in browser, edge, or Node.js\n * runtimes with `globalThis.fetch`.\n *\n * **Details**\n *\n * The layer uses the current `Fetch` reference and optional `RequestInit`\n * service for each request. Request-specific method, headers, body, and abort\n * signal are supplied by the client and override matching `RequestInit` fields.\n *\n * **Gotchas**\n *\n * Fetch behavior comes from the runtime's implementation, so CORS, cookies,\n * redirects, abort handling, and streaming support can vary by platform.\n * `fetch` follows redirects itself by default, so `HttpClient.followRedirects`\n * has no effect unless `RequestInit` sets `redirect: \"manual\"`. Trace\n * propagation is on by default, and a browser preflight fails unless the\n * target allows `b3` and `traceparent`. Stream request bodies are sent as Web\n * streams with `duplex: \"half\"` when the runtime supports it; see\n * `StreamBodyFallback` for the unsupported case. Any `content-length` header is\n * removed before calling `fetch`. Chrome passes the support check but rejects\n * streaming uploads over HTTP/1.1, which surfaces as a `TransportError`, and\n * browsers only deliver the response after the entire request body has been sent.\n *\n * @see {@link Fetch} for supplying the fetch implementation used by this layer\n * @see {@link RequestInit} for default `RequestInit` options applied before request-specific fields\n * @see {@link StreamBodyFallback} for opting into buffering on unsupported runtimes\n * @see {@link HttpClient.TracerPropagationEnabled} for leaving `b3` and `traceparent` off a browser request\n *\n * @stability unstable\n * @category layers\n * @since 4.0.0\n */\nexport const layer = /*#__PURE__*/HttpClient.layerMergedContext(/*#__PURE__*/Effect.succeed(fetch));\n//# sourceMappingURL=FetchHttpClient.js.map",
|
|
27
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { validateIdentifier } from \"./internal/identifier.js\";\nimport { PipeableProto } from \"./internal/proto.js\";\nimport { Array, DateTime, Duration, Effect, Match, Number, Option, Predicate, Schema, pipe } from \"effect\";\nimport { Headers, HttpClientError } from \"effect/http\";\n// src/Action.ts\nvar Action_exports = /* @__PURE__ */ __exportAll({\n\tActionHandlerError: () => ActionHandlerError,\n\tRetryableActionHandlerError: () => RetryableActionHandlerError,\n\tTypeId: () => TypeId,\n\tfromHttpClientFailure: () => fromHttpClientFailure,\n\thandlerKey: () => handlerKey,\n\tisAction: () => isAction,\n\tmake: () => make,\n\torHttpClientFailure: () => orHttpClientFailure\n});\n/**\n* @since 0.0.0\n* @category type ids\n*/\nconst TypeId = \"@dual-os/sdk/Action\";\n/**\n* Non-retryable failure reported by a trusted action handler.\n*\n* The invoke boundary owns action/provider/version metadata, so handler errors\n* intentionally describe only the failed operation itself.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar ActionHandlerError = class extends Schema.TaggedError()(\"ActionHandlerError\", {\n\tcause: Schema.optional(Schema.Defect()),\n\tdetails: Schema.optional(Schema.Unknown),\n\tmessage: Schema.String,\n\tstatus: Schema.optional(Schema.Number)\n}) {};\n/**\n* Retryable failure reported by a trusted action handler.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar RetryableActionHandlerError = class extends Schema.TaggedError()(\"RetryableActionHandlerError\", {\n\tcause: Schema.optional(Schema.Defect()),\n\tdetails: Schema.optional(Schema.Unknown),\n\tmessage: Schema.String,\n\tretryAfterSeconds: Schema.optional(Schema.Number),\n\tstatus: Schema.optional(Schema.Number)\n}) {};\nfunction retryAfterSeconds(headers) {\n\treturn pipe(Option.fromNullishOr(headers), Option.flatMap(Headers.get(\"retry-after\")), Option.flatMap((value) => Option.orElse(Number.parse(value), () => Option.map(DateTime.make(value), (date) => Duration.toSeconds(DateTime.distance(DateTime.nowUnsafe(), date))))), Option.map(Number.clamp({\n\t\tmaximum: 3600,\n\t\tminimum: 0\n\t})), Option.getOrUndefined);\n}\nfunction schemaIssuesAt(issue, path) {\n\treturn pipe(Match.value(issue), Match.tags({\n\t\tAnyOf: (anyOf) => Array.match(anyOf.issues, {\n\t\t\tonEmpty: () => [{\n\t\t\t\tkind: anyOf._tag,\n\t\t\t\tpath\n\t\t\t}],\n\t\t\tonNonEmpty: (issues) => Array.flatMap(issues, (inner) => schemaIssuesAt(inner, path))\n\t\t}),\n\t\tComposite: (composite) => Array.flatMap(composite.issues, (inner) => schemaIssuesAt(inner, path)),\n\t\tEncoding: (encoding) => schemaIssuesAt(encoding.issue, path),\n\t\tPointer: (pointer) => schemaIssuesAt(pointer.issue, [...path, ...pointer.path])\n\t}), Match.orElse((leaf) => [{\n\t\tkind: leaf._tag,\n\t\tpath\n\t}]));\n}\nfunction schemaIssues(issue) {\n\treturn Array.map(schemaIssuesAt(issue, []), (located) => ({\n\t\tkind: located.kind,\n\t\tpath: Array.filter(located.path, Predicate.or(Predicate.isString, Predicate.isNumber))\n\t}));\n}\n/**\n* Map an Effect HTTP client failure to the action failure contract.\n*\n* Transport failures, rate limits, and server errors can be retried, carrying\n* the provider's Retry-After delay (at most an hour) when the response sent\n* one. Request construction, response decoding, declared client errors, and\n* other client errors are terminal.\n*\n* @since 0.0.0\n* @category errors\n*/\nconst fromHttpClientFailure = (error) => {\n\tif (Schema.isSchemaError(error)) return new ActionHandlerError({\n\t\tcause: error,\n\t\tdetails: {\n\t\t\tissues: schemaIssues(error.issue),\n\t\t\treason: \"SchemaError\"\n\t\t},\n\t\tmessage: \"HTTP response did not match the expected schema\"\n\t});\n\tif (!HttpClientError.isHttpClientError(error)) {\n\t\tconst status = error.response.status;\n\t\tconst fields = {\n\t\t\tdetails: error.cause,\n\t\t\tmessage: `HTTP request failed with status ${status}`,\n\t\t\tstatus\n\t\t};\n\t\treturn status === 429 || status >= 500 ? RetryableActionHandlerError.make({\n\t\t\t...fields,\n\t\t\tretryAfterSeconds: retryAfterSeconds(error.response.headers)\n\t\t}) : new ActionHandlerError(fields);\n\t}\n\tconst status = error.response?.status;\n\tconst fields = {\n\t\tmessage: status === void 0 ? \"HTTP request failed\" : `HTTP request failed with status ${status}`,\n\t\t...status === void 0 ? {} : { status },\n\t\tdetails: {\n\t\t\tmethod: error.request.method,\n\t\t\treason: error.reason._tag\n\t\t},\n\t\tcause: error\n\t};\n\treturn error.reason._tag === \"TransportError\" || status === 429 || status !== void 0 && status >= 500 ? RetryableActionHandlerError.make({\n\t\t...fields,\n\t\tretryAfterSeconds: retryAfterSeconds(error.response?.headers)\n\t}) : new ActionHandlerError(fields);\n};\n/**\n* Map an Effect HTTP client effect onto the action failure contract.\n*\n* @since 0.0.0\n* @category errors\n*/\nconst orHttpClientFailure = (effect) => Effect.mapError(effect, fromHttpClientFailure);\n/**\n* Context key used for the action handler with the supplied canonical id.\n*\n* @since 0.0.0\n* @category handlers\n*/\nconst handlerKey = (actionId) => `@dual-os/sdk/Action/Handler/${actionId}`;\nconst Proto = {\n\t...PipeableProto,\n\t[TypeId]: TypeId\n};\n/**\n* Create an {@link Action} from its contract.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst make = (identifier, options) => {\n\tvalidateIdentifier(\"action\", identifier);\n\treturn Object.assign(Object.create(Proto), {\n\t\tdescription: options.description,\n\t\texamples: options.examples ?? [],\n\t\tidentifier,\n\t\tinput: options.input,\n\t\tname: options.name,\n\t\toutput: options.output,\n\t\trequireAuth: options.requireAuth ?? true\n\t});\n};\n/**\n* Check if a value is an {@link Action}.\n*\n* @since 0.0.0\n* @category guards\n*/\nconst isAction = (u) => Predicate.hasProperty(u, TypeId);\nexport { ActionHandlerError, Action_exports, RetryableActionHandlerError, TypeId, fromHttpClientFailure, handlerKey, isAction, make, orHttpClientFailure };\n\n//# sourceMappingURL=Action.js.map",
|
|
28
|
+
"import { Array, Context, Predicate, String } from \"effect\";\n// src/internal/handler-context.ts\n/**\n* A plugin's handlers live in the layer context as one group entry, keyed by\n* plugin id, so merging layer outputs grows with the number of plugins and\n* not with their actions. A handler keeps the services of its own build, never\n* the groups of other plugins, and a runtime resolves groups through one\n* index entry, so per-call context copies grow with the services in the app.\n*/\nconst groupKeyPrefix = \"@dual-os/sdk/Plugin/Handlers/\";\nconst handlerGroupKey = (pluginId) => `${groupKeyPrefix}${pluginId}`;\nconst isGroupKey = String.startsWith(groupKeyPrefix);\nvar HandlerIndex = class extends Context.Service()(\"@dual-os/sdk/internal/handler-context/HandlerIndex\") {};\nconst withoutGroups = (context) => {\n\tconst services = Array.filter(Array.fromIterable(context.mapUnsafe), (entry) => !isGroupKey(entry[0]));\n\treturn services.length === context.mapUnsafe.size ? context : Context.makeUnsafe(new Map(services));\n};\nconst indexGroups = (context) => {\n\tconst entries = Array.fromIterable(context.mapUnsafe);\n\treturn Context.add(Context.makeUnsafe(new Map(Array.filter(entries, (entry) => !isGroupKey(entry[0])))), HandlerIndex, new Map(Array.filter(entries, (entry) => isGroupKey(entry[0]))));\n};\nconst mergeUnder = (lower, input) => Array.reduce(Array.fromIterable(lower.mapUnsafe), input, (merged, entry) => input.mapUnsafe.has(entry[0]) ? merged : Context.addUnsafe(merged, entry[0], entry[1]));\nconst findHandler = (context, providerId, handlerKey) => {\n\tconst groupKey = handlerGroupKey(providerId);\n\tconst group = context.mapUnsafe.get(groupKey) ?? Context.getOrUndefined(context, HandlerIndex)?.get(groupKey);\n\treturn Predicate.isMap(group) ? group.get(handlerKey) : void 0;\n};\nexport { findHandler, handlerGroupKey, indexGroups, mergeUnder, withoutGroups };\n\n//# sourceMappingURL=handler-context.js.map",
|
|
29
|
+
"import { Effect, Schema } from \"effect\";\n// src/internal/schema-runtime.ts\nfunction decodeJson(schema, value) {\n\treturn Schema.decodeUnknownEffect(Schema.toCodecJson(schema))(value);\n}\nconst decodeJsonMapError = (schema, value, mapError) => decodeJson(schema, value).pipe(Effect.mapError(mapError));\nexport { decodeJson, decodeJsonMapError };\n\n//# sourceMappingURL=schema-runtime.js.map",
|
|
30
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport \"./ConnectionResolver.js\";\nimport { Context, Schema } from \"effect\";\n// src/ConnectionResolver.ts\nvar ConnectionResolver_exports = /* @__PURE__ */ __exportAll({\n\tConnectionIdNotAllowedError: () => ConnectionIdNotAllowedError,\n\tConnectionReauthorizationRequiredError: () => ConnectionReauthorizationRequiredError,\n\tConnectionRequiredError: () => ConnectionRequiredError,\n\tConnectionResolver: () => ConnectionResolver_exports,\n\tConnectionResolverStoreError: () => ConnectionResolverStoreError,\n\tConnectionSelectionRequiredError: () => ConnectionSelectionRequiredError,\n\tInvalidConnectionIdError: () => InvalidConnectionIdError,\n\tInvalidResolvedConnectionError: () => InvalidResolvedConnectionError,\n\tService: () => Service\n});\n/**\n* Raised when a runtime target does not accept a connection but a connectionId was still provided.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar ConnectionIdNotAllowedError = class extends Schema.TaggedError()(\"ConnectionIdNotAllowedError\", {\n\tconnectionId: Schema.String,\n\tphase: Schema.optional(Schema.String),\n\tproviderId: Schema.String,\n\ttargetId: Schema.String,\n\ttargetKind: Schema.Literals([\n\t\t\"action\",\n\t\t\"trigger\",\n\t\t\"ai_model\",\n\t\t\"agent-channel\"\n\t])\n}) {};\n/**\n* Raised when execution requires a connection and no compatible binding is available.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar ConnectionRequiredError = class extends Schema.TaggedError()(\"ConnectionRequiredError\", {\n\tphase: Schema.optional(Schema.String),\n\tproviderId: Schema.String,\n\ttargetId: Schema.String,\n\ttargetKind: Schema.Literals([\n\t\t\"action\",\n\t\t\"trigger\",\n\t\t\"ai_model\",\n\t\t\"agent-channel\"\n\t])\n}) {};\n/**\n* Raised when several compatible connection bindings exist and the caller must choose one.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar ConnectionSelectionRequiredError = class extends Schema.TaggedError()(\"ConnectionSelectionRequiredError\", {\n\tphase: Schema.optional(Schema.String),\n\tproviderId: Schema.String,\n\ttargetId: Schema.String,\n\ttargetKind: Schema.Literals([\n\t\t\"action\",\n\t\t\"trigger\",\n\t\t\"ai_model\",\n\t\t\"agent-channel\"\n\t])\n}) {};\n/**\n* Raised when the requested connectionId does not resolve to a compatible binding.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar InvalidConnectionIdError = class extends Schema.TaggedError()(\"InvalidConnectionIdError\", {\n\tconnectionId: Schema.String,\n\tphase: Schema.optional(Schema.String),\n\tproviderId: Schema.String,\n\ttargetId: Schema.String,\n\ttargetKind: Schema.Literals([\n\t\t\"action\",\n\t\t\"trigger\",\n\t\t\"ai_model\",\n\t\t\"agent-channel\"\n\t])\n}) {};\n/**\n* Raised when the resolved connection value does not satisfy the selected auth method schema.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar InvalidResolvedConnectionError = class extends Schema.TaggedError()(\"InvalidResolvedConnectionError\", {\n\tdescription: Schema.String,\n\tmethodId: Schema.String,\n\tphase: Schema.optional(Schema.String),\n\tproviderId: Schema.String,\n\ttargetId: Schema.String,\n\ttargetKind: Schema.Literals([\n\t\t\"action\",\n\t\t\"trigger\",\n\t\t\"ai_model\",\n\t\t\"agent-channel\"\n\t])\n}) {};\n/**\n* Raised when the provider refuses the connection's stored grant, so the user must sign in again.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar ConnectionReauthorizationRequiredError = class extends Schema.TaggedError()(\"ConnectionReauthorizationRequiredError\", {\n\tconnectionId: Schema.String,\n\tmessage: Schema.String,\n\tphase: Schema.optional(Schema.String),\n\tproviderId: Schema.String,\n\ttargetId: Schema.String,\n\ttargetKind: Schema.Literals([\n\t\t\"action\",\n\t\t\"trigger\",\n\t\t\"ai_model\",\n\t\t\"agent-channel\"\n\t])\n}) {};\n/**\n* Raised when the host credential store cannot be read during connection resolution.\n*\n* @since 0.0.0\n* @category errors\n*/\nvar ConnectionResolverStoreError = class extends Schema.TaggedError()(\"ConnectionResolverStoreError\", {\n\tcause: Schema.Defect(),\n\toperation: Schema.String,\n\tphase: Schema.optional(Schema.String),\n\tproviderId: Schema.String,\n\ttargetId: Schema.String,\n\ttargetKind: Schema.Literals([\n\t\t\"action\",\n\t\t\"trigger\",\n\t\t\"ai_model\",\n\t\t\"agent-channel\"\n\t])\n}) {};\n/**\n* Host-provided connection resolver service.\n*\n* @since 0.0.0\n* @category services\n*/\nvar Service = class extends Context.Service()(\"@dual-os/sdk/ConnectionResolver\") {};\nexport { ConnectionIdNotAllowedError, ConnectionReauthorizationRequiredError, ConnectionRequiredError, ConnectionResolver_exports as ConnectionResolver, ConnectionResolverStoreError, ConnectionResolver_exports, ConnectionSelectionRequiredError, InvalidConnectionIdError, InvalidResolvedConnectionError, Service };\n\n//# sourceMappingURL=ConnectionResolver.js.map",
|
|
31
|
+
"import { isBindingForMethod, makeBinding } from \"../AuthMethodBinding.js\";\nimport { decodeSetup, resolveDecoded, resolveUnknown } from \"../AuthMethodExecution.js\";\nimport { ConnectionIdNotAllowedError, InvalidResolvedConnectionError, Service } from \"../ConnectionResolver.js\";\nimport { decodeJson } from \"./schema-runtime.js\";\nimport { Effect } from \"effect\";\n// src/internal/auth-execution.ts\nconst knownAuthMethodIds = (methods) => methods.map((method) => method.identifier);\nconst fullAuthMethodId = (providerId, method) => `${providerId}/${method.identifier}`;\nconst findMethod = (providerId, methods, methodId) => methods.find((method) => method.identifier === methodId || fullAuthMethodId(providerId, method) === methodId);\nconst invalidResolvedAuth = (targetKind, targetId, phase, providerId, methodId, description) => new InvalidResolvedConnectionError({\n\tdescription,\n\tmethodId,\n\tphase,\n\tproviderId,\n\ttargetId,\n\ttargetKind\n});\nconst makeAuthContext = (binding) => {\n\tconst context = {\n\t\tcurrent: binding,\n\t\tis(methodOrBinding, maybeMethod) {\n\t\t\treturn maybeMethod === void 0 ? isBindingForMethod(context.current, methodOrBinding) : isBindingForMethod(methodOrBinding, maybeMethod);\n\t\t},\n\t\tmatch(cases) {\n\t\t\treturn cases[context.current.methodId](context.current);\n\t\t}\n\t};\n\treturn context;\n};\nconst noAuthRuntimeContext = () => ({});\nconst authRuntimeContext = (binding) => ({ auth: makeAuthContext(binding) });\nconst toNonEmptyArray = (values) => values.length === 0 ? void 0 : [values[0], ...values.slice(1)];\nconst failConnectionIdNotAllowed = (targetKind, targetId, phase, providerId, connectionId) => Effect.fail(new ConnectionIdNotAllowedError({\n\tconnectionId,\n\tphase,\n\tproviderId,\n\ttargetId,\n\ttargetKind\n}));\nconst resolveRuntimeConnection = (targetKind, targetId, phase, providerId, methods, connectionId, context) => Effect.gen(function* () {\n\tconst resolved = yield* (yield* Service).resolve({\n\t\ttarget: {\n\t\t\tproviderId,\n\t\t\ttargetId,\n\t\t\ttargetKind,\n\t\t\t...phase === void 0 ? {} : { phase }\n\t\t},\n\t\t...connectionId === void 0 ? {} : { connectionId },\n\t\t...context === void 0 ? {} : { context }\n\t});\n\tif (resolved.providerId !== providerId) return yield* invalidResolvedAuth(targetKind, targetId, phase, providerId, resolved.methodId, `expected provider \"${providerId}\", got \"${resolved.providerId}\"`);\n\tconst method = findMethod(providerId, methods, resolved.methodId);\n\tif (method === void 0) return yield* invalidResolvedAuth(targetKind, targetId, phase, providerId, resolved.methodId, `method \"${resolved.methodId}\" is not registered for provider \"${providerId}\"; known methods: ${knownAuthMethodIds(methods).join(\", \")}`);\n\tconst setup = yield* (resolved.encoding === \"json\" && method.setup !== void 0 ? decodeJson(method.setup, resolved.setup) : decodeSetup(method, resolved.setup)).pipe(Effect.mapError((error) => invalidResolvedAuth(targetKind, targetId, phase, providerId, method.identifier, error.message)));\n\tconst value = yield* (resolved.encoding === \"json\" ? decodeJson(method.material, resolved.material).pipe(Effect.flatMap((material) => resolveDecoded(method, material, { setup }))) : resolveUnknown(method, resolved.material, { setup })).pipe(Effect.mapError((error) => invalidResolvedAuth(targetKind, targetId, phase, providerId, method.identifier, error instanceof Error ? error.message : String(error))));\n\treturn makeBinding({\n\t\tconnectionId: resolved.connectionId,\n\t\tmethod,\n\t\tproviderId,\n\t\tvalue\n\t});\n});\nexport { authRuntimeContext, failConnectionIdNotAllowed, noAuthRuntimeContext, resolveRuntimeConnection, toNonEmptyArray };\n\n//# sourceMappingURL=auth-execution.js.map",
|
|
32
|
+
"import { findHandler } from \"./handler-context.js\";\nimport { decodeJson, decodeJsonMapError } from \"./schema-runtime.js\";\nimport { authRuntimeContext, failConnectionIdNotAllowed, noAuthRuntimeContext, resolveRuntimeConnection, toNonEmptyArray } from \"./auth-execution.js\";\nimport { InvalidTriggerConfigError, InvalidTriggerOutputError, InvalidTriggerStateError, UnsupportedTriggerRuntimeError, handlerKey } from \"../Trigger.js\";\nimport { Effect, Schema } from \"effect\";\n// src/internal/trigger-runtime-shared.ts\nconst decodeConfig = (triggerId, schema, value) => decodeJsonMapError(schema, value, (error) => new InvalidTriggerConfigError({\n\tdescription: error.message,\n\ttriggerId\n}));\nconst decodeStateValue = () => Effect.as(Effect.void, void 0);\nfunction decodeStateSchema(schema, value) {\n\tif (value === void 0) return decodeStateValue();\n\treturn decodeJson(schema, value);\n}\nfunction decodeState(triggerId, phase, schema, value) {\n\tif (schema === void 0) return value === void 0 ? decodeStateValue() : Effect.fail(new InvalidTriggerStateError({\n\t\tdescription: \"state is not supported for this trigger\",\n\t\tlocation: \"input\",\n\t\tphase,\n\t\ttriggerId\n\t}));\n\treturn decodeStateSchema(schema, value).pipe(Effect.mapError((error) => new InvalidTriggerStateError({\n\t\tdescription: error.message,\n\t\tlocation: \"input\",\n\t\tphase,\n\t\ttriggerId\n\t})));\n}\nconst encodeStateSchema = (triggerId, phase, schema, value) => {\n\tif (value === void 0) return Effect.void;\n\treturn Schema.encodeEffect(schema)(value).pipe(Effect.mapError((error) => new InvalidTriggerStateError({\n\t\tdescription: error.message,\n\t\tlocation: \"result\",\n\t\tphase,\n\t\ttriggerId\n\t})));\n};\nfunction validateStateResult(triggerId, phase, schema, value) {\n\tif (schema === void 0) return value === void 0 ? decodeStateValue() : Effect.fail(new InvalidTriggerStateError({\n\t\tdescription: \"state is not supported for this trigger\",\n\t\tlocation: \"result\",\n\t\tphase,\n\t\ttriggerId\n\t}));\n\treturn encodeStateSchema(triggerId, phase, schema, value);\n}\nconst KeyedEventEnvelope = Schema.Struct({\n\tkey: Schema.NonEmptyString,\n\tpayload: Schema.Unknown\n});\nconst eventKeysAreUnique = (events) => {\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const event of events) {\n\t\tif (seen.has(event.key)) return `duplicate event key \"${event.key}\"`;\n\t\tseen.add(event.key);\n\t}\n\treturn true;\n};\nconst KeyedEventEnvelopes = Schema.Array(KeyedEventEnvelope).check(Schema.makeFilter(eventKeysAreUnique));\nconst mapOutputError = (triggerId, phase) => (error) => new InvalidTriggerOutputError({\n\tdescription: error.message,\n\tphase,\n\ttriggerId\n});\nconst validateOutputs = (triggerId, phase, schema, events) => Schema.decodeUnknownEffect(KeyedEventEnvelopes)(events).pipe(Effect.flatMap((decodedEvents) => Effect.forEach(decodedEvents, (event) => Schema.encodeEffect(schema)(event.payload).pipe(Effect.flatMap((encoded) => Schema.decodeUnknownEffect(Schema.Json)(encoded)), Effect.map((payload) => ({\n\tkey: event.key,\n\tpayload\n}))))), Effect.mapError(mapOutputError(triggerId, phase)));\nconst getTriggerHandler = (entry) => Effect.context().pipe(Effect.flatMap((context) => {\n\tconst handler = findHandler(context, entry.providerId, handlerKey(entry.triggerId));\n\treturn handler === void 0 ? Effect.fail(new UnsupportedTriggerRuntimeError({\n\t\tkind: entry.trigger.kind,\n\t\tphase: entry.trigger.kind === \"polling\" ? \"poll\" : \"parse\",\n\t\ttriggerId: entry.triggerId\n\t})) : Effect.succeed(handler);\n}));\nconst requireWebhookHook = (entry, phase) => {\n\tif (entry.trigger.kind !== \"webhook\") return Effect.fail(new UnsupportedTriggerRuntimeError({\n\t\tkind: entry.trigger.kind,\n\t\tphase,\n\t\ttriggerId: entry.triggerId\n\t}));\n\treturn getTriggerHandler(entry).pipe(Effect.flatMap((handler) => {\n\t\tconst hook = handler.runtime[phase];\n\t\tif (hook === void 0) return Effect.fail(new UnsupportedTriggerRuntimeError({\n\t\t\tkind: entry.trigger.kind,\n\t\t\tphase,\n\t\t\ttriggerId: entry.triggerId\n\t\t}));\n\t\treturn Effect.succeed({\n\t\t\tcontext: handler.context,\n\t\t\thook\n\t\t});\n\t}));\n};\nconst requirePollingHook = (entry) => {\n\tif (entry.trigger.kind !== \"polling\") return Effect.fail(new UnsupportedTriggerRuntimeError({\n\t\tkind: entry.trigger.kind,\n\t\tphase: \"poll\",\n\t\ttriggerId: entry.triggerId\n\t}));\n\treturn getTriggerHandler(entry).pipe(Effect.flatMap((handler) => {\n\t\tconst hook = handler.runtime.poll;\n\t\tif (hook === void 0) return Effect.fail(new UnsupportedTriggerRuntimeError({\n\t\t\tkind: entry.trigger.kind,\n\t\t\tphase: \"poll\",\n\t\t\ttriggerId: entry.triggerId\n\t\t}));\n\t\treturn Effect.succeed({\n\t\t\tcontext: handler.context,\n\t\t\thook\n\t\t});\n\t}));\n};\nconst withRuntimeContext = (entry, phase, connectionId, context, run) => {\n\tconst requiredAuthMethods = toNonEmptyArray(entry.authMethods);\n\tconst runtimeContext = (authContext) => context === void 0 ? authContext : {\n\t\t...context,\n\t\t...authContext\n\t};\n\tif (requiredAuthMethods === void 0) {\n\t\tif (connectionId !== void 0) return failConnectionIdNotAllowed(\"trigger\", entry.triggerId, phase, entry.providerId, connectionId);\n\t\treturn run(runtimeContext(noAuthRuntimeContext()));\n\t}\n\tif (entry.trigger.requireAuth === false && connectionId === void 0) return run(runtimeContext(noAuthRuntimeContext()));\n\treturn resolveRuntimeConnection(\"trigger\", entry.triggerId, phase, entry.providerId, requiredAuthMethods, connectionId, context).pipe(Effect.flatMap((binding) => run(runtimeContext(authRuntimeContext(binding)))));\n};\nexport { decodeConfig, decodeState, requirePollingHook, requireWebhookHook, validateOutputs, validateStateResult, withRuntimeContext };\n\n//# sourceMappingURL=trigger-runtime-shared.js.map",
|
|
33
|
+
"import { mergeUnder } from \"./handler-context.js\";\nimport { decodeConfig, decodeState, requirePollingHook, requireWebhookHook, validateOutputs, validateStateResult, withRuntimeContext } from \"./trigger-runtime-shared.js\";\nimport { Effect, Record, String } from \"effect\";\n// src/internal/trigger-runtime.ts\n/**\n* Shared execution skeleton for all trigger runtime phases: decode config and\n* state, resolve the runtime connection, run the hook inside the registered\n* handler context, then hand the raw hook result to the phase finisher.\n*/\nconst runPhase = (options) => Effect.gen(function* () {\n\tconst { entry, phase, request } = options;\n\tconst runtime = yield* options.hook;\n\tconst config = yield* decodeConfig(entry.triggerId, entry.trigger.config, request.config);\n\tconst state = yield* decodeState(entry.triggerId, phase, entry.trigger.state, request.state);\n\tconst input = {\n\t\t...options.input,\n\t\tconfig,\n\t\tstate\n\t};\n\tconst result = yield* withRuntimeContext(entry, phase, request.connectionId, request.context, (context) => Effect.suspend(() => runtime.hook(input, context))).pipe(Effect.updateContext((current) => mergeUnder(runtime.context, current)));\n\treturn yield* options.finish(result);\n});\nconst meta = (entry, phase) => ({\n\tphase,\n\ttriggerId: entry.triggerId\n});\nconst finishEmit = (entry, phase) => (emitted) => validateOutputs(entry.triggerId, phase, entry.trigger.output, emitted.events).pipe(Effect.zip(validateStateResult(entry.triggerId, phase, entry.trigger.state, emitted.state)), Effect.map(([events, state]) => ({\n\tevents,\n\tmeta: meta(entry, phase),\n\tstate\n})));\nconst activate = (entry, request) => runPhase({\n\tentry,\n\tfinish: (result) => validateStateResult(entry.triggerId, \"activate\", entry.trigger.state, result.state).pipe(Effect.map((state) => ({\n\t\tmeta: meta(entry, \"activate\"),\n\t\tstate\n\t}))),\n\thook: requireWebhookHook(entry, \"activate\"),\n\tinput: { webhookUrl: request.webhookUrl },\n\tphase: \"activate\",\n\trequest\n});\nconst deactivate = (entry, request) => runPhase({\n\tentry,\n\tfinish: () => Effect.succeed({ meta: meta(entry, \"deactivate\") }),\n\thook: requireWebhookHook(entry, \"deactivate\"),\n\tinput: { webhookUrl: request.webhookUrl },\n\tphase: \"deactivate\",\n\trequest\n});\nconst lowercaseHeaders = (request) => request.headers === void 0 ? request : {\n\t...request,\n\theaders: Record.mapKeys(request.headers, String.toLowerCase)\n};\nconst verify = (entry, request) => runPhase({\n\tentry,\n\tfinish: Effect.fnUntraced(function* (result) {\n\t\tconst state = yield* validateStateResult(entry.triggerId, \"verify\", entry.trigger.state, result?.state);\n\t\treturn {\n\t\t\tverified: true,\n\t\t\t...result?.response === void 0 ? {} : { response: result.response },\n\t\t\t...state === void 0 ? {} : { state },\n\t\t\tmeta: meta(entry, \"verify\")\n\t\t};\n\t}),\n\thook: requireWebhookHook(entry, \"verify\"),\n\tinput: {\n\t\trequest: lowercaseHeaders(request.request),\n\t\twebhookUrl: request.webhookUrl\n\t},\n\tphase: \"verify\",\n\trequest\n});\nconst parse = (entry, request) => runPhase({\n\tentry,\n\tfinish: finishEmit(entry, \"parse\"),\n\thook: requireWebhookHook(entry, \"parse\"),\n\tinput: {\n\t\trequest: lowercaseHeaders(request.request),\n\t\twebhookUrl: request.webhookUrl\n\t},\n\tphase: \"parse\",\n\trequest\n});\nconst poll = (entry, request) => runPhase({\n\tentry,\n\tfinish: finishEmit(entry, \"poll\"),\n\thook: requirePollingHook(entry),\n\tphase: \"poll\",\n\trequest\n});\nexport { activate, deactivate, parse, poll, verify };\n\n//# sourceMappingURL=trigger-runtime.js.map",
|
|
34
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { validateIdentifier } from \"./internal/identifier.js\";\nimport { PipeableProto } from \"./internal/proto.js\";\nimport { activate as activate$1, deactivate as deactivate$1, parse as parse$1, poll as poll$1, verify as verify$1 } from \"./internal/trigger-runtime.js\";\nimport { Array, Clock, Duration, Effect, Match, Number, Option, Predicate, Record, Result, Schema, String, pipe } from \"effect\";\nimport { Base64, Hex } from \"effect/encoding\";\n// src/Trigger.ts\nvar Trigger_exports = /* @__PURE__ */ __exportAll({\n\tInvalidTriggerConfigError: () => InvalidTriggerConfigError,\n\tInvalidTriggerOutputError: () => InvalidTriggerOutputError,\n\tInvalidTriggerStateError: () => InvalidTriggerStateError,\n\tTypeId: () => TypeId,\n\tUnsupportedTriggerRuntimeError: () => UnsupportedTriggerRuntimeError,\n\tactivate: () => activate,\n\tbodyDigest: () => bodyDigest,\n\tdeactivate: () => deactivate,\n\thandlerKey: () => handlerKey,\n\tisTrigger: () => isTrigger,\n\tparse: () => parse,\n\tpoll: () => poll,\n\tpolling: () => polling,\n\tverify: () => verify,\n\tverifyEcdsaP256: () => verifyEcdsaP256,\n\tverifyHmac: () => verifyHmac,\n\tverifyHmacSha256: () => verifyHmacSha256,\n\tverifyStandardWebhook: () => verifyStandardWebhook,\n\tverifyToken: () => verifyToken,\n\twebhook: () => webhook\n});\n/** @since 0.0.0 @category type ids */\nconst TypeId = \"@dual-os/sdk/Trigger\";\nfunction encoded(part) {\n\treturn Predicate.isString(part) ? new TextEncoder().encode(part) : part;\n}\nfunction bytes(value) {\n\tif (Predicate.isString(value)) return new TextEncoder().encode(value);\n\tif (value instanceof Uint8Array) return new Uint8Array(value);\n\tconst parts = Array.map(value, encoded);\n\tconst joined = new Uint8Array(Number.sumAll(Array.map(parts, (part) => part.length)));\n\tArray.reduce(parts, 0, (offset, part) => {\n\t\tjoined.set(part, offset);\n\t\treturn offset + part.length;\n\t});\n\treturn joined;\n}\nfunction sameBytes(left, right) {\n\treturn left.length === right.length && Number.sumAll(Array.zipWith(left, right, (a, b) => a ^ b)) === 0;\n}\nconst hmacHashes = {\n\tsha1: \"SHA-1\",\n\tsha256: \"SHA-256\"\n};\nconst matchesAny = Effect.fnUntraced(function* (algorithm, secret, message, signatures) {\n\tif (secret.length === 0 || signatures.length === 0) return false;\n\tconst key = yield* Effect.promise(() => crypto.subtle.importKey(\"raw\", bytes(secret), {\n\t\thash: hmacHashes[algorithm],\n\t\tname: \"HMAC\"\n\t}, false, [\"sign\"]));\n\tconst expected = new Uint8Array(yield* Effect.promise(() => crypto.subtle.sign(\"HMAC\", key, bytes(message))));\n\treturn Array.contains(Array.map(signatures, (signature) => sameBytes(signature, expected)), true);\n});\n/**\n* The hex SHA-256 of a delivery's raw body. Use it as the event key when the provider signs the\n* body but not its delivery identifier header, so a replayed delivery keeps one identity.\n*\n* @since 0.0.0\n* @category webhooks\n*/\nconst bodyDigest = Effect.fn(\"Trigger.bodyDigest\")(function* (rawBody) {\n\tconst digest = yield* Effect.promise(() => crypto.subtle.digest(\"SHA-256\", bytes(rawBody)));\n\treturn Hex.encode(new Uint8Array(digest));\n});\n/**\n* Whether `signature` is the HMAC-SHA256 of `message` keyed with `secret`, the way most webhook\n* providers sign their deliveries. The comparison runs in constant time.\n*\n* @since 0.0.0\n* @category webhooks\n*/\nconst verifyHmacSha256 = Effect.fn(\"Trigger.verifyHmacSha256\")(function* (secret, message, signature) {\n\treturn yield* matchesAny(\"sha256\", secret, message, [signature]);\n});\n/**\n* Whether `signature`, written in `encoding`, is the HMAC of `message` keyed with `secret`, given\n* as text or as raw key bytes such as a decoded `whsec_` secret. A message given as parts is signed\n* as their concatenation, such as a timestamp followed by the raw body. Given several signatures,\n* such as one per rotated secret, it verifies when any of them matches and hashes the message once.\n* A missing secret, or signatures none of which is valid `encoding`, never verifies. The comparison\n* runs in constant time.\n*\n* @since 0.0.0\n* @category webhooks\n*/\nconst verifyHmac = Effect.fn(\"Trigger.verifyHmac\")(function* (options) {\n\tconst decode = pipe(Match.value(options.encoding), Match.when(\"hex\", () => Hex.decode), Match.when(\"base64\", () => Base64.decode), Match.exhaustive);\n\treturn yield* matchesAny(options.algorithm, options.secret, options.message, Array.filterMap(Array.ensure(options.signature), (signature) => decode(signature)));\n});\n/**\n* Whether a [Standard Webhooks](https://www.standardwebhooks.com) delivery is signed with `secret`:\n* one `v1,<base64>` entry of its `webhook-signature` header (`svix-signature` from Svix) must be the\n* HMAC-SHA256 of `id.timestamp.body` keyed with the bytes of the `whsec_` secret, and its timestamp\n* must be within five minutes of now. Header names are lowercase, as in `WebhookRequest`. Missing\n* headers or secret never verify.\n*\n* @since 0.0.0\n* @category webhooks\n*/\nconst verifyStandardWebhook = Effect.fn(\"Trigger.verifyStandardWebhook\")(function* (options) {\n\tconst now = yield* Clock.currentTimeMillis;\n\tfunction header(name) {\n\t\treturn Option.orElse(Record.get(options.headers, `webhook-${name}`), () => Record.get(options.headers, `svix-${name}`));\n\t}\n\tconst signed = Option.all({\n\t\tid: header(\"id\"),\n\t\tkey: Result.getSuccess(Base64.decode(pipe(options.secret, String.replace(/^whsec_/u, \"\")))),\n\t\tsignature: header(\"signature\"),\n\t\ttimestamp: Option.filter(header(\"timestamp\"), (timestamp) => Option.exists(Number.parse(timestamp), (seconds) => Number.between(seconds * 1e3, {\n\t\t\tmaximum: now + Duration.toMillis(Duration.minutes(5)),\n\t\t\tminimum: now - Duration.toMillis(Duration.minutes(5))\n\t\t})))\n\t});\n\treturn yield* Option.match(signed, {\n\t\tonNone: () => Effect.succeed(false),\n\t\tonSome: (delivery) => verifyHmac({\n\t\t\talgorithm: \"sha256\",\n\t\t\tencoding: \"base64\",\n\t\t\tmessage: [`${delivery.id}.${delivery.timestamp}.`, options.body],\n\t\t\tsecret: delivery.key,\n\t\t\tsignature: pipe(delivery.signature, String.split(\" \"), Array.filter(String.startsWith(\"v1,\")), Array.map(String.slice(3)))\n\t\t})\n\t});\n});\n/**\n* Whether `actual` equals the shared secret `expected`, for providers that send the secret itself\n* back with each delivery. An empty or missing secret never verifies. The comparison runs in\n* constant time.\n*\n* @since 0.0.0\n* @category webhooks\n*/\nconst verifyToken = Effect.fn(\"Trigger.verifyToken\")(function* (expected, actual) {\n\tif (expected === \"\" || actual === void 0) return false;\n\tconst key = yield* Effect.promise(() => crypto.subtle.importKey(\"raw\", crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)), {\n\t\thash: \"SHA-256\",\n\t\tname: \"HMAC\"\n\t}, false, [\"sign\", \"verify\"]));\n\tconst reference = yield* Effect.promise(() => crypto.subtle.sign(\"HMAC\", key, bytes(expected)));\n\treturn yield* Effect.promise(() => crypto.subtle.verify(\"HMAC\", key, reference, bytes(actual)));\n});\nconst p256ScalarLength = 32;\nfunction paddedScalar(integer) {\n\tconst trimmed = Array.dropWhile(integer, (byte) => byte === 0);\n\treturn Option.liftPredicate(Array.appendAll(Array.take(Array.replicate(0, p256ScalarLength), p256ScalarLength - trimmed.length), trimmed), (scalar) => scalar.length === p256ScalarLength);\n}\nfunction derInteger(der, offset) {\n\treturn Option.gen(function* () {\n\t\tyield* Option.liftPredicate(yield* Array.get(der, offset), (tag) => tag === 2);\n\t\tconst length = yield* Array.get(der, offset + 1);\n\t\tconst value = Array.take(Array.drop(der, offset + 2), length);\n\t\tyield* Option.liftPredicate(value, (taken) => taken.length === length);\n\t\treturn {\n\t\t\tnext: offset + 2 + length,\n\t\t\tvalue\n\t\t};\n\t});\n}\nfunction derToP1363(signature) {\n\treturn Option.gen(function* () {\n\t\tconst der = Array.fromIterable(signature);\n\t\tyield* Option.liftPredicate(yield* Array.get(der, 0), (tag) => tag === 48);\n\t\tyield* Option.liftPredicate(yield* Array.get(der, 1), (length) => length === der.length - 2);\n\t\tconst r = yield* derInteger(der, 2);\n\t\tconst s = yield* derInteger(der, r.next);\n\t\tyield* Option.liftPredicate(s.next, (next) => next === der.length);\n\t\treturn new Uint8Array(Array.appendAll(yield* paddedScalar(r.value), yield* paddedScalar(s.value)));\n\t});\n}\n/**\n* Whether `signature`, a base64 DER ECDSA signature, signs `message` with the ECDSA P-256 key\n* `publicKey`, a base64 DER SubjectPublicKeyInfo, hashed with SHA-256. A message given as parts is\n* signed as their concatenation, such as a timestamp followed by the raw body. A missing key or a\n* key or signature that is not valid never verifies.\n*\n* @since 0.0.0\n* @category webhooks\n*/\nconst verifyEcdsaP256 = Effect.fn(\"Trigger.verifyEcdsaP256\")(function* (options) {\n\tconst decoded = Option.all({\n\t\tpublicKey: Result.getSuccess(Base64.decode(options.publicKey)),\n\t\tsignature: Option.flatMap(Result.getSuccess(Base64.decode(options.signature)), derToP1363)\n\t});\n\treturn yield* Option.match(decoded, {\n\t\tonNone: () => Effect.succeed(false),\n\t\tonSome: Effect.fnUntraced(function* (keys) {\n\t\t\treturn yield* pipe(Effect.tryPromise(async () => crypto.subtle.verify({\n\t\t\t\thash: \"SHA-256\",\n\t\t\t\tname: \"ECDSA\"\n\t\t\t}, await crypto.subtle.importKey(\"spki\", bytes(keys.publicKey), {\n\t\t\t\tname: \"ECDSA\",\n\t\t\t\tnamedCurve: \"P-256\"\n\t\t\t}, false, [\"verify\"]), keys.signature, bytes(options.message))), Effect.orElseSucceed(() => false));\n\t\t})\n\t});\n});\n/** @since 0.0.0 @category handlers */\nconst handlerKey = (triggerId) => `@dual-os/sdk/Trigger/Handler/${triggerId}`;\nconst Proto = {\n\t...PipeableProto,\n\t[TypeId]: TypeId\n};\nconst constructor = (kind) => (identifier, options) => {\n\tvalidateIdentifier(\"trigger\", identifier);\n\treturn Object.assign(Object.create(Proto), {\n\t\tconfig: options.config,\n\t\tdescription: options.description,\n\t\tidentifier,\n\t\tkind,\n\t\tname: options.name,\n\t\toutput: options.output,\n\t\trequireAuth: options.requireAuth ?? true,\n\t\tstate: options.state\n\t});\n};\n/**\n* Provider webhook triggers must own isolated per-trigger/per-deploy-version\n* ingress/subscription state, or no external provider resource at all.\n* Activating or deactivating one Dual trigger must never mutate provider state\n* that another trigger, deploy version, mailbox, account, or app-level\n* subscription depends on. Shared provider watches must be modeled as polling.\n*\n* @since 0.0.0 @category constructors\n*/\nconst webhook = constructor(\"webhook\");\n/** @since 0.0.0 @category constructors */\nconst polling = constructor(\"polling\");\n/** @since 0.0.0 @category guards */\nconst isTrigger = (u) => Predicate.hasProperty(u, TypeId);\n/** @since 0.0.0 @category errors */\nvar InvalidTriggerConfigError = class extends Schema.TaggedError()(\"InvalidTriggerConfigError\", {\n\tdescription: Schema.String,\n\ttriggerId: Schema.String\n}) {};\n/** @since 0.0.0 @category errors */\nvar InvalidTriggerStateError = class extends Schema.TaggedError()(\"InvalidTriggerStateError\", {\n\tdescription: Schema.String,\n\tlocation: Schema.Literals([\"input\", \"result\"]),\n\tphase: Schema.Literals([\n\t\t\"activate\",\n\t\t\"deactivate\",\n\t\t\"verify\",\n\t\t\"parse\",\n\t\t\"poll\"\n\t]),\n\ttriggerId: Schema.String\n}) {};\n/** @since 0.0.0 @category errors */\nvar InvalidTriggerOutputError = class extends Schema.TaggedError()(\"InvalidTriggerOutputError\", {\n\tdescription: Schema.String,\n\tphase: Schema.Literals([\"parse\", \"poll\"]),\n\ttriggerId: Schema.String\n}) {};\n/** @since 0.0.0 @category errors */\nvar UnsupportedTriggerRuntimeError = class extends Schema.TaggedError()(\"UnsupportedTriggerRuntimeError\", {\n\tkind: Schema.Literals([\"webhook\", \"polling\"]),\n\tphase: Schema.Literals([\n\t\t\"activate\",\n\t\t\"deactivate\",\n\t\t\"verify\",\n\t\t\"parse\",\n\t\t\"poll\"\n\t]),\n\ttriggerId: Schema.String\n}) {};\n/** @since 0.0.0 @category execution */\nconst activate = activate$1;\n/** @since 0.0.0 @category execution */\nconst deactivate = deactivate$1;\n/** @since 0.0.0 @category execution */\nconst verify = verify$1;\n/** @since 0.0.0 @category execution */\nconst parse = parse$1;\n/** @since 0.0.0 @category execution */\nconst poll = poll$1;\nexport { InvalidTriggerConfigError, InvalidTriggerOutputError, InvalidTriggerStateError, Trigger_exports, TypeId, UnsupportedTriggerRuntimeError, activate, bodyDigest, deactivate, handlerKey, isTrigger, parse, poll, polling, verify, verifyEcdsaP256, verifyHmac, verifyHmacSha256, verifyStandardWebhook, verifyToken, webhook };\n\n//# sourceMappingURL=Trigger.js.map",
|
|
35
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { validateIdentifier } from \"./internal/identifier.js\";\nimport { PipeableProto } from \"./internal/proto.js\";\nimport { appendElements } from \"./internal/collection-utils.js\";\nimport { assertUniqueMixedChildIdentifiers, assertUniqueStructuralChildIdentifiers, partitionChildren } from \"./internal/children.js\";\nimport { Function, Predicate } from \"effect\";\n// src/Group.ts\nvar Group_exports = /* @__PURE__ */ __exportAll({\n\tTypeId: () => TypeId,\n\tadd: () => add,\n\tisGroup: () => isGroup,\n\tmake: () => make,\n\twithAction: () => withAction,\n\twithActions: () => withActions,\n\twithDescription: () => withDescription,\n\twithGroup: () => withGroup,\n\twithGroups: () => withGroups,\n\twithName: () => withName,\n\twithTrigger: () => withTrigger,\n\twithTriggers: () => withTriggers\n});\n/** @since 0.0.0 @category type ids */\nconst TypeId = \"@dual-os/sdk/Group\";\nconst optionsFromGroup = (group) => ({\n\tidentifier: group.identifier,\n\t...group.name === void 0 ? {} : { name: group.name },\n\t...group.description === void 0 ? {} : { description: group.description }\n});\nconst Proto = {\n\t...PipeableProto,\n\t[TypeId]: TypeId\n};\nconst makeGroup = (options, groups, actions, triggers) => {\n\tvalidateIdentifier(\"group\", options.identifier);\n\treturn Object.assign(Object.create(Proto), {\n\t\tactions,\n\t\tdescription: options.description,\n\t\tgroups,\n\t\tidentifier: options.identifier,\n\t\tname: options.name,\n\t\ttriggers\n\t});\n};\nconst appendChildren = (group, children, childKind) => {\n\tif (childKind === void 0) assertUniqueMixedChildIdentifiers(\"group\", group.identifier, group, children);\n\telse assertUniqueStructuralChildIdentifiers(\"group\", group.identifier, group, children, childKind);\n\tconst partitioned = partitionChildren(children);\n\treturn makeGroup(optionsFromGroup(group), appendElements(group.groups, partitioned.groups), appendElements(group.actions, partitioned.actions), appendElements(group.triggers, partitioned.triggers));\n};\n/** @since 0.0.0 @category constructors */\nconst make = (identifier) => makeGroup({ identifier }, [], [], []);\n/** @since 0.0.0 @category guards */\nconst isGroup = (u) => Predicate.hasProperty(u, TypeId);\n/** @since 0.0.0 @category combinators */\nconst withName = Function.dual(2, (group, name) => makeGroup({\n\t...optionsFromGroup(group),\n\tname\n}, group.groups, group.actions, group.triggers));\n/** @since 0.0.0 @category combinators */\nconst withDescription = Function.dual(2, (group, description) => makeGroup({\n\t...optionsFromGroup(group),\n\tdescription\n}, group.groups, group.actions, group.triggers));\n/** @since 0.0.0 @category combinators */\nconst withGroups = Function.dual(2, (group, groups) => appendChildren(group, groups, \"group\"));\n/** @since 0.0.0 @category combinators */\nconst withActions = Function.dual(2, (group, actions) => appendChildren(group, actions, \"action\"));\n/** @since 0.0.0 @category combinators */\nconst withTriggers = Function.dual(2, (group, triggers) => appendChildren(group, triggers, \"trigger\"));\n/** @since 0.0.0 @category combinators */\nconst withGroup = Function.dual(2, (value, group) => appendChildren(value, [group], \"group\"));\n/** @since 0.0.0 @category combinators */\nconst withAction = Function.dual(2, (value, action) => appendChildren(value, [action], \"action\"));\n/** @since 0.0.0 @category combinators */\nconst withTrigger = Function.dual(2, (value, trigger) => appendChildren(value, [trigger], \"trigger\"));\n/**\n* Add mixed structural children to a group.\n*\n* @since 0.0.0\n* @category combinators\n*/\nconst add = Function.dual((args) => isGroup(args[0]), (group, ...children) => appendChildren(group, children));\nexport { Group_exports, TypeId, add, isGroup, make, withAction, withActions, withDescription, withGroup, withGroups, withName, withTrigger, withTriggers };\n\n//# sourceMappingURL=Group.js.map",
|
|
36
|
+
"import { BuilderCollisionError } from \"../DefinitionError.js\";\nimport { isAction } from \"../Action.js\";\nimport { isTrigger } from \"../Trigger.js\";\nimport { isGroup } from \"../Group.js\";\n// src/internal/children.ts\n/**\n* Shared structural-children machinery for Group and Plugin builders.\n*\n* Both owners accept the same mixed child set (groups, actions, triggers) and\n* need identical type-level partitioning, runtime partitioning, and collision\n* checks, so the logic lives here once.\n*/\nconst partitionChildren = (children) => ({\n\tactions: children.filter(isAction),\n\tgroups: children.filter(isGroup),\n\ttriggers: children.filter(isTrigger)\n});\nconst childKind = (child) => isGroup(child) ? \"group\" : isAction(child) ? \"action\" : \"trigger\";\nconst seenChildren = (existing) => {\n\tconst seen = /* @__PURE__ */ new Map();\n\tfor (const group of existing.groups) seen.set(group.identifier, \"group\");\n\tfor (const action of existing.actions) seen.set(action.identifier, \"action\");\n\tfor (const trigger of existing.triggers) seen.set(trigger.identifier, \"trigger\");\n\tfor (const channel of existing.agentChannels ?? []) seen.set(channel.identifier, \"agent-channel\");\n\treturn seen;\n};\nconst assertAdditions = (ownerKind, ownerIdentifier, seen, additions) => {\n\tfor (const [addition, kind] of additions) {\n\t\tconst existingChildKind = seen.get(addition.identifier);\n\t\tif (existingChildKind !== void 0) throw new BuilderCollisionError({\n\t\t\tchildKind: kind,\n\t\t\texistingChildKind,\n\t\t\tidentifier: addition.identifier,\n\t\t\townerIdentifier,\n\t\t\townerKind\n\t\t});\n\t\tseen.set(addition.identifier, kind);\n\t}\n};\nconst assertUniqueStructuralChildIdentifiers = (ownerKind, ownerIdentifier, existing, additions, childKind) => {\n\tassertAdditions(ownerKind, ownerIdentifier, seenChildren(existing), additions.map((addition) => [addition, childKind]));\n};\n/**\n* Mixed-kind variant used by `add`: additions are checked in declaration order\n* so a collision between two added children of different kinds is still caught.\n*/\nconst assertUniqueMixedChildIdentifiers = (ownerKind, ownerIdentifier, existing, additions) => {\n\tassertAdditions(ownerKind, ownerIdentifier, seenChildren(existing), additions.map((addition) => [addition, childKind(addition)]));\n};\nexport { assertUniqueMixedChildIdentifiers, assertUniqueStructuralChildIdentifiers, partitionChildren };\n\n//# sourceMappingURL=children.js.map",
|
|
37
|
+
"import \"./identifier.js\";\n// src/internal/capabilities.ts\nconst walkCapabilities = (provider, select) => {\n\tconst entries = [];\n\tconst visit = (owner, prefix) => {\n\t\tfor (const node of select(owner)) {\n\t\t\tconst localId = prefix === \"\" ? node.identifier : `${prefix}/${node.identifier}`;\n\t\t\tentries.push({\n\t\t\t\tcanonicalId: `${provider.identifier}/${localId}`,\n\t\t\t\tlocalId,\n\t\t\t\tnode\n\t\t\t});\n\t\t}\n\t\tfor (const group of owner.groups) visit(group, prefix === \"\" ? group.identifier : `${prefix}/${group.identifier}`);\n\t};\n\tvisit(provider, \"\");\n\treturn entries;\n};\nexport { walkCapabilities };\n\n//# sourceMappingURL=capabilities.js.map",
|
|
38
|
+
"import \"./identifier.js\";\nimport { handlerKey } from \"../Action.js\";\nimport { handlerKey as handlerKey$1 } from \"../AgentChannel.js\";\nimport { handlerGroupKey, withoutGroups } from \"./handler-context.js\";\nimport { walkCapabilities } from \"./capabilities.js\";\nimport { handlerKey as handlerKey$2 } from \"../Trigger.js\";\nimport { Context, Effect, Predicate } from \"effect\";\n// src/internal/plugin-handlers.ts\n/** Plugin handler services and their registration. */\nconst missingDeclaration = (kind, localId, pluginId) => {\n\tthrow new Error(`missing ${kind} handler for \"${localId}\" in plugin \"${pluginId}\"`);\n};\nconst getNestedHandler = (handlers, localId) => {\n\tlet current = handlers;\n\tfor (const segment of localId.split(\"/\")) {\n\t\tif (!Predicate.hasProperty(current, segment)) return void 0;\n\t\tcurrent = current[segment];\n\t}\n\treturn current;\n};\n/** Register a plugin's handlers as one Context group keyed by the plugin. */\nconst toHandlers = (plugin, handlers) => Effect.gen(function* () {\n\tconst context = yield* Effect.context();\n\tconst services = withoutGroups(context);\n\tconst inherited = context.mapUnsafe.get(handlerGroupKey(plugin.identifier));\n\tconst map = new Map(Predicate.isMap(inherited) ? inherited : []);\n\tconst find = (kind, declarations, localId) => {\n\t\tconst handler = getNestedHandler(declarations, localId);\n\t\treturn handler === void 0 ? missingDeclaration(kind, localId, plugin.identifier) : handler;\n\t};\n\tfor (const entry of walkCapabilities(plugin, (owner) => owner.actions)) map.set(handlerKey(entry.canonicalId), {\n\t\tactionId: entry.canonicalId,\n\t\tcontext: services,\n\t\thandler: find(\"action\", handlers.actions, entry.localId)\n\t});\n\tfor (const entry of walkCapabilities(plugin, (owner) => owner.triggers)) map.set(handlerKey$2(entry.canonicalId), {\n\t\tcontext: services,\n\t\truntime: find(\"trigger\", handlers.triggers, entry.localId),\n\t\ttriggerId: entry.canonicalId\n\t});\n\tfor (const channel of plugin.agentChannels) {\n\t\tconst channelId = `${plugin.identifier}/${channel.identifier}`;\n\t\tmap.set(handlerKey$1(channelId), {\n\t\t\tchannelId,\n\t\t\tcontext: services,\n\t\t\truntime: find(\"agent channel\", handlers.agentChannels, channel.identifier)\n\t\t});\n\t}\n\treturn Context.makeUnsafe(/* @__PURE__ */ new Map([[handlerGroupKey(plugin.identifier), map]]));\n});\nexport { toHandlers };\n\n//# sourceMappingURL=plugin-handlers.js.map",
|
|
39
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { validateIdentifier } from \"./internal/identifier.js\";\nimport { PipeableProto } from \"./internal/proto.js\";\nimport { ChannelError, validateDefinition } from \"./AgentChannel.js\";\nimport { assertNoDuplicateAuthMethodIdentifiers } from \"./internal/auth-runtime.js\";\nimport { appendElements } from \"./internal/collection-utils.js\";\nimport { assertUniqueMixedChildIdentifiers, assertUniqueStructuralChildIdentifiers, partitionChildren } from \"./internal/children.js\";\nimport { toHandlers } from \"./internal/plugin-handlers.js\";\nimport { Array, Effect, Function, Layer, Option, Predicate, Result, String } from \"effect\";\nimport { Url, UrlParams } from \"effect/http\";\n// src/Plugin.ts\nvar Plugin_exports = /* @__PURE__ */ __exportAll({\n\tTypeId: () => TypeId,\n\tadd: () => add,\n\tcategories: () => categories,\n\tisGitRequest: () => isGitRequest,\n\tisPlugin: () => isPlugin,\n\tmake: () => make,\n\tprovide: () => provide,\n\ttoLayer: () => toLayer,\n\twithAction: () => withAction,\n\twithAgentChannel: () => withAgentChannel,\n\twithAuthMethod: () => withAuthMethod,\n\twithAuthMethods: () => withAuthMethods,\n\twithCategories: () => withCategories,\n\twithDescription: () => withDescription,\n\twithDocsUrl: () => withDocsUrl,\n\twithGroup: () => withGroup,\n\twithGroups: () => withGroups,\n\twithHomepageUrl: () => withHomepageUrl,\n\twithIconUrl: () => withIconUrl,\n\twithIconUrlDark: () => withIconUrlDark,\n\twithName: () => withName,\n\twithSandboxAccess: () => withSandboxAccess,\n\twithTrigger: () => withTrigger,\n\twithTriggers: () => withTriggers\n});\n/**\n* @since 0.0.0\n* @category type ids\n*/\nconst TypeId = \"@dual-os/sdk/Plugin\";\n/** @since 0.0.0 @category models */\nconst categories = [\n\t\"sales_crm\",\n\t\"marketing\",\n\t\"customer_support\",\n\t\"calendar_scheduling\",\n\t\"communication\",\n\t\"project_management\",\n\t\"developer_tools\",\n\t\"data_storage\",\n\t\"docs_productivity\",\n\t\"commerce_payments\",\n\t\"finance_accounting\",\n\t\"human_resources\",\n\t\"analytics\",\n\t\"design\",\n\t\"it_service_management\",\n\t\"search\",\n\t\"telephony\",\n\t\"web_scraping\"\n];\nconst gitServices = [\"git-upload-pack\", \"git-receive-pack\"];\n/**\n* Whether a request is a Git smart HTTP request of a fetch, clone or push: `GET <repository>/info/refs?service=<service>`\n* or `POST <repository>/<service>` with the service's request content type.\n*\n* @since 0.0.0\n* @category predicates\n*/\nfunction isGitRequest(request) {\n\treturn Result.match(Url.fromString(request.url), {\n\t\tonFailure: () => false,\n\t\tonSuccess: (url) => {\n\t\t\tconst service = Option.orElse(UrlParams.getFirst(Url.urlParams(url), \"service\"), () => UrlParams.getFirst(request.urlParams, \"service\"));\n\t\t\treturn Array.some(gitServices, (name) => request.method === \"GET\" && String.endsWith(\"/info/refs\")(url.pathname) && Option.contains(service, name) || request.method === \"POST\" && String.endsWith(`/${name}`)(url.pathname) && request.headers[\"content-type\"] === `application/x-${name}-request`);\n\t\t}\n\t});\n}\nconst Proto = {\n\t...PipeableProto,\n\t[TypeId]: TypeId\n};\nconst makePlugin = (fields) => {\n\tvalidateIdentifier(\"plugin\", fields.identifier);\n\tassertNoDuplicateAuthMethodIdentifiers(fields.identifier, fields.authMethods);\n\treturn Object.assign(Object.create(Proto), fields);\n};\nconst update = (plugin, fields) => makePlugin({\n\t...plugin,\n\t...fields\n});\n/**\n* Create an empty {@link Plugin}.\n*\n* @since 0.0.0\n* @category constructors\n*/\nconst make = (identifier) => makePlugin({\n\tactions: [],\n\tagentChannels: [],\n\tauthMethods: [],\n\tcategories: [],\n\tdescription: void 0,\n\tdocsUrl: void 0,\n\tgroups: [],\n\thomepageUrl: void 0,\n\ticonUrl: void 0,\n\ticonUrlDark: void 0,\n\tidentifier,\n\tlayer: Layer.empty,\n\tname: void 0,\n\tsandboxAccess: void 0,\n\ttriggers: []\n});\n/**\n* Check if a value is a {@link Plugin}.\n*\n* @since 0.0.0\n* @category guards\n*/\nconst isPlugin = (u) => Predicate.hasProperty(u, TypeId);\nconst metadata = (key) => Function.dual(2, (plugin, value) => update(plugin, { [key]: value }));\n/** @since 0.0.0 @category combinators */\nconst withName = metadata(\"name\");\n/** @since 0.0.0 @category combinators */\nconst withDescription = metadata(\"description\");\n/** @since 0.6.0 @category combinators */\nconst withIconUrl = metadata(\"iconUrl\");\n/** @since 0.6.0 @category combinators */\nconst withIconUrlDark = metadata(\"iconUrlDark\");\n/** @since 0.6.0 @category combinators */\nconst withHomepageUrl = metadata(\"homepageUrl\");\n/** @since 0.6.0 @category combinators */\nconst withDocsUrl = metadata(\"docsUrl\");\n/** @since 0.6.0 @category combinators */\nconst withCategories = Function.dual(2, (plugin, categories) => update(plugin, { categories: [...categories] }));\n/**\n* Add authentication alternatives. Actions and triggers accept every method.\n*\n* @since 0.6.0\n* @category combinators\n*/\nconst withAuthMethods = (methods) => (plugin) => {\n\tif (plugin.sandboxAccess !== void 0) throw new Error(`plugin \"${plugin.identifier}\" must declare auth methods before its sandbox access`);\n\treturn update(plugin, { authMethods: appendElements(plugin.authMethods, methods) });\n};\n/**\n* Add an authentication alternative. Actions and triggers accept every method.\n*\n* @since 0.6.0\n* @category combinators\n*/\nconst withAuthMethod = Function.dual(2, (plugin, method) => withAuthMethods([method])(plugin));\n/**\n* Lets commands in a run sandbox use the plugin's Connection through Dual's sandbox gateway.\n*\n* @since 0.6.0\n* @category combinators\n*/\nconst withSandboxAccess = (access) => (plugin) => update(plugin, { sandboxAccess: access });\nconst appendChildren = (plugin, children, childKind) => {\n\tif (childKind === void 0) assertUniqueMixedChildIdentifiers(\"plugin\", plugin.identifier, plugin, children);\n\telse assertUniqueStructuralChildIdentifiers(\"plugin\", plugin.identifier, plugin, children, childKind);\n\tconst partitioned = partitionChildren(children);\n\treturn update(plugin, {\n\t\tactions: appendElements(plugin.actions, partitioned.actions),\n\t\tgroups: appendElements(plugin.groups, partitioned.groups),\n\t\ttriggers: appendElements(plugin.triggers, partitioned.triggers)\n\t});\n};\n/** @since 0.6.0 @category combinators */\nconst withAction = Function.dual(2, (plugin, action) => appendChildren(plugin, [action], \"action\"));\n/** @since 0.6.0 @category combinators */\nconst withGroup = Function.dual(2, (plugin, group) => appendChildren(plugin, [group], \"group\"));\n/** @since 0.6.0 @category combinators */\nconst withTrigger = Function.dual(2, (plugin, trigger) => appendChildren(plugin, [trigger], \"trigger\"));\n/** Add the generated action groups. @since 0.6.0 @category combinators */\nconst withGroups = (groups) => (plugin) => appendChildren(plugin, groups, \"group\");\n/** Add trigger definitions from an overlay. @since 0.6.0 @category combinators */\nconst withTriggers = (triggers) => (plugin) => appendChildren(plugin, triggers, \"trigger\");\n/** Add grouped capabilities. @since 0.6.0 @category combinators */\nconst add = (...children) => (plugin) => appendChildren(plugin, children);\n/** Add an Agent Channel; its definition owns its exact auth subset. @since 0.6.0 @category combinators */\nconst withAgentChannel = (channel) => (plugin) => {\n\tif ([\n\t\t...plugin.actions,\n\t\t...plugin.triggers,\n\t\t...plugin.groups,\n\t\t...plugin.agentChannels\n\t].some((child) => child.identifier === channel.identifier)) throw new ChannelError({ code: \"invalid_definition\" });\n\tvalidateDefinition(channel.definition, plugin.identifier, plugin.authMethods);\n\treturn update(plugin, { agentChannels: [...plugin.agentChannels, channel] });\n};\n/**\n* Attach runtime services to a plugin definition.\n*\n* @since 0.0.0\n* @category combinators\n*/\nconst provide = Function.dual(2, (plugin, layer) => update(plugin, { layer: Layer.provideMerge(plugin.layer, layer) }));\nconst makeHandlers = (actions, triggers, agentChannels = {}) => ({\n\taction: (name, handler) => makeHandlers({\n\t\t...actions,\n\t\t[name]: handler\n\t}, triggers, agentChannels),\n\tactions,\n\tagentChannels,\n\tchannel: (name, lifecycle) => makeHandlers(actions, triggers, {\n\t\t...agentChannels,\n\t\t[name]: lifecycle\n\t}),\n\tgroup: (name, build) => {\n\t\tconst group = build(makeHandlers({}, {}));\n\t\treturn makeHandlers({\n\t\t\t...actions,\n\t\t\t[name]: group.actions\n\t\t}, {\n\t\t\t...triggers,\n\t\t\t[name]: group.triggers\n\t\t}, agentChannels);\n\t},\n\ttrigger: (name, lifecycle) => makeHandlers(actions, {\n\t\t...triggers,\n\t\t[name]: lifecycle\n\t}, agentChannels),\n\ttriggers,\n\twithTriggers: (lifecycles) => makeHandlers(actions, {\n\t\t...triggers,\n\t\t...lifecycles\n\t}, agentChannels)\n});\n/**\n* Implement a plugin's capabilities. `build` registers one handler per action,\n* trigger and Channel; the Layer is rejected until every capability is implemented.\n*\n* @since 0.6.0\n* @category handlers\n*/\nconst toLayer = (plugin, build) => Layer.effectContext(Effect.gen(function* () {\n\tconst result = build(makeHandlers({}, {}));\n\tconst handlers = Effect.isEffect(result) ? yield* result : result;\n\treturn yield* toHandlers(plugin, handlers);\n}));\nexport { Plugin_exports, TypeId, add, categories, isGitRequest, isPlugin, make, provide, toLayer, withAction, withAgentChannel, withAuthMethod, withAuthMethods, withCategories, withDescription, withDocsUrl, withGroup, withGroups, withHomepageUrl, withIconUrl, withIconUrlDark, withName, withSandboxAccess, withTrigger, withTriggers };\n\n//# sourceMappingURL=Plugin.js.map",
|
|
40
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { AccessOutcome, ChannelError, CheckedResult, FailureCode, Key, Verification, VerifiedIdentity, commandSchema, handlerKey, resultByteLimit, resultSchema, validateDefinition } from \"./AgentChannel.js\";\nimport { Service as Service$1 } from \"./ConnectionResolver.js\";\nimport { findHandler } from \"./internal/handler-context.js\";\nimport \"./AgentChannelRuntime.js\";\nimport { Cause, Context, Effect, Layer, Option, Predicate, Schema } from \"effect\";\n// src/AgentChannelRuntime.ts\n/** Checked execution of pinned Agent Channel capabilities. No product lifecycle or persistence. */\nvar AgentChannelRuntime_exports = /* @__PURE__ */ __exportAll({\n\tAgentChannelRuntime: () => AgentChannelRuntime_exports,\n\tConnectionContext: () => ConnectionContext,\n\tService: () => Service,\n\tlayer: () => layer\n});\n/** Host-only connection authority context. It is never included in handler inputs. */\nconst ConnectionContext = Schema.Struct({\n\tactor: Schema.optionalKey(Schema.Union([Schema.Struct({\n\t\tkind: Schema.Literal(\"user\"),\n\t\tuserId: Key\n\t}), Schema.Struct({\n\t\tkind: Schema.Literal(\"system\"),\n\t\treason: Schema.optionalKey(Key)\n\t})])),\n\tsource: Schema.optionalKey(Schema.Struct({\n\t\tkind: Key,\n\t\tsubjectId: Schema.optionalKey(Key)\n\t})),\n\ttenant: Schema.optionalKey(Schema.Struct({\n\t\torganizationId: Key,\n\t\tteamId: Key\n\t}))\n});\nconst Pin = Schema.Struct({ channelId: Key });\nconst Input = Schema.Struct({\n\t...Pin.fields,\n\tcommand: Schema.Unknown,\n\tconnectionId: Schema.optionalKey(Key),\n\tcontext: Schema.optionalKey(ConnectionContext),\n\tdefinitionSettings: Schema.Unknown,\n\tdeploymentSettings: Schema.Unknown\n});\nconst AccessInput = Schema.Struct({\n\t...Pin.fields,\n\tconnectionId: Schema.optionalKey(Key),\n\tcontext: Schema.optionalKey(ConnectionContext),\n\tdefinitionSettings: Schema.Unknown,\n\tdeploymentSettings: Schema.Unknown,\n\tidentity: VerifiedIdentity\n});\nvar Service = class extends Context.Service()(\"@dual-os/sdk/AgentChannelRuntime\") {};\nconst fail = (code) => new ChannelError({ code });\nconst safe = (effect, code) => effect.pipe(Effect.catchCause((cause) => Cause.hasInterrupts(cause) ? Effect.interrupt : Effect.fail(fail(code))));\nconst AssetResultJson = Schema.Json.check(Schema.makeFilter((value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= 14680064));\nconst Json = Schema.Json.check(Schema.makeFilter((value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= resultByteLimit));\nconst strict = { onExcessProperty: \"error\" };\nconst decode = (schema, input, code) => safe(Effect.suspend(() => Schema.decodeUnknownEffect(schema)(input, strict)), code);\nconst json = (value, code) => decode(Json, value, code);\nconst decodeData = Effect.fn(\"AgentChannelRuntime.decodeData\")(function* (schema, input, code, largeAssetResult = false) {\n\tconst boundary = largeAssetResult ? AssetResultJson : Json;\n\tyield* decode(boundary, input, code);\n\tconst value = yield* decode(schema, input, code);\n\tyield* decode(boundary, value, code);\n\treturn value;\n});\nconst invokeHandler = (handler, effect) => effect.pipe(Effect.provideContext(handler.context), Effect.catch((error) => decode(Schema.TaggedStruct(\"AgentChannelHandlerError\", { code: FailureCode }), Predicate.isObject(error) ? { ...error } : error, \"provider_failure\").pipe(Effect.flatMap((checked) => Effect.fail(new ChannelError({\n\tcode: \"provider_failure\",\n\tproviderCode: checked.code\n}))))), Effect.catchCause((cause) => {\n\tif (Cause.hasInterrupts(cause)) return Effect.interrupt;\n\tconst error = Cause.findErrorOption(cause);\n\treturn Option.isSome(error) && error.value instanceof ChannelError ? Effect.fail(error.value) : Effect.fail(fail(\"provider_failure\"));\n}));\nconst checkExtensions = Effect.fn(\"AgentChannelRuntime.checkExtensions\")(function* (definition, extensions, code) {\n\tfor (const [key, value] of Object.entries(extensions ?? {})) {\n\t\tconst schema = definition.extensions?.[key];\n\t\tif (schema === void 0) return yield* fail(code);\n\t\tyield* decodeData(Schema.toType(schema), value, code);\n\t}\n});\nconst checkMessage = (features, destination, content) => (destination.kind === \"direct\" || features.groups) && (destination.threadKey === void 0 || features.threads) && (content.mentions === void 0 || features.mentions) && (content.assets === void 0 || features.assets) && (content.replyToMessageKey === void 0 || features.replies);\nconst checkDelivery = (features, command) => checkMessage(features, command.destination, { text: \"\" }) && (features.operations ?? []).includes(command.operation.kind);\nconst Material = Schema.Struct({\n\tconnectionId: Key,\n\tencoding: Schema.optionalKey(Schema.Literal(\"json\")),\n\tmaterial: Schema.Unknown,\n\tmethodId: Key,\n\tproviderId: Key,\n\tsetup: Schema.Unknown\n});\nconst ResolveHook = Schema.declare((value) => Predicate.isFunction(value));\nconst resolveAuth = Effect.fn(\"AgentChannelRuntime.resolveAuth\")(function* (providerId, channelId, definition, connectionId, phase, context) {\n\tif (definition.authMethods.length === 0) {\n\t\tif (connectionId !== void 0) return yield* fail(\"invalid_auth\");\n\t\treturn;\n\t}\n\tif (connectionId === void 0) return yield* fail(\"invalid_auth\");\n\tconst resolver = yield* Effect.serviceOption(Service$1);\n\tif (Option.isNone(resolver)) return yield* fail(\"invalid_auth\");\n\tconst raw = yield* safe(Effect.suspend(() => resolver.value.resolve({\n\t\tconnectionId,\n\t\ttarget: {\n\t\t\tphase,\n\t\t\tproviderId,\n\t\t\ttargetId: channelId,\n\t\t\ttargetKind: \"agent-channel\"\n\t\t},\n\t\t...context === void 0 ? {} : { context }\n\t})), \"invalid_auth\");\n\tconst resolved = yield* decode(Material, raw, \"invalid_auth\");\n\tif (resolved.providerId !== providerId || resolved.connectionId !== connectionId) return yield* fail(\"invalid_auth\");\n\tconst method = definition.authMethods.find((method) => resolved.methodId === method.identifier || resolved.methodId === `${providerId}/${method.identifier}`);\n\tif (method === void 0) return yield* fail(\"invalid_auth\");\n\tconst decodeAuth = (schema, value) => decode(resolved.encoding === \"json\" ? Schema.toCodecJson(schema) : schema, value, \"invalid_auth\");\n\tconst setup = method.setup === void 0 ? yield* decode(Schema.Undefined, resolved.setup, \"invalid_auth\") : yield* decodeAuth(method.setup, resolved.setup);\n\tconst material = yield* decodeAuth(method.material, resolved.material);\n\tlet value;\n\tif (method.resolve === void 0) value = method.material === method.value ? material : yield* decode(method.value, material, \"invalid_auth\");\n\telse {\n\t\tconst hook = yield* decode(ResolveHook, method.resolve, \"invalid_auth\");\n\t\tconst output = yield* safe(Effect.suspend(() => {\n\t\t\tconst result = hook(material, { setup });\n\t\t\treturn Effect.isEffect(result) ? result : Effect.succeed(result);\n\t\t}), \"invalid_auth\");\n\t\tvalue = yield* decode(method.value, output, \"invalid_auth\");\n\t}\n\treturn {\n\t\tmethodId: method.identifier,\n\t\tvalue\n\t};\n});\nconst find = (plugins, pin) => {\n\tfor (const provider of plugins) {\n\t\tconst channel = provider.agentChannels.find((channel) => `${provider.identifier}/${channel.identifier}` === pin.channelId);\n\t\tif (channel !== void 0) return {\n\t\t\tdefinition: channel.definition,\n\t\t\tprovider\n\t\t};\n\t}\n};\n/** Build from the installed plugins. */\nconst layer = (plugins) => Layer.effect(Service, Effect.gen(function* () {\n\tconst context = yield* Effect.context();\n\tconst get = Effect.fn(\"AgentChannelRuntime.get\")(function* (input) {\n\t\tconst pin = yield* decode(Pin, input, \"invalid_input\");\n\t\tconst found = find(plugins, pin);\n\t\tif (found === void 0) return yield* fail(\"not_found\");\n\t\tyield* safe(Effect.sync(() => {\n\t\t\tvalidateDefinition(found.definition, found.provider.identifier, found.provider.authMethods);\n\t\t}), \"invalid_definition\");\n\t\tconst handler = Option.fromNullishOr(findHandler(context, found.provider.identifier, handlerKey(pin.channelId)));\n\t\tif (Option.isNone(handler) || !Predicate.isObject(handler.value.runtime) || !Predicate.isFunction(handler.value.runtime.execute) || !Predicate.isFunction(handler.value.runtime.verify) || !Predicate.isFunction(handler.value.runtime.checkAccess)) return yield* fail(\"handler_unavailable\");\n\t\treturn found.definition;\n\t});\n\tconst checkAccess = Effect.fn(\"AgentChannelRuntime.checkAccess\")(function* (input) {\n\t\tyield* json(input, \"invalid_input\");\n\t\tconst request = yield* decode(AccessInput, input, \"invalid_input\");\n\t\tconst definition = yield* get({ channelId: request.channelId });\n\t\tconst found = find(plugins, request);\n\t\tif (found === void 0) return yield* fail(\"not_found\");\n\t\tconst definitionSettings = yield* decodeData(definition.definitionSettings, request.definitionSettings, \"invalid_input\");\n\t\tconst deploymentSettings = yield* decodeData(definition.deploymentSettings, request.deploymentSettings, \"invalid_input\");\n\t\tif (!checkMessage(definition.features, request.identity.conversation, { text: \"\" })) return yield* fail(\"unsupported_feature\");\n\t\tconst auth = yield* resolveAuth(found.provider.identifier, request.channelId, definition, request.connectionId, \"check_access\", request.context);\n\t\tconst handler = Option.fromNullishOr(findHandler(context, found.provider.identifier, handlerKey(request.channelId)));\n\t\tif (Option.isNone(handler)) return yield* fail(\"handler_unavailable\");\n\t\tconst output = yield* invokeHandler(handler.value, Effect.suspend(() => handler.value.runtime.checkAccess(request.identity, {\n\t\t\tdefinitionSettings,\n\t\t\tdeploymentSettings,\n\t\t\t...auth === void 0 ? {} : { auth }\n\t\t})));\n\t\treturn yield* decodeData(AccessOutcome, output, \"invalid_result\");\n\t});\n\tconst execute = Effect.fn(\"AgentChannelRuntime.execute\")(function* (input) {\n\t\tyield* json(input, \"invalid_input\");\n\t\tconst request = yield* decode(Input, input, \"invalid_input\");\n\t\tconst definition = yield* get({ channelId: request.channelId });\n\t\tconst found = find(plugins, request);\n\t\tif (found === void 0) return yield* fail(\"not_found\");\n\t\tconst definitionSettings = yield* decodeData(definition.definitionSettings, request.definitionSettings, \"invalid_input\");\n\t\tconst deploymentSettings = yield* decodeData(definition.deploymentSettings, request.deploymentSettings, \"invalid_input\");\n\t\tconst command = yield* decodeData(commandSchema(definition.state), request.command, \"invalid_input\");\n\t\tyield* checkExtensions(definition, command.extensions, \"invalid_input\");\n\t\tif (command.kind === \"deliver\" && command.operationKey !== command.deliveryKey) return yield* fail(\"invalid_input\");\n\t\tif (command.kind === \"deliver\" && !checkDelivery(definition.features, command)) return yield* fail(\"unsupported_feature\");\n\t\tif (command.kind === \"deliver\" && command.operation.kind === \"set_reaction\" && command.operation.target.kind === \"activation\" && command.activationMessageKey === void 0) return yield* fail(\"invalid_input\");\n\t\tif (command.kind === \"read_context\" && (definition.features.readContext !== true || !checkMessage(definition.features, command.destination, { text: \"\" }))) return yield* fail(\"unsupported_feature\");\n\t\tconst handler = Option.fromNullishOr(findHandler(context, found.provider.identifier, handlerKey(request.channelId)));\n\t\tif (Option.isNone(handler)) return yield* fail(\"handler_unavailable\");\n\t\tconst auth = yield* resolveAuth(found.provider.identifier, request.channelId, definition, request.connectionId, command.kind, request.context);\n\t\tconst operationKey = command.operationKey;\n\t\tconst kind = command.kind;\n\t\tconst deliveryKey = command.kind === \"deliver\" ? command.deliveryKey : void 0;\n\t\tconst assetKey = command.kind === \"read_asset\" ? command.asset.assetKey : void 0;\n\t\tconst adapterContext = {\n\t\t\tdefinitionSettings,\n\t\t\tdeploymentSettings,\n\t\t\t...auth === void 0 ? {} : { auth }\n\t\t};\n\t\tif (!Predicate.isFunction(handler.value.runtime.execute) || !Predicate.isFunction(handler.value.runtime.verify) || !Predicate.isFunction(handler.value.runtime.checkAccess)) return yield* fail(\"handler_unavailable\");\n\t\tif (command.kind === \"receive\") yield* decodeData(Verification, yield* invokeHandler(handler.value, Effect.suspend(() => handler.value.runtime.verify(command.request, adapterContext))), \"invalid_result\");\n\t\tif (command.kind === \"read_asset\") {\n\t\t\tif (!definition.features.assets) return yield* fail(\"unsupported_feature\");\n\t\t\tif ((yield* decodeData(AccessOutcome, yield* invokeHandler(handler.value, Effect.suspend(() => handler.value.runtime.checkAccess(command.identity, adapterContext))), \"invalid_result\")).decision !== \"allow\") return yield* new ChannelError({\n\t\t\t\tcode: \"provider_failure\",\n\t\t\t\tproviderCode: \"unauthorized\"\n\t\t\t});\n\t\t}\n\t\tconst output = yield* invokeHandler(handler.value, Effect.suspend(() => handler.value.runtime.execute(command, adapterContext)));\n\t\tconst result = yield* decodeData(resultSchema(Schema.toType(definition.state), definition.features), output, \"invalid_result\", kind === \"read_asset\");\n\t\tif (result.kind !== kind || result.operationKey !== operationKey || result.kind === \"deliver\" && result.deliveryKey !== deliveryKey || result.kind === \"read_asset\" && result.assetKey !== assetKey) return yield* fail(\"invalid_result\");\n\t\tyield* checkExtensions(definition, result.extensions, \"invalid_result\");\n\t\tif (result.kind === \"deliver\" && result.status === \"pending\" && !definition.features.deliveryState) return yield* fail(\"invalid_result\");\n\t\tconst allowedEvents = [];\n\t\tconst deniedEventKeys = [];\n\t\tif (result.kind === \"receive\") {\n\t\t\tif (result.deniedEventKeys !== void 0) return yield* fail(\"invalid_result\");\n\t\t\tif (result.activationProof === \"verified\" && (result.response === void 0 || result.events.length !== 0)) return yield* fail(\"invalid_result\");\n\t\t\tconst eventKeys = /* @__PURE__ */ new Set();\n\t\t\tfor (const event of result.events) {\n\t\t\t\tif (eventKeys.has(event.eventKey)) return yield* fail(\"invalid_result\");\n\t\t\t\teventKeys.add(event.eventKey);\n\t\t\t\tif (event.kind === \"message\" && !checkMessage(definition.features, event.conversation, event.content)) return yield* fail(\"invalid_result\");\n\t\t\t\tif ((event.kind === \"echo\" || event.kind === \"stop\") && !checkMessage(definition.features, event.conversation, { text: \"\" })) return yield* fail(\"invalid_result\");\n\t\t\t\tif (event.kind === \"delivery_update\" && !definition.features.deliveryState) return yield* fail(\"invalid_result\");\n\t\t\t\tyield* checkExtensions(definition, event.extensions, \"invalid_result\");\n\t\t\t\tlet denied = false;\n\t\t\t\tif (event.kind === \"message\" || event.kind === \"echo\" || event.kind === \"stop\") {\n\t\t\t\t\tconst identity = yield* decodeData(VerifiedIdentity, {\n\t\t\t\t\t\tconversation: event.conversation,\n\t\t\t\t\t\tsenderKey: event.senderKey\n\t\t\t\t\t}, \"invalid_result\");\n\t\t\t\t\tdenied = (yield* decodeData(AccessOutcome, yield* invokeHandler(handler.value, Effect.suspend(() => handler.value.runtime.checkAccess(identity, adapterContext))), \"invalid_result\")).decision === \"deny\";\n\t\t\t\t}\n\t\t\t\tif (denied) {\n\t\t\t\t\tdeniedEventKeys.push(event.eventKey);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tallowedEvents.push(event);\n\t\t\t}\n\t\t}\n\t\tconst encoded = yield* safe(Schema.encodeUnknownEffect(resultSchema(definition.state, definition.features))(result.kind === \"receive\" ? {\n\t\t\t...result,\n\t\t\tevents: allowedEvents,\n\t\t\t...deniedEventKeys.length === 0 ? {} : { deniedEventKeys }\n\t\t} : result, strict), \"invalid_result\");\n\t\treturn yield* decodeData(CheckedResult, encoded, \"invalid_result\", kind === \"read_asset\");\n\t});\n\tconst run = (effect) => effect.pipe(Effect.provideContext(context));\n\tconst decodeSettings = (field) => Effect.fn(\"AgentChannelRuntime.decodeSettings\")(function* (input) {\n\t\tconst request = yield* decode(Schema.Struct({\n\t\t\t...Pin.fields,\n\t\t\tvalue: Schema.Json\n\t\t}), input, \"invalid_input\");\n\t\tconst schema = (yield* get({ channelId: request.channelId }))[field];\n\t\tconst value = yield* decodeData(schema, request.value, \"invalid_input\");\n\t\treturn yield* json(yield* safe(Schema.encodeUnknownEffect(schema)(value, strict), \"invalid_input\"), \"invalid_input\");\n\t});\n\treturn Service.of({\n\t\tcheckAccess: (input) => run(checkAccess(input)),\n\t\tdecodeDefinitionSettings: (input) => run(decodeSettings(\"definitionSettings\")(input)),\n\t\tdecodeDeploymentSettings: (input) => run(decodeSettings(\"deploymentSettings\")(input)),\n\t\texecute: (input) => run(execute(input)),\n\t\tget: (input) => run(get(input))\n\t});\n}));\nexport { AgentChannelRuntime_exports as AgentChannelRuntime, AgentChannelRuntime_exports, ConnectionContext, Service, layer };\n\n//# sourceMappingURL=AgentChannelRuntime.js.map",
|
|
41
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { validateIdentifier } from \"./internal/identifier.js\";\nimport { PipeableProto } from \"./internal/proto.js\";\nimport { assertNoDuplicateAuthMethodIdentifiers } from \"./internal/auth-runtime.js\";\nimport { appendElements } from \"./internal/collection-utils.js\";\nimport { Function, Predicate, Schema } from \"effect\";\n// src/AiProvider.ts\nvar AiProvider_exports = /* @__PURE__ */ __exportAll({\n\tRuntimeConfig: () => RuntimeConfig,\n\tTypeId: () => TypeId,\n\tisAiProvider: () => isAiProvider,\n\tmake: () => make,\n\tregistryId: () => registryId,\n\twithAuthMethod: () => withAuthMethod,\n\twithAuthMethods: () => withAuthMethods,\n\twithCategories: () => withCategories,\n\twithDescription: () => withDescription,\n\twithDocsUrl: () => withDocsUrl,\n\twithHomepageUrl: () => withHomepageUrl,\n\twithIconUrl: () => withIconUrl,\n\twithIconUrlDark: () => withIconUrlDark,\n\twithName: () => withName,\n\twithRuntimeConfig: () => withRuntimeConfig\n});\n/** @since 0.0.0 @category type ids */\nconst TypeId = \"@dual-os/sdk/AiProvider\";\n/** @since 0.0.0 @category models */\nconst RuntimeConfig = Schema.Struct({\n\tapiKey: Schema.optional(Schema.String),\n\tbaseUrl: Schema.optional(Schema.String),\n\tenv: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n\theaders: Schema.optional(Schema.Record(Schema.String, Schema.NullOr(Schema.String)))\n});\nconst optionsFromProvider = (provider) => ({\n\tidentifier: provider.identifier,\n\t...provider.name === void 0 ? {} : { name: provider.name },\n\t...provider.description === void 0 ? {} : { description: provider.description },\n\t...provider.iconUrl === void 0 ? {} : { iconUrl: provider.iconUrl },\n\t...provider.iconUrlDark === void 0 ? {} : { iconUrlDark: provider.iconUrlDark },\n\t...provider.categories.length === 0 ? {} : { categories: provider.categories },\n\t...provider.homepageUrl === void 0 ? {} : { homepageUrl: provider.homepageUrl },\n\t...provider.docsUrl === void 0 ? {} : { docsUrl: provider.docsUrl }\n});\nconst Proto = {\n\t...PipeableProto,\n\t[TypeId]: TypeId\n};\nconst makeProvider = (options, authMethods, resolveRuntimeConfig) => {\n\tvalidateIdentifier(\"provider\", options.identifier);\n\tassertNoDuplicateAuthMethodIdentifiers(options.identifier, authMethods);\n\treturn Object.assign(Object.create(Proto), {\n\t\tauthMethods,\n\t\tcategories: options.categories ?? [],\n\t\tdescription: options.description,\n\t\tdocsUrl: options.docsUrl,\n\t\thomepageUrl: options.homepageUrl,\n\t\ticonUrl: options.iconUrl,\n\t\ticonUrlDark: options.iconUrlDark,\n\t\tidentifier: options.identifier,\n\t\tname: options.name,\n\t\tresolveRuntimeConfig\n\t});\n};\n/** @since 0.0.0 @category constructors */\nconst make = (identifier) => makeProvider({ identifier }, []);\n/** @since 0.0.0 @category registry */\nconst registryId = (identifier) => `ai/${identifier}`;\n/** @since 0.0.0 @category guards */\nconst isAiProvider = (value) => Predicate.hasProperty(value, TypeId);\nconst withOption = (provider, options) => makeProvider({\n\t...optionsFromProvider(provider),\n\t...options\n}, provider.authMethods, provider.resolveRuntimeConfig);\n/** @since 0.0.0 @category combinators */\nconst withName = Function.dual(2, (provider, name) => withOption(provider, { name }));\n/** @since 0.0.0 @category combinators */\nconst withDescription = Function.dual(2, (provider, description) => withOption(provider, { description }));\n/** @since 0.0.0 @category combinators */\nconst withIconUrl = Function.dual(2, (provider, iconUrl) => withOption(provider, { iconUrl }));\n/** @since 0.0.0 @category combinators */\nconst withIconUrlDark = Function.dual(2, (provider, iconUrlDark) => withOption(provider, { iconUrlDark }));\n/** @since 0.0.0 @category combinators */\nconst withCategories = Function.dual(2, (provider, categories) => withOption(provider, { categories: [...categories] }));\n/** @since 0.0.0 @category combinators */\nconst withHomepageUrl = Function.dual(2, (provider, homepageUrl) => withOption(provider, { homepageUrl }));\n/** @since 0.0.0 @category combinators */\nconst withDocsUrl = Function.dual(2, (provider, docsUrl) => withOption(provider, { docsUrl }));\n/** @since 0.0.0 @category combinators */\nconst withAuthMethods = Function.dual(2, (provider, methods) => {\n\tif (provider.resolveRuntimeConfig !== void 0) throw new Error(`AI provider \"${provider.identifier}\" must declare auth methods before its runtime config`);\n\treturn makeProvider(optionsFromProvider(provider), appendElements(provider.authMethods, methods));\n});\n/** @since 0.0.0 @category combinators */\nconst withAuthMethod = Function.dual(2, (provider, method) => withAuthMethods(provider, [method]));\n/** @since 0.0.0 @category combinators */\nconst withRuntimeConfig = Function.dual(2, (provider, resolve) => makeProvider(optionsFromProvider(provider), provider.authMethods, resolve));\nexport { AiProvider_exports, RuntimeConfig, TypeId, isAiProvider, make, registryId, withAuthMethod, withAuthMethods, withCategories, withDescription, withDocsUrl, withHomepageUrl, withIconUrl, withIconUrlDark, withName, withRuntimeConfig };\n\n//# sourceMappingURL=AiProvider.js.map",
|
|
42
|
+
"import { walkCapabilities } from \"../capabilities.js\";\n// src/internal/dual/actions.ts\nconst entriesOf = (installation) => walkCapabilities(installation.plugin, (owner) => owner.actions).map(({ localId, canonicalId, node }) => ({\n\taction: node,\n\tactionId: canonicalId,\n\tauthMethods: installation.plugin.authMethods,\n\tlocalId,\n\tpluginVersion: installation.version,\n\tproviderId: installation.plugin.identifier\n}));\nconst collectActionEntries = (installations) => installations.flatMap(entriesOf);\nconst actionIndex = /* @__PURE__ */ new WeakMap();\n/** An action of the installed releases, or of the exact `version` when the caller pins one. */\nconst resolveAction = (installations, actionId, version) => {\n\tlet index = actionIndex.get(installations);\n\tif (index === void 0) {\n\t\tindex = new Map(collectActionEntries(installations).map((entry) => [entry.actionId, entry]));\n\t\tactionIndex.set(installations, index);\n\t}\n\tconst entry = index.get(actionId);\n\treturn entry === void 0 || version !== void 0 && entry.pluginVersion !== version ? void 0 : entry;\n};\nexport { collectActionEntries, resolveAction };\n\n//# sourceMappingURL=actions.js.map",
|
|
43
|
+
"import { walkCapabilities } from \"../capabilities.js\";\n// src/internal/dual/triggers.ts\nconst entriesOf = (installation) => walkCapabilities(installation.plugin, (owner) => owner.triggers).map((walked) => ({\n\tauthMethods: installation.plugin.authMethods,\n\tlocalId: walked.localId,\n\tpluginVersion: installation.version,\n\tproviderId: installation.plugin.identifier,\n\ttrigger: walked.node,\n\ttriggerId: walked.canonicalId\n}));\nconst collectTriggerEntries = (installations) => installations.flatMap(entriesOf);\nconst triggerIndex = /* @__PURE__ */ new WeakMap();\n/** A trigger of the installed releases, or of the exact `version` when the caller pins one. */\nconst resolveRuntimeTrigger = (installations, triggerId, version) => {\n\tlet index = triggerIndex.get(installations);\n\tif (index === void 0) {\n\t\tindex = new Map(collectTriggerEntries(installations).map((entry) => [entry.triggerId, entry]));\n\t\ttriggerIndex.set(installations, index);\n\t}\n\tconst entry = index.get(triggerId);\n\treturn entry === void 0 || version !== void 0 && entry.pluginVersion !== version ? void 0 : entry;\n};\nexport { collectTriggerEntries, resolveRuntimeTrigger };\n\n//# sourceMappingURL=triggers.js.map",
|
|
44
|
+
"import { projectContract, validateDefinition } from \"../../AgentChannel.js\";\nimport { registryId } from \"../../AiProvider.js\";\nimport { collectActionEntries } from \"./actions.js\";\nimport { collectTriggerEntries } from \"./triggers.js\";\nimport { Schema } from \"effect\";\n// src/internal/dual/registry.ts\n/** Materialized Dual registry DTOs and resolver. */\nconst authMethodId = (providerId, methodId) => `${providerId}/${methodId}`;\nconst schemaJson = (schema) => Schema.toJsonSchemaDocument(schema, { onExcessProperty: \"error\" });\nconst authMethodMetadataJson = (method) => {\n\tif (method.oauth2 === void 0) return {};\n\tconst staticClient = typeof method.oauth2.client === \"function\" ? void 0 : method.oauth2.client;\n\tconst staticEndpoint = (endpoint) => typeof endpoint === \"function\" ? void 0 : endpoint;\n\tconst discoveryUrl = staticEndpoint(method.oauth2.discoveryUrl);\n\tconst authorizationUrl = staticEndpoint(method.oauth2.authorizationUrl);\n\tconst tokenUrl = staticEndpoint(method.oauth2.tokenUrl);\n\treturn { oauth2: {\n\t\tscopes: method.oauth2.scopes,\n\t\t...staticClient === void 0 ? {} : { clientAuthentication: staticClient.authentication ?? \"basic\" },\n\t\t...discoveryUrl === void 0 ? {} : { discoveryUrl },\n\t\t...authorizationUrl === void 0 ? {} : { authorizationUrl },\n\t\t...tokenUrl === void 0 ? {} : { tokenUrl },\n\t\t...method.oauth2.pkce === void 0 ? {} : { pkce: method.oauth2.pkce },\n\t\t...method.oauth2.authorizationParams === void 0 ? {} : { authorizationParams: method.oauth2.authorizationParams },\n\t\t...method.oauth2.tokenParams === void 0 ? {} : { tokenParams: method.oauth2.tokenParams }\n\t} };\n};\n/**\n* Materialize the provider/capability registry of the installed plugin releases. This is the\n* canonical SDK-owned resolver used by server persistence/bootstrap code.\n*\n* @since 0.0.0\n* @category registry\n*/\nconst materializeResolvedRegistry = (input) => {\n\tconst projectedSchemas = input.projections ?? /* @__PURE__ */ new Map();\n\tconst projectSchemaUncached = input.schemaJson ?? schemaJson;\n\tconst projectSchema = (schema) => {\n\t\tif (projectedSchemas.has(schema)) return projectedSchemas.get(schema);\n\t\tconst projected = projectSchemaUncached(schema);\n\t\tprojectedSchemas.set(schema, projected);\n\t\treturn projected;\n\t};\n\tconst projectSchemasFor = input.projectSchemas ?? (() => true);\n\tconst capabilityVersionsByProvider = /* @__PURE__ */ new Map();\n\tconst addCapabilityVersion = (providerId, capabilityVersion) => {\n\t\tconst versions = capabilityVersionsByProvider.get(providerId) ?? [];\n\t\tversions.push(capabilityVersion);\n\t\tcapabilityVersionsByProvider.set(providerId, versions);\n\t};\n\tfor (const entry of collectActionEntries(input.plugins)) {\n\t\tconst projected = projectSchemasFor(entry.actionId, entry.pluginVersion);\n\t\taddCapabilityVersion(entry.providerId, {\n\t\t\tauthMethodIds: entry.authMethods.map((method) => authMethodId(entry.providerId, method.identifier)),\n\t\t\tcapabilityId: entry.actionId,\n\t\t\tdescription: entry.action.description,\n\t\t\texamplesJson: entry.action.examples,\n\t\t\tinputSchemaJson: projected ? projectSchema(entry.action.input) : void 0,\n\t\t\tkey: entry.localId,\n\t\t\tkind: \"action\",\n\t\t\trequireAuth: entry.action.requireAuth !== false,\n\t\t\tname: entry.action.name,\n\t\t\toutputSchemaJson: projected ? projectSchema(entry.action.output) : void 0,\n\t\t\tsourcePluginKey: entry.providerId,\n\t\t\tsourcePluginVersion: entry.pluginVersion,\n\t\t\tversion: entry.pluginVersion\n\t\t});\n\t}\n\tfor (const entry of collectTriggerEntries(input.plugins)) {\n\t\tconst projected = projectSchemasFor(entry.triggerId, entry.pluginVersion);\n\t\taddCapabilityVersion(entry.providerId, {\n\t\t\tauthMethodIds: entry.authMethods.map((method) => authMethodId(entry.providerId, method.identifier)),\n\t\t\tcapabilityId: entry.triggerId,\n\t\t\tconfigSchemaJson: projected ? projectSchema(entry.trigger.config) : void 0,\n\t\t\tdescription: entry.trigger.description,\n\t\t\tkey: entry.localId,\n\t\t\tkind: \"trigger\",\n\t\t\trequireAuth: entry.trigger.requireAuth !== false,\n\t\t\tname: entry.trigger.name,\n\t\t\toutputSchemaJson: projected ? projectSchema(entry.trigger.output) : void 0,\n\t\t\tsourcePluginKey: entry.providerId,\n\t\t\tsourcePluginVersion: entry.pluginVersion,\n\t\t\tstateSchemaJson: projected && entry.trigger.state !== void 0 ? projectSchema(entry.trigger.state) : void 0,\n\t\t\ttriggerKind: entry.trigger.kind,\n\t\t\tversion: entry.pluginVersion\n\t\t});\n\t}\n\tfor (const { plugin, version } of input.plugins) for (const channel of plugin.agentChannels) {\n\t\tconst definition = channel.definition;\n\t\tvalidateDefinition(definition, plugin.identifier, plugin.authMethods);\n\t\taddCapabilityVersion(plugin.identifier, {\n\t\t\tauthMethodIds: definition.authMethods.map((method) => authMethodId(plugin.identifier, method.identifier)),\n\t\t\tcapabilityId: `${plugin.identifier}/${channel.identifier}`,\n\t\t\tdescription: channel.description,\n\t\t\tkey: channel.identifier,\n\t\t\tkind: \"agent_channel\",\n\t\t\trequireAuth: true,\n\t\t\tname: channel.name,\n\t\t\tsourcePluginKey: plugin.identifier,\n\t\t\tsourcePluginVersion: version,\n\t\t\tversion,\n\t\t\t...projectContract(definition, projectSchema)\n\t\t});\n\t}\n\tconst toolProviders = input.plugins.map(({ plugin, version }) => ({\n\t\tauthMethods: plugin.authMethods.map((method) => ({\n\t\t\tdescription: method.description,\n\t\t\tid: authMethodId(plugin.identifier, method.identifier),\n\t\t\tinputSchemaJson: method.input === void 0 ? null : projectSchema(method.input),\n\t\t\tkey: method.identifier,\n\t\t\tkind: method.kind,\n\t\t\tmaterialSchemaJson: projectSchema(method.material),\n\t\t\tmetadataJson: authMethodMetadataJson(method),\n\t\t\tname: method.name,\n\t\t\tproviderId: plugin.identifier,\n\t\t\tsetupSchemaJson: method.setup === void 0 ? null : projectSchema(method.setup)\n\t\t})),\n\t\tcapabilityVersions: capabilityVersionsByProvider.get(plugin.identifier) ?? [],\n\t\tcategories: plugin.categories,\n\t\tdescription: plugin.description,\n\t\tdocsUrl: plugin.docsUrl,\n\t\thomepageUrl: plugin.homepageUrl,\n\t\ticonUrl: plugin.iconUrl,\n\t\ticonUrlDark: plugin.iconUrlDark,\n\t\tid: plugin.identifier,\n\t\tkey: plugin.identifier,\n\t\tkind: \"tools\",\n\t\tname: plugin.name,\n\t\tsandboxAccess: plugin.sandboxAccess !== void 0,\n\t\tsourcePluginKey: plugin.identifier,\n\t\tsourcePluginVersion: version\n\t}));\n\tconst aiProviders = input.aiProviders.flatMap((provider) => {\n\t\tconst id = registryId(provider.identifier);\n\t\treturn [{\n\t\t\tauthMethods: provider.authMethods.map((method) => ({\n\t\t\t\tdescription: method.description,\n\t\t\t\tid: authMethodId(id, method.identifier),\n\t\t\t\tinputSchemaJson: method.input === void 0 ? null : projectSchema(method.input),\n\t\t\t\tkey: method.identifier,\n\t\t\t\tkind: method.kind,\n\t\t\t\tmaterialSchemaJson: projectSchema(method.material),\n\t\t\t\tmetadataJson: authMethodMetadataJson(method),\n\t\t\t\tname: method.name,\n\t\t\t\tproviderId: id,\n\t\t\t\tsetupSchemaJson: method.setup === void 0 ? null : projectSchema(method.setup)\n\t\t\t})),\n\t\t\tcapabilityVersions: [],\n\t\t\tcategories: provider.categories,\n\t\t\tdescription: provider.description,\n\t\t\tdocsUrl: provider.docsUrl,\n\t\t\thomepageUrl: provider.homepageUrl,\n\t\t\ticonUrl: provider.iconUrl,\n\t\t\ticonUrlDark: provider.iconUrlDark,\n\t\t\tid,\n\t\t\tkey: provider.identifier,\n\t\t\tkind: \"ai\",\n\t\t\tname: provider.name,\n\t\t\tsandboxAccess: false,\n\t\t\tsourcePluginKey: void 0,\n\t\t\tsourcePluginVersion: void 0\n\t\t}];\n\t});\n\treturn {\n\t\tdualIdentifier: input.dualIdentifier,\n\t\tproviders: [...toolProviders, ...aiProviders]\n\t};\n};\nexport { materializeResolvedRegistry };\n\n//# sourceMappingURL=registry.js.map",
|
|
45
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { collectActionEntries } from \"./internal/dual/actions.js\";\nimport { collectTriggerEntries, resolveRuntimeTrigger } from \"./internal/dual/triggers.js\";\nimport { materializeResolvedRegistry } from \"./internal/dual/registry.js\";\nimport \"./DualRegistry.js\";\nimport { Schema } from \"effect\";\n// src/DualRegistry.ts\n/**\n* Dual registry resolution and materialization.\n*\n* @since 0.0.0\n*/\nvar DualRegistry_exports = /* @__PURE__ */ __exportAll({\n\tDualRegistry: () => DualRegistry_exports,\n\tTriggerNotFoundError: () => TriggerNotFoundError,\n\tactionIds: () => actionIds,\n\tmaterializePlugin: () => materializePlugin,\n\tmaterializePlugins: () => materializePlugins,\n\tmaterializeRegistry: () => materializeRegistry,\n\tresolveTrigger: () => resolveTrigger,\n\ttriggerIds: () => triggerIds\n});\n/** Raised when a trigger lifecycle request references an unknown trigger id. */\nvar TriggerNotFoundError = class extends Schema.TaggedError()(\"TriggerNotFoundError\", { triggerId: Schema.String }) {};\n/**\n* Enumerate the canonical machine ids for every action in the app.\n*\n* @since 0.0.0\n* @category getters\n*/\nconst actionIds = (app) => collectActionEntries(app.plugins).map((entry) => entry.actionId);\n/**\n* Enumerate the canonical machine ids for every trigger in the app.\n*\n* @since 0.0.0\n* @category getters\n*/\nconst triggerIds = (app) => collectTriggerEntries(app.plugins).map((entry) => entry.triggerId);\n/**\n* Resolve one trigger entry from the app, including its auth methods.\n*\n* @since 0.0.0\n* @category getters\n*/\nconst resolveTrigger = (app, triggerId, options = {}) => resolveRuntimeTrigger(app.plugins, triggerId, options.triggerVersion);\n/**\n* Materialize the capability catalog of an app's installed releases.\n*\n* @since 0.0.0\n* @category registry\n*/\nconst materializeRegistry = (app, options = {}) => materializeResolvedRegistry({\n\taiProviders: app.aiProviders,\n\tdualIdentifier: app.identifier,\n\tplugins: app.plugins,\n\tprojectSchemas: options.projectSchemas,\n\tprojections: options.projections,\n\tschemaJson: options.schemaJson\n});\n/**\n* Extract a release's contracts without building Layers or running handlers.\n*\n* @since 0.0.0\n* @category registry\n*/\nconst materializePlugin = (plugin, options) => ({\n\tpluginIdentifier: plugin.identifier,\n\tpluginVersion: options.version,\n\tproviders: materializeResolvedRegistry({\n\t\taiProviders: [],\n\t\tdualIdentifier: plugin.identifier,\n\t\tplugins: [{\n\t\t\tplugin,\n\t\t\tversion: options.version\n\t\t}],\n\t\tprojectSchemas: options.projectSchemas,\n\t\tprojections: options.projections,\n\t\tschemaJson: options.schemaJson\n\t}).providers\n});\n/** Every installed plugin release and its contracts. @since 0.0.0 @category registry */\nconst materializePlugins = (app, options = {}) => {\n\tconst projections = options.projections ?? /* @__PURE__ */ new Map();\n\treturn app.plugins.map((installation) => ({\n\t\t...materializePlugin(installation.plugin, {\n\t\t\t...options,\n\t\t\tprojections,\n\t\t\tversion: installation.version\n\t\t}),\n\t\tordinal: 0\n\t}));\n};\nexport { DualRegistry_exports as DualRegistry, DualRegistry_exports, TriggerNotFoundError, actionIds, materializePlugin, materializePlugins, materializeRegistry, resolveTrigger, triggerIds };\n\n//# sourceMappingURL=DualRegistry.js.map",
|
|
46
|
+
"import { handlerKey } from \"../../Action.js\";\nimport { findHandler, mergeUnder } from \"../handler-context.js\";\nimport { decodeJsonMapError } from \"../schema-runtime.js\";\nimport { authRuntimeContext, failConnectionIdNotAllowed, noAuthRuntimeContext, resolveRuntimeConnection, toNonEmptyArray } from \"../auth-execution.js\";\nimport { Effect, Schema, SchemaIssue } from \"effect\";\n// src/internal/dual/invoke.ts\nvar FieldIssue = class extends Schema.Class(\"FieldIssue\")({\n\tmessage: Schema.String,\n\tpath: Schema.String\n}) {};\nvar ActionNotFoundError = class extends Schema.TaggedError()(\"ActionNotFoundError\", { actionId: Schema.String }) {};\nvar InvalidActionInputError = class extends Schema.TaggedError()(\"InvalidActionInputError\", {\n\tactionId: Schema.String,\n\tdescription: Schema.String,\n\tfields: Schema.Array(FieldIssue)\n}) {};\nvar ActionHandlerNotFoundError = class extends Schema.TaggedError()(\"ActionHandlerNotFoundError\", { actionId: Schema.String }) {};\nvar InvalidActionOutputError = class extends Schema.TaggedError()(\"InvalidActionOutputError\", {\n\tactionId: Schema.String,\n\tdescription: Schema.String,\n\tfields: Schema.Array(FieldIssue)\n}) {};\nconst schemaIssueFormatter = SchemaIssue.makeFormatterStandardSchemaV1();\nconst formatFieldPath = (path) => {\n\tlet current = \"$\";\n\tfor (const segment of path) {\n\t\tif (typeof segment === \"number\") {\n\t\t\tcurrent += `[${segment}]`;\n\t\t\tcontinue;\n\t\t}\n\t\tconst key = String(segment);\n\t\tcurrent += /^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(key) ? `.${key}` : `[${JSON.stringify(key)}]`;\n\t}\n\treturn current;\n};\nconst schemaErrorFields = (error) => schemaIssueFormatter(error.issue).issues.map((issue) => new FieldIssue({\n\tmessage: issue.message,\n\tpath: formatFieldPath(issue.path ?? [])\n}));\nconst decodeActionInput = (actionId, schema, input) => decodeJsonMapError(schema, input, (error) => new InvalidActionInputError({\n\tactionId,\n\tdescription: error.message,\n\tfields: schemaErrorFields(error)\n}));\nconst validateActionOutput = (actionId, schema, output) => Schema.encodeEffect(schema)(output).pipe(Effect.as(output), Effect.mapError((error) => new InvalidActionOutputError({\n\tactionId,\n\tdescription: error.message,\n\tfields: schemaErrorFields(error)\n})));\nconst getActionHandler = (providerId, actionId) => Effect.context().pipe(Effect.flatMap((context) => {\n\tconst handler = findHandler(context, providerId, handlerKey(actionId));\n\treturn handler === void 0 ? Effect.fail(new ActionHandlerNotFoundError({ actionId })) : Effect.succeed(handler);\n}));\nconst invokeResolvedActionWithOutput = (providerId, actionId, pluginVersion, action, authMethods, request, finish) => {\n\tconst requiredAuthMethods = toNonEmptyArray(authMethods);\n\tif (requiredAuthMethods === void 0 && request.connectionId !== void 0) return failConnectionIdNotAllowed(\"action\", actionId, void 0, providerId, request.connectionId);\n\treturn getActionHandler(providerId, actionId).pipe(Effect.flatMap((handler) => decodeActionInput(actionId, action.input, request.input).pipe(Effect.flatMap((decodedInput) => requiredAuthMethods === void 0 || action.requireAuth === false && request.connectionId === void 0 ? Effect.suspend(() => handler.handler(decodedInput, noAuthRuntimeContext())) : resolveRuntimeConnection(\"action\", actionId, void 0, providerId, requiredAuthMethods, request.connectionId, request.context).pipe(Effect.flatMap((binding) => Effect.suspend(() => handler.handler(decodedInput, authRuntimeContext(binding)))))), Effect.updateContext((input) => mergeUnder(handler.context, input)))), Effect.flatMap(finish), Effect.map((data) => ({\n\t\tdata,\n\t\tmeta: {\n\t\t\tactionId,\n\t\t\tpluginVersion,\n\t\t\tproviderId\n\t\t}\n\t})));\n};\nconst invokeResolvedAction = (providerId, actionId, pluginVersion, action, authMethods, request) => invokeResolvedActionWithOutput(providerId, actionId, pluginVersion, action, authMethods, request, (data) => validateActionOutput(actionId, action.output, data));\nconst invokeResolvedActionJson = (providerId, actionId, pluginVersion, action, authMethods, request) => invokeResolvedActionWithOutput(providerId, actionId, pluginVersion, action, authMethods, request, (data) => Schema.encodeUnknownEffect(Schema.toCodecJson(action.output))(data).pipe(Effect.mapError((error) => InvalidActionOutputError.make({\n\tactionId,\n\tdescription: error.message,\n\tfields: schemaErrorFields(error)\n}))));\nexport { ActionHandlerNotFoundError, ActionNotFoundError, FieldIssue, InvalidActionInputError, InvalidActionOutputError, invokeResolvedAction, invokeResolvedActionJson };\n\n//# sourceMappingURL=invoke.js.map",
|
|
47
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { BuilderCollisionError } from \"./DefinitionError.js\";\nimport { ActionHandlerError, RetryableActionHandlerError } from \"./Action.js\";\nimport { makeBinding } from \"./AuthMethodBinding.js\";\nimport { decodeSetup, executeJson, prepare, prepareOAuth2Tokens, refreshUnknown, resolve, resolveDecoded } from \"./AuthMethodExecution.js\";\nimport { ConnectionIdNotAllowedError, ConnectionReauthorizationRequiredError, ConnectionRequiredError, ConnectionResolverStoreError, ConnectionSelectionRequiredError, InvalidConnectionIdError, InvalidResolvedConnectionError } from \"./ConnectionResolver.js\";\nimport { indexGroups } from \"./internal/handler-context.js\";\nimport { Service as Service$1, layer } from \"./AgentChannelRuntime.js\";\nimport { RuntimeConfig, registryId } from \"./AiProvider.js\";\nimport { resolveAction } from \"./internal/dual/actions.js\";\nimport { resolveRuntimeTrigger } from \"./internal/dual/triggers.js\";\nimport { TriggerNotFoundError } from \"./DualRegistry.js\";\nimport { authRuntimeContext } from \"./internal/auth-execution.js\";\nimport { ActionHandlerNotFoundError, ActionNotFoundError, FieldIssue, InvalidActionInputError, InvalidActionOutputError, invokeResolvedAction, invokeResolvedActionJson } from \"./internal/dual/invoke.js\";\nimport { activate, deactivate, parse, poll, verify } from \"./Trigger.js\";\nimport \"./DualRuntime.js\";\nimport { Array, Context, Effect, Function, Layer, Predicate, Result, Schema, pipe } from \"effect\";\nimport { Url } from \"effect/http\";\n// src/DualRuntime.ts\n/**\n* Dual action invocation, trigger lifecycle, and auth runtime.\n*\n* @since 0.0.0\n*/\nvar DualRuntime_exports = /* @__PURE__ */ __exportAll({\n\tActionHandlerError: () => ActionHandlerError,\n\tActionHandlerNotFoundError: () => ActionHandlerNotFoundError,\n\tActionNotFoundError: () => ActionNotFoundError,\n\tAiProviderRuntimeNotConfiguredError: () => AiProviderRuntimeNotConfiguredError,\n\tAuthMethodNotFoundError: () => AuthMethodNotFoundError,\n\tConnectionIdNotAllowedError: () => ConnectionIdNotAllowedError,\n\tConnectionReauthorizationRequiredError: () => ConnectionReauthorizationRequiredError,\n\tConnectionRequiredError: () => ConnectionRequiredError,\n\tConnectionResolverStoreError: () => ConnectionResolverStoreError,\n\tConnectionSelectionRequiredError: () => ConnectionSelectionRequiredError,\n\tDualRuntime: () => DualRuntime_exports,\n\tFieldIssue: () => FieldIssue,\n\tInvalidActionInputError: () => InvalidActionInputError,\n\tInvalidActionOutputError: () => InvalidActionOutputError,\n\tInvalidConnectionIdError: () => InvalidConnectionIdError,\n\tInvalidResolvedConnectionError: () => InvalidResolvedConnectionError,\n\tRetryableActionHandlerError: () => RetryableActionHandlerError,\n\tSandboxAccessNotDeclaredError: () => SandboxAccessNotDeclaredError,\n\tSandboxRequestNotAllowedError: () => SandboxRequestNotAllowedError,\n\tService: () => Service,\n\tfromPlugin: () => fromPlugin,\n\tinstall: () => install,\n\tinvoke: () => invoke,\n\tmake: () => make,\n\ttoLayer: () => toLayer,\n\twithPlugin: () => withPlugin,\n\twithPlugins: () => withPlugins\n});\n/**\n* Install one plugin release.\n*\n* @since 0.7.0\n* @category constructors\n*/\nconst install = (plugin, version) => ({\n\tplugin,\n\tversion\n});\n/**\n* The runtime of one plugin release, as the plugin's own process runs it. `version` defaults to\n* `0.0.0` for tests that do not need the package version.\n*\n* @since 0.7.0\n* @category constructors\n*/\nconst fromPlugin = (plugin, version = \"0.0.0\") => ({\n\taiProviders: [],\n\tidentifier: plugin.identifier,\n\tlayer: plugin.layer,\n\tplugins: [install(plugin, version)]\n});\n/**\n* An app runtime without plugins, for {@link withPlugin} and {@link withPlugins} to fill.\n*\n* @since 0.7.0\n* @category constructors\n*/\nconst make = (identifier) => ({\n\taiProviders: [],\n\tidentifier,\n\tlayer: Layer.empty,\n\tplugins: []\n});\nfunction addPlugins(app, entries) {\n\tconst seen = new Set(Array.map(app.plugins, (installation) => installation.plugin.identifier));\n\tfor (const [plugin] of entries) {\n\t\tif (seen.has(plugin.identifier)) throw new BuilderCollisionError({\n\t\t\tchildKind: \"plugin\",\n\t\t\texistingChildKind: \"plugin\",\n\t\t\tidentifier: plugin.identifier,\n\t\t\townerIdentifier: app.identifier,\n\t\t\townerKind: \"dual\"\n\t\t});\n\t\tseen.add(plugin.identifier);\n\t}\n\treturn {\n\t\t...app,\n\t\tlayer: Array.reduce(entries, app.layer, (layer, [plugin]) => Layer.provideMerge(layer, plugin.layer)),\n\t\tplugins: [...app.plugins, ...Array.map(entries, ([plugin, version]) => install(plugin, version))]\n\t};\n}\n/**\n* Add one plugin release: the plugin and its package version.\n*\n* @since 0.7.0\n* @category combinators\n*/\nconst withPlugin = Function.dual(3, (app, plugin, version) => addPlugins(app, [[plugin, version]]));\n/**\n* Add several plugin releases in one step, which keeps a large app's inferred type compact.\n*\n* @since 0.7.0\n* @category combinators\n*/\nconst withPlugins = Function.dual(2, addPlugins);\nconst pluginOf = (app, identifier) => app.plugins.find((installation) => installation.plugin.identifier === identifier)?.plugin;\n/**\n* Invoke an action directly in-process.\n*\n* The invocation boundary resolves an action by canonical machine id, validates\n* unknown input against the resolved runtime schema, runs the handler, and\n* returns a standard success envelope. This mirrors the server trusted invoke\n* boundary: runtime schema validation is authoritative.\n*\n* @since 0.0.0\n* @category execution\n*/\nconst failInvokeActionNotFound = (actionId) => Effect.fail(new ActionNotFoundError({ actionId }));\nconst invokeRaw = (app, request, json = false) => {\n\tconst resolved = resolveAction(app.plugins, request.actionId, request.actionVersion);\n\tif (resolved === void 0 || request.pluginKey !== void 0 && resolved.providerId !== request.pluginKey) return failInvokeActionNotFound(request.actionId);\n\treturn (json ? invokeResolvedActionJson : invokeResolvedAction)(resolved.providerId, resolved.actionId, resolved.pluginVersion, resolved.action, resolved.authMethods, request);\n};\nconst invoke = (app, request) => invokeRaw(app, request).pipe(Effect.provide(app.layer));\nvar AuthMethodNotFoundError = class extends Schema.TaggedError()(\"AuthMethodNotFoundError\", {\n\tauthMethodId: Schema.String,\n\tproviderId: Schema.String\n}) {};\nvar AiProviderRuntimeNotConfiguredError = class extends Schema.TaggedError()(\"AiProviderRuntimeNotConfiguredError\", { providerId: Schema.String }) {};\n/** Raised when a provider declares no sandbox access. */\nvar SandboxAccessNotDeclaredError = class extends Schema.TaggedError()(\"SandboxAccessNotDeclaredError\", { providerId: Schema.String }) {};\n/** Raised when the Connection may not be sent with a sandbox request: another origin, or a request the provider refuses. */\nvar SandboxRequestNotAllowedError = class extends Schema.TaggedError()(\"SandboxRequestNotAllowedError\", {\n\torigin: Schema.String,\n\tpath: Schema.String,\n\tproviderId: Schema.String\n}) {};\n/**\n* Effect service provided by {@link toLayer}.\n*\n* @since 0.0.0\n* @category services\n*/\nvar Service = class extends Context.Service()(\"@dual-os/sdk/Dual/Service\") {};\n/**\n* Turn an {@link App} into a runtime Effect service layer.\n*\n* @since 0.0.0\n* @category layers\n*/\nconst toLayer = (app) => {\n\tconst fullAuthMethodId = (providerId, method) => `${providerId}/${method.identifier}`;\n\tconst findAuthMethod = (providerId, authMethodId) => {\n\t\tconst method = (pluginOf(app, providerId) ?? app.aiProviders.find((candidate) => registryId(candidate.identifier) === providerId))?.authMethods.find((candidate) => candidate.identifier === authMethodId || fullAuthMethodId(providerId, candidate) === authMethodId);\n\t\treturn method === void 0 ? Effect.fail(new AuthMethodNotFoundError({\n\t\t\tauthMethodId,\n\t\t\tproviderId\n\t\t})) : Effect.succeed(method);\n\t};\n\treturn Layer.effect(Service, Effect.gen(function* () {\n\t\tconst channels = yield* Service$1;\n\t\tconst context = yield* Effect.context();\n\t\tconst appContext = indexGroups(context);\n\t\tconst provideRuntimeContext = (effect) => effect.pipe(Effect.updateContext((input) => Context.merge(appContext, input)));\n\t\tconst runWithCapturedAppContext = (effect) => provideRuntimeContext(effect);\n\t\tconst getAuthMethod = (request) => findAuthMethod(request.providerId, request.authMethodId);\n\t\tconst getTrigger = (request) => {\n\t\t\tconst resolved = resolveRuntimeTrigger(app.plugins, request.triggerId, request.triggerVersion);\n\t\t\treturn resolved === void 0 || request.pluginKey !== void 0 && resolved.providerId !== request.pluginKey ? Effect.fail(new TriggerNotFoundError({ triggerId: request.triggerId })) : Effect.succeed(resolved);\n\t\t};\n\t\tconst triggerLifecycleRequest = (request) => ({\n\t\t\tconfig: request.config,\n\t\t\t...request.state === void 0 ? {} : { state: request.state },\n\t\t\t...request.connectionId === void 0 ? {} : { connectionId: request.connectionId },\n\t\t\t...request.context === void 0 ? {} : { context: request.context }\n\t\t});\n\t\tconst webhookActivationRequest = (request) => ({\n\t\t\t...triggerLifecycleRequest(request),\n\t\t\twebhookUrl: request.webhookUrl\n\t\t});\n\t\tconst webhookTriggerLifecycleRequest = (request) => ({\n\t\t\t...webhookActivationRequest(request),\n\t\t\trequest: Predicate.isString(request.request.rawBody) ? {\n\t\t\t\t...request.request,\n\t\t\t\trawBody: new TextEncoder().encode(request.request.rawBody)\n\t\t\t} : request.request\n\t\t});\n\t\tconst activateTrigger = (request) => runWithCapturedAppContext(Effect.gen(function* () {\n\t\t\tconst entry = yield* getTrigger(request);\n\t\t\treturn yield* activate(entry, webhookActivationRequest(request));\n\t\t}));\n\t\tconst deactivateTrigger = (request) => runWithCapturedAppContext(Effect.gen(function* () {\n\t\t\tconst entry = yield* getTrigger(request);\n\t\t\treturn yield* deactivate(entry, webhookActivationRequest(request));\n\t\t}));\n\t\tconst verifyTrigger = (request) => runWithCapturedAppContext(Effect.gen(function* () {\n\t\t\tconst entry = yield* getTrigger(request);\n\t\t\treturn yield* verify(entry, webhookTriggerLifecycleRequest(request));\n\t\t}));\n\t\tconst parseTrigger = (request) => runWithCapturedAppContext(Effect.gen(function* () {\n\t\t\tconst entry = yield* getTrigger(request);\n\t\t\treturn yield* parse(entry, webhookTriggerLifecycleRequest(request));\n\t\t}));\n\t\tconst pollTrigger = (request) => runWithCapturedAppContext(Effect.gen(function* () {\n\t\t\tconst entry = yield* getTrigger(request);\n\t\t\treturn yield* poll(entry, triggerLifecycleRequest(request));\n\t\t}));\n\t\tconst decodeAuthMethodSetup = (request) => runWithCapturedAppContext(getAuthMethod(request).pipe(Effect.flatMap((method) => {\n\t\t\tif (request.encoding === \"json\" && method.setup !== void 0) return Schema.decodeUnknownEffect(Schema.toCodecJson(method.setup))(request.setup);\n\t\t\treturn decodeSetup(method, request.setup);\n\t\t})));\n\t\tconst withAuthMethodSetup = (request, execute) => runWithCapturedAppContext(getAuthMethod(request).pipe(Effect.flatMap((method) => decodeSetup(method, request.setup).pipe(Effect.flatMap((setup) => execute(method, setup))))));\n\t\tconst prepareAuthMethod = (request) => withAuthMethodSetup(request, (method, setup) => prepare(method, request.input, { setup }));\n\t\tconst prepareOAuth2Tokens$1 = (request) => withAuthMethodSetup(request, (method, setup) => prepareOAuth2Tokens(method, request.tokens, { setup }));\n\t\tconst refreshAuthMethod = (request) => runWithCapturedAppContext(getAuthMethod(request).pipe(Effect.flatMap((method) => decodeSetup(method, request.setup).pipe(Effect.flatMap((setup) => refreshUnknown(method, request.material, {\n\t\t\tminValidityMs: request.minValidityMs,\n\t\t\tnow: request.now,\n\t\t\treason: request.reason,\n\t\t\tsetup\n\t\t}))))));\n\t\tconst resolveAuthMethod = (request) => runWithCapturedAppContext(Effect.gen(function* () {\n\t\t\tconst method = yield* getAuthMethod(request);\n\t\t\tconst setup = yield* decodeAuthMethodSetup(request);\n\t\t\tconst value = request.encoding === \"json\" ? yield* resolveDecoded(method, yield* Schema.decodeUnknownEffect(Schema.toCodecJson(method.material))(request.material), { setup }) : yield* resolve(method, request.material, { setup });\n\t\t\treturn makeBinding({\n\t\t\t\tconnectionId: void 0,\n\t\t\t\tmethod,\n\t\t\t\tproviderId: request.providerId,\n\t\t\t\tvalue\n\t\t\t});\n\t\t}));\n\t\tconst resolveAiModelConfig = (request) => runWithCapturedAppContext(Effect.gen(function* () {\n\t\t\tconst provider = app.aiProviders.find((candidate) => registryId(candidate.identifier) === request.providerId);\n\t\t\tif (provider?.resolveRuntimeConfig === void 0) return yield* new AiProviderRuntimeNotConfiguredError({ providerId: request.providerId });\n\t\t\tconst binding = yield* resolveAuthMethod(request);\n\t\t\tconst resolveRuntimeConfig = provider.resolveRuntimeConfig;\n\t\t\treturn yield* Schema.decodeUnknownEffect(RuntimeConfig)(resolveRuntimeConfig({\n\t\t\t\tbinding,\n\t\t\t\tmodel: request.model\n\t\t\t}));\n\t\t}));\n\t\tconst resolveSandboxAccess = (request) => runWithCapturedAppContext(Effect.gen(function* () {\n\t\t\tconst access = pluginOf(app, request.providerId)?.sandboxAccess;\n\t\t\tif (access === void 0) return yield* new SandboxAccessNotDeclaredError({ providerId: request.providerId });\n\t\t\tconst context = authRuntimeContext(yield* resolveAuthMethod(request));\n\t\t\tconst origins = Array.map(access.origins(context), (origin) => Result.getOrUndefined(Url.fromString(origin))?.origin ?? origin);\n\t\t\tconst authorize = (outgoing) => {\n\t\t\t\tconst url = Result.getOrUndefined(Url.fromString(outgoing.url));\n\t\t\t\tconst refused = new SandboxRequestNotAllowedError({\n\t\t\t\t\torigin: url?.origin ?? outgoing.url,\n\t\t\t\t\tpath: url?.pathname ?? \"\",\n\t\t\t\t\tproviderId: request.providerId\n\t\t\t\t});\n\t\t\t\tif (url === void 0 || !origins.includes(url.origin)) return Effect.fail(refused);\n\t\t\t\treturn Effect.fromOption(access.authorize(outgoing, context), () => refused);\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tauthorize,\n\t\t\t\torigins\n\t\t\t};\n\t\t}));\n\t\treturn Service.of({\n\t\t\tactivateTrigger,\n\t\t\tcheckAccessAgentChannel: channels.checkAccess,\n\t\t\tdeactivateTrigger,\n\t\t\tdecodeAgentChannelDefinitionSettings: channels.decodeDefinitionSettings,\n\t\t\tdecodeAgentChannelDeploymentSettings: channels.decodeDeploymentSettings,\n\t\t\tdecodeAuthMethodSetup,\n\t\t\texecuteAgentChannel: channels.execute,\n\t\t\texecuteAuthJson: (request) => runWithCapturedAppContext(pipe(getAuthMethod(request), Effect.flatMap((method) => executeJson(method, request)))),\n\t\t\tgetAgentChannel: channels.get,\n\t\t\tgetAuthMethod,\n\t\t\tinvoke: (request) => runWithCapturedAppContext(invokeRaw(app, request)),\n\t\t\tinvokeJson: (request) => runWithCapturedAppContext(Effect.gen(function* () {\n\t\t\t\tconst result = yield* invokeRaw(app, request, true);\n\t\t\t\treturn {\n\t\t\t\t\t...result,\n\t\t\t\t\tdata: yield* Schema.decodeUnknownEffect(Schema.Json)(result.data)\n\t\t\t\t};\n\t\t\t})),\n\t\t\tparseTrigger,\n\t\t\tpollTrigger,\n\t\t\tprepareAuthMethod,\n\t\t\tprepareOAuth2Tokens: prepareOAuth2Tokens$1,\n\t\t\trefreshAuthMethod,\n\t\t\tresolveAiModelConfig,\n\t\t\tresolveAuthMethod,\n\t\t\tresolveSandboxAccess,\n\t\t\tverifyTrigger\n\t\t});\n\t})).pipe(Layer.provide(layer(app.plugins.map((installation) => installation.plugin))), Layer.provide(app.layer));\n};\nexport { ActionHandlerError, ActionHandlerNotFoundError, ActionNotFoundError, AiProviderRuntimeNotConfiguredError, AuthMethodNotFoundError, ConnectionIdNotAllowedError, ConnectionReauthorizationRequiredError, ConnectionRequiredError, ConnectionResolverStoreError, ConnectionSelectionRequiredError, DualRuntime_exports as DualRuntime, DualRuntime_exports, FieldIssue, InvalidActionInputError, InvalidActionOutputError, InvalidConnectionIdError, InvalidResolvedConnectionError, RetryableActionHandlerError, SandboxAccessNotDeclaredError, SandboxRequestNotAllowedError, Service, fromPlugin, install, invoke, make, toLayer, withPlugin, withPlugins };\n\n//# sourceMappingURL=DualRuntime.js.map",
|
|
48
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport \"./Files.js\";\nimport { Context, Effect, Schema, pipe } from \"effect\";\n// src/Files.ts\n/**\n* Files that actions take and return: a small reference in action data, with the bytes kept by the\n* host and read or written through the host's file service.\n*\n* @since 0.1.0\n*/\nvar Files_exports = /* @__PURE__ */ __exportAll({\n\tFile: () => File,\n\tFileError: () => FileError,\n\tFiles: () => Files_exports,\n\tService: () => Service,\n\tread: () => read,\n\twrite: () => write\n});\nconst File = Schema.TaggedStruct(\"File\", {\n\tcontentType: Schema.String,\n\tid: Schema.NonEmptyString,\n\tname: Schema.String,\n\tsizeBytes: Schema.Natural\n}).annotate({ description: \"A file: pass the reference a file input or an earlier step returned.\" });\n/**\n* A file the host could not read or keep. The message is safe for callers; an optional cause\n* retains the host failure in memory for trusted diagnostics. Wrap causes with Redacted.make\n* without a provider-derived label. JSON schema encoding of a cause is intentionally refused.\n*\n* @since 0.1.0\n* @category errors\n*/\nvar FileError = class extends Schema.TaggedError()(\"FileError\", {\n\tcause: Schema.optionalKey(Schema.Redacted(Schema.Unknown, { disallowJsonEncode: true })),\n\tmessage: Schema.String\n}) {};\n/**\n* Reads and stores files for the caller of an action: a workflow run, or the person in a chat.\n*\n* @since 0.1.0\n* @category services\n*/\nvar Service = class extends Context.Service()(\"@dual-os/sdk/Files/Service\") {};\nconst service = pipe(Effect.serviceOption(Service), Effect.flatMap(Effect.fromOption(() => FileError.make({ message: \"Files are only available when Dual calls the action\" }))));\n/**\n* Reads a file's bytes through the caller's file service.\n*\n* @since 0.1.0\n* @category files\n*/\nconst read = Effect.fnUntraced(function* (file) {\n\treturn yield* (yield* service).read(file);\n});\n/**\n* Stores bytes as a new file of the caller and returns its reference.\n*\n* @since 0.1.0\n* @category files\n*/\nconst write = Effect.fnUntraced(function* (file) {\n\treturn yield* (yield* service).write(file);\n});\nexport { File, FileError, Files_exports as Files, Files_exports, Service, read, write };\n\n//# sourceMappingURL=Files.js.map",
|
|
49
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { Service as Service$1 } from \"./OAuth2TokenRefresher.js\";\nimport { OAuth2ProviderTokenResponse } from \"./AuthMethod.js\";\nimport \"./OAuthFlow.js\";\nimport { Array, Clock, ConfigProvider, Context, Effect, HashSet, Layer, Predicate, Random, Record, Redacted, Schema, String, pipe } from \"effect\";\nimport { FetchHttpClient, HttpClient, HttpClientRequest } from \"effect/http\";\nimport { Base64, Base64Url } from \"effect/encoding\";\n// src/OAuthFlow.ts\n/**\n* OAuth protocol runner used by ConnectionStore.\n*\n* OAuthFlow owns provider-facing protocol mechanics: resolving OAuth client\n* configuration, optional discovery, authorization URL construction, token\n* exchange, token refresh, and token response normalization. It does not persist\n* OAuth sessions or create Connections; ConnectionStore owns those product\n* lifecycle records and calls this service for the protocol steps.\n*/\nvar OAuthFlow_exports = /* @__PURE__ */ __exportAll({\n\tOAuthConnectionValidationFailed: () => OAuthConnectionValidationFailed,\n\tOAuthFlow: () => OAuthFlow_exports,\n\tOAuthGrantRejected: () => OAuthGrantRejected,\n\tOAuthProviderRejected: () => OAuthProviderRejected,\n\tService: () => Service,\n\tlayer: () => layer,\n\toauth2TokenRefresherLayer: () => oauth2TokenRefresherLayer,\n\ttesting: () => testing\n});\nvar OAuthConnectionValidationFailed = class extends Schema.TaggedError()(\"OAuthConnectionValidationFailed\", {\n\tcause: Schema.optionalKey(Schema.Redacted(Schema.Defect())),\n\tmessage: Schema.String\n}) {};\nvar OAuthProviderRejected = class extends Schema.TaggedError()(\"OAuthProviderRejected\", {\n\terror: Schema.String,\n\terrorDescription: Schema.optional(Schema.String)\n}) {};\nvar OAuthGrantRejected = class extends Schema.TaggedError()(\"OAuthGrantRejected\", {\n\terrorSubtype: Schema.optionalKey(Schema.String),\n\tmessage: Schema.String\n}) {};\nconst DefaultFlowTtlMs = 6e5;\nSchema.Struct({\n\tauthorizationUrl: Schema.String,\n\texpectedIssuer: Schema.optional(Schema.String),\n\ttokenUrl: Schema.String\n});\nconst ClientAuthentication = Schema.Union([\n\tSchema.Literal(\"basic\"),\n\tSchema.Literal(\"post\"),\n\tSchema.Literal(\"none\")\n]);\nconst ReservedTokenHeaders = HashSet.fromIterable([\n\t\"accept\",\n\t\"accept-charset\",\n\t\"accept-encoding\",\n\t\"access-control-request-headers\",\n\t\"access-control-request-method\",\n\t\"authorization\",\n\t\"connection\",\n\t\"content-encoding\",\n\t\"content-length\",\n\t\"content-type\",\n\t\"cookie\",\n\t\"cookie2\",\n\t\"date\",\n\t\"dnt\",\n\t\"expect\",\n\t\"host\",\n\t\"keep-alive\",\n\t\"origin\",\n\t\"permissions-policy\",\n\t\"referer\",\n\t\"set-cookie\",\n\t\"te\",\n\t\"trailer\",\n\t\"transfer-encoding\",\n\t\"upgrade\",\n\t\"user-agent\",\n\t\"via\"\n]);\nconst TokenHeaders = Schema.Record(Schema.String, Schema.String.check(Schema.isPattern(/^[\\t\\x20-\\x7e\\x80-\\xff]*$/u))).check(Schema.makeFilter((headers) => {\n\tconst names = Array.map(Record.keys(headers), String.toLowerCase);\n\treturn HashSet.size(HashSet.fromIterable(names)) === names.length && Array.every(names, (name) => /^[!#$%&'*+.^_`|~0-9a-z-]+$/u.test(name) && !HashSet.has(ReservedTokenHeaders, name) && !String.startsWith(\"proxy-\")(name) && !String.startsWith(\"sec-\")(name));\n}, { message: \"Invalid provider token headers\" }));\nSchema.Struct({\n\tauthorizationParams: Schema.Record(Schema.String, Schema.String),\n\tauthorizationUrl: Schema.String,\n\tclientAuthentication: ClientAuthentication,\n\tclientId: Schema.String,\n\tclientSecret: Schema.optional(Schema.String),\n\texpectedIssuer: Schema.optional(Schema.String),\n\tpkce: Schema.Boolean,\n\tscopes: Schema.Array(Schema.String),\n\ttokenHeaders: TokenHeaders,\n\ttokenParams: Schema.Record(Schema.String, Schema.String),\n\ttokenRequestEncoding: Schema.Literals([\"form\", \"json\"]),\n\ttokenUrl: Schema.String\n});\nconst ProviderDiscoveryDocument = Schema.Struct({\n\tauthorization_endpoint: Schema.String,\n\tissuer: Schema.optional(Schema.String),\n\ttoken_endpoint: Schema.String\n});\nconst decodeDiscoveryDocument = Schema.decodeUnknownSync(ProviderDiscoveryDocument);\nconst encodeJsonTokenParams = Schema.encodeSync(Schema.fromJsonString(Schema.Record(Schema.String, Schema.String)));\nconst decodeProviderTokenError = Schema.decodeSync(Schema.fromJsonString(Schema.Struct({ error: Schema.Literals([\n\t\"invalid_request\",\n\t\"invalid_client\",\n\t\"invalid_grant\",\n\t\"unauthorized_client\",\n\t\"unsupported_grant_type\",\n\t\"invalid_scope\",\n\t\"server_error\",\n\t\"temporarily_unavailable\"\n]) })));\nconst decodeProviderTokenErrorSubtype = Schema.decodeSync(Schema.fromJsonString(Schema.Struct({ error_subtype: Schema.Literals([\"invalid_rapt\", \"rapt_required\"]) })));\nconst randomBase64Url = (bytes) => {\n\tconst data = new Uint8Array(bytes);\n\tcrypto.getRandomValues(data);\n\treturn Base64Url.encode(data);\n};\nconst sha256Base64Url = (value) => Effect.promise(() => crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(value))).pipe(Effect.map((digest) => Base64Url.encode(new Uint8Array(digest))));\nconst requiredString = (value, message) => typeof value === \"string\" && value.trim() !== \"\" ? Effect.succeed(value) : Effect.fail(new OAuthConnectionValidationFailed({ message }));\nconst fetchDiscovery = Effect.fn(\"OAuthFlow.fetchDiscovery\")(function* (discoveryUrl, client) {\n\tconst rawDocument = yield* pipe(HttpClient.filterStatusOk(client).get(discoveryUrl, { headers: { Accept: \"application/json\" } }), Effect.flatMap((response) => response.json), Effect.mapError((cause) => OAuthConnectionValidationFailed.make({\n\t\tcause: Redacted.make(cause),\n\t\tmessage: \"failed to load oauth discovery document\"\n\t})));\n\tconst document = yield* Effect.try({\n\t\tcatch: () => new OAuthConnectionValidationFailed({ message: \"invalid oauth discovery document\" }),\n\t\ttry: () => decodeDiscoveryDocument(rawDocument)\n\t});\n\tconst authorizationUrl = yield* requiredString(document.authorization_endpoint, \"oauth discovery document missing authorization_endpoint\");\n\tconst tokenUrl = yield* requiredString(document.token_endpoint, \"oauth discovery document missing token_endpoint\");\n\tconst expectedIssuer = typeof document.issuer === \"string\" && document.issuer.trim() !== \"\" ? document.issuer : void 0;\n\treturn {\n\t\tauthorizationUrl,\n\t\ttokenUrl,\n\t\t...expectedIssuer === void 0 ? {} : { expectedIssuer }\n\t};\n});\nconst resolveEndpoint = (value, setup) => value === void 0 ? void 0 : typeof value === \"function\" ? value({ setup }) : value;\nconst resolveParams = (value, setup) => typeof value === \"function\" ? value({ setup }) : value ?? {};\nfunction invalidTokenHeaders() {\n\treturn OAuthConnectionValidationFailed.make({ message: \"invalid oauth token headers\" });\n}\nconst resolveTokenHeaders = Effect.fnUntraced(function* (input) {\n\tconst raw = yield* Effect.try({\n\t\tcatch: invalidTokenHeaders,\n\t\ttry: () => {\n\t\t\tif (Predicate.isFunction(input.value)) return input.value({ setup: input.setup });\n\t\t\tif (input.value === void 0) return {};\n\t\t\treturn input.value;\n\t\t}\n\t});\n\treturn yield* pipe(Schema.decodeEffect(TokenHeaders)(raw), Effect.mapError(invalidTokenHeaders));\n});\nconst resolveClientValue = Effect.fn(\"OAuthFlow.resolveClientValue\")(function* (input) {\n\tif (input.value === void 0) return;\n\tif (typeof input.value === \"string\") return yield* requiredString(input.value, `${input.field} is empty`);\n\treturn yield* input.value.parse(input.configProvider).pipe(Effect.mapError((cause) => new OAuthConnectionValidationFailed({ message: `failed to resolve ${input.field}: ${cause.message}` })));\n});\nconst resolveOAuthConfig = Effect.fn(\"OAuthFlow.resolveOAuthConfig\")(function* (input) {\n\tconst oauth = input.method.oauth2;\n\tif (oauth === void 0) return yield* new OAuthConnectionValidationFailed({ message: \"auth method is not oauth2\" });\n\tconst tokenHeaders = yield* resolveTokenHeaders({\n\t\tsetup: input.setup,\n\t\tvalue: oauth.tokenHeaders\n\t});\n\tconst client = typeof oauth.client === \"function\" ? oauth.client({ setup: input.setup }) : oauth.client;\n\tconst clientId = yield* resolveClientValue({\n\t\tconfigProvider: input.configProvider,\n\t\tfield: \"clientId\",\n\t\tvalue: client.clientId\n\t});\n\tconst clientSecret = yield* resolveClientValue({\n\t\tconfigProvider: input.configProvider,\n\t\tfield: \"clientSecret\",\n\t\tvalue: client.clientSecret\n\t});\n\tif (clientId === void 0) return yield* new OAuthConnectionValidationFailed({ message: \"missing oauth client id\" });\n\tconst authorizationUrl = resolveEndpoint(oauth.authorizationUrl, input.setup);\n\tconst tokenUrl = resolveEndpoint(oauth.tokenUrl, input.setup);\n\tconst discoveryUrl = resolveEndpoint(oauth.discoveryUrl, input.setup);\n\treturn {\n\t\t...authorizationUrl !== void 0 && tokenUrl !== void 0 ? {\n\t\t\tauthorizationUrl,\n\t\t\ttokenUrl\n\t\t} : discoveryUrl === void 0 ? yield* new OAuthConnectionValidationFailed({ message: \"oauth method requires explicit endpoints or discoveryUrl\" }) : yield* fetchDiscovery(discoveryUrl, input.client),\n\t\tauthorizationParams: resolveParams(oauth.authorizationParams, input.setup),\n\t\tclientAuthentication: client.authentication ?? \"basic\",\n\t\tclientId,\n\t\tclientSecret,\n\t\tpkce: oauth.pkce ?? true,\n\t\tscopes: oauth.scopes,\n\t\ttokenHeaders,\n\t\ttokenParams: resolveParams(oauth.tokenParams, input.setup),\n\t\ttokenRequestEncoding: oauth.tokenRequestEncoding ?? \"form\"\n\t};\n});\nconst buildAuthorizationUrl = (input) => {\n\tconst url = new URL(input.config.authorizationUrl);\n\turl.searchParams.set(\"response_type\", \"code\");\n\turl.searchParams.set(\"client_id\", input.config.clientId);\n\turl.searchParams.set(\"redirect_uri\", input.redirectUri);\n\turl.searchParams.set(\"state\", input.state);\n\tif (input.config.scopes.length > 0) url.searchParams.set(\"scope\", input.config.scopes.join(\" \"));\n\tif (input.pkceChallenge !== void 0) {\n\t\turl.searchParams.set(\"code_challenge\", input.pkceChallenge);\n\t\turl.searchParams.set(\"code_challenge_method\", \"S256\");\n\t}\n\tfor (const [key, value] of Object.entries(input.config.authorizationParams)) url.searchParams.set(key, value);\n\treturn url.toString();\n};\nconst httpStatusClass = (status) => {\n\tif (status >= 500) return \"5xx\";\n\tif (status >= 400) return \"4xx\";\n\treturn \"unexpected\";\n};\nconst oauthProtocolErrorCode = (body) => {\n\ttry {\n\t\treturn decodeProviderTokenError(body).error;\n\t} catch {\n\t\treturn;\n\t}\n};\nconst oauthProtocolErrorSubtype = (body) => {\n\ttry {\n\t\treturn decodeProviderTokenErrorSubtype(body).error_subtype;\n\t} catch {\n\t\treturn;\n\t}\n};\nconst tokenRequestHeaders = (config) => {\n\tconst headers = {\n\t\t...config.tokenHeaders,\n\t\tAccept: \"application/json\",\n\t\t\"Content-Type\": config.tokenRequestEncoding === \"json\" ? \"application/json\" : \"application/x-www-form-urlencoded\"\n\t};\n\tif (config.clientAuthentication === \"basic\") {\n\t\tif (config.clientSecret === void 0) return Effect.fail(new OAuthConnectionValidationFailed({ message: \"missing client secret for basic token auth\" }));\n\t\theaders[\"Authorization\"] = `Basic ${Base64.encode(`${config.clientId}:${config.clientSecret}`)}`;\n\t}\n\treturn Effect.succeed(headers);\n};\nconst postTokenRequest = Effect.fn(\"OAuthFlow.postTokenRequest\")(function* (input) {\n\tif (input.config.clientAuthentication === \"post\") {\n\t\tinput.params.set(\"client_id\", input.config.clientId);\n\t\tif (input.config.clientSecret !== void 0) input.params.set(\"client_secret\", input.config.clientSecret);\n\t} else if (input.config.clientAuthentication === \"none\") input.params.set(\"client_id\", input.config.clientId);\n\tfor (const [key, value] of Object.entries(input.config.tokenParams)) input.params.set(key, value);\n\tconst headers = yield* tokenRequestHeaders(input.config);\n\tconst request = HttpClientRequest.post(input.config.tokenUrl, { headers }).pipe(HttpClientRequest.bodyText(input.config.tokenRequestEncoding === \"json\" ? encodeJsonTokenParams(Record.fromEntries(input.params)) : input.params.toString(), headers[\"Content-Type\"]));\n\tconst response = yield* pipe(input.client.execute(request), Effect.provideService(FetchHttpClient.RequestInit, Record.isEmptyRecord(input.config.tokenHeaders) ? {} : { redirect: \"error\" }), Effect.mapError((cause) => OAuthConnectionValidationFailed.make({\n\t\tcause: Redacted.make(cause),\n\t\tmessage: `${input.failurePrefix} (network)`\n\t})));\n\tif (response.status < 200 || response.status >= 300) {\n\t\tconst body = yield* pipe(response.text, Effect.mapError((cause) => OAuthConnectionValidationFailed.make({\n\t\t\tcause: Redacted.make(cause),\n\t\t\tmessage: `${input.failurePrefix} (unreadable response)`\n\t\t})));\n\t\tconst statusClass = httpStatusClass(response.status);\n\t\tconst protocolError = oauthProtocolErrorCode(body);\n\t\tconst errorSubtype = oauthProtocolErrorSubtype(body);\n\t\tconst reason = Array.join(Array.filter([protocolError, errorSubtype], Predicate.isNotUndefined), \", \");\n\t\tconst message = `${input.failurePrefix} (${Array.join(Array.filter([statusClass, reason], String.isNonEmpty), \": \")})`;\n\t\tif (protocolError === \"invalid_grant\") return yield* OAuthGrantRejected.make({\n\t\t\tmessage,\n\t\t\t...errorSubtype === void 0 ? {} : { errorSubtype }\n\t\t});\n\t\treturn yield* OAuthConnectionValidationFailed.make({ message });\n\t}\n\treturn yield* pipe(response.json, Effect.mapError((cause) => OAuthConnectionValidationFailed.make({\n\t\tcause: Redacted.make(cause),\n\t\tmessage: `${input.failurePrefix} (network)`\n\t})), Effect.flatMap((raw) => pipe(Schema.decodeUnknownEffect(Schema.Record(Schema.String, Schema.Unknown))(raw), Effect.mapError(() => OAuthConnectionValidationFailed.make({ message: \"invalid oauth token response\" })))));\n});\nconst numberFromToken = (value) => {\n\tif (typeof value === \"number\" && Number.isFinite(value)) return value;\n\tif (typeof value === \"string\" && value.trim() !== \"\") {\n\t\tconst parsed = Number(value);\n\t\treturn Number.isFinite(parsed) ? parsed : void 0;\n\t}\n};\nconst normalizeTokenResponse = Effect.fn(\"OAuthFlow.normalizeTokenResponse\")(function* (input) {\n\tconst response = yield* pipe(Schema.decodeUnknownEffect(input.method.oauth2?.tokenResponse ?? OAuth2ProviderTokenResponse)(input.raw), Effect.mapError(() => OAuthConnectionValidationFailed.make({ message: \"invalid oauth token response\" })));\n\tconst accessToken = yield* requiredString(response.access_token, \"oauth token response missing access_token\");\n\tif (response.refresh_token?.trim() === \"\") return yield* OAuthConnectionValidationFailed.make({ message: \"invalid oauth token response\" });\n\tconst refreshToken = response.refresh_token ?? input.previousRefreshToken;\n\tconst expiresIn = numberFromToken(response.expires_in);\n\tif (response.expires_in !== void 0 && (expiresIn === void 0 || expiresIn < 0)) return yield* OAuthConnectionValidationFailed.make({ message: \"invalid oauth token response\" });\n\tconst now = yield* Clock.currentTimeMillis;\n\tconst absoluteExpiry = response.expires_at === void 0 ? void 0 : Date.parse(response.expires_at);\n\tif (absoluteExpiry !== void 0 && !Number.isFinite(absoluteExpiry)) return yield* OAuthConnectionValidationFailed.make({ message: \"invalid oauth token response\" });\n\treturn {\n\t\taccessToken,\n\t\t...refreshToken === void 0 ? {} : { refreshToken },\n\t\t...response.token_type === void 0 ? {} : { tokenType: response.token_type },\n\t\t...expiresIn === void 0 ? {} : {\n\t\t\texpiresAt: now + expiresIn * 1e3,\n\t\t\texpiresIn\n\t\t},\n\t\t...absoluteExpiry === void 0 ? {} : { expiresAt: absoluteExpiry },\n\t\t...response.scope === void 0 ? {} : { scope: response.scope },\n\t\traw: input.raw\n\t};\n});\nvar Service = class extends Context.Service()(\"@dual-os/sdk/OAuthFlow\") {};\n/** Deterministic OAuthFlow test layer that avoids external provider traffic. */\nconst testing = (options = {}) => Layer.succeed(Service, Service.of({\n\tcomplete: Effect.fn(\"OAuthFlow.testing.complete\")(function* (input) {\n\t\tif (input.query[\"state\"] !== input.continuation.state) return yield* new OAuthConnectionValidationFailed({ message: \"oauth state mismatch\" });\n\t\tif (input.query[\"error\"] !== void 0) return yield* new OAuthProviderRejected({\n\t\t\terror: input.query[\"error\"],\n\t\t\terrorDescription: input.query[\"error_description\"]\n\t\t});\n\t\tif (input.query[\"code\"] === void 0 || input.query[\"code\"].trim() === \"\") return yield* new OAuthConnectionValidationFailed({ message: \"missing oauth authorization code\" });\n\t\tconst tokens = {\n\t\t\taccessToken: options.accessToken ?? `test_access_${input.query[\"code\"]}`,\n\t\t\texpiresIn: options.expiresIn ?? 3600,\n\t\t\traw: {\n\t\t\t\tcode: input.query[\"code\"],\n\t\t\t\tgrantType: \"authorization_code\",\n\t\t\t\ttesting: true\n\t\t\t},\n\t\t\trefreshToken: options.refreshToken ?? `test_refresh_${input.query[\"code\"]}`,\n\t\t\ttokenType: options.tokenType ?? \"Bearer\"\n\t\t};\n\t\treturn {\n\t\t\tmaterial: tokens,\n\t\t\ttokens\n\t\t};\n\t}),\n\trefresh: Effect.fn(\"OAuthFlow.testing.refresh\")(function* (input) {\n\t\tconst tokens = {\n\t\t\taccessToken: options.refreshedAccessToken ?? `test_refreshed_${input.refreshToken}`,\n\t\t\texpiresIn: options.expiresIn ?? 3600,\n\t\t\traw: {\n\t\t\t\tgrantType: \"refresh_token\",\n\t\t\t\ttesting: true\n\t\t\t},\n\t\t\trefreshToken: input.refreshToken,\n\t\t\ttokenType: options.tokenType ?? \"Bearer\"\n\t\t};\n\t\tyield* Effect.void;\n\t\treturn {\n\t\t\tmaterial: tokens,\n\t\t\ttokens\n\t\t};\n\t}),\n\tstart: Effect.fn(\"OAuthFlow.testing.start\")(function* (input) {\n\t\tconst oauth = input.method.oauth2;\n\t\tif (oauth === void 0) return yield* new OAuthConnectionValidationFailed({ message: \"auth method is not oauth2\" });\n\t\tconst client = typeof oauth.client === \"function\" ? oauth.client({ setup: input.setup }) : oauth.client;\n\t\tconst state = `test_state_${yield* Random.nextInt}`;\n\t\tconst pkceVerifier = oauth.pkce === false ? null : `test_pkce_${yield* Random.nextInt}`;\n\t\tconst authorizationUrl = new URL(resolveEndpoint(oauth.authorizationUrl, input.setup) ?? \"https://oauth.testing.local/authorize\");\n\t\tauthorizationUrl.searchParams.set(\"response_type\", \"code\");\n\t\tauthorizationUrl.searchParams.set(\"client_id\", globalThis.String(client.clientId));\n\t\tauthorizationUrl.searchParams.set(\"redirect_uri\", input.redirectUri);\n\t\tauthorizationUrl.searchParams.set(\"state\", state);\n\t\tif (oauth.scopes.length > 0) authorizationUrl.searchParams.set(\"scope\", oauth.scopes.join(\" \"));\n\t\tif (pkceVerifier !== null) {\n\t\t\tauthorizationUrl.searchParams.set(\"code_challenge\", \"testing-code-challenge\");\n\t\t\tauthorizationUrl.searchParams.set(\"code_challenge_method\", \"S256\");\n\t\t}\n\t\tfor (const [key, value] of Object.entries(resolveParams(oauth.authorizationParams, input.setup))) authorizationUrl.searchParams.set(key, value);\n\t\treturn {\n\t\t\tauthorizationUrl: authorizationUrl.toString(),\n\t\t\tcontinuation: {\n\t\t\t\texpiresAt: new Date((yield* Clock.currentTimeMillis) + (input.ttlMs ?? DefaultFlowTtlMs)),\n\t\t\t\tpkceVerifier,\n\t\t\t\tredirectUri: input.redirectUri,\n\t\t\t\tstate\n\t\t\t}\n\t\t};\n\t})\n}));\n/** Live protocol layer that reads OAuth client config from Effect ConfigProvider. */\nconst layer = Layer.effect(Service, Effect.gen(function* () {\n\tconst configProvider = yield* ConfigProvider.ConfigProvider;\n\tconst client = yield* HttpClient.HttpClient;\n\tconst start = Effect.fn(\"OAuthFlow.start\")(function* (input) {\n\t\tconst config = yield* resolveOAuthConfig({\n\t\t\tclient,\n\t\t\tconfigProvider,\n\t\t\tmethod: input.method,\n\t\t\tsetup: input.setup\n\t\t});\n\t\tconst expiresAt = new Date((yield* Clock.currentTimeMillis) + (input.ttlMs ?? DefaultFlowTtlMs));\n\t\tconst state = randomBase64Url(32);\n\t\tconst pkceVerifier = config.pkce ? randomBase64Url(32) : void 0;\n\t\tconst pkceChallenge = pkceVerifier === void 0 ? void 0 : yield* sha256Base64Url(pkceVerifier);\n\t\treturn {\n\t\t\tauthorizationUrl: buildAuthorizationUrl({\n\t\t\t\tconfig,\n\t\t\t\tpkceChallenge,\n\t\t\t\tredirectUri: input.redirectUri,\n\t\t\t\tstate\n\t\t\t}),\n\t\t\tcontinuation: {\n\t\t\t\texpiresAt,\n\t\t\t\tpkceVerifier: pkceVerifier ?? null,\n\t\t\t\tredirectUri: input.redirectUri,\n\t\t\t\tstate\n\t\t\t}\n\t\t};\n\t});\n\tconst complete = Effect.fn(\"OAuthFlow.complete\")(function* (input) {\n\t\tif (input.query[\"state\"] !== input.continuation.state) return yield* new OAuthConnectionValidationFailed({ message: \"oauth state mismatch\" });\n\t\tif (input.query[\"error\"] !== void 0) return yield* new OAuthProviderRejected({\n\t\t\terror: input.query[\"error\"],\n\t\t\terrorDescription: input.query[\"error_description\"]\n\t\t});\n\t\tconst code = input.query[\"code\"];\n\t\tif (code === void 0 || code.trim() === \"\") return yield* new OAuthConnectionValidationFailed({ message: \"missing oauth authorization code\" });\n\t\tconst config = yield* resolveOAuthConfig({\n\t\t\tclient,\n\t\t\tconfigProvider,\n\t\t\tmethod: input.method,\n\t\t\tsetup: input.setup\n\t\t});\n\t\tif (config.expectedIssuer !== void 0 && input.query[\"iss\"] !== void 0 && input.query[\"iss\"] !== config.expectedIssuer) return yield* new OAuthConnectionValidationFailed({ message: \"oauth issuer mismatch\" });\n\t\tconst tokenParams = new URLSearchParams({\n\t\t\tcode,\n\t\t\tgrant_type: \"authorization_code\",\n\t\t\tredirect_uri: input.continuation.redirectUri\n\t\t});\n\t\tif (input.continuation.pkceVerifier !== null) tokenParams.set(\"code_verifier\", input.continuation.pkceVerifier);\n\t\tconst rawTokens = yield* pipe(postTokenRequest({\n\t\t\tclient,\n\t\t\tconfig,\n\t\t\tfailurePrefix: \"oauth token exchange failed\",\n\t\t\tparams: tokenParams\n\t\t}), Effect.catchTag(\"OAuthGrantRejected\", (error) => Effect.fail(OAuthConnectionValidationFailed.make({ message: error.message }))));\n\t\tconst tokens = yield* normalizeTokenResponse({\n\t\t\tmethod: input.method,\n\t\t\traw: rawTokens\n\t\t});\n\t\treturn {\n\t\t\tmaterial: tokens,\n\t\t\ttokens\n\t\t};\n\t});\n\tconst refresh = Effect.fn(\"OAuthFlow.refresh\")(function* (input) {\n\t\tconst config = yield* resolveOAuthConfig({\n\t\t\tclient,\n\t\t\tconfigProvider,\n\t\t\tmethod: input.method,\n\t\t\tsetup: input.setup\n\t\t});\n\t\tconst rawTokens = yield* postTokenRequest({\n\t\t\tclient,\n\t\t\tconfig,\n\t\t\tfailurePrefix: \"oauth token refresh failed\",\n\t\t\tparams: new URLSearchParams({\n\t\t\t\tgrant_type: \"refresh_token\",\n\t\t\t\trefresh_token: input.refreshToken\n\t\t\t})\n\t\t});\n\t\tconst tokens = yield* normalizeTokenResponse({\n\t\t\tmethod: input.method,\n\t\t\tpreviousRefreshToken: input.refreshToken,\n\t\t\traw: rawTokens\n\t\t});\n\t\treturn {\n\t\t\tmaterial: tokens,\n\t\t\ttokens\n\t\t};\n\t});\n\treturn Service.of({\n\t\tcomplete,\n\t\trefresh,\n\t\tstart\n\t});\n})).pipe(Layer.provide(FetchHttpClient.layer));\nconst oauth2TokenRefresherLayer = Layer.effect(Service$1, Effect.gen(function* () {\n\tconst flow = yield* Service;\n\treturn Service$1.of({ refresh: (input) => flow.refresh({\n\t\tmethod: input.method,\n\t\trefreshToken: input.refreshToken,\n\t\tsetup: input.setup\n\t}).pipe(Effect.map((refreshed) => refreshed.tokens)) });\n}));\nexport { OAuthConnectionValidationFailed, OAuthFlow_exports as OAuthFlow, OAuthFlow_exports, OAuthGrantRejected, OAuthProviderRejected, Service, layer, oauth2TokenRefresherLayer, testing };\n\n//# sourceMappingURL=OAuthFlow.js.map",
|
|
50
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { ActionHandlerError, RetryableActionHandlerError } from \"./Action.js\";\nimport { JsonRequest } from \"./AuthMethodExecution.js\";\nimport { ChannelError, ErrorCode, FailureCode, VerifiedIdentity } from \"./AgentChannel.js\";\nimport { ConnectionRequiredError, InvalidConnectionIdError, Service } from \"./ConnectionResolver.js\";\nimport { InvalidActionInputError, InvalidActionOutputError } from \"./internal/dual/invoke.js\";\nimport { Service as Service$1 } from \"./DualRuntime.js\";\nimport { File, FileError, Service as Service$2 } from \"./Files.js\";\nimport \"./remote-runtime.js\";\nimport { Array, Cause, Effect, Layer, Match, Option, Predicate, Redacted, Schema, flow, pipe } from \"effect\";\nimport { HttpClient, HttpClientRequest } from \"effect/http\";\n// src/remote-runtime.ts\n/**\n* Data-only SDK lifecycle requests for an installed, isolated integration plugin.\n*\n* @since 0.3.0\n*/\nvar remote_runtime_exports = /* @__PURE__ */ __exportAll({\n\tFailure: () => Failure,\n\tFileAccess: () => FileAccess,\n\tIdentity: () => Identity,\n\tOperation: () => Operation,\n\tRemoteRuntime: () => remote_runtime_exports,\n\tRequest: () => Request,\n\tResponse: () => Response,\n\tconnectionLayer: () => connectionLayer,\n\texecute: () => execute,\n\tfailure: () => failure,\n\tfilesUnavailable: () => filesUnavailable\n});\nconst Identity = Schema.Struct({\n\tartifactDigest: Schema.String.check(Schema.isPattern(/^[a-f0-9]{128}$/u)),\n\tinvocationId: Schema.NonEmptyString,\n\torganizationId: Schema.NonEmptyString,\n\tpluginKey: Schema.NonEmptyString,\n\tpluginVersion: Schema.NonEmptyString\n});\nconst connection = Schema.Struct({\n\tconnectionId: Schema.NonEmptyString,\n\tmaterial: Schema.Json,\n\tmethodId: Schema.NonEmptyString,\n\tproviderId: Schema.NonEmptyString,\n\tsetup: Schema.optionalKey(Schema.Json)\n});\nconst context = Schema.Struct({\n\tactor: Schema.Union([Schema.Struct({\n\t\tkind: Schema.Literal(\"user\"),\n\t\tuserId: Schema.NonEmptyString\n\t}), Schema.Struct({\n\t\tkind: Schema.Literal(\"system\"),\n\t\treason: Schema.optionalKey(Schema.String)\n\t})]),\n\tmetadata: Schema.optionalKey(Schema.Record(Schema.String, Schema.Json)),\n\tsource: Schema.Struct({\n\t\tkind: Schema.NonEmptyString,\n\t\tmetadata: Schema.optionalKey(Schema.Record(Schema.String, Schema.Json)),\n\t\tsubjectId: Schema.optionalKey(Schema.String)\n\t}),\n\ttenant: Schema.Struct({\n\t\torganizationId: Schema.NonEmptyString,\n\t\tteamId: Schema.NonEmptyString\n\t})\n});\nconst trigger = {\n\tconfig: Schema.Json,\n\tstate: Schema.optionalKey(Schema.Json),\n\ttriggerId: Schema.NonEmptyString\n};\nconst webhook = {\n\t...trigger,\n\twebhookUrl: Schema.String\n};\nconst channel = {\n\tchannelId: Schema.NonEmptyString,\n\tdefinitionSettings: Schema.Json,\n\tdeploymentSettings: Schema.Json\n};\nconst delivery = {\n\t...webhook,\n\trequest: Schema.Struct({\n\t\tbody: Schema.Json,\n\t\theaders: Schema.optionalKey(Schema.Record(Schema.String, Schema.String)),\n\t\tmethod: Schema.optionalKey(Schema.String),\n\t\tquery: Schema.optionalKey(Schema.Record(Schema.String, Schema.Union([Schema.String, Schema.Array(Schema.String)]))),\n\t\trawBody: Schema.Uint8ArrayFromBase64,\n\t\turl: Schema.optionalKey(Schema.String)\n\t})\n};\nconst Operation = Schema.Union([\n\tSchema.TaggedStruct(\"invoke\", {\n\t\tactionId: Schema.NonEmptyString,\n\t\tinput: Schema.Json\n\t}),\n\tSchema.TaggedStruct(\"activate\", webhook),\n\tSchema.TaggedStruct(\"deactivate\", webhook),\n\tSchema.TaggedStruct(\"verify\", delivery),\n\tSchema.TaggedStruct(\"parse\", delivery),\n\tSchema.TaggedStruct(\"poll\", trigger),\n\tSchema.TaggedStruct(\"channelCheckAccess\", {\n\t\t...channel,\n\t\tidentity: VerifiedIdentity\n\t}),\n\tSchema.TaggedStruct(\"channelExecute\", {\n\t\t...channel,\n\t\tcommand: Schema.Json\n\t}),\n\tJsonRequest\n]);\nconst FileAccess = Schema.Struct({\n\ttoken: Schema.NonEmptyString,\n\turl: Schema.String\n});\nconst Request = Schema.Struct({\n\tconnection: Schema.optionalKey(connection),\n\tcontext,\n\tfiles: Schema.optionalKey(FileAccess),\n\tidentity: Identity,\n\toperation: Operation\n});\nconst RuntimeFailure = Schema.Struct({\n\tcategory: Schema.Literals([\n\t\t\"validation\",\n\t\t\"connection\",\n\t\t\"handler\",\n\t\t\"initialization\",\n\t\t\"protocol\"\n\t]),\n\t/** The Agent Channel failure the host rebuilds as its `ChannelError`. */\n\tchannel: Schema.optionalKey(Schema.Struct({\n\t\tcode: ErrorCode,\n\t\tproviderCode: Schema.optionalKey(FailureCode)\n\t})),\n\tcode: Schema.String,\n\tfields: Schema.optionalKey(Schema.Array(Schema.Struct({ path: Schema.String }))),\n\tmessage: Schema.String,\n\tretryAfterSeconds: Schema.optionalKey(Schema.Finite),\n\tretryable: Schema.Boolean,\n\t/** The provider's HTTP status, kept so the host can report why a provider rejected the call. */\n\tstatus: Schema.optionalKey(Schema.Int)\n});\nconst Failure = Schema.Union([\n\tActionHandlerError,\n\tRetryableActionHandlerError,\n\tRuntimeFailure\n]);\nconst Response = Schema.Union([Schema.TaggedStruct(\"success\", {\n\tidentity: Identity,\n\tvalue: Schema.optionalKey(Schema.Json)\n}), Schema.TaggedStruct(\"failure\", {\n\terror: Failure,\n\tidentity: Identity\n})]);\nfunction failure(error) {\n\tif (Schema.is(ActionHandlerError)(error) || Schema.is(RetryableActionHandlerError)(error)) return error;\n\tif (Schema.is(ChannelError)(error)) return {\n\t\tcategory: \"handler\",\n\t\tchannel: Option.match(Option.fromUndefinedOr(error.providerCode), {\n\t\t\tonNone: () => ({ code: error.code }),\n\t\t\tonSome: (providerCode) => ({\n\t\t\t\tcode: error.code,\n\t\t\t\tproviderCode\n\t\t\t})\n\t\t}),\n\t\tcode: error._tag,\n\t\tmessage: \"Agent Channel operation failed\",\n\t\tretryable: false\n\t};\n\tif (Schema.is(FileError)(error)) return {\n\t\tcategory: \"handler\",\n\t\tcode: \"FileError\",\n\t\tmessage: \"A Dual Files operation failed\",\n\t\tretryable: false\n\t};\n\tif (Schema.is(InvalidActionInputError)(error) || Schema.is(InvalidActionOutputError)(error)) return {\n\t\tcategory: \"validation\",\n\t\tcode: error._tag,\n\t\tfields: Array.map(error.fields, (field) => ({ path: field.path })),\n\t\tmessage: \"Plugin action validation failed\",\n\t\tretryable: false\n\t};\n\tconst tag = Predicate.hasProperty(error, \"_tag\") && Predicate.isString(error._tag) ? error._tag : \"PluginHandlerError\";\n\treturn {\n\t\tcategory: pipe(Match.value(tag), Match.when(\"SchemaError\", () => \"validation\"), Match.whenOr(\"InvalidTriggerConfigError\", \"InvalidTriggerStateError\", \"InvalidTriggerOutputError\", () => \"validation\"), Match.whenOr(\"ConnectionRequiredError\", \"InvalidConnectionIdError\", \"InvalidResolvedConnectionError\", \"ConnectionIdNotAllowedError\", \"AuthMethodNotFoundError\", \"AuthMethodHookError\", \"ExpectedOAuth2MethodError\", \"OAuth2RefreshTokenUnavailableError\", () => \"connection\"), Match.orElse(() => \"handler\")),\n\t\tcode: Array.contains([\n\t\t\t\"SchemaError\",\n\t\t\t\"InvalidTriggerConfigError\",\n\t\t\t\"InvalidTriggerStateError\",\n\t\t\t\"InvalidTriggerOutputError\",\n\t\t\t\"ConnectionRequiredError\",\n\t\t\t\"InvalidConnectionIdError\",\n\t\t\t\"InvalidResolvedConnectionError\",\n\t\t\t\"ConnectionIdNotAllowedError\",\n\t\t\t\"AuthMethodNotFoundError\",\n\t\t\t\"AuthMethodHookError\",\n\t\t\t\"ExpectedOAuth2MethodError\",\n\t\t\t\"OAuth2RefreshTokenUnavailableError\",\n\t\t\t\"ActionNotFoundError\",\n\t\t\t\"ActionHandlerNotFoundError\",\n\t\t\t\"TriggerNotFoundError\",\n\t\t\t\"UnsupportedTriggerRuntimeError\",\n\t\t\t\"FileError\",\n\t\t\t\"SandboxAccessNotDeclaredError\",\n\t\t\t\"SandboxRequestNotAllowedError\"\n\t\t], tag) ? tag : \"PluginHandlerError\",\n\t\tmessage: \"Plugin operation failed\",\n\t\tretryable: false\n\t};\n}\nconst unavailableFiles = Service$2.of({\n\tread: () => Effect.fail(FileError.make({ message: \"Dual Files is not available to this operation\" })),\n\twrite: () => Effect.fail(FileError.make({ message: \"Dual Files is not available to this operation\" }))\n});\nconst filesUnavailable = Layer.succeed(Service$2, unavailableFiles);\nconst FileFailure = Schema.Struct({ message: Schema.String });\nfunction filesService(access, http) {\n\tconst client = HttpClient.mapRequest(http, flow(HttpClientRequest.prependUrl(`${access.url}/api/plugin-files`), HttpClientRequest.bearerToken(access.token)));\n\tfunction call(request, read) {\n\t\treturn pipe(Effect.gen(function* () {\n\t\t\tconst response = yield* client.execute(request);\n\t\t\tif (response.status < 200 || response.status >= 300) return yield* FileError.make(yield* Schema.decodeUnknownEffect(FileFailure)(yield* response.json));\n\t\t\treturn yield* read(response);\n\t\t}), Effect.mapError((cause) => Schema.is(FileError)(cause) ? cause : FileError.make({\n\t\t\tcause: Redacted.make(cause),\n\t\t\tmessage: \"Cannot reach Dual Files\"\n\t\t})));\n\t}\n\treturn Service$2.of({\n\t\tread: (file) => call(HttpClientRequest.get(`/${encodeURIComponent(file.id)}`), (response) => Effect.map(response.arrayBuffer, (buffer) => new Uint8Array(buffer))),\n\t\twrite: (file) => call(pipe(HttpClientRequest.post(\"\", { urlParams: { name: file.name } }), HttpClientRequest.bodyUint8Array(file.bytes, file.contentType ?? void 0)), (response) => Effect.flatMap(response.json, Schema.decodeUnknownEffect(File)))\n\t});\n}\nfunction connectionService(request) {\n\treturn Service.of({ resolve: (input) => {\n\t\tconst selected = request.connection;\n\t\tif (selected === void 0) return Effect.fail(ConnectionRequiredError.make(input.target));\n\t\tif (selected.providerId !== input.target.providerId || input.connectionId !== void 0 && input.connectionId !== selected.connectionId) return Effect.fail(InvalidConnectionIdError.make({\n\t\t\t...input.target,\n\t\t\tconnectionId: input.connectionId ?? selected.connectionId\n\t\t}));\n\t\treturn Effect.succeed({\n\t\t\t...selected,\n\t\t\tencoding: \"json\",\n\t\t\tsetup: selected.setup\n\t\t});\n\t} });\n}\nfunction connectionLayer(request) {\n\treturn Layer.succeed(Service, connectionService(request));\n}\nconst run = Effect.fnUntraced(function* (request) {\n\tconst runtime = yield* Service$1;\n\tconst connectionId = Option.match(Option.fromUndefinedOr(request.connection), {\n\t\tonNone: () => ({}),\n\t\tonSome: (selected) => ({ connectionId: selected.connectionId })\n\t});\n\tconst target = {\n\t\t...connectionId,\n\t\tcontext: request.context,\n\t\tpluginKey: request.identity.pluginKey\n\t};\n\tconst operation = request.operation;\n\tif (operation._tag === \"invoke\") return yield* runtime.invokeJson({\n\t\t...operation,\n\t\t...target\n\t});\n\tif (operation._tag === \"poll\") {\n\t\tconst result = yield* flow(runtime.pollTrigger, Effect.mapError(failure))({\n\t\t\t...operation,\n\t\t\t...target\n\t\t});\n\t\tif (result.state === void 0) return {\n\t\t\tevents: result.events,\n\t\t\tmeta: result.meta\n\t\t};\n\t\treturn result;\n\t}\n\tif (operation._tag === \"activate\") {\n\t\tconst result = yield* flow(runtime.activateTrigger, Effect.mapError(failure))({\n\t\t\t...operation,\n\t\t\t...target\n\t\t});\n\t\tif (result.state === void 0) return { meta: result.meta };\n\t\treturn result;\n\t}\n\tif (operation._tag === \"deactivate\") return yield* flow(runtime.deactivateTrigger, Effect.mapError(failure))({\n\t\t...operation,\n\t\t...target\n\t});\n\tif (operation._tag === \"verify\") return yield* flow(runtime.verifyTrigger, Effect.mapError(failure))({\n\t\t...operation,\n\t\t...target\n\t});\n\tif (operation._tag === \"parse\") {\n\t\tconst result = yield* flow(runtime.parseTrigger, Effect.mapError(failure))({\n\t\t\t...operation,\n\t\t\t...target\n\t\t});\n\t\tif (result.state === void 0) return {\n\t\t\tevents: result.events,\n\t\t\tmeta: result.meta\n\t\t};\n\t\treturn result;\n\t}\n\tif (operation._tag === \"channelCheckAccess\") return yield* runtime.checkAccessAgentChannel({\n\t\tchannelId: operation.channelId,\n\t\tdefinitionSettings: operation.definitionSettings,\n\t\tdeploymentSettings: operation.deploymentSettings,\n\t\tidentity: operation.identity,\n\t\t...connectionId\n\t});\n\tif (operation._tag === \"channelExecute\") return yield* runtime.executeAgentChannel({\n\t\tchannelId: operation.channelId,\n\t\tcommand: operation.command,\n\t\tdefinitionSettings: operation.definitionSettings,\n\t\tdeploymentSettings: operation.deploymentSettings,\n\t\t...connectionId\n\t});\n\treturn yield* runtime.executeAuthJson(operation);\n}, Effect.mapError((error) => Schema.is(Failure)(error) ? error : failure(error)));\n/** Execute only in the guest after importing and building its installed plugin. */\nconst execute = Effect.fn(\"RemoteRuntime.execute\")(function* (request) {\n\tconst http = yield* Effect.serviceOption(HttpClient.HttpClient);\n\tif (request.identity.organizationId !== request.context.tenant.organizationId) return {\n\t\t_tag: \"failure\",\n\t\terror: {\n\t\t\tcategory: \"protocol\",\n\t\t\tcode: \"OrganizationMismatch\",\n\t\t\tmessage: \"Invocation organization does not match its context\",\n\t\t\tretryable: false\n\t\t},\n\t\tidentity: request.identity\n\t};\n\treturn yield* pipe(run(request), Effect.provideService(Service, connectionService(request)), Effect.provideService(Service$2, pipe(Option.fromUndefinedOr(request.files), Option.flatMap((access) => Option.map(http, (client) => filesService(access, client))), Option.getOrElse(() => unavailableFiles))), Effect.flatMap(Effect.fnUntraced(function* (value) {\n\t\tif (value === void 0) return {\n\t\t\t_tag: \"success\",\n\t\t\tidentity: request.identity\n\t\t};\n\t\treturn {\n\t\t\t_tag: \"success\",\n\t\t\tidentity: request.identity,\n\t\t\tvalue: yield* pipe(Schema.decodeUnknownEffect(Schema.Json)(value), Effect.mapError(failure))\n\t\t};\n\t})), Effect.catch((error) => Effect.succeed({\n\t\t_tag: \"failure\",\n\t\terror,\n\t\tidentity: request.identity\n\t})), Effect.catchCauseIf((cause) => !Cause.hasInterrupts(cause), () => Effect.succeed({\n\t\t_tag: \"failure\",\n\t\terror: {\n\t\t\tcategory: \"handler\",\n\t\t\tcode: \"PluginDefect\",\n\t\t\tmessage: \"Plugin operation failed\",\n\t\t\tretryable: false\n\t\t},\n\t\tidentity: request.identity\n\t})));\n});\nexport { Failure, FileAccess, Identity, Operation, remote_runtime_exports as RemoteRuntime, Request, Response, connectionLayer, execute, failure, filesUnavailable, remote_runtime_exports };\n\n//# sourceMappingURL=remote-runtime.js.map",
|
|
51
|
+
"import { __exportAll } from \"./_virtual/_rolldown/runtime.js\";\nimport { JsonRequest } from \"./AuthMethodExecution.js\";\nimport { Service } from \"./DualRuntime.js\";\nimport { OAuthGrantRejected, Service as Service$1 } from \"./OAuthFlow.js\";\nimport { Identity, Request as Request$1, Response, execute as execute$1, failure } from \"./remote-runtime.js\";\nimport \"./PluginRuntime.js\";\nimport { Cause, Effect, Queue, Redacted, Schema, Stream, pipe } from \"effect\";\nimport { HttpClientRequest } from \"effect/http\";\n// src/PluginRuntime.ts\nvar PluginRuntime_exports = /* @__PURE__ */ __exportAll({\n\tAuthRequest: () => AuthRequest,\n\tChannelSettingsRequest: () => ChannelSettingsRequest,\n\tExecutionRequest: () => ExecutionRequest,\n\tInput: () => Input,\n\tInvocation: () => Invocation,\n\tOAuthContinuation: () => OAuthContinuation,\n\tOAuthStarted: () => OAuthStarted,\n\tOutput: () => Output,\n\tPluginExecutionError: () => PluginExecutionError,\n\tPluginRuntime: () => PluginRuntime_exports,\n\tRequest: () => Request,\n\tSandboxAccessResult: () => SandboxAccessResult,\n\tcancellationTimeout: () => cancellationTimeout,\n\tcheckMessageSize: () => checkMessageSize,\n\tdecodeInput: () => decodeInput,\n\tdecodeOutput: () => decodeOutput,\n\tencodeInput: () => encodeInput,\n\tencodeOutput: () => encodeOutput,\n\tencodeRequest: () => encodeRequest,\n\texecute: () => execute,\n\tipcMessages: () => ipcMessages,\n\tmaxChannelResultBytes: () => maxChannelResultBytes,\n\tmaxMetadataBytes: () => maxMetadataBytes,\n\tmaxPayloadBytes: () => maxPayloadBytes,\n\treadBounded: () => readBounded,\n\tresponseLimit: () => responseLimit,\n\tsendIpc: () => sendIpc,\n\tverifyResponse: () => verifyResponse\n});\nvar PluginExecutionError = class extends Schema.TaggedError()(\"PluginExecutionError\", {\n\tcategory: Schema.Literals([\n\t\t\"transport\",\n\t\t\"runner\",\n\t\t\"protocol\",\n\t\t\"cleanup\",\n\t\t\"artifact-expired\"\n\t]),\n\tcause: Schema.optionalKey(Schema.Redacted(Schema.Defect())),\n\tmessage: Schema.String\n}) {};\nconst maxPayloadBytes = 1048576;\nconst maxMetadataBytes = 67108864;\n/** An Agent Channel result carries a read asset of up to 14 MiB. */\nconst maxChannelResultBytes = 16777216;\nconst cancellationTimeout = \"5 seconds\";\n/** Receive native Node and Bun IPC messages without interpreting plugin logs. */\nfunction ipcMessages(channel) {\n\treturn Stream.callback((queue) => {\n\t\tconst message = (value) => {\n\t\t\tQueue.offerUnsafe(queue, value);\n\t\t};\n\t\tconst disconnected = () => {\n\t\t\tQueue.endUnsafe(queue);\n\t\t};\n\t\tconst failed = (cause) => {\n\t\t\tQueue.failCauseUnsafe(queue, Cause.fail(PluginExecutionError.make({\n\t\t\t\tcategory: \"runner\",\n\t\t\t\tcause: Redacted.make(cause),\n\t\t\t\tmessage: \"Plugin IPC channel failed\"\n\t\t\t})));\n\t\t};\n\t\treturn Effect.acquireRelease(Effect.sync(() => {\n\t\t\tchannel.on(\"message\", message);\n\t\t\tchannel.on(\"disconnect\", disconnected);\n\t\t\tchannel.on(\"error\", failed);\n\t\t}), () => Effect.sync(() => {\n\t\t\tchannel.removeListener(\"message\", message);\n\t\t\tchannel.removeListener(\"disconnect\", disconnected);\n\t\t\tchannel.removeListener(\"error\", failed);\n\t\t}));\n\t});\n}\n/** Queue a JSON message; the runtime reports asynchronous send failures through its error event. */\nfunction sendIpc(channel, value) {\n\treturn Effect.try({\n\t\ttry: () => {\n\t\t\tif (!channel.connected || channel.send === void 0) throw PluginExecutionError.make({\n\t\t\t\tcategory: \"runner\",\n\t\t\t\tmessage: \"Plugin IPC channel is closed\"\n\t\t\t});\n\t\t\tchannel.send(value);\n\t\t},\n\t\tcatch: (cause) => PluginExecutionError.make({\n\t\t\tcategory: \"runner\",\n\t\t\tcause: Redacted.make(cause),\n\t\t\tmessage: \"Cannot send plugin IPC message\"\n\t\t})\n\t});\n}\nconst OAuthContinuation = Schema.Struct({\n\texpiresAt: Schema.DateFromString,\n\tpkceVerifier: Schema.NullOr(Schema.String),\n\tredirectUri: Schema.String,\n\tstate: Schema.String\n});\nconst OAuthStarted = Schema.Struct({\n\tauthorizationUrl: Schema.String,\n\tcontinuation: OAuthContinuation\n});\nconst oauth = {\n\tauthMethodId: Schema.NonEmptyString,\n\tproviderId: Schema.NonEmptyString,\n\tsetup: Schema.optionalKey(Schema.Json)\n};\nconst SandboxAccessResult = Schema.Struct({\n\theaders: Schema.optionalKey(Schema.Record(Schema.String, Schema.String)),\n\torigins: Schema.Array(Schema.String)\n});\nconst AuthRequest = Schema.TaggedStruct(\"auth\", {\n\tidentity: Identity,\n\toperation: Schema.Union([\n\t\tJsonRequest,\n\t\tSchema.TaggedStruct(\"oauthStart\", {\n\t\t\t...oauth,\n\t\t\tredirectUri: Schema.String\n\t\t}),\n\t\tSchema.TaggedStruct(\"oauthComplete\", {\n\t\t\t...oauth,\n\t\t\tcontinuation: OAuthContinuation,\n\t\t\tquery: Schema.Record(Schema.String, Schema.String)\n\t\t}),\n\t\tSchema.TaggedStruct(\"sandboxAccess\", {\n\t\t\t...oauth,\n\t\t\tmaterial: Schema.Json,\n\t\t\trequest: Schema.optionalKey(Schema.Struct({\n\t\t\t\theaders: Schema.Record(Schema.String, Schema.String),\n\t\t\t\tmethod: Schema.Literals([\n\t\t\t\t\t\"GET\",\n\t\t\t\t\t\"POST\",\n\t\t\t\t\t\"PUT\",\n\t\t\t\t\t\"DELETE\",\n\t\t\t\t\t\"PATCH\",\n\t\t\t\t\t\"HEAD\",\n\t\t\t\t\t\"OPTIONS\",\n\t\t\t\t\t\"TRACE\",\n\t\t\t\t\t\"QUERY\"\n\t\t\t\t]),\n\t\t\t\turl: Schema.String\n\t\t\t}))\n\t\t})\n\t])\n});\nconst ChannelSettingsRequest = Schema.TaggedStruct(\"channelSettings\", {\n\tidentity: Identity,\n\toperation: Schema.TaggedStruct(\"decodeChannelSettings\", {\n\t\tchannelId: Schema.NonEmptyString,\n\t\tfield: Schema.Literals([\"definitionSettings\", \"deploymentSettings\"]),\n\t\tvalue: Schema.Json\n\t})\n});\nconst ExecutionRequest = Schema.Union([\n\tRequest$1,\n\tAuthRequest,\n\tChannelSettingsRequest\n]);\nconst Request = Schema.Union([ExecutionRequest, Schema.TaggedStruct(\"extract\", { identity: Identity })]);\nconst Input = Schema.Union([Request, Schema.TaggedStruct(\"cancel\", { identity: Identity })]);\nconst Output = Schema.Union([Response, Schema.TaggedStruct(\"interrupted\", { identity: Identity })]);\nfunction checkMessageSize(value, maximum) {\n\tif (new TextEncoder().encode(JSON.stringify(value)).byteLength <= maximum) return Effect.void;\n\treturn Effect.fail(PluginExecutionError.make({\n\t\tcategory: \"protocol\",\n\t\tmessage: \"Plugin message exceeds its transport limit\"\n\t}));\n}\nconst encodeInput = Effect.fnUntraced(function* (input) {\n\tconst encoded = yield* Schema.encodeEffect(Input)(input);\n\tyield* checkMessageSize(encoded, maxPayloadBytes);\n\treturn encoded;\n});\nconst decodeInput = Effect.fnUntraced(function* (input) {\n\tconst json = yield* Schema.decodeUnknownEffect(Schema.Json)(input);\n\tyield* checkMessageSize(json, maxPayloadBytes);\n\treturn yield* Schema.decodeUnknownEffect(Input)(json);\n});\nconst encodeOutput = Effect.fnUntraced(function* (output, maximum) {\n\tconst encoded = yield* Schema.encodeEffect(Output)(output);\n\tyield* checkMessageSize(encoded, maximum);\n\treturn encoded;\n});\nconst decodeOutput = Effect.fnUntraced(function* (output) {\n\tconst json = yield* Schema.decodeUnknownEffect(Schema.Json)(output);\n\tyield* checkMessageSize(json, maxMetadataBytes);\n\treturn yield* Schema.decodeUnknownEffect(Output)(json);\n});\nfunction responseLimit(request) {\n\tif (\"_tag\" in request && request._tag === \"extract\") return maxMetadataBytes;\n\tif (\"context\" in request && request.operation._tag === \"channelExecute\") return maxChannelResultBytes;\n\treturn maxPayloadBytes;\n}\nconst Invocation = Schema.Struct({\n\tentrypoint: Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_-]+(?:[./][A-Za-z0-9_-]+)*$/u)),\n\texportName: Schema.String.check(Schema.isPattern(/^[A-Za-z_$][A-Za-z0-9_$]*$/u)),\n\trequest: Request\n});\nconst encodeRequest = Effect.fnUntraced(function* (request) {\n\tconst encoded = yield* pipe(Schema.encodeEffect(Schema.fromJsonString(Request))(request), Effect.mapError((cause) => PluginExecutionError.make({\n\t\tcause: Redacted.make(cause),\n\t\tcategory: \"protocol\",\n\t\tmessage: \"Invalid plugin request\"\n\t})));\n\tif (new TextEncoder().encode(encoded).byteLength > 1048576) return yield* PluginExecutionError.make({\n\t\tcategory: \"protocol\",\n\t\tmessage: \"Plugin request exceeds the 1 MiB transport limit\"\n\t});\n\treturn encoded;\n});\nconst readBounded = Effect.fnUntraced(function* (input, maximum = maxPayloadBytes) {\n\tconst output = {\n\t\tbytes: Buffer.alloc(maximum),\n\t\tsize: 0\n\t};\n\tyield* pipe(input, Stream.runForEach((chunk) => Effect.gen(function* () {\n\t\tif (output.size + chunk.byteLength > maximum) return yield* PluginExecutionError.make({\n\t\t\tcategory: \"protocol\",\n\t\t\tmessage: \"Plugin payload exceeds its transport limit\"\n\t\t});\n\t\tBuffer.from(chunk).copy(output.bytes, output.size);\n\t\toutput.size += chunk.byteLength;\n\t})), Effect.mapError((cause) => PluginExecutionError.make({\n\t\tcause: Redacted.make(cause),\n\t\tcategory: \"protocol\",\n\t\tmessage: \"Cannot read plugin payload\"\n\t})));\n\treturn output.bytes.toString(\"utf8\", 0, output.size);\n});\nconst verifyResponse = Effect.fnUntraced(function* (request, response) {\n\tif (response.identity.invocationId !== request.identity.invocationId || response.identity.artifactDigest !== request.identity.artifactDigest || response.identity.organizationId !== request.identity.organizationId || response.identity.pluginKey !== request.identity.pluginKey || response.identity.pluginVersion !== request.identity.pluginVersion) return yield* PluginExecutionError.make({\n\t\tcategory: \"protocol\",\n\t\tmessage: \"Plugin result does not match its invocation\"\n\t});\n\treturn response;\n});\nconst executeAuth = Effect.fnUntraced(function* (request) {\n\tconst operation = request.operation;\n\tconst runtime = yield* Service;\n\tif (operation._tag === \"sandboxAccess\") {\n\t\tconst access = yield* runtime.resolveSandboxAccess({\n\t\t\t...operation,\n\t\t\tencoding: \"json\",\n\t\t\tsetup: operation.setup\n\t\t});\n\t\tif (operation.request === void 0) return yield* Schema.encodeEffect(SandboxAccessResult)({ origins: access.origins });\n\t\tconst authorized = yield* access.authorize(HttpClientRequest.make(operation.request.method)(operation.request.url, { headers: operation.request.headers }));\n\t\treturn yield* Schema.encodeEffect(SandboxAccessResult)({\n\t\t\theaders: authorized.headers,\n\t\t\torigins: access.origins\n\t\t});\n\t}\n\tif (operation._tag !== \"oauthStart\" && operation._tag !== \"oauthComplete\") return yield* runtime.executeAuthJson(operation);\n\tconst method = yield* runtime.getAuthMethod(operation);\n\tconst setup = yield* runtime.decodeAuthMethodSetup({\n\t\t...operation,\n\t\tencoding: \"json\",\n\t\tsetup: operation.setup\n\t});\n\tconst oauth = yield* Service$1;\n\tif (operation._tag === \"oauthStart\") return yield* Schema.encodeEffect(OAuthStarted)(yield* oauth.start({\n\t\tmethod,\n\t\tredirectUri: operation.redirectUri,\n\t\tsetup\n\t}));\n\tconst completed = yield* oauth.complete({\n\t\t...operation,\n\t\tmethod,\n\t\tsetup\n\t});\n\treturn yield* runtime.executeAuthJson(yield* Schema.decodeUnknownEffect(JsonRequest)({\n\t\t...operation,\n\t\t_tag: \"prepareOAuth2Tokens\",\n\t\ttokens: completed.tokens\n\t}));\n}, (effect, request) => pipe(effect, Effect.flatMap(Effect.fnUntraced(function* (value) {\n\tconst result = {\n\t\t_tag: \"success\",\n\t\tidentity: request.identity\n\t};\n\tif (value === void 0) return result;\n\treturn {\n\t\t...result,\n\t\tvalue: yield* Schema.decodeUnknownEffect(Schema.Json)(value)\n\t};\n})), Effect.catch((error) => {\n\tconst cause = error._tag === \"AuthMethodHookError\" ? error.cause : error;\n\tconst failure$1 = failure(error);\n\tif (Schema.is(OAuthGrantRejected)(cause) && !(\"_tag\" in failure$1)) return Effect.succeed({\n\t\t_tag: \"failure\",\n\t\terror: {\n\t\t\t...failure$1,\n\t\t\tcode: \"OAuthGrantRejected\"\n\t\t},\n\t\tidentity: request.identity\n\t});\n\treturn Effect.succeed({\n\t\t_tag: \"failure\",\n\t\terror: failure$1,\n\t\tidentity: request.identity\n\t});\n})));\nconst executeChannelSettings = Effect.fnUntraced(function* (request) {\n\tconst runtime = yield* Service;\n\tconst { channelId, field, value } = request.operation;\n\tconst input = {\n\t\tchannelId,\n\t\tvalue\n\t};\n\tif (field === \"definitionSettings\") return yield* runtime.decodeAgentChannelDefinitionSettings(input);\n\treturn yield* runtime.decodeAgentChannelDeploymentSettings(input);\n}, (effect, request) => pipe(effect, Effect.map((value) => ({\n\t_tag: \"success\",\n\tidentity: request.identity,\n\tvalue\n})), Effect.catch((error) => Effect.succeed({\n\t_tag: \"failure\",\n\terror: failure(error),\n\tidentity: request.identity\n}))));\n/** Execute one request against the plugin built in this process; only the guest runner calls it in production. */\nconst execute = Effect.fnUntraced(function* (request) {\n\tif (!(\"_tag\" in request)) return yield* execute$1(request);\n\tif (request._tag === \"auth\") return yield* executeAuth(request);\n\treturn yield* executeChannelSettings(request);\n});\nexport { AuthRequest, ChannelSettingsRequest, ExecutionRequest, Input, Invocation, OAuthContinuation, OAuthStarted, Output, PluginExecutionError, PluginRuntime_exports as PluginRuntime, PluginRuntime_exports, Request, SandboxAccessResult, cancellationTimeout, checkMessageSize, decodeInput, decodeOutput, encodeInput, encodeOutput, encodeRequest, execute, ipcMessages, maxChannelResultBytes, maxMetadataBytes, maxPayloadBytes, readBounded, responseLimit, sendIpc, verifyResponse };\n\n//# sourceMappingURL=PluginRuntime.js.map"
|
|
52
|
+
],
|
|
53
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,cAAc,CAAC,KAAK,eAAe;AAAA,EACtC,IAAI,SAAS,CAAC;AAAA,EACd,SAAS,QAAQ;AAAA,IAAK,UAAU,QAAQ,MAAM;AAAA,MAC7C,KAAK,IAAI;AAAA,MACT,YAAY;AAAA,IACb,CAAC;AAAA,EACD,IAAI,CAAC;AAAA,IAAY,UAAU,QAAQ,OAAO,aAAa,EAAE,OAAO,SAAS,CAAC;AAAA,EAC1E,OAAO;AAAA;;;ACmCD,IAAM,UAAS,WAAW;AAkK1B,IAAM,YAAY,OAAK,IAAI;AA2C3B,IAAM,QAAc;AAyIpB,IAAM,0BAA6B,UAAU,KAAK;AAkClD,IAAM,yBAA2B,MAAM,KAAK;AAyF5C,IAAM,SAAS,gBAAc;AAAA,EAClC,I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