@artenx/dshb 0.1.18 → 0.1.19

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.
Files changed (101) hide show
  1. package/lib/client.js +2157 -567
  2. package/lib/client.js.map +1 -1
  3. package/lib/core/index.js +72 -4
  4. package/lib/core/index.js.map +1 -1
  5. package/lib/core/node-registry.d.ts +2 -108
  6. package/lib/core/node-registry.js +43 -2
  7. package/lib/core/node-registry.js.map +1 -1
  8. package/lib/core/routes.d.ts +4 -3
  9. package/lib/core/routes.js +67 -23
  10. package/lib/core/routes.js.map +1 -1
  11. package/lib/core/sync/coordinator.d.ts +48 -0
  12. package/lib/core/sync/coordinator.js +247 -0
  13. package/lib/core/sync/coordinator.js.map +1 -0
  14. package/lib/core/sync/host-key.d.ts +2 -0
  15. package/lib/core/sync/host-key.js +71 -0
  16. package/lib/core/sync/host-key.js.map +1 -0
  17. package/lib/core/sync/internal-routes.d.ts +9 -0
  18. package/lib/core/sync/internal-routes.js +236 -0
  19. package/lib/core/sync/internal-routes.js.map +1 -0
  20. package/lib/core/sync/model.d.ts +2 -0
  21. package/lib/core/sync/model.js +106 -0
  22. package/lib/core/sync/model.js.map +1 -0
  23. package/lib/core/sync/node-sync.d.ts +2 -0
  24. package/lib/core/sync/node-sync.js +660 -0
  25. package/lib/core/sync/node-sync.js.map +1 -0
  26. package/lib/core/sync/offline-archive.d.ts +55 -0
  27. package/lib/core/sync/offline-archive.js +673 -0
  28. package/lib/core/sync/offline-archive.js.map +1 -0
  29. package/lib/core/sync/offline-journal.d.ts +22 -0
  30. package/lib/core/sync/offline-journal.js +74 -0
  31. package/lib/core/sync/offline-journal.js.map +1 -0
  32. package/lib/core/sync/offline-routes.d.ts +7 -0
  33. package/lib/core/sync/offline-routes.js +192 -0
  34. package/lib/core/sync/offline-routes.js.map +1 -0
  35. package/lib/core/sync/peer-manager.d.ts +56 -0
  36. package/lib/core/sync/peer-manager.js +258 -0
  37. package/lib/core/sync/peer-manager.js.map +1 -0
  38. package/lib/core/sync/protocol.d.ts +2 -0
  39. package/lib/core/sync/protocol.js +124 -0
  40. package/lib/core/sync/protocol.js.map +1 -0
  41. package/lib/core/sync/remote-helper.d.ts +5 -0
  42. package/lib/core/sync/remote-helper.js +160 -0
  43. package/lib/core/sync/remote-helper.js.map +1 -0
  44. package/lib/core/sync/revision.d.ts +2 -0
  45. package/lib/core/sync/revision.js +77 -0
  46. package/lib/core/sync/revision.js.map +1 -0
  47. package/lib/core/sync/routes.d.ts +9 -0
  48. package/lib/core/sync/routes.js +339 -0
  49. package/lib/core/sync/routes.js.map +1 -0
  50. package/lib/core/sync/scheduler.d.ts +14 -0
  51. package/lib/core/sync/scheduler.js +81 -0
  52. package/lib/core/sync/scheduler.js.map +1 -0
  53. package/lib/core/sync/session-journal.d.ts +2 -0
  54. package/lib/core/sync/session-journal.js +191 -0
  55. package/lib/core/sync/session-journal.js.map +1 -0
  56. package/lib/core/sync/session-routes.d.ts +7 -0
  57. package/lib/core/sync/session-routes.js +67 -0
  58. package/lib/core/sync/session-routes.js.map +1 -0
  59. package/lib/core/sync/session-sync.d.ts +2 -0
  60. package/lib/core/sync/session-sync.js +2 -0
  61. package/lib/core/sync/ssh-transport.d.ts +2 -0
  62. package/lib/core/sync/ssh-transport.js +408 -0
  63. package/lib/core/sync/ssh-transport.js.map +1 -0
  64. package/lib/core/sync/stores.d.ts +3 -0
  65. package/lib/core/sync/stores.js +385 -0
  66. package/lib/core/sync/stores.js.map +1 -0
  67. package/lib/core/test.d.ts +1 -1
  68. package/lib/core/workspace-bindings.d.ts +2 -28
  69. package/lib/core/workspace-bindings.js +14 -14
  70. package/lib/core/workspace-bindings.js.map +1 -1
  71. package/lib/core/workspace-instruction-context.d.ts +3 -2260
  72. package/lib/core/workspace-instruction-context.js +104 -2
  73. package/lib/core/workspace-instruction-context.js.map +1 -0
  74. package/lib/core/workspace-instruction-routes.d.ts +1 -1
  75. package/lib/core/workspace-instructions.d.ts +2 -68
  76. package/lib/core/workspace-instructions.js +13 -0
  77. package/lib/core/workspace-instructions.js.map +1 -1
  78. package/lib/core/workspaces.d.ts +4 -3
  79. package/lib/core/workspaces.js +17 -1
  80. package/lib/core/workspaces.js.map +1 -1
  81. package/lib/host-key-C5afhAUd.d.ts +30 -0
  82. package/lib/index-VF8bcBeX.d.ts +2293 -0
  83. package/lib/{workspace-instruction-context-DytAmaPY.js → lib-gdtU_WKT.js} +159 -102
  84. package/lib/lib-gdtU_WKT.js.map +1 -0
  85. package/lib/model-BP7Gw1yk.d.ts +104 -0
  86. package/lib/node-registry-BTnnM5-k.d.ts +112 -0
  87. package/lib/node-sync-3Z9QLz2n.d.ts +89 -0
  88. package/lib/protocol-CV7LGE44.d.ts +35 -0
  89. package/lib/revision-C9sOlDZ6.d.ts +25 -0
  90. package/lib/router/router-fs.d.ts +12 -3
  91. package/lib/router/router-fs.js.map +1 -1
  92. package/lib/session-journal-pgPqcWn9.d.ts +40 -0
  93. package/lib/session-sync-EdfwUON5.js +2177 -0
  94. package/lib/session-sync-EdfwUON5.js.map +1 -0
  95. package/lib/session-sync-g6qKZzjV.d.ts +1252 -0
  96. package/lib/ssh-transport-BcIiLxsX.d.ts +55 -0
  97. package/lib/stores-CKyEt0yk.d.ts +31 -0
  98. package/lib/workspace-bindings-CsB0TIJB.d.ts +28 -0
  99. package/lib/workspace-instructions-DirYYiku.d.ts +69 -0
  100. package/package.json +20 -1
  101. package/lib/workspace-instruction-context-DytAmaPY.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-instruction-context-DytAmaPY.js","names":["valueMap","z"],"sources":["../../../node_modules/@deepseek-ai/dsh-typert-protocol/lib/index.js","../../../node_modules/@deepseek-ai/dsh-util-values/lib/index.js","../../../node_modules/@deepseek-ai/dsh-util-crypto/lib/index.js","../../../node_modules/@deepseek-ai/dsh-brand/lib/index.js","../../../node_modules/@deepseek-ai/cosmokit/lib/index.js","../../../node_modules/@deepseek-ai/schemastery/lib/index.mjs","../../../node_modules/@deepseek-ai/dsh-timeout/lib/index.js","../../../node_modules/@deepseek-ai/dsh-llm/lib/index.js","../src/core/workspace-instruction-context.ts"],"sourcesContent":["import { Context, Service } from \"@deepseek-ai/cordis\";\n//#region lib/types/remote-error.js\n/** The one Remote failure class shared by owners, the Gateway, and consumers. */\n/**\n* One Remote call failure: a real Error carrying its stable code and typed\n* details. Owners throw it at the failure point; the Host Gateway encodes it\n* onto the wire unchanged; the Client face rebuilds an instance for the\n* `RemoteResult` error branch, so `throw result.error` keeps throw semantics.\n* Discrimination is always by `code`, never by instanceof.\n*/\nvar RemoteError = class extends Error {\n\tcode;\n\tdetails;\n\t/** Structural marker: cross-realm/bundle identification never uses instanceof. */\n\tisDSHRemoteError = true;\n\t/**\n\t* @param code - stable failure code declared in {@link RemoteErrorDetailsMap}.\n\t* @param message - human diagnostic carried across the wire.\n\t* @param details - structured payload typed by the code.\n\t* @param options - standard Error options (`cause` survives in-process only).\n\t*/\n\tconstructor(code, message, details, options) {\n\t\tsuper(message, options);\n\t\tthis.code = code;\n\t\tthis.details = details;\n\t\tthis.name = \"RemoteError\";\n\t}\n};\n/**\n* Structurally identify a RemoteError thrown across module or realm copies of\n* this class. Mechanism-internal: the Gateway and test assertions use it;\n* business code receives typed failures and never needs it.\n* @param value - a caught value.\n* @returns the failure when the marker matches, otherwise undefined.\n*/\nfunction remoteErrorOf(value) {\n\tif (typeof value === \"object\" && value !== null && value.isDSHRemoteError === true && typeof value.code === \"string\") return value;\n}\n//#endregion\n//#region lib/types/owned-value.js\n/** Generic invocation-owned values returned by synchronous Client Context resolvers. */\n/** Shared identity across independently bundled Context providers and Gateway. */\nconst TYPERT_OWNED_VALUE = Symbol.for(\"dsh.typert.owned-value\");\n/**\n* Transfer cleanup ownership without adding another resource reference count.\n* @param value - resolved payload passed to the invocation.\n* @param release - non-throwing synchronous release, called at most once.\n* @returns an owned payload disposed after invocation and reply settlement.\n*/\nfunction typertOwnedValue(value, release) {\n\tlet active = true;\n\treturn {\n\t\t[TYPERT_OWNED_VALUE]: true,\n\t\tvalue,\n\t\t[Symbol.dispose]() {\n\t\t\tif (!active) return;\n\t\t\tactive = false;\n\t\t\trelease();\n\t\t}\n\t};\n}\n/**\n* Identify invocation-owned values using the shared marker.\n* @param value - borrowed or owned resolver result.\n* @returns whether the result carries invocation cleanup.\n*/\nfunction isTypertOwnedValue(value) {\n\treturn typeof value === \"object\" && value !== null && TYPERT_OWNED_VALUE in value && value[TYPERT_OWNED_VALUE] === true;\n}\n//#endregion\n//#region lib/types/json-value.js\n/**\n* Lossless JSON checks every Remote carrier shares: the Client handle before it\n* queues an uplink item, the Gateway at its wire and codec-less uplink\n* boundaries, and the in-process mock.\n*/\n/**\n* Test whether a value crosses JSON transport without coercion or omission.\n* @param value - candidate boundary value.\n* @returns whether the value is losslessly JSON-compatible.\n*/\nfunction isRemoteJsonValue(value) {\n\treturn visitJsonValue(value, /* @__PURE__ */ new Set());\n}\n/**\n* Test whether a value may travel as one uplink item: a lossless JSON value, or\n* a top-level `undefined`, which the wire carries as an `item` frame without\n* `value`. Nested `undefined`, `NaN`, and infinities stay rejected.\n* @param value - candidate uplink item.\n* @returns whether the item crosses every carrier unchanged.\n*/\nfunction isRemoteUplinkItem(value) {\n\treturn value === void 0 || isRemoteJsonValue(value);\n}\nfunction visitJsonValue(value, ancestors) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value) && !Object.is(value, -0);\n\tif (typeof value !== \"object\") return false;\n\tif (ancestors.has(value)) return false;\n\tancestors.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) {\n\t\t\tif (Object.getPrototypeOf(value) !== Array.prototype || Reflect.ownKeys(value).length !== value.length + 1) return false;\n\t\t\tfor (let index = 0; index < value.length; index++) if (!Object.hasOwn(value, index) || !visitJsonValue(value[index], ancestors)) return false;\n\t\t\treturn true;\n\t\t}\n\t\tconst prototype = Object.getPrototypeOf(value);\n\t\tif (prototype !== Object.prototype && prototype !== null) return false;\n\t\tfor (const key of Reflect.ownKeys(value)) {\n\t\t\tif (typeof key !== \"string\") return false;\n\t\t\tif (Object.getOwnPropertyDescriptor(value, key)?.enumerable !== true || !visitJsonValue(Reflect.get(value, key), ancestors)) return false;\n\t\t}\n\t\treturn true;\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n}\n//#endregion\n//#region lib/types/remote-info.js\n/** Lazy assembly of generated Remote definitions using caller-supplied Zod; no runtime imports. */\n/**\n* Retain one generated definition per endpoint without constructing parsers or projections.\n* The class instance builds its shared descriptor/method index on first access;\n* input schemas and JSON Schema projections are cached only when requested.\n* @param spec - compiler-produced method facts and Zod factories.\n* @param zod - the generated artifact's Zod runtime for named-input parsers.\n* @returns a lazy, mountable info instance with no registration or transport effects.\n*/\nfunction createTypertRemoteInfo(spec, zod) {\n\treturn new RemoteInfo(spec, zod);\n}\nvar RemoteInfo = class {\n\tspec;\n\tzod;\n\tindex;\n\tconstructor(spec, zod) {\n\t\tthis.spec = spec;\n\t\tthis.zod = zod;\n\t}\n\tget package() {\n\t\treturn this.spec.package;\n\t}\n\tget descriptors() {\n\t\treturn this.resolve().descriptors;\n\t}\n\tget methods() {\n\t\treturn this.resolve().methods;\n\t}\n\tresolve() {\n\t\tif (this.index !== void 0) return this.index;\n\t\tconst zod = this.zod;\n\t\tconst descriptors = [];\n\t\tconst methods = Object.create(null);\n\t\tfor (const [endpoint, definition] of Object.entries(this.spec.methods)) {\n\t\t\tconst separator = endpoint.indexOf(\"/\");\n\t\t\tconst namespace = endpoint.slice(0, separator);\n\t\t\tconst method = endpoint.slice(separator + 1);\n\t\t\tconst parameters = definition.parameters.map((parameter) => ({\n\t\t\t\t...parameter,\n\t\t\t\twire: parameter.wire ?? parameter.name\n\t\t\t}));\n\t\t\tconst descriptor = {\n\t\t\t\t...definition,\n\t\t\t\tid: `${this.spec.package}#${endpoint}`,\n\t\t\t\tnamespace,\n\t\t\t\tmethod,\n\t\t\t\tparameters,\n\t\t\t\tresult: definition.result.description === void 0 ? definition.result : new ResultValue(definition.result)\n\t\t\t};\n\t\t\tif (definition.invocation.kind === \"direct\") {\n\t\t\t\tconst inputs = [];\n\t\t\t\tmethods[endpoint] = Object.assign(descriptor, {\n\t\t\t\t\tinput(options) {\n\t\t\t\t\t\tconst strict = options?.strict === true;\n\t\t\t\t\t\treturn inputs[strict ? 1 : 0] ??= new NamedInput(parameters, strict, zod);\n\t\t\t\t\t},\n\t\t\t\t\tinvoke(remote, input, signal) {\n\t\t\t\t\t\tconst named = input;\n\t\t\t\t\t\tconst values = parameters.map((parameter) => named[parameter.wire]);\n\t\t\t\t\t\tif (definition.cancellation !== void 0) values.push(signal);\n\t\t\t\t\t\tconst receiver = Reflect.get(remote, namespace);\n\t\t\t\t\t\treturn Reflect.get(receiver, method).apply(receiver, values);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tdescriptors.push(descriptor);\n\t\t}\n\t\treturn this.index = {\n\t\t\tdescriptors,\n\t\t\tmethods\n\t\t};\n\t}\n};\n/**\n* Narrow a Registry descriptor to its generated direct-method capabilities.\n* @param descriptor - a live descriptor, including possible source fallback or Context-only receivers.\n* @returns whether generated named input and direct invocation are available.\n*/\nfunction isTypertRemoteMethod(descriptor) {\n\treturn descriptor.invocation.kind === \"direct\" && descriptor.result.mode === \"strict\" && \"input\" in descriptor && typeof descriptor.input === \"function\" && \"invoke\" in descriptor && typeof descriptor.invoke === \"function\";\n}\nfunction optional(parameter) {\n\treturn parameter.source === \"json\" && parameter.acceptsUndefined === true;\n}\nvar NamedInput = class {\n\tparameters;\n\tstrict;\n\tzod;\n\tschema;\n\tprojection;\n\tconstructor(parameters, strict, zod) {\n\t\tthis.parameters = parameters;\n\t\tthis.strict = strict;\n\t\tthis.zod = zod;\n\t}\n\tcodec(parameter) {\n\t\treturn this.strict ? parameter.strictCodec : parameter.codec;\n\t}\n\tcreate = () => this.schema ??= this.zod.strictObject(Object.fromEntries(this.parameters.map((parameter) => {\n\t\tconst value = this.codec(parameter).create();\n\t\treturn [parameter.wire, optional(parameter) ? value.optional() : value.nonoptional()];\n\t})));\n\tget jsonSchema() {\n\t\treturn this.project().jsonSchema;\n\t}\n\tget jsonSchemaError() {\n\t\treturn this.project().jsonSchemaError;\n\t}\n\tproject() {\n\t\tif (this.projection !== void 0) return this.projection;\n\t\tconst unavailable = this.parameters.find((parameter) => this.codec(parameter).jsonSchema === void 0);\n\t\tif (unavailable !== void 0) return this.projection = { jsonSchemaError: this.codec(unavailable).jsonSchemaError ?? `No JSON Schema for parameter ${unavailable.wire}` };\n\t\treturn this.projection = { jsonSchema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: Object.fromEntries(this.parameters.map((parameter) => [parameter.wire, {\n\t\t\t\t...this.codec(parameter).jsonSchema,\n\t\t\t\t...parameter.description === void 0 ? {} : { description: parameter.description }\n\t\t\t}])),\n\t\t\trequired: this.parameters.filter((parameter) => !optional(parameter)).map((parameter) => parameter.wire),\n\t\t\tadditionalProperties: false\n\t\t} };\n\t}\n};\nvar ResultValue = class {\n\tspec;\n\tprojection;\n\tconstructor(spec) {\n\t\tthis.spec = spec;\n\t}\n\tget mode() {\n\t\treturn this.spec.mode;\n\t}\n\tget typeSymbol() {\n\t\treturn this.spec.typeSymbol;\n\t}\n\tget create() {\n\t\treturn this.spec.create;\n\t}\n\tget decode() {\n\t\treturn this.spec.decode;\n\t}\n\tget encode() {\n\t\treturn this.spec.encode;\n\t}\n\tget description() {\n\t\treturn this.spec.description;\n\t}\n\tget jsonSchemaError() {\n\t\treturn this.spec.jsonSchemaError;\n\t}\n\tget jsonSchema() {\n\t\tif (this.projection === void 0) {\n\t\t\tconst schema = this.spec.jsonSchema;\n\t\t\tthis.projection = { value: schema === void 0 ? void 0 : {\n\t\t\t\t...schema,\n\t\t\t\tdescription: this.spec.description\n\t\t\t} };\n\t\t}\n\t\treturn this.projection.value;\n\t}\n};\n//#endregion\n//#region lib/types/principal.js\n/**\n* Reads the non-owner caller of the current Remote call.\n* @module @deepseek-ai/dsh-typert-protocol/principal\n*/\n/**\n* The identity a Remote-call producer records on durable output.\n* @param invocation - `ctx.invocation`; `undefined` outside a Remote call.\n* @returns the caller's principal when it is not the owner; `undefined` for the\n* owner and for trusted in-process code outside a Remote call.\n*/\nfunction principalOf(invocation) {\n\tconst principal = invocation?.peer.principal;\n\treturn principal?.kind === \"owner\" ? void 0 : principal;\n}\n//#endregion\n//#region lib/types/index.js\n/**\n* Remote decorators and explicit Gateway bindings backed by versioned\n* descriptors carried on decorated class prototypes. Strict reflection\n* remains a Typert compiler responsibility.\n* @module @deepseek-ai/dsh-typert-protocol\n*/\nconst TYPERT_REMOTE_SEGMENT_PATTERN = /^[A-Za-z0-9_$.-]+$/;\n/**\n* Test one generated Remote name against the Connection endpoint grammar.\n* @param value - namespace, method, lookup, or Context segment.\n* @returns whether the value can cross the shared RPC carrier unchanged.\n*/\nfunction isTypertRemoteSegment(value) {\n\treturn value !== \".\" && value !== \"..\" && TYPERT_REMOTE_SEGMENT_PATTERN.test(value);\n}\nconst REMOTE_METHOD_DESCRIPTOR = \"@deepseek-ai/dsh-typert-protocol/remote-methods\";\n/**\n* Bind one visible Service field to a Cordis key and Remote namespace. A\n* service that owns a Cordis Context also gives its tree `ctx.invocation`,\n* `undefined` outside a Remote call, so no `TypertRemoteService` is needed for\n* a Host composition to read it.\n* @param service - owning Service instance, normally `this`.\n* @param serviceKey - exact Cordis service key.\n* @param options - optional wire namespace.\n* @returns a frozen, inspectable binding with no compiler-injected metadata.\n*/\nfunction bindTypertRemote(service, serviceKey, options = {}) {\n\tvalidateName(\"service key\", serviceKey);\n\tconst namespace = options.namespace ?? serviceKey;\n\tvalidateName(\"namespace\", namespace);\n\tconst ctx = Reflect.get(service, \"ctx\");\n\tif (Context.is(ctx)) provideInvocationAccessor(ctx);\n\treturn Object.freeze({\n\t\tservice,\n\t\tserviceKey,\n\t\tnamespace\n\t});\n}\n/** Cordis Service base that exposes its registered name through Typert Gateway. */\nvar TypertRemoteService = class extends Service {\n\t/** Visible binding consumed by the Gateway's source-mode discovery. */\n\ttypertRemote;\n\t/**\n\t* Register the Service and bind the same key to Typert Gateway.\n\t* @param ctx - owning Cordis Context.\n\t* @param serviceKey - exact Cordis service key and default wire namespace.\n\t* @param options - optional wire namespace.\n\t*/\n\tconstructor(ctx, serviceKey, options = {}) {\n\t\tsuper(ctx, serviceKey);\n\t\tthis.typertRemote = bindTypertRemote(this, this.name, options);\n\t}\n};\n/**\n* Make `ctx.invocation` read as `undefined` outside a Remote call instead of the\n* reflect service's \"cannot get property\" error; a call-derived Context shadows\n* the accessor with its own property. The first Remote Service constructed in a\n* tree registers it on the root, where it outlives any one Service.\n*/\nfunction provideInvocationAccessor(ctx) {\n\tif (Object.hasOwn(ctx.root.reflect.props, \"invocation\")) return;\n\tctx.root.accessor(\"invocation\", { get: () => void 0 });\n}\nfunction Remote(methodExportOrOptions, context) {\n\tif (typeof methodExportOrOptions === \"string\") {\n\t\tvalidateName(\"Remote export name\", methodExportOrOptions);\n\t\treturn remoteDecorator({ kind: \"direct\" }, { exportName: methodExportOrOptions });\n\t}\n\tif (typeof methodExportOrOptions === \"object\") return remoteDecorator({ kind: \"direct\" }, markerOptions(methodExportOrOptions, REMOTE_OPTION_KEYS, \"Remote options require name, mode: \\\"stream\\\", or resources\"));\n\tif (context === void 0) throw new TypeError(\"typert-protocol: Remote decorator context is missing\");\n\taddMarkerInitializer(context, { kind: \"direct\" });\n}\nconst REMOTE_OPTION_KEYS = new Set([\n\t\"name\",\n\t\"mode\",\n\t\"resources\"\n]);\nconst REMOTE_SCOPE_OPTION_KEYS = new Set([\"name\", \"resources\"]);\n/** Validate one decorator options object against its accepted keys and select the marker fields. */\nfunction markerOptions(options, accepted, requirement) {\n\tconst keys = Reflect.ownKeys(options);\n\tif (keys.length === 0 || keys.some((key) => typeof key !== \"string\" || !accepted.has(key)) || Object.hasOwn(options, \"mode\") && options.mode !== \"stream\") throw new TypeError(`typert-protocol: ${requirement}`);\n\tconst { mode, name, resources } = options;\n\tif (name !== void 0) validateName(\"Remote export name\", name);\n\treturn {\n\t\t...mode === void 0 ? {} : { mode },\n\t\t...name === void 0 ? {} : { exportName: name },\n\t\t...resources === void 0 ? {} : { resources: resourceReaders(resources) }\n\t};\n}\n/** Freeze declared readers into the marker record; a misdeclared reader fails at decoration. */\nfunction resourceReaders(resources) {\n\tconst readers = {};\n\tfor (const [kind, reader] of Object.entries(resources)) {\n\t\tif (typeof reader !== \"function\") throw new TypeError(`typert-protocol: Remote resource reader \"${kind}\" must be a function`);\n\t\treaders[kind] = reader;\n\t}\n\tif (Object.keys(readers).length === 0) throw new TypeError(\"typert-protocol: Remote resources require at least one reader\");\n\treturn Object.freeze(readers);\n}\nfunction remoteDecorator(invocation, options = {}) {\n\treturn function(_method, context) {\n\t\taddMarkerInitializer(context, invocation, options);\n\t};\n}\nfunction RemoteScope(key, option) {\n\tvalidateName(\"Scope key\", key);\n\tconst invocation = {\n\t\tkind: \"context\",\n\t\tcontext: key\n\t};\n\tif (option === void 0) return remoteDecorator(invocation);\n\tif (typeof option === \"string\") {\n\t\tvalidateName(\"Remote export name\", option);\n\t\treturn remoteDecorator(invocation, { exportName: option });\n\t}\n\treturn remoteDecorator(invocation, markerOptions(option, REMOTE_SCOPE_OPTION_KEYS, \"RemoteScope options require name or resources\"));\n}\n/**\n* Read Remote markers attached to a live Service's class prototype.\n* The returned snapshot cannot mutate the stored descriptor.\n* @param service - live Service instance.\n* @returns markers in class declaration order.\n*/\nfunction remoteMethods(service) {\n\tconst prototype = Object.getPrototypeOf(service);\n\tif (prototype === null) return [];\n\treturn (readRemoteMethodDescriptor(prototype)?.methods ?? []).map((marker) => ({ ...marker }));\n}\nfunction readRemoteMethodDescriptor(prototype) {\n\tconst property = Object.getOwnPropertyDescriptor(prototype, REMOTE_METHOD_DESCRIPTOR);\n\tif (property === void 0) return void 0;\n\tconst descriptor = property.value;\n\tif (descriptor === null || typeof descriptor !== \"object\") throw new TypeError(\"typert-protocol: Remote method descriptor must be an object\");\n\tconst version = Reflect.get(descriptor, \"version\");\n\tif (version !== 1) throw new TypeError(`typert-protocol: unsupported Remote method descriptor version ${String(version)}`);\n\tconst methods = Reflect.get(descriptor, \"methods\");\n\tif (!Array.isArray(methods)) throw new TypeError(\"typert-protocol: Remote method descriptor methods must be an array\");\n\treturn descriptor;\n}\nfunction addMarkerInitializer(context, invocation, options = {}) {\n\tif (context.private || context.static || typeof context.name !== \"string\") throw new TypeError(\"typert-protocol: Remote decorators require a public instance method with a string name\");\n\tconst method = context.name;\n\tcontext.addInitializer(function() {\n\t\tconst prototype = Object.getPrototypeOf(this);\n\t\tif (prototype === null) throw new TypeError(`typert-protocol: cannot mark Remote method \"${method}\" on an object without a prototype`);\n\t\tmark(prototype, method, invocation, options);\n\t});\n}\nfunction mark(prototype, method, invocation, { mode, exportName, resources }) {\n\tconst descriptor = readRemoteMethodDescriptor(prototype);\n\tconst marker = Object.freeze({\n\t\tmethod,\n\t\t...exportName === void 0 || exportName === method ? {} : { exportName },\n\t\t...mode === void 0 ? {} : { mode },\n\t\tinvocation: Object.freeze(invocation),\n\t\t...resources === void 0 ? {} : { resources }\n\t});\n\tconst current = descriptor?.methods.find((candidate) => candidate.method === method);\n\tif (current !== void 0) {\n\t\tif (current.exportName === marker.exportName && current.mode === marker.mode && current.resources === marker.resources && sameInvocation(current.invocation, invocation)) return;\n\t\tthrow new Error(`typert-protocol: Remote method \"${method}\" has conflicting invocation markers`);\n\t}\n\tObject.defineProperty(prototype, REMOTE_METHOD_DESCRIPTOR, {\n\t\tconfigurable: true,\n\t\tvalue: Object.freeze({\n\t\t\tversion: 1,\n\t\t\tmethods: Object.freeze([...descriptor?.methods ?? [], marker])\n\t\t})\n\t});\n}\nfunction sameInvocation(left, right) {\n\tif (left.kind === \"direct\") return right.kind === \"direct\";\n\tif (right.kind === \"direct\") return false;\n\treturn left.context === right.context;\n}\nfunction validateName(subject, value) {\n\tif (!isTypertRemoteSegment(value)) throw new TypeError(`typert-protocol: ${subject} must contain only RPC endpoint segment characters`);\n}\n//#endregion\nexport { Remote, RemoteError, RemoteScope, TYPERT_OWNED_VALUE, TypertRemoteService, bindTypertRemote, createTypertRemoteInfo, isRemoteJsonValue, isRemoteUplinkItem, isTypertOwnedValue, isTypertRemoteMethod, isTypertRemoteSegment, principalOf, remoteErrorOf, remoteMethods, typertOwnedValue };\n","//#region lib/types/partial-json.js\n/**\n* Lazily scanned view of one JSON object's top-level fields, built from text\n* that may still be streaming or from an already parsed object. Nothing is\n* scanned until a reader asks; the view remembers every question it answered\n* and reports changed answers when the owner refreshes for publication.\n* Used for model tool-call arguments: a row reads the fields it\n* cares about at whatever granularity it displays, at every stage of the call.\n* @module @deepseek-ai/dsh-util-values/src/partial-json\n*/\nconst SIMPLE_ESCAPES = {\n\t\"\\\"\": \"\\\"\",\n\t\"\\\\\": \"\\\\\",\n\t\"/\": \"/\",\n\tb: \"\\b\",\n\tf: \"\\f\",\n\tn: \"\\n\",\n\tr: \"\\r\",\n\tt: \"\t\"\n};\nconst CONTENT_ESCAPE = /[\\\\\\u0000-\\u001f]/u;\nfunction isWhitespace(c) {\n\treturn c === \" \" || c === \"\\n\" || c === \"\\r\" || c === \"\t\";\n}\nfunction isHex(c) {\n\treturn c >= \"0\" && c <= \"9\" || c >= \"a\" && c <= \"f\" || c >= \"A\" && c <= \"F\";\n}\n/**\n* The view. A streaming instance grows through {@link PartialArguments.append};\n* {@link PartialArguments.fromText} and {@link PartialArguments.fromObject} build\n* sealed instances over a finished call. Every reader is total: an absent or\n* differently typed field answers `undefined` (or `false`), never throws.\n*/\nvar PartialArguments = class PartialArguments {\n\t/** The view of a call with no arguments available. */\n\tstatic EMPTY = PartialArguments.fromObject({});\n\t/**\n\t* View finished argument text without scanning it until a reader asks.\n\t* @param text - the complete argument JSON text.\n\t* @returns a sealed view.\n\t*/\n\tstatic fromText(text) {\n\t\tconst view = new PartialArguments();\n\t\tview.append(text);\n\t\tview.sealed = true;\n\t\treturn view;\n\t}\n\t/**\n\t* View an already parsed argument payload, such as a PTC dispatch object.\n\t* @param value - the parsed argument value.\n\t* @returns a sealed view; a non-object payload has no fields.\n\t*/\n\tstatic fromObject(value) {\n\t\tconst view = new PartialArguments();\n\t\tview.object = typeof value === \"object\" && value !== null && !Array.isArray(value) ? value : {};\n\t\tview.sealed = true;\n\t\treturn view;\n\t}\n\t/**\n\t* The source: text so far or a parsed object, plus whether it can still grow.\n\t* These are the only enumerable fields, so two views over the same source\n\t* compare equal structurally however far each has been read.\n\t*/\n\tchunks = [];\n\tobject;\n\tsealed = false;\n\t#ends = [];\n\t#size = 0;\n\t#consumed = 0;\n\t#mode = \"root\";\n\t#escape = false;\n\t#keyStart = 0;\n\t#keyEscaped = false;\n\t#key = \"\";\n\t#current = null;\n\t#nestedEnds = [];\n\t#nestedInString = false;\n\t#invalidAt;\n\t#invalidValue = false;\n\t#entries = /* @__PURE__ */ new Map();\n\t#order = [];\n\t#reads = /* @__PURE__ */ new Map();\n\t/** Whether this view rejects further appends; does not scan text or register reads. */\n\tget isSealed() {\n\t\treturn this.sealed;\n\t}\n\t/** Whether indexing or a content read found invalid JSON; unread value contents are not validated. */\n\tget invalid() {\n\t\tthis.scan();\n\t\treturn this.#mode === \"invalid\" || this.#invalidValue;\n\t}\n\t/**\n\t* Retain streamed argument text without scanning or comparing observed answers.\n\t* @param fragment - the text following every fragment appended before.\n\t*/\n\tappend(fragment) {\n\t\tif (this.sealed) throw new Error(\"PartialArguments: cannot append to a sealed view\");\n\t\tif (fragment.length === 0) return;\n\t\tthis.chunks.push(fragment);\n\t\tthis.#size += fragment.length;\n\t\tthis.#ends.push(this.#size);\n\t}\n\t/**\n\t* Reconcile a streamed prefix with authoritative complete text without joining the fragments.\n\t* @param text - the final argument text, which replaces missing or conflicting deltas.\n\t* @returns this view sealed with its caches retained when every character matches; otherwise a new sealed view.\n\t*/\n\tsettle(text) {\n\t\tif (this.object !== void 0 || text.length !== this.#size) return PartialArguments.fromText(text);\n\t\tlet offset = 0;\n\t\tfor (const chunk of this.chunks) {\n\t\t\tif (!text.startsWith(chunk, offset)) return PartialArguments.fromText(text);\n\t\t\toffset += chunk.length;\n\t\t}\n\t\tthis.chunks = text.length === 0 ? [] : [text];\n\t\tthis.#ends = text.length === 0 ? [] : [text.length];\n\t\tthis.sealed = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Compare observed answers and advance their publication baseline. Unread views remain unscanned.\n\t* @returns whether any observed answer changed since its first read or the preceding refresh.\n\t*/\n\trefresh() {\n\t\tif (this.#reads.size === 0) return false;\n\t\tthis.scan();\n\t\tlet changed = false;\n\t\tlet completions = false;\n\t\tfor (const read of this.#reads.values()) {\n\t\t\tif (read.completion) {\n\t\t\t\tcompletions = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tchanged = this.refreshRead(read) || changed;\n\t\t}\n\t\tif (completions) {\n\t\t\tfor (const read of this.#reads.values()) if (read.completion) changed = this.refreshRead(read) || changed;\n\t\t}\n\t\tif (this.sealed) this.#reads.clear();\n\t\treturn changed;\n\t}\n\trefreshRead(read) {\n\t\tconst now = read.answer();\n\t\tif (Object.is(now, read.last)) return false;\n\t\tread.last = now;\n\t\treturn true;\n\t}\n\t/**\n\t* Check whether no further fields can arrive.\n\t* @returns whether the outer object closed, indexing failed, or the view is sealed; unread values are not validated.\n\t*/\n\tclosed() {\n\t\treturn this.remember(\"closed\", \"\", () => this.closedNow());\n\t}\n\t/**\n\t* List discovered fields in first-appearance order.\n\t* @returns top-level keys seen so far, in first-appearance order.\n\t*/\n\tkeys() {\n\t\treturn this.remember(\"keys\", \"\", () => this.keysNow(), (keys) => keys.length);\n\t}\n\t/**\n\t* Check whether a top-level field has appeared.\n\t* @param key - argument name.\n\t* @returns whether the field has appeared (a string opened or another value began).\n\t*/\n\thas(key) {\n\t\treturn this.remember(\"has\", key, () => this.hasNow(key));\n\t}\n\t/**\n\t* Check whether a field's closing delimiter has arrived, without validating its contents.\n\t* @param key - argument name.\n\t* @returns whether its delimiter arrived and no content reader has reported an error for this value.\n\t*/\n\tcomplete(key) {\n\t\treturn this.remember(\"complete\", key, () => this.completeNow(key));\n\t}\n\t/**\n\t* Read string length without materializing its text.\n\t* @param key - argument name.\n\t* @param options - change granularity for a streaming string.\n\t* @returns decoded UTF-16 length of the string field so far; undefined when absent or not a string.\n\t*/\n\tstringLength(key, options) {\n\t\tconst step = Math.max(1, Math.floor(options?.step ?? 1));\n\t\tconst offset = options?.offset ?? 0;\n\t\treturn this.remember(`length:${step}:${offset}`, key, () => this.lengthNow(key), (length) => length === void 0 ? void 0 : Math.ceil((length + offset) / step));\n\t}\n\t/**\n\t* Check a string against a decoded UTF-16 length limit without materializing it.\n\t* @param key - argument name.\n\t* @param maxLength - decoded UTF-16 limit, floored to at least zero.\n\t* @returns whether the string is longer than the limit; false when absent or not a string.\n\t*/\n\tstringExceeds(key, maxLength) {\n\t\tconst limit = Math.max(0, Math.floor(maxLength));\n\t\treturn this.remember(`exceeds:${limit}`, key, () => (this.lengthNow(key, limit + 1) ?? 0) > limit);\n\t}\n\t/**\n\t* Read a decoded string, including a streaming prefix.\n\t* @param key - argument name.\n\t* @returns the string field's decoded text so far; undefined when absent or not a string.\n\t*/\n\ttext(key) {\n\t\treturn this.remember(\"text\", key, () => this.textNow(key));\n\t}\n\t/**\n\t* Read at most the first decoded UTF-16 units of a string.\n\t* @param key - argument name.\n\t* @param maxLength - maximum decoded UTF-16 length, floored to at least one.\n\t* @returns the bounded string prefix; undefined when absent or not a string.\n\t*/\n\ttextPrefix(key, maxLength) {\n\t\tconst limit = Math.max(1, Math.floor(maxLength));\n\t\treturn this.remember(`prefix:${limit}`, key, () => this.textPrefixNow(key, limit));\n\t}\n\t/**\n\t* Read a completed non-string argument.\n\t* @param key - argument name.\n\t* @returns the parsed non-string value once it closed; undefined while open, absent, or a string.\n\t*/\n\tvalue(key) {\n\t\treturn this.remember(\"value\", key, () => this.valueNow(key));\n\t}\n\t/** Answer a question and, on a streaming view, remember it for change detection. */\n\tremember(kind, key, read, comparison) {\n\t\tthis.scan();\n\t\tconst result = read();\n\t\tif (!this.sealed) {\n\t\t\tconst id = `${kind}/${key}`;\n\t\t\tif (!this.#reads.has(id)) this.#reads.set(id, {\n\t\t\t\tcompletion: kind === \"complete\",\n\t\t\t\tanswer: comparison === void 0 ? read : () => comparison(read()),\n\t\t\t\tlast: comparison === void 0 ? result : comparison(result)\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\tclosedNow() {\n\t\treturn this.sealed || this.#mode === \"closed\" || this.#mode === \"invalid\";\n\t}\n\tkeysNow() {\n\t\treturn this.object === void 0 ? this.#order : Object.keys(this.object);\n\t}\n\thasNow(key) {\n\t\treturn this.object === void 0 ? this.#entries.has(key) : Object.hasOwn(this.object, key);\n\t}\n\tcompleteNow(key) {\n\t\tif (this.object !== void 0) return Object.hasOwn(this.object, key);\n\t\tconst entry = this.#entries.get(key);\n\t\treturn entry !== void 0 && entry.end >= 0 && (entry.kind === \"string\" ? entry.invalidAt === void 0 : !entry.invalid);\n\t}\n\tlengthNow(key, limit = Number.POSITIVE_INFINITY) {\n\t\tif (this.object !== void 0) {\n\t\t\tconst field = Object.hasOwn(this.object, key) ? this.object[key] : void 0;\n\t\t\treturn typeof field === \"string\" ? field.length : void 0;\n\t\t}\n\t\tconst entry = this.#entries.get(key);\n\t\tif (entry?.kind !== \"string\") return void 0;\n\t\tif (entry.text !== void 0 && entry.text.at === entry.end) return entry.text.length;\n\t\tconst read = entry.length ??= {\n\t\t\tat: entry.start,\n\t\t\tlength: 0,\n\t\t\ttext: \"\"\n\t\t};\n\t\tthis.readString(entry, read, limit, false);\n\t\treturn read.length;\n\t}\n\ttextNow(key) {\n\t\tif (this.object !== void 0) {\n\t\t\tconst field = Object.hasOwn(this.object, key) ? this.object[key] : void 0;\n\t\t\treturn typeof field === \"string\" ? field : void 0;\n\t\t}\n\t\tconst entry = this.#entries.get(key);\n\t\tif (entry?.kind !== \"string\") return void 0;\n\t\tif (entry.text === void 0 && entry.end >= 0 && entry.needsDecoding && entry.invalidAt === void 0) {\n\t\t\tlet text;\n\t\t\ttry {\n\t\t\t\ttext = JSON.parse(`\"${this.slice(entry.start, entry.end)}\"`);\n\t\t\t} catch (_error) {}\n\t\t\tif (text !== void 0) entry.text = {\n\t\t\t\tat: entry.end,\n\t\t\t\tlength: text.length,\n\t\t\t\ttext\n\t\t\t};\n\t\t}\n\t\tconst read = entry.text ??= {\n\t\t\tat: entry.start,\n\t\t\tlength: 0,\n\t\t\ttext: \"\"\n\t\t};\n\t\tthis.readString(entry, read, Number.POSITIVE_INFINITY, true);\n\t\treturn read.text;\n\t}\n\ttextPrefixNow(key, maxLength) {\n\t\tif (this.object !== void 0) {\n\t\t\tconst field = Object.hasOwn(this.object, key) ? this.object[key] : void 0;\n\t\t\treturn typeof field === \"string\" ? field.slice(0, maxLength) : void 0;\n\t\t}\n\t\tconst entry = this.#entries.get(key);\n\t\tif (entry?.kind !== \"string\") return void 0;\n\t\tconst prefixes = entry.prefixes ??= /* @__PURE__ */ new Map();\n\t\tlet read = prefixes.get(maxLength);\n\t\tif (read === void 0) {\n\t\t\tread = {\n\t\t\t\tat: entry.start,\n\t\t\t\tlength: 0,\n\t\t\t\ttext: \"\"\n\t\t\t};\n\t\t\tprefixes.set(maxLength, read);\n\t\t}\n\t\tthis.readString(entry, read, maxLength, true);\n\t\treturn read.text;\n\t}\n\tvalueNow(key) {\n\t\tif (this.object !== void 0) {\n\t\t\tif (!Object.hasOwn(this.object, key)) return void 0;\n\t\t\tconst field = this.object[key];\n\t\t\treturn typeof field === \"string\" ? void 0 : field;\n\t\t}\n\t\tconst entry = this.#entries.get(key);\n\t\tif (entry?.kind !== \"value\" || entry.end < 0 || entry.invalid) return void 0;\n\t\tif (entry.parsed === void 0) try {\n\t\t\tentry.parsed = JSON.parse(this.slice(entry.start, entry.end));\n\t\t} catch (_error) {\n\t\t\tentry.invalid = true;\n\t\t\tthis.#invalidValue = true;\n\t\t}\n\t\treturn entry.parsed;\n\t}\n\tchunkAt(at) {\n\t\tlet low = 0;\n\t\tlet high = this.#ends.length;\n\t\twhile (low < high) {\n\t\t\tconst mid = low + high >>> 1;\n\t\t\tif (this.#ends[mid] <= at) low = mid + 1;\n\t\t\telse high = mid;\n\t\t}\n\t\treturn low;\n\t}\n\t/** Materialize only a requested range, never the cumulative source. */\n\tslice(start, end) {\n\t\tif (start >= end) return \"\";\n\t\tconst first = this.chunkAt(start);\n\t\tconst last = this.chunkAt(end - 1);\n\t\tconst base = first === 0 ? 0 : this.#ends[first - 1];\n\t\tif (first === last) return this.chunks[first].slice(start - base, end - base);\n\t\tconst parts = [this.chunks[first].slice(start - base)];\n\t\tfor (let i = first + 1; i < last; i++) parts.push(this.chunks[i]);\n\t\tparts.push(this.chunks[last].slice(0, end - this.#ends[last - 1]));\n\t\treturn parts.join(\"\");\n\t}\n\treadString(entry, read, limit, materialize) {\n\t\tconst end = Math.min(entry.end < 0 ? this.#consumed : entry.end, entry.invalidAt ?? Number.POSITIVE_INFINITY, this.#invalidAt ?? Number.POSITIVE_INFINITY);\n\t\tif (!entry.needsDecoding) {\n\t\t\tconst length = Math.min(end - read.at, limit - read.length);\n\t\t\tif (length <= 0) return;\n\t\t\tif (materialize) read.text += this.slice(read.at, read.at + length);\n\t\t\tread.at += length;\n\t\t\tread.length += length;\n\t\t\treturn;\n\t\t}\n\t\tlet chunkIndex = this.chunkAt(read.at);\n\t\twhile (read.at < end && read.length < limit) {\n\t\t\tconst base = chunkIndex === 0 ? 0 : this.#ends[chunkIndex - 1];\n\t\t\tconst chunk = this.chunks[chunkIndex];\n\t\t\tconst remaining = chunk.slice(read.at - base, Math.min(chunk.length, end - base));\n\t\t\tconst boundary = remaining.search(CONTENT_ESCAPE);\n\t\t\tconst length = Math.min(boundary < 0 ? remaining.length : boundary, limit - read.length);\n\t\t\tif (length > 0) {\n\t\t\t\tif (materialize) read.text += remaining.slice(0, length);\n\t\t\t\tread.at += length;\n\t\t\t\tread.length += length;\n\t\t\t\tif (read.at === base + chunk.length) chunkIndex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst type = remaining.length > 1 ? remaining[1] : read.at + 1 < end ? this.chunks[chunkIndex + 1][0] : void 0;\n\t\t\tlet decoded;\n\t\t\tlet width = 2;\n\t\t\tif (remaining[0] === \"\\\\\" && type === void 0 && entry.end < 0) return;\n\t\t\tif (remaining[0] === \"\\\\\" && type === \"u\") {\n\t\t\t\tconst hex = this.slice(read.at + 2, Math.min(end, read.at + 6));\n\t\t\t\tlet valid = true;\n\t\t\t\tfor (let i = 0; i < hex.length; i++) if (!isHex(hex[i])) valid = false;\n\t\t\t\tif (valid) {\n\t\t\t\t\tif (hex.length < 4 && entry.end < 0) return;\n\t\t\t\t\tif (hex.length === 4) decoded = String.fromCharCode(Number.parseInt(hex, 16));\n\t\t\t\t}\n\t\t\t\twidth = 6;\n\t\t\t} else if (remaining[0] === \"\\\\\" && type !== void 0) decoded = SIMPLE_ESCAPES[type];\n\t\t\tif (decoded === void 0) {\n\t\t\t\tentry.invalidAt = read.at;\n\t\t\t\tthis.#invalidValue = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (materialize) read.text += decoded;\n\t\t\tread.length++;\n\t\t\tread.at += width;\n\t\t\twhile (chunkIndex < this.chunks.length && read.at >= this.#ends[chunkIndex]) chunkIndex++;\n\t\t}\n\t}\n\t/** Locate new field ranges without decoding or parsing their contents. */\n\tscan() {\n\t\tif (this.object !== void 0 || this.#consumed === this.#size) return;\n\t\tfor (let i = this.chunkAt(this.#consumed); i < this.chunks.length && this.#invalidAt === void 0; i++) {\n\t\t\tconst pending = this.chunks[i];\n\t\t\tconst base = i === 0 ? 0 : this.#ends[i - 1];\n\t\t\tfor (let index = this.#consumed - base; index < pending.length && this.#mode !== \"invalid\"; index++) {\n\t\t\t\tif (this.#mode === \"string\" || this.#mode === \"nested\" && this.#nestedInString) {\n\t\t\t\t\tconst end = this.stringBoundary(pending, index);\n\t\t\t\t\tthis.#consumed += end - index;\n\t\t\t\t\tindex = end;\n\t\t\t\t\tif (index === pending.length) break;\n\t\t\t\t}\n\t\t\t\tthis.step(pending[index], this.#consumed);\n\t\t\t\tthis.#consumed++;\n\t\t\t}\n\t\t}\n\t}\n\t/** Only raw quotes and their preceding backslash runs can terminate a string. */\n\tstringBoundary(fragment, start) {\n\t\tlet at = start;\n\t\twhile (true) {\n\t\t\tconst quote = fragment.indexOf(\"\\\"\", at);\n\t\t\tconst end = quote < 0 ? fragment.length : quote;\n\t\t\tif (this.#mode === \"string\") {\n\t\t\t\tconst entry = this.#current;\n\t\t\t\tif (!entry.needsDecoding && CONTENT_ESCAPE.test(fragment.slice(at, end))) entry.needsDecoding = true;\n\t\t\t}\n\t\t\tlet slashStart = end;\n\t\t\twhile (slashStart > at && fragment[slashStart - 1] === \"\\\\\") slashStart--;\n\t\t\tconst escaped = (end - slashStart) % 2 === 1 !== (slashStart === at && this.#escape);\n\t\t\tthis.#escape = quote < 0 && escaped;\n\t\t\tif (quote < 0 || !escaped) return end;\n\t\t\tat = quote + 1;\n\t\t}\n\t}\n\tstep(c, at) {\n\t\tswitch (this.#mode) {\n\t\t\tcase \"root\":\n\t\t\t\tif (isWhitespace(c)) return;\n\t\t\t\tif (c === \"{\") {\n\t\t\t\t\tthis.#mode = \"key-or-end\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.fail();\n\t\t\t\treturn;\n\t\t\tcase \"key-or-end\":\n\t\t\t\tif (isWhitespace(c)) return;\n\t\t\t\tif (c === \"}\") {\n\t\t\t\t\tthis.#mode = \"closed\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (c === \"\\\"\") {\n\t\t\t\t\tthis.beginKey(at);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.fail();\n\t\t\t\treturn;\n\t\t\tcase \"key-only\":\n\t\t\t\tif (isWhitespace(c)) return;\n\t\t\t\tif (c === \"\\\"\") {\n\t\t\t\t\tthis.beginKey(at);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.fail();\n\t\t\t\treturn;\n\t\t\tcase \"key\":\n\t\t\t\tthis.stepKey(c, at);\n\t\t\t\treturn;\n\t\t\tcase \"colon\":\n\t\t\t\tif (isWhitespace(c)) return;\n\t\t\t\tif (c === \":\") {\n\t\t\t\t\tthis.#mode = \"value\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.fail();\n\t\t\t\treturn;\n\t\t\tcase \"value\":\n\t\t\t\tthis.beginValue(c, at);\n\t\t\t\treturn;\n\t\t\tcase \"string\": {\n\t\t\t\tconst entry = this.#current;\n\t\t\t\tentry.end = at;\n\t\t\t\tthis.#current = null;\n\t\t\t\tthis.#mode = \"comma-or-end\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"scalar\":\n\t\t\t\tthis.stepScalar(c, at);\n\t\t\t\treturn;\n\t\t\tcase \"nested\":\n\t\t\t\tthis.stepNested(c, at);\n\t\t\t\treturn;\n\t\t\tcase \"comma-or-end\":\n\t\t\t\tif (isWhitespace(c)) return;\n\t\t\t\tif (c === \",\") {\n\t\t\t\t\tthis.#mode = \"key-only\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (c === \"}\") {\n\t\t\t\t\tthis.#mode = \"closed\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.fail();\n\t\t\t\treturn;\n\t\t\tcase \"closed\":\n\t\t\t\tif (isWhitespace(c)) return;\n\t\t\t\tthis.fail();\n\t\t\t\treturn;\n\t\t\t/* v8 ignore next 2 -- scan() stops stepping once the view is invalid. */\n\t\t\tcase \"invalid\": return;\n\t\t\t/* v8 ignore next 2 -- Every scanner mode has a handler above. */\n\t\t\tdefault: assertNever(this.#mode);\n\t\t}\n\t}\n\tfail() {\n\t\tthis.#invalidAt = this.#consumed;\n\t\tthis.#mode = \"invalid\";\n\t\tthis.#current = null;\n\t}\n\tbeginKey(at) {\n\t\tthis.#mode = \"key\";\n\t\tthis.#keyStart = at + 1;\n\t\tthis.#keyEscaped = false;\n\t\tthis.#escape = false;\n\t}\n\tstepKey(c, at) {\n\t\tif (c < \" \") {\n\t\t\tthis.fail();\n\t\t\treturn;\n\t\t}\n\t\tif (this.#escape) {\n\t\t\tthis.#escape = false;\n\t\t\treturn;\n\t\t}\n\t\tif (c === \"\\\\\") {\n\t\t\tthis.#escape = true;\n\t\t\tthis.#keyEscaped = true;\n\t\t\treturn;\n\t\t}\n\t\tif (c !== \"\\\"\") return;\n\t\tconst raw = this.slice(this.#keyStart, at);\n\t\tif (this.#keyEscaped) try {\n\t\t\tthis.#key = JSON.parse(`\"${raw}\"`);\n\t\t} catch (_error) {\n\t\t\tthis.fail();\n\t\t\treturn;\n\t\t}\n\t\telse this.#key = raw;\n\t\tthis.#mode = \"colon\";\n\t}\n\topen(entry) {\n\t\tif (!this.#entries.has(this.#key)) this.#order.push(this.#key);\n\t\tthis.#entries.set(this.#key, entry);\n\t\tthis.#current = entry;\n\t}\n\tbeginValue(c, at) {\n\t\tif (isWhitespace(c)) return;\n\t\tif (c === \"\\\"\") {\n\t\t\tthis.open({\n\t\t\t\tkind: \"string\",\n\t\t\t\tstart: at + 1,\n\t\t\t\tend: -1,\n\t\t\t\tneedsDecoding: false,\n\t\t\t\tinvalidAt: void 0,\n\t\t\t\tlength: void 0,\n\t\t\t\ttext: void 0,\n\t\t\t\tprefixes: void 0\n\t\t\t});\n\t\t\tthis.#escape = false;\n\t\t\tthis.#mode = \"string\";\n\t\t\treturn;\n\t\t}\n\t\tif (c === \"}\" || c === \",\" || c === \":\" || c === \"]\") {\n\t\t\tthis.fail();\n\t\t\treturn;\n\t\t}\n\t\tthis.open({\n\t\t\tkind: \"value\",\n\t\t\tstart: at,\n\t\t\tend: -1,\n\t\t\tparsed: void 0,\n\t\t\tinvalid: false\n\t\t});\n\t\tif (c === \"{\" || c === \"[\") {\n\t\t\tthis.#mode = \"nested\";\n\t\t\tthis.#nestedEnds = [c === \"{\" ? \"}\" : \"]\"];\n\t\t\tthis.#nestedInString = false;\n\t\t\tthis.#escape = false;\n\t\t\treturn;\n\t\t}\n\t\tthis.#mode = \"scalar\";\n\t}\n\tstepScalar(c, at) {\n\t\tif (c !== \",\" && c !== \"}\" && !isWhitespace(c)) return;\n\t\tthis.closeValue(at);\n\t\tthis.#mode = c === \",\" ? \"key-only\" : c === \"}\" ? \"closed\" : \"comma-or-end\";\n\t}\n\tstepNested(c, at) {\n\t\tif (this.#nestedInString) {\n\t\t\tthis.#nestedInString = false;\n\t\t\treturn;\n\t\t}\n\t\tif (c === \"\\\"\") {\n\t\t\tthis.#nestedInString = true;\n\t\t\treturn;\n\t\t}\n\t\tif (c === \"{\" || c === \"[\") {\n\t\t\tthis.#nestedEnds.push(c === \"{\" ? \"}\" : \"]\");\n\t\t\treturn;\n\t\t}\n\t\tif (c === \"}\" || c === \"]\") {\n\t\t\tif (this.#nestedEnds.pop() !== c) {\n\t\t\t\tthis.fail();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this.#nestedEnds.length === 0) {\n\t\t\t\tthis.closeValue(at + 1);\n\t\t\t\tthis.#mode = \"comma-or-end\";\n\t\t\t}\n\t\t}\n\t}\n\tcloseValue(end) {\n\t\tconst entry = this.#current;\n\t\tentry.end = end;\n\t\tthis.#current = null;\n\t}\n};\n//#endregion\n//#region lib/types/index.js\n/** Duplicate-install-safe JSON and immutable-value helpers. @module @deepseek-ai/dsh-util-values */\n/**\n* Mark an unreachable closed-union branch.\n* @param value - impossible value; an unhandled typed variant fails at the call site.\n* @param context - optional switch-site label included in the failure message.\n* @returns never; a runtime value that escaped its type always throws.\n*/\nfunction assertNever(value, context) {\n\tconst rendered = JSON.stringify(value) ?? String(value);\n\tthrow new Error(`unreachable variant${context ? ` in ${context}` : \"\"}: ${rendered}`);\n}\n/** Whether a realm-owned intrinsic prototype has a native constructor matching this engine's representation. */\nfunction hasIntrinsicConstructor(prototype, name) {\n\tconst constructor = Object.getOwnPropertyDescriptor(prototype, \"constructor\")?.value;\n\tif (typeof constructor !== \"function\") return false;\n\ttry {\n\t\treturn constructor.name === name && constructor.prototype === prototype && Function.prototype.toString.call(constructor) === Function.prototype.toString.call(name === \"Array\" ? Array : Object);\n\t} catch {\n\t\treturn false;\n\t}\n}\n/** Whether a candidate is one realm's intrinsic `Object.prototype`. */\nfunction isIntrinsicObjectPrototype(value) {\n\treturn Object.getPrototypeOf(value) === null && hasIntrinsicConstructor(value, \"Object\");\n}\n/** Whether an array uses one realm's intrinsic `Array.prototype`, not a subclass or forged prototype. */\nfunction hasPlainArrayPrototype(value) {\n\tconst prototype = Object.getPrototypeOf(value);\n\tif (!Array.isArray(prototype) || !hasIntrinsicConstructor(prototype, \"Array\")) return false;\n\tconst objectPrototype = Object.getPrototypeOf(prototype);\n\treturn typeof objectPrototype === \"object\" && objectPrototype !== null && isIntrinsicObjectPrototype(objectPrototype);\n}\n/** Whether an object is a plain or null-prototype record from any JavaScript realm. */\nfunction hasPlainObjectPrototype(value) {\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === null || typeof prototype === \"object\" && isIntrinsicObjectPrototype(prototype);\n}\n/** Return every JSON-visible object key, or reject own data JSON would discard. */\nfunction enumerableStringKeys(value) {\n\tconst keys = Reflect.ownKeys(value);\n\tif (keys.some((key) => typeof key !== \"string\" || !Object.prototype.propertyIsEnumerable.call(value, key))) return void 0;\n\treturn keys;\n}\n/** Validate lossless JSON iteratively, optionally materializing a detached snapshot. */\nfunction walkJsonValue(value, detach) {\n\tconst ancestors = /* @__PURE__ */ new Set();\n\tlet root;\n\tconst assign = (destination, item) => {\n\t\tif (destination === void 0) return;\n\t\tif (destination.kind === \"root\") root = item;\n\t\telse if (destination.kind === \"array\") destination.target[destination.index] = item;\n\t\telse Object.defineProperty(destination.target, destination.key, {\n\t\t\tvalue: item,\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true\n\t\t});\n\t};\n\tconst tasks = [{\n\t\tkind: \"visit\",\n\t\tvalue,\n\t\t...detach ? { destination: { kind: \"root\" } } : {}\n\t}];\n\tfor (let task = tasks.pop(); task !== void 0; task = tasks.pop()) {\n\t\tif (task.kind === \"leave\") {\n\t\t\tancestors.delete(task.source);\n\t\t\tcontinue;\n\t\t}\n\t\tif (task.kind === \"array-item\") {\n\t\t\tif (!Object.prototype.hasOwnProperty.call(task.source, task.index)) return void 0;\n\t\t\ttasks.push({\n\t\t\t\tkind: \"visit\",\n\t\t\t\tvalue: task.source[task.index],\n\t\t\t\t...task.target === void 0 ? {} : { destination: {\n\t\t\t\t\tkind: \"array\",\n\t\t\t\t\ttarget: task.target,\n\t\t\t\t\tindex: task.index\n\t\t\t\t} }\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (task.kind === \"object-property\") {\n\t\t\ttasks.push({\n\t\t\t\tkind: \"visit\",\n\t\t\t\tvalue: task.source[task.key],\n\t\t\t\t...task.target === void 0 ? {} : { destination: {\n\t\t\t\t\tkind: \"object\",\n\t\t\t\t\ttarget: task.target,\n\t\t\t\t\tkey: task.key\n\t\t\t\t} }\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst current = task.value;\n\t\tif (current === null) {\n\t\t\tassign(task.destination, null);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof current === \"boolean\" || typeof current === \"string\") {\n\t\t\tassign(task.destination, current);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof current === \"number\") {\n\t\t\tif (!Number.isFinite(current) || Object.is(current, -0)) return void 0;\n\t\t\tassign(task.destination, current);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof current !== \"object\") return void 0;\n\t\tif (ancestors.has(current)) return void 0;\n\t\tif (Array.isArray(current)) {\n\t\t\tif (!hasPlainArrayPrototype(current)) return void 0;\n\t\t\tconst length = current.length;\n\t\t\tif (Reflect.ownKeys(current).length !== length + 1) return void 0;\n\t\t\tconst target = detach ? [] : void 0;\n\t\t\tif (target !== void 0) assign(task.destination, target);\n\t\t\tancestors.add(current);\n\t\t\ttasks.push({\n\t\t\t\tkind: \"leave\",\n\t\t\t\tsource: current\n\t\t\t});\n\t\t\tfor (let index = length - 1; index >= 0; index--) tasks.push({\n\t\t\t\tkind: \"array-item\",\n\t\t\t\tsource: current,\n\t\t\t\tindex,\n\t\t\t\t...target === void 0 ? {} : { target }\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (!hasPlainObjectPrototype(current)) return void 0;\n\t\tconst keys = enumerableStringKeys(current);\n\t\tif (keys === void 0) return void 0;\n\t\tconst target = detach ? {} : void 0;\n\t\tif (target !== void 0) assign(task.destination, target);\n\t\tancestors.add(current);\n\t\ttasks.push({\n\t\t\tkind: \"leave\",\n\t\t\tsource: current\n\t\t});\n\t\tfor (let index = keys.length - 1; index >= 0; index--) {\n\t\t\tconst key = keys[index];\n\t\t\t/* v8 ignore next -- the loop is bounded by the captured key count. */\n\t\t\tif (key === void 0) return void 0;\n\t\t\ttasks.push({\n\t\t\t\tkind: \"object-property\",\n\t\t\t\tsource: current,\n\t\t\t\tkey,\n\t\t\t\t...target === void 0 ? {} : { target }\n\t\t\t});\n\t\t}\n\t}\n\treturn detach ? root : true;\n}\n/**\n* Validate and detach lossless JSON in one read per property.\n* @param value - candidate value to validate and detach.\n* @returns the detached snapshot, or `undefined` when the value is not losslessly JSON-serializable.\n*/\nfunction snapshotJsonValue(value) {\n\treturn walkJsonValue(value, true);\n}\n/**\n* Test the same lossless JSON rules as {@link snapshotJsonValue} without detaching the value.\n* @param value - candidate value to test.\n* @returns whether the value survives a JSON round trip without loss.\n*/\nfunction isJsonValue(value) {\n\treturn walkJsonValue(value, false) === true;\n}\n/**\n* Compare JSON-compatible values structurally.\n* @param a - one JSON-compatible value.\n* @param b - the other JSON-compatible value.\n* @returns whether both values contain the same JSON data.\n*/\nfunction deepEqualJson(a, b) {\n\tif (a === b) return true;\n\tif (typeof a !== \"object\" || typeof b !== \"object\" || a === null || b === null) return false;\n\tif (Array.isArray(a) || Array.isArray(b)) {\n\t\tif (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;\n\t\treturn a.every((entry, index) => deepEqualJson(entry, b[index]));\n\t}\n\tconst left = a;\n\tconst right = b;\n\tconst keys = Object.keys(left);\n\tif (keys.length !== Object.keys(right).length) return false;\n\treturn keys.every((key) => key in right && deepEqualJson(left[key], right[key]));\n}\n/**\n* Deep-freeze an object graph in place while leaving live AbortSignal objects mutable.\n* @param value - value to freeze.\n* @returns the same value after every reachable enumerable child is frozen.\n*/\nfunction deepFreeze(value) {\n\tconst seen = /* @__PURE__ */ new WeakSet();\n\tconst pending = [{\n\t\tkind: \"visit\",\n\t\tnode: value\n\t}];\n\twhile (pending.length > 0) {\n\t\tconst task = pending.pop();\n\t\t/* v8 ignore next -- the loop condition guarantees one pending task. */\n\t\tif (task === void 0) continue;\n\t\tif (task.kind === \"property\") {\n\t\t\tpending.push({\n\t\t\t\tkind: \"visit\",\n\t\t\t\tnode: task.source[task.key]\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst node = task.node;\n\t\tif (node === null || typeof node !== \"object\") continue;\n\t\tif (node instanceof AbortSignal) continue;\n\t\tif (seen.has(node)) continue;\n\t\tseen.add(node);\n\t\tObject.freeze(node);\n\t\tconst keys = Object.keys(node);\n\t\tfor (let index = keys.length - 1; index >= 0; index--) {\n\t\t\tconst key = keys[index];\n\t\t\t/* v8 ignore next -- the loop is bounded by the captured key count. */\n\t\t\tif (key === void 0) continue;\n\t\t\tpending.push({\n\t\t\t\tkind: \"property\",\n\t\t\t\tsource: node,\n\t\t\t\tkey\n\t\t\t});\n\t\t}\n\t}\n\treturn value;\n}\n/**\n* Weak-key lookup with a strongly retained iterable set of associated values.\n*\n* Each value must belong to only one key. The container performs no automatic\n* cleanup; owners delete associations or clear the container at lifecycle end.\n*/\nvar WeakMapWithValues = class {\n\tkeys = /* @__PURE__ */ new WeakMap();\n\tvalueSet = /* @__PURE__ */ new Set();\n\t/** Live strongly retained values in insertion order. */\n\tvalues = this.valueSet;\n\t/**\n\t* Read the value associated with a key.\n\t* @param key - weakly held lookup key.\n\t* @returns the associated value, or absence.\n\t*/\n\tget(key) {\n\t\treturn this.keys.get(key);\n\t}\n\t/**\n\t* Test whether a key has an association.\n\t* @param key - weakly held lookup key.\n\t* @returns whether the key is present.\n\t*/\n\thas(key) {\n\t\treturn this.keys.has(key);\n\t}\n\t/**\n\t* Associate one key with one caller-unique value.\n\t* @param key - weakly held lookup key.\n\t* @param value - strongly retained value that belongs to no other key.\n\t* @returns this container.\n\t*/\n\tset(key, value) {\n\t\tif (this.keys.has(key)) {\n\t\t\tconst previous = this.keys.get(key);\n\t\t\tif (previous === value) return this;\n\t\t\tthis.valueSet.delete(previous);\n\t\t}\n\t\tthis.keys.set(key, value);\n\t\tthis.valueSet.add(value);\n\t\treturn this;\n\t}\n\t/**\n\t* Remove one association and its strongly retained value.\n\t* @param key - weakly held lookup key.\n\t* @returns whether an association was removed.\n\t*/\n\tdelete(key) {\n\t\tif (!this.keys.has(key)) return false;\n\t\tconst value = this.keys.get(key);\n\t\tconst deleted = this.keys.delete(key);\n\t\tthis.valueSet.delete(value);\n\t\treturn deleted;\n\t}\n\t/** Remove every association and strongly retained value. */\n\tclear() {\n\t\tthis.keys = /* @__PURE__ */ new WeakMap();\n\t\tthis.valueSet.clear();\n\t}\n};\n//#endregion\nexport { PartialArguments, WeakMapWithValues, assertNever, deepEqualJson, deepFreeze, isJsonValue, snapshotJsonValue };\n","//#region lib/types/index.js\n/**\n* UUID minting that works in every JavaScript context this repository ships\n* to. `crypto.randomUUID` is a secure-context Web API — a page or worker\n* served over plain HTTP on a LAN address has no such method — while\n* `crypto.getRandomValues` is unrestricted everywhere (browsers, workers,\n* Node ≥ 19). One implementation here replaces per-caller polyfills; the\n* `no-restricted-properties` lint rule points `crypto.randomUUID` callers at\n* this module.\n* @module @deepseek-ai/dsh-util-crypto\n*/\n/**\n* Encode bytes as canonical base64 without overflowing function argument limits.\n* @param data - Bytes to encode.\n* @returns base64 text.\n*/\nfunction bytesToBase64(data) {\n\tlet binary = \"\";\n\tconst chunk = 32768;\n\tfor (let offset = 0; offset < data.length; offset += chunk) binary += String.fromCharCode(...data.subarray(offset, offset + chunk));\n\treturn btoa(binary);\n}\n/**\n* Random v4 UUID, minted from `crypto.getRandomValues`.\n* @returns the UUID string.\n*/\nfunction randomUUID() {\n\tconst bytes = globalThis.crypto.getRandomValues(new Uint8Array(16));\n\tconst hex = Array.from(bytes, (byte, index) => {\n\t\treturn (index === 6 ? byte & 15 | 64 : index === 8 ? byte & 63 | 128 : byte).toString(16).padStart(2, \"0\");\n\t}).join(\"\");\n\treturn `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n//#endregion\nexport { bytesToBase64, randomUUID };\n","//#region lib/types/index.js\n/**\n* Duplicate-install-safe nominal primitive helpers.\n*\n* A brand makes structurally identical strings or numbers non-interchangeable\n* at the type level: a `SessionId` cannot be passed where a `ToolCallId` is\n* expected, and an event sequence cannot be passed as a log offset. Comparison,\n* logging, and serialization retain the underlying primitive behavior.\n*\n* This package owns no concrete domain value and keeps no runtime identity or mutable\n* state, so independently installed copies produce interchangeable values.\n*\n* @module @deepseek-ai/dsh-brand\n*/\n/**\n* Apply a compile-time string brand without changing the value.\n* @param value - string admitted by the domain that owns the target brand.\n* @returns the same string with the requested compile-time brand.\n*/\nfunction brandString(value) {\n\treturn value;\n}\n/**\n* Apply a compile-time number brand without changing the value.\n* @param value - number admitted by the domain that owns the target brand.\n* @returns the same number with the requested compile-time brand.\n*/\nfunction brandNumber(value) {\n\treturn value;\n}\n//#endregion\nexport { brandNumber, brandString };\n","//#region lib/types/misc.js\n/** No-op callback returning `undefined` at runtime and `any` at type level. */\nfunction noop() {}\n/** Return true when a value is `null` or `undefined`. */\nfunction isNullable(value) {\n\treturn value === null || value === void 0;\n}\n/** Return true when a value is neither `null` nor `undefined`. */\nfunction isNonNullable(value) {\n\treturn !isNullable(value);\n}\n/** Return true for non-array object values. */\nfunction isPlainObject(data) {\n\treturn data && typeof data === \"object\" && !Array.isArray(data);\n}\n/** Filter object entries and return a new object. */\nfunction filterKeys(object, filter) {\n\treturn Object.fromEntries(Object.entries(object).filter(([key, value]) => filter(key, value)));\n}\n/** Map object values while preserving the original key set. */\nfunction mapValues(object, transform) {\n\treturn Object.fromEntries(Object.entries(object).map(([key, value]) => [key, transform(value, key)]));\n}\n/** Pick selected keys from an object, optionally including `undefined` values. */\nfunction pick(source, keys, forced) {\n\tif (!keys) return { ...source };\n\tconst result = {};\n\tfor (const key of keys) if (forced || source[key] !== void 0) result[key] = source[key];\n\treturn result;\n}\n/** Omit selected keys from a shallow object copy. */\nfunction omit(source, keys) {\n\tif (!keys) return { ...source };\n\tconst result = { ...source };\n\tfor (const key of keys) Reflect.deleteProperty(result, key);\n\treturn result;\n}\n/** Define a non-enumerable writable property and return the object. */\nfunction defineProperty(object, key, value) {\n\treturn Object.defineProperty(object, key, {\n\t\twritable: true,\n\t\tvalue,\n\t\tenumerable: false\n\t});\n}\n//#endregion\n//#region lib/types/array.js\n/** Return true when every item in `array2` is present in `array1`. */\nfunction contain(array1, array2) {\n\treturn array2.every((item) => array1.includes(item));\n}\n/** Return items that appear in both arrays. */\nfunction intersection(array1, array2) {\n\treturn array1.filter((item) => array2.includes(item));\n}\n/** Return items from `array1` that do not appear in `array2`. */\nfunction difference(array1, array2) {\n\treturn array1.filter((item) => !array2.includes(item));\n}\n/** Return the set-union of two arrays while preserving first occurrence order. */\nfunction union(array1, array2) {\n\treturn Array.from(new Set([...array1, ...array2]));\n}\n/** Remove duplicate values while preserving first occurrence order. */\nfunction deduplicate(array) {\n\treturn [...new Set(array)];\n}\n/** Remove one item from an array and report whether it was found. */\nfunction remove(list, item) {\n\tconst index = list?.indexOf(item);\n\tif (index >= 0) {\n\t\tlist.splice(index, 1);\n\t\treturn true;\n\t} else return false;\n}\n/** Normalize nullish, scalar, or array input to an array. */\nfunction makeArray(source) {\n\treturn Array.isArray(source) ? source : isNullable(source) ? [] : [source];\n}\n//#endregion\n//#region lib/types/volatile.js\n/** Shared config references used by schema validators and plugin runtimes. */\nconst write = Symbol.for(\"cosmokit.volatile.write\");\nfunction snapshot(value, ancestors = /* @__PURE__ */ new Set()) {\n\tif (typeof value === \"function\") throw new TypeError(\"volatile config cannot contain functions\");\n\tif (value === null || typeof value !== \"object\") return value;\n\tif (ancestors.has(value)) throw new TypeError(\"volatile config cannot contain cycles\");\n\tancestors.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) return Object.freeze(value.map((item) => snapshot(item, ancestors)));\n\t\tif (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) throw new TypeError(\"volatile config objects must be plain objects or arrays\");\n\t\treturn Object.freeze(Object.fromEntries(Object.entries(value).map(([key, item]) => [key, snapshot(item, ancestors)])));\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n}\n/**\n* Create a detached reference containing an immutable copy of the supplied data.\n* @param value - validated config data; class instances and functions are unsupported.\n* @returns a reference whose value is updated only by its owning runtime.\n*/\nfunction createVolatile(value) {\n\tlet current = snapshot(value);\n\treturn Object.freeze({\n\t\tget: () => current,\n\t\t[write]: (value) => {\n\t\t\tcurrent = value;\n\t\t}\n\t});\n}\n/**\n* Identify references across ESM/CJS copies of the shared library.\n* @param value - a parsed config value.\n* @returns whether the value implements the shared reference protocol.\n*/\nfunction isVolatile(value) {\n\treturn typeof value === \"object\" && value !== null && write in value;\n}\n/**\n* Collect config references without descending into their snapshots or opaque objects.\n* @internal\n* @param value - parsed config; cyclic ordinary fields are visited once per path.\n* @returns references and their object-key paths, including an empty path for a root reference.\n*/\nfunction volatileEntries(value) {\n\tconst ancestors = /* @__PURE__ */ new Set();\n\tfunction visit(value, path) {\n\t\tif (isVolatile(value)) return [{\n\t\t\tpath,\n\t\t\tref: value\n\t\t}];\n\t\tif (!value || typeof value !== \"object\" || ancestors.has(value)) return [];\n\t\tif (!Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) return [];\n\t\tancestors.add(value);\n\t\ttry {\n\t\t\treturn Object.entries(value).flatMap(([key, child]) => visit(child, [...path, key]));\n\t\t} finally {\n\t\t\tancestors.delete(value);\n\t\t}\n\t}\n\treturn visit(value, []);\n}\n/**\n* Commit an already validated immutable snapshot from another reference.\n* @internal\n* @param target - the owning plugin's stable reference.\n* @param source - a newly parsed candidate reference.\n*/\nfunction updateVolatile(target, source) {\n\ttarget[write](source.get());\n}\n//#endregion\n//#region lib/types/types.js\n/** Test values using `instanceof` with a `toStringTag` fallback. */\nfunction is(type, value) {\n\tif (arguments.length === 1) return (value) => is(type, value);\n\treturn type in globalThis && value instanceof globalThis[type] || Object.prototype.toString.call(value).slice(8, -1) === type;\n}\nfunction isArrayBufferLike(value) {\n\treturn is(\"ArrayBuffer\", value) || is(\"SharedArrayBuffer\", value);\n}\nfunction isArrayBufferSource(value) {\n\treturn isArrayBufferLike(value) || ArrayBuffer.isView(value);\n}\n/** Binary source detection and base64/hex conversion helpers. */\nvar Binary;\n(function(Binary) {\n\tBinary.is = isArrayBufferLike;\n\tBinary.isSource = isArrayBufferSource;\n\tfunction fromSource(source) {\n\t\tif (ArrayBuffer.isView(source)) return source.buffer.slice(source.byteOffset, source.byteOffset + source.byteLength);\n\t\telse return source;\n\t}\n\tBinary.fromSource = fromSource;\n\tfunction toBase64(source) {\n\t\tsource = fromSource(source);\n\t\tif (typeof Buffer !== \"undefined\") return Buffer.from(source).toString(\"base64\");\n\t\tlet binary = \"\";\n\t\tconst bytes = new Uint8Array(source);\n\t\tfor (let i = 0; i < bytes.byteLength; i++) binary += String.fromCharCode(bytes[i]);\n\t\treturn btoa(binary);\n\t}\n\tBinary.toBase64 = toBase64;\n\tfunction fromBase64(source) {\n\t\tif (typeof Buffer !== \"undefined\") return fromSource(Buffer.from(source, \"base64\"));\n\t\treturn Uint8Array.from(atob(source), (c) => c.charCodeAt(0));\n\t}\n\tBinary.fromBase64 = fromBase64;\n\tfunction toHex(source) {\n\t\tsource = fromSource(source);\n\t\tif (typeof Buffer !== \"undefined\") return Buffer.from(source).toString(\"hex\");\n\t\treturn Array.from(new Uint8Array(source), (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n\t}\n\tBinary.toHex = toHex;\n\tfunction fromHex(source) {\n\t\tif (typeof Buffer !== \"undefined\") return fromSource(Buffer.from(source, \"hex\"));\n\t\tconst hex = source.length % 2 === 0 ? source : source.slice(0, source.length - 1);\n\t\tconst buffer = [];\n\t\tfor (let i = 0; i < hex.length; i += 2) buffer.push(parseInt(`${hex[i]}${hex[i + 1]}`, 16));\n\t\treturn Uint8Array.from(buffer).buffer;\n\t}\n\tBinary.fromHex = fromHex;\n})(Binary || (Binary = {}));\n/** Decode a base64 string into binary data. */\nconst base64ToArrayBuffer = Binary.fromBase64;\n/** Encode binary data as base64. */\nconst arrayBufferToBase64 = Binary.toBase64;\n/** Decode a hex string into binary data. */\nconst hexToArrayBuffer = Binary.fromHex;\n/** Encode binary data as hex. */\nconst arrayBufferToHex = Binary.toHex;\n/** Deep-clone common JavaScript values while preserving prototypes and cycles. */\nfunction clone(source, refs = /* @__PURE__ */ new Map()) {\n\tif (!source || typeof source !== \"object\") return source;\n\tif (is(\"Date\", source)) return new Date(source.valueOf());\n\tif (is(\"RegExp\", source)) return new RegExp(source.source, source.flags);\n\tif (isArrayBufferLike(source)) return source.slice(0);\n\tif (ArrayBuffer.isView(source)) return source.buffer.slice(source.byteOffset, source.byteOffset + source.byteLength);\n\tconst cached = refs.get(source);\n\tif (cached) return cached;\n\tif (Array.isArray(source)) {\n\t\tconst result = [];\n\t\trefs.set(source, result);\n\t\tsource.forEach((value, index) => {\n\t\t\tresult[index] = Reflect.apply(clone, null, [value, refs]);\n\t\t});\n\t\treturn result;\n\t}\n\tconst result = Object.create(Object.getPrototypeOf(source));\n\trefs.set(source, result);\n\tfor (const key of Reflect.ownKeys(source)) {\n\t\tconst descriptor = { ...Reflect.getOwnPropertyDescriptor(source, key) };\n\t\tif (\"value\" in descriptor) descriptor.value = Reflect.apply(clone, null, [descriptor.value, refs]);\n\t\tReflect.defineProperty(result, key, descriptor);\n\t}\n\treturn result;\n}\n/**\n* Compare values recursively, treating two volatile references as equal regardless of value.\n* Strict comparison distinguishes null/undefined, treats opaque objects by identity,\n* compares URLs by normalized href, treats array holes as undefined, and considers distinct cyclic structures unequal.\n* @param a - first value.\n* @param b - second value.\n* @param strict - whether to require strict data equality outside volatile references.\n* @returns whether the values compare equal.\n*/\nfunction deepEqual(a, b, strict) {\n\tconst ancestors = /* @__PURE__ */ new Set();\n\tfunction compare(a, b) {\n\t\tif (a === b) return true;\n\t\tif (isVolatile(a) || isVolatile(b)) return isVolatile(a) && isVolatile(b);\n\t\tif (!strict && isNullable(a) && isNullable(b)) return true;\n\t\tif (typeof a !== typeof b || typeof a !== \"object\" || !a || !b) return false;\n\t\tif (ancestors.has(a)) return false;\n\t\tfunction check(test, then) {\n\t\t\treturn test(a) ? test(b) ? then(a, b) : false : test(b) ? false : void 0;\n\t\t}\n\t\tancestors.add(a);\n\t\ttry {\n\t\t\treturn check(Array.isArray, (a, b) => {\n\t\t\t\tif (a.length !== b.length) return false;\n\t\t\t\tfor (let index = 0; index < a.length; index++) if (!compare(a[index], b[index])) return false;\n\t\t\t\treturn true;\n\t\t\t}) ?? check(is(\"Date\"), (a, b) => a.valueOf() === b.valueOf()) ?? check(is(\"URL\"), (a, b) => a.href === b.href) ?? check(is(\"RegExp\"), (a, b) => a.source === b.source && a.flags === b.flags) ?? check(isArrayBufferLike, (a, b) => {\n\t\t\t\tif (a.byteLength !== b.byteLength) return false;\n\t\t\t\tconst viewA = new Uint8Array(a);\n\t\t\t\tconst viewB = new Uint8Array(b);\n\t\t\t\tfor (let i = 0; i < viewA.length; i++) if (viewA[i] !== viewB[i]) return false;\n\t\t\t\treturn true;\n\t\t\t}) ?? ((!strict || [a, b].every((value) => Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null)) && Object.keys({\n\t\t\t\t...a,\n\t\t\t\t...b\n\t\t\t}).every((key) => compare(a[key], b[key])));\n\t\t} finally {\n\t\t\tancestors.delete(a);\n\t\t}\n\t}\n\treturn compare(a, b);\n}\n//#endregion\n//#region lib/types/string.js\n/** Uppercase the first character of a string. */\nfunction capitalize(source) {\n\treturn source.charAt(0).toUpperCase() + source.slice(1);\n}\n/** Lowercase the first character of a string. */\nfunction uncapitalize(source) {\n\treturn source.charAt(0).toLowerCase() + source.slice(1);\n}\n/** Convert dash or underscore delimited text to camelCase. */\nfunction camelCase(source) {\n\treturn source.replace(/[_-][a-z]/g, (str) => str.slice(1).toUpperCase());\n}\nfunction tokenize(source, delimiters, delimiter) {\n\tconst output = [];\n\tlet state = 0;\n\tfor (let i = 0; i < source.length; i++) {\n\t\tconst code = source.charCodeAt(i);\n\t\tif (code >= 65 && code <= 90) {\n\t\t\tif (state === 1) {\n\t\t\t\tconst next = source.charCodeAt(i + 1);\n\t\t\t\tif (next >= 97 && next <= 122) output.push(delimiter);\n\t\t\t\toutput.push(code + 32);\n\t\t\t} else {\n\t\t\t\tif (state !== 0) output.push(delimiter);\n\t\t\t\toutput.push(code + 32);\n\t\t\t}\n\t\t\tstate = 1;\n\t\t} else if (code >= 97 && code <= 122) {\n\t\t\toutput.push(code);\n\t\t\tstate = 2;\n\t\t} else if (delimiters.includes(code)) {\n\t\t\tif (state !== 0) output.push(delimiter);\n\t\t\tstate = 0;\n\t\t} else output.push(code);\n\t}\n\treturn String.fromCharCode(...output);\n}\n/** Convert text to dash-delimited parameter case. */\nfunction paramCase(source) {\n\treturn tokenize(source, [45, 95], 45);\n}\n/** Convert text to underscore-delimited snake case. */\nfunction snakeCase(source) {\n\treturn tokenize(source, [45, 95], 95);\n}\n/** Runtime alias for `camelCase`. */\nconst camelize = camelCase;\n/** Runtime alias for `paramCase`. */\nconst hyphenate = paramCase;\n/** Format a property key as a JavaScript member access suffix. */\nfunction formatProperty(key) {\n\tif (typeof key !== \"string\") return `[${key.toString()}]`;\n\treturn /^[a-z_$][\\w$]*$/i.test(key) ? `.${key}` : `[${JSON.stringify(key)}]`;\n}\n/** Remove one trailing slash from a path string. */\nfunction trimSlash(source) {\n\treturn source.replace(/\\/$/, \"\");\n}\n/** Ensure a path starts with `/` and has no trailing slash. */\nfunction sanitize(source) {\n\tif (!source.startsWith(\"/\")) source = \"/\" + source;\n\treturn trimSlash(source);\n}\n//#endregion\n//#region lib/types/time.js\n/** Time constants plus parsing and formatting helpers. */\nvar Time;\n(function(Time) {\n\tTime.millisecond = 1;\n\tTime.second = 1e3;\n\tTime.minute = Time.second * 60;\n\tTime.hour = Time.minute * 60;\n\tTime.day = Time.hour * 24;\n\tTime.week = Time.day * 7;\n\tlet timezoneOffset = (/* @__PURE__ */ new Date()).getTimezoneOffset();\n\tfunction setTimezoneOffset(offset) {\n\t\ttimezoneOffset = offset;\n\t}\n\tTime.setTimezoneOffset = setTimezoneOffset;\n\tfunction getTimezoneOffset() {\n\t\treturn timezoneOffset;\n\t}\n\tTime.getTimezoneOffset = getTimezoneOffset;\n\tfunction getDateNumber(date = /* @__PURE__ */ new Date(), offset) {\n\t\tif (typeof date === \"number\") date = new Date(date);\n\t\tif (offset === void 0) offset = timezoneOffset;\n\t\treturn Math.floor((date.valueOf() / Time.minute - offset) / 1440);\n\t}\n\tTime.getDateNumber = getDateNumber;\n\tfunction fromDateNumber(value, offset) {\n\t\tconst date = new Date(value * Time.day);\n\t\tif (offset === void 0) offset = timezoneOffset;\n\t\treturn new Date(+date + offset * Time.minute);\n\t}\n\tTime.fromDateNumber = fromDateNumber;\n\tconst numeric = /\\d+(?:\\.\\d+)?/.source;\n\tconst timeRegExp = new RegExp(`^${[\n\t\t\"w(?:eek(?:s)?)?\",\n\t\t\"d(?:ay(?:s)?)?\",\n\t\t\"h(?:our(?:s)?)?\",\n\t\t\"m(?:in(?:ute)?(?:s)?)?\",\n\t\t\"s(?:ec(?:ond)?(?:s)?)?\"\n\t].map((unit) => `(${numeric}${unit})?`).join(\"\")}$`);\n\tfunction parseTime(source) {\n\t\tconst capture = timeRegExp.exec(source);\n\t\tif (!capture) return 0;\n\t\treturn (parseFloat(capture[1]) * Time.week || 0) + (parseFloat(capture[2]) * Time.day || 0) + (parseFloat(capture[3]) * Time.hour || 0) + (parseFloat(capture[4]) * Time.minute || 0) + (parseFloat(capture[5]) * Time.second || 0);\n\t}\n\tTime.parseTime = parseTime;\n\tfunction parseDate(date) {\n\t\tconst parsed = parseTime(date);\n\t\tif (parsed) date = Date.now() + parsed;\n\t\telse if (/^\\d{1,2}(:\\d{1,2}){1,2}$/.test(date)) date = `${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${date}`;\n\t\telse if (/^\\d{1,2}-\\d{1,2}-\\d{1,2}(:\\d{1,2}){1,2}$/.test(date)) date = `${(/* @__PURE__ */ new Date()).getFullYear()}-${date}`;\n\t\treturn date ? new Date(date) : /* @__PURE__ */ new Date();\n\t}\n\tTime.parseDate = parseDate;\n\tfunction format(ms) {\n\t\tconst abs = Math.abs(ms);\n\t\tif (abs >= Time.day - Time.hour / 2) return Math.round(ms / Time.day) + \"d\";\n\t\telse if (abs >= Time.hour - Time.minute / 2) return Math.round(ms / Time.hour) + \"h\";\n\t\telse if (abs >= Time.minute - Time.second / 2) return Math.round(ms / Time.minute) + \"m\";\n\t\telse if (abs >= Time.second) return Math.round(ms / Time.second) + \"s\";\n\t\treturn ms + \"ms\";\n\t}\n\tTime.format = format;\n\tfunction toDigits(source, length = 2) {\n\t\treturn source.toString().padStart(length, \"0\");\n\t}\n\tTime.toDigits = toDigits;\n\tfunction template(template, time = /* @__PURE__ */ new Date()) {\n\t\treturn template.replace(\"yyyy\", time.getFullYear().toString()).replace(\"yy\", time.getFullYear().toString().slice(2)).replace(\"MM\", toDigits(time.getMonth() + 1)).replace(\"dd\", toDigits(time.getDate())).replace(\"hh\", toDigits(time.getHours())).replace(\"mm\", toDigits(time.getMinutes())).replace(\"ss\", toDigits(time.getSeconds())).replace(\"SSS\", toDigits(time.getMilliseconds(), 3));\n\t}\n\tTime.template = template;\n})(Time || (Time = {}));\n//#endregion\nexport { Binary, Time, arrayBufferToBase64, arrayBufferToHex, base64ToArrayBuffer, camelCase, camelize, capitalize, clone, contain, createVolatile, deduplicate, deepEqual, defineProperty, difference, filterKeys, formatProperty, hexToArrayBuffer, hyphenate, intersection, is, isNonNullable, isNullable, isPlainObject, isVolatile, makeArray, mapValues, mapValues as valueMap, noop, omit, paramCase, pick, remove, sanitize, snakeCase, trimSlash, uncapitalize, union, updateVolatile, volatileEntries };\n","import { Binary, clone, createVolatile, deepEqual, filterKeys, isNullable, isPlainObject, isVolatile, pick, valueMap } from \"@deepseek-ai/cosmokit\";\n//#region lib/types/index.js\nconst kSchema = Symbol.for(\"schemastery\");\nconst kValidationError = Symbol.for(\"ValidationError\");\nglobalThis.__schemastery_index__ ??= 0;\nglobalThis.__schemastery_refs__ = void 0;\nvar ValidationError = class extends TypeError {\n\toptions;\n\tname = \"ValidationError\";\n\tconstructor(message, options) {\n\t\tlet prefix = \"$\";\n\t\tfor (const segment of options.path || []) if (typeof segment === \"string\") prefix += \".\" + segment;\n\t\telse if (typeof segment === \"number\") prefix += \"[\" + segment + \"]\";\n\t\telse if (typeof segment === \"symbol\") prefix += `[Symbol(${segment.toString()})]`;\n\t\tif (prefix.startsWith(\".\")) prefix = prefix.slice(1);\n\t\tsuper((prefix === \"$\" ? \"\" : `${prefix} `) + message);\n\t\tthis.options = options;\n\t}\n\tstatic is(error) {\n\t\treturn !!error?.[kValidationError];\n\t}\n};\nObject.defineProperty(ValidationError.prototype, kValidationError, { value: true });\nconst Schema = function(options) {\n\tconst schema = function(data, options = {}) {\n\t\treturn Schema.resolve(data, schema, options)[0];\n\t};\n\tif (options.refs) {\n\t\tconst refs = valueMap(options.refs, (options) => new Schema(options));\n\t\tconst getRef = (uid) => refs[uid];\n\t\tfor (const key in refs) {\n\t\t\tconst options = refs[key];\n\t\t\toptions.sKey = getRef(options.sKey);\n\t\t\toptions.inner = getRef(options.inner);\n\t\t\toptions.list = options.list && options.list.map(getRef);\n\t\t\toptions.dict = options.dict && valueMap(options.dict, getRef);\n\t\t}\n\t\treturn refs[options.uid];\n\t}\n\tObject.assign(schema, options);\n\tif (typeof schema.callback === \"string\") try {\n\t\tschema.callback = new Function(\"return \" + schema.callback)();\n\t} catch {}\n\tObject.defineProperty(schema, \"uid\", { value: globalThis.__schemastery_index__++ });\n\tObject.setPrototypeOf(schema, Schema.prototype);\n\tschema.meta ||= {};\n\tschema.toString = schema.toString.bind(schema);\n\treturn schema;\n};\nSchema.prototype = Object.create(Function.prototype);\nSchema.prototype[kSchema] = true;\nObject.defineProperty(Schema.prototype, \"~standard\", { get() {\n\treturn {\n\t\tversion: 1,\n\t\tvendor: \"schemastery\",\n\t\tvalidate: (value) => {\n\t\t\ttry {\n\t\t\t\treturn { value: Schema.resolve(value, this, {})[0] };\n\t\t\t} catch (error) {\n\t\t\t\tif (ValidationError.is(error)) return { issues: [{\n\t\t\t\t\tmessage: error.message,\n\t\t\t\t\tpath: error.options.path\n\t\t\t\t}] };\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t};\n} });\nSchema.ValidationError = ValidationError;\nSchema.prototype.toJSON = function toJSON() {\n\tif (globalThis.__schemastery_refs__) {\n\t\tglobalThis.__schemastery_refs__[this.uid] ??= JSON.parse(JSON.stringify({ ...this }));\n\t\treturn this.uid;\n\t}\n\tglobalThis.__schemastery_refs__ = { [this.uid]: { ...this } };\n\tglobalThis.__schemastery_refs__[this.uid] = JSON.parse(JSON.stringify({ ...this }));\n\tconst result = {\n\t\tuid: this.uid,\n\t\trefs: globalThis.__schemastery_refs__\n\t};\n\tglobalThis.__schemastery_refs__ = void 0;\n\treturn result;\n};\nSchema.prototype.set = function set(key, value) {\n\tthis.dict[key] = value;\n\treturn this;\n};\nSchema.prototype.push = function push(value) {\n\tthis.list.push(value);\n\treturn this;\n};\nfunction mergeDesc(original, messages) {\n\tconst result = typeof original === \"string\" ? { \"\": original } : { ...original };\n\tfor (const locale in messages) {\n\t\tconst value = messages[locale];\n\t\tif (value?.$description || value?.$desc) result[locale] = value.$description || value.$desc;\n\t\telse if (typeof value === \"string\") result[locale] = value;\n\t}\n\treturn result;\n}\nfunction getInner(value) {\n\treturn value?.$value ?? value?.$inner;\n}\nfunction extractKeys(data) {\n\treturn filterKeys(data ?? {}, (key) => !key.startsWith(\"$\"));\n}\nSchema.prototype.i18n = function i18n(messages) {\n\tconst schema = Schema(this);\n\tconst desc = mergeDesc(schema.meta.description, messages);\n\tif (Object.keys(desc).length) schema.meta.description = desc;\n\tif (schema.dict) schema.dict = valueMap(schema.dict, (inner, key) => {\n\t\treturn inner.i18n(valueMap(messages, (data) => getInner(data)?.[key] ?? data?.[key]));\n\t});\n\tif (schema.list) schema.list = schema.list.map((inner, index) => {\n\t\treturn inner.i18n(valueMap(messages, (data = {}) => {\n\t\t\tif (Array.isArray(getInner(data))) return getInner(data)[index];\n\t\t\tif (Array.isArray(data)) return data[index];\n\t\t\treturn extractKeys(data);\n\t\t}));\n\t});\n\tif (schema.inner) schema.inner = schema.inner.i18n(valueMap(messages, (data) => {\n\t\tif (getInner(data)) return getInner(data);\n\t\treturn extractKeys(data);\n\t}));\n\tif (schema.sKey) schema.sKey = schema.sKey.i18n(valueMap(messages, (data) => data?.$key));\n\treturn schema;\n};\nSchema.prototype.extra = function extra(key, value) {\n\tconst schema = Schema(this);\n\tschema.meta = {\n\t\t...schema.meta,\n\t\t[key]: value\n\t};\n\treturn schema;\n};\nfor (const key of [\n\t\"required\",\n\t\"disabled\",\n\t\"collapse\",\n\t\"hidden\",\n\t\"loose\"\n]) Object.assign(Schema.prototype, { [key](value = true) {\n\tconst schema = Schema(this);\n\tschema.meta = {\n\t\t...schema.meta,\n\t\t[key]: value\n\t};\n\treturn schema;\n} });\nSchema.prototype.deprecated = function deprecated() {\n\tconst schema = Schema(this);\n\tschema.meta.badges ||= [];\n\tschema.meta.badges.push({\n\t\ttext: \"deprecated\",\n\t\ttype: \"danger\"\n\t});\n\treturn schema;\n};\nSchema.prototype.experimental = function experimental() {\n\tconst schema = Schema(this);\n\tschema.meta.badges ||= [];\n\tschema.meta.badges.push({\n\t\ttext: \"experimental\",\n\t\ttype: \"warning\"\n\t});\n\treturn schema;\n};\nSchema.prototype.pattern = function pattern(regexp) {\n\tconst schema = Schema(this);\n\tconst pattern = pick(regexp, [\"source\", \"flags\"]);\n\tschema.meta = {\n\t\t...schema.meta,\n\t\tpattern\n\t};\n\treturn schema;\n};\nSchema.prototype.simplify = function simplify(value) {\n\tif (isVolatile(value)) value = value.get();\n\tif (deepEqual(value, this.meta.default, this.type === \"dict\")) return null;\n\tif (isNullable(value)) return value;\n\tif (this.type === \"object\" || this.type === \"dict\") {\n\t\tconst result = {};\n\t\tfor (const key in value) {\n\t\t\tconst item = (this.type === \"object\" ? this.dict[key] : this.inner)?.simplify(value[key]);\n\t\t\tif (this.type === \"dict\" || !isNullable(item)) result[key] = item;\n\t\t}\n\t\tif (deepEqual(result, this.meta.default, this.type === \"dict\")) return null;\n\t\treturn result;\n\t} else if (this.type === \"array\" || this.type === \"tuple\") {\n\t\tconst result = [];\n\t\tvalue.forEach((value, index) => {\n\t\t\tconst schema = this.type === \"array\" ? this.inner : this.list[index];\n\t\t\tconst item = schema ? schema.simplify(value) : value;\n\t\t\tresult.push(item);\n\t\t});\n\t\treturn result;\n\t} else if (this.type === \"intersect\") {\n\t\tconst result = {};\n\t\tfor (const item of this.list) Object.assign(result, item.simplify(value));\n\t\treturn result;\n\t} else if (this.type === \"union\") for (const schema of this.list) try {\n\t\tSchema.resolve(value, schema, {});\n\t\treturn schema.simplify(value);\n\t} catch {}\n\treturn value;\n};\nSchema.prototype.toString = function toString(inline) {\n\treturn formatters[this.type]?.(this, inline) ?? `Schema<${this.type}>`;\n};\nSchema.prototype.role = function role(role, extra) {\n\tconst schema = Schema(this);\n\tschema.meta = {\n\t\t...schema.meta,\n\t\trole,\n\t\textra\n\t};\n\treturn schema;\n};\nfor (const key of [\n\t\"default\",\n\t\"link\",\n\t\"comment\",\n\t\"description\",\n\t\"max\",\n\t\"min\",\n\t\"step\"\n]) Object.assign(Schema.prototype, { [key](value) {\n\tconst schema = Schema(this);\n\tschema.meta = {\n\t\t...schema.meta,\n\t\t[key]: value\n\t};\n\treturn schema;\n} });\nSchema.prototype.volatile = function volatile() {\n\tif (this.meta.volatile) throw new TypeError(\"volatile schema is already wrapped\");\n\treturn this.extra(\"volatile\", true);\n};\nconst resolvers = {};\nconst checkedVolatile = Symbol(\"checked-volatile-schema\");\nfunction validateVolatileSchema(schema, path = [], blocked = false, seen = /* @__PURE__ */ new Map()) {\n\tconst states = seen.get(schema) ?? /* @__PURE__ */ new Set();\n\tif (states.has(blocked)) return;\n\tstates.add(blocked);\n\tseen.set(schema, states);\n\tif (schema.meta?.volatile && blocked) throw new ValidationError(\"volatile fields require a fixed object path without an enclosing volatile field\", { path });\n\tconst nested = blocked || !!schema.meta?.volatile;\n\tif (schema.dict) for (const [key, child] of Object.entries(schema.dict)) validateVolatileSchema(child, [...path, key], nested, seen);\n\tif (schema.sKey) validateVolatileSchema(schema.sKey, [...path, \"<key>\"], true, seen);\n\tif (schema.inner && (schema.type !== \"lazy\" || schema.inner[kSchema])) validateVolatileSchema(schema.inner, [...path, \"*\"], true, seen);\n\tif (schema.list) for (let index = 0; index < schema.list.length; index++) validateVolatileSchema(schema.list[index], [...path, String(index)], true, seen);\n}\nSchema.extend = function extend(type, resolve) {\n\tresolvers[type] = resolve;\n};\nSchema.resolve = function resolve(data, schema, options = {}, strict = false) {\n\tif (!schema) return [data];\n\tif (!options[checkedVolatile]) {\n\t\tvalidateVolatileSchema(schema, options.path);\n\t\toptions = {\n\t\t\t...options,\n\t\t\t[checkedVolatile]: true\n\t\t};\n\t}\n\tif (schema.meta?.volatile) {\n\t\tconst inner = Schema(schema);\n\t\tinner.meta = {\n\t\t\t...schema.meta,\n\t\t\tvolatile: false\n\t\t};\n\t\tconst [value, adapted] = Schema.resolve(data, inner, options, strict);\n\t\ttry {\n\t\t\treturn [createVolatile(value), adapted];\n\t\t} catch (error) {\n\t\t\tthrow new ValidationError(error instanceof Error ? error.message : String(error), options);\n\t\t}\n\t}\n\tif (options.ignore?.(data, schema)) return [data];\n\tif (isNullable(data) && schema.type !== \"lazy\") {\n\t\tif (schema.meta.required) throw new ValidationError(`missing required value`, options);\n\t\tlet current = schema;\n\t\tlet fallback = schema.meta.default;\n\t\twhile (current?.type === \"intersect\" && isNullable(fallback)) {\n\t\t\tcurrent = current.list[0];\n\t\t\tfallback = current?.meta.default;\n\t\t}\n\t\tif (isNullable(fallback)) return [data];\n\t\tdata = clone(fallback);\n\t}\n\tconst callback = resolvers[schema.type];\n\tif (!callback) throw new ValidationError(`unsupported type \"${schema.type}\"`, options);\n\ttry {\n\t\treturn callback(data, schema, options, strict);\n\t} catch (error) {\n\t\tif (!schema.meta.loose) throw error;\n\t\treturn [schema.meta.default];\n\t}\n};\nSchema.from = function from(source) {\n\tif (isNullable(source)) return Schema.any();\n\telse if ([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"boolean\"\n\t].includes(typeof source)) return Schema.const(source).required();\n\telse if (source[kSchema]) return source;\n\telse if (typeof source === \"function\") switch (source) {\n\t\tcase String: return Schema.string().required();\n\t\tcase Number: return Schema.number().required();\n\t\tcase Boolean: return Schema.boolean().required();\n\t\tcase Function: return Schema.function().required();\n\t\tdefault: return Schema.is(source).required();\n\t}\n\telse throw new TypeError(`cannot infer schema from ${source}`);\n};\nSchema.lazy = function lazy(builder) {\n\tconst toJSON = () => {\n\t\tif (!schema.inner[kSchema]) {\n\t\t\tschema.inner = schema.builder();\n\t\t\tschema.inner.meta = {\n\t\t\t\t...schema.meta,\n\t\t\t\t...schema.inner.meta\n\t\t\t};\n\t\t}\n\t\treturn schema.inner.toJSON();\n\t};\n\tconst schema = new Schema({\n\t\ttype: \"lazy\",\n\t\tbuilder,\n\t\tinner: { toJSON }\n\t});\n\treturn schema;\n};\nSchema.natural = function natural() {\n\treturn Schema.number().step(1).min(0);\n};\nSchema.percent = function percent() {\n\treturn Schema.number().step(.01).min(0).max(1).role(\"slider\");\n};\nSchema.date = function date() {\n\treturn Schema.union([Schema.is(Date), Schema.transform(Schema.string().role(\"datetime\"), (value, options) => {\n\t\tconst date = new Date(value);\n\t\tif (isNaN(+date)) throw new ValidationError(`invalid date \"${value}\"`, options);\n\t\treturn date;\n\t}, true)]);\n};\nSchema.regExp = function regExp(flag = \"\") {\n\treturn Schema.union([Schema.is(RegExp), Schema.transform(Schema.string().role(\"regexp\", { flag }), (value, options) => {\n\t\ttry {\n\t\t\treturn new RegExp(value, flag);\n\t\t} catch (e) {\n\t\t\tthrow new ValidationError(e.message, options);\n\t\t}\n\t}, true)]);\n};\nSchema.arrayBuffer = function arrayBuffer(encoding) {\n\treturn Schema.union([\n\t\tSchema.is(ArrayBuffer),\n\t\tSchema.is(SharedArrayBuffer),\n\t\tSchema.transform(Schema.any(), (value, options) => {\n\t\t\tif (Binary.isSource(value)) return Binary.fromSource(value);\n\t\t\tthrow new ValidationError(`expected ArrayBufferSource but got ${value}`, options);\n\t\t}, true),\n\t\t...encoding ? [Schema.transform(Schema.string(), (value, options) => {\n\t\t\ttry {\n\t\t\t\treturn encoding === \"base64\" ? Binary.fromBase64(value) : Binary.fromHex(value);\n\t\t\t} catch (e) {\n\t\t\t\tthrow new ValidationError(e.message, options);\n\t\t\t}\n\t\t}, true)] : []\n\t]);\n};\nSchema.extend(\"lazy\", (data, schema, options, strict) => {\n\tif (!schema.inner[kSchema]) {\n\t\tschema.inner = schema.builder();\n\t\tschema.inner.meta = {\n\t\t\t...schema.meta,\n\t\t\t...schema.inner.meta\n\t\t};\n\t\tvalidateVolatileSchema(schema.inner, options.path, true);\n\t}\n\treturn Schema.resolve(data, schema.inner, options, strict);\n});\nSchema.extend(\"any\", (data) => {\n\treturn [data];\n});\nSchema.extend(\"never\", (data, _, options) => {\n\tthrow new ValidationError(`expected nullable but got ${data}`, options);\n});\nSchema.extend(\"const\", (data, { value }, options) => {\n\tif (deepEqual(data, value)) return [value];\n\tthrow new ValidationError(`expected ${value} but got ${data}`, options);\n});\nfunction checkWithinRange(data, meta, description, options, skipMin = false) {\n\tconst { max = Infinity, min = -Infinity } = meta;\n\tif (data > max) throw new ValidationError(`expected ${description} <= ${max} but got ${data}`, options);\n\tif (data < min && !skipMin) throw new ValidationError(`expected ${description} >= ${min} but got ${data}`, options);\n}\nSchema.extend(\"string\", (data, { meta }, options) => {\n\tif (typeof data !== \"string\") throw new ValidationError(`expected string but got ${data}`, options);\n\tif (meta.pattern) {\n\t\tconst regexp = new RegExp(meta.pattern.source, meta.pattern.flags);\n\t\tif (!regexp.test(data)) throw new ValidationError(`expect string to match regexp ${regexp}`, options);\n\t}\n\tcheckWithinRange(data.length, meta, \"string length\", options);\n\treturn [data];\n});\nfunction decimalShift(data, digits) {\n\tconst str = data.toString();\n\tif (str.includes(\"e\")) return data * Math.pow(10, digits);\n\tconst index = str.indexOf(\".\");\n\tif (index === -1) return data * Math.pow(10, digits);\n\tconst frac = str.slice(index + 1);\n\tconst integer = str.slice(0, index);\n\tif (frac.length <= digits) return +(integer + frac.padEnd(digits, \"0\"));\n\treturn +(integer + frac.slice(0, digits) + \".\" + frac.slice(digits));\n}\nfunction isMultipleOf(data, min, step) {\n\tstep = Math.abs(step);\n\tif (!/^\\d+\\.\\d+$/.test(step.toString())) return (data - min) % step === 0;\n\tconst index = step.toString().indexOf(\".\");\n\tconst digits = step.toString().slice(index + 1).length;\n\treturn Math.abs(decimalShift(data, digits) - decimalShift(min, digits)) % decimalShift(step, digits) === 0;\n}\nSchema.extend(\"number\", (data, { meta }, options) => {\n\tif (typeof data !== \"number\") throw new ValidationError(`expected number but got ${data}`, options);\n\tcheckWithinRange(data, meta, \"number\", options);\n\tconst { step } = meta;\n\tif (step && !isMultipleOf(data, meta.min ?? 0, step)) throw new ValidationError(`expected number multiple of ${step} but got ${data}`, options);\n\treturn [data];\n});\nSchema.extend(\"boolean\", (data, _, options) => {\n\tif (typeof data === \"boolean\") return [data];\n\tthrow new ValidationError(`expected boolean but got ${data}`, options);\n});\nSchema.extend(\"bitset\", (data, { bits, meta }, options) => {\n\tlet value = 0, keys = [];\n\tif (typeof data === \"number\") {\n\t\tvalue = data;\n\t\tfor (const key in bits) if (data & bits[key]) keys.push(key);\n\t} else if (Array.isArray(data)) {\n\t\tkeys = data;\n\t\tfor (const key of keys) {\n\t\t\tif (typeof key !== \"string\") throw new ValidationError(`expected string but got ${key}`, options);\n\t\t\tif (key in bits) value |= bits[key];\n\t\t}\n\t} else throw new ValidationError(`expected number or array but got ${data}`, options);\n\tif (value === meta.default) return [value];\n\treturn [value, keys];\n});\nSchema.extend(\"function\", (data, _, options) => {\n\tif (typeof data === \"function\") return [data];\n\tthrow new ValidationError(`expected function but got ${data}`, options);\n});\nSchema.extend(\"is\", (data, { constructor }, options) => {\n\tif (typeof constructor === \"function\") {\n\t\tif (data instanceof constructor) return [data];\n\t\tthrow new ValidationError(`expected ${constructor.name} but got ${data}`, options);\n\t} else {\n\t\tif (isNullable(data)) throw new ValidationError(`expected ${constructor} but got ${data}`, options);\n\t\tlet prototype = Object.getPrototypeOf(data);\n\t\twhile (prototype) {\n\t\t\tif (prototype.constructor?.name === constructor) return [data];\n\t\t\tprototype = Object.getPrototypeOf(prototype);\n\t\t}\n\t\tthrow new ValidationError(`expected ${constructor} but got ${data}`, options);\n\t}\n});\nfunction property(data, key, schema, options) {\n\ttry {\n\t\tconst [value, adapted] = Schema.resolve(data[key], schema, {\n\t\t\t...options,\n\t\t\tpath: [...options.path || [], key]\n\t\t});\n\t\tif (adapted !== void 0) data[key] = adapted;\n\t\treturn value;\n\t} catch (e) {\n\t\tif (!options?.autofix) throw e;\n\t\tdelete data[key];\n\t\treturn schema.meta.volatile ? createVolatile(schema.meta.default) : schema.meta.default;\n\t}\n}\nSchema.extend(\"array\", (data, { inner, meta }, options) => {\n\tif (!Array.isArray(data)) throw new ValidationError(`expected array but got ${data}`, options);\n\tcheckWithinRange(data.length, meta, \"array length\", options, !isNullable(inner.meta.default));\n\treturn [data.map((_, index) => property(data, index, inner, options))];\n});\nSchema.extend(\"dict\", (data, { inner, sKey }, options, strict) => {\n\tif (!isPlainObject(data)) throw new ValidationError(`expected object but got ${data}`, options);\n\tconst result = {};\n\tfor (const key in data) {\n\t\tlet rKey;\n\t\ttry {\n\t\t\trKey = Schema.resolve(key, sKey, options)[0];\n\t\t} catch (error) {\n\t\t\tif (strict) continue;\n\t\t\tthrow error;\n\t\t}\n\t\tresult[rKey] = property(data, key, inner, options);\n\t\tdata[rKey] = data[key];\n\t\tif (key !== rKey) delete data[key];\n\t}\n\treturn [result];\n});\nSchema.extend(\"tuple\", (data, { list }, options, strict) => {\n\tif (!Array.isArray(data)) throw new ValidationError(`expected array but got ${data}`, options);\n\tconst result = list.map((inner, index) => property(data, index, inner, options));\n\tif (strict) return [result];\n\tresult.push(...data.slice(list.length));\n\treturn [result];\n});\nfunction merge(result, data) {\n\tfor (const key in data) {\n\t\tif (key in result) continue;\n\t\tresult[key] = data[key];\n\t}\n}\nSchema.extend(\"object\", (data, { dict }, options, strict) => {\n\tif (!isPlainObject(data)) throw new ValidationError(`expected object but got ${data}`, options);\n\tconst result = {};\n\tfor (const key in dict) {\n\t\tconst value = property(data, key, dict[key], options);\n\t\tif (!isNullable(value) || key in data) result[key] = value;\n\t}\n\tif (!strict) merge(result, data);\n\treturn [result];\n});\nSchema.extend(\"union\", (data, { list, toString }, options, strict) => {\n\tconst messages = [];\n\tfor (const inner of list) try {\n\t\treturn Schema.resolve(data, inner, options, strict);\n\t} catch (error) {\n\t\tmessages.push(error);\n\t}\n\tthrow new ValidationError(`expected ${toString()} but got ${JSON.stringify(data)}`, options);\n});\nSchema.extend(\"intersect\", (data, { list, toString }, options, strict) => {\n\tif (!list.length) return [data];\n\tlet result;\n\tfor (const inner of list) {\n\t\tconst value = Schema.resolve(data, inner, options, true)[0];\n\t\tif (isNullable(value)) continue;\n\t\tif (isNullable(result)) result = value;\n\t\telse if (typeof result !== typeof value) throw new ValidationError(`expected ${toString()} but got ${JSON.stringify(data)}`, options);\n\t\telse if (typeof value === \"object\") merge(result ??= {}, value);\n\t\telse if (result !== value) throw new ValidationError(`expected ${toString()} but got ${JSON.stringify(data)}`, options);\n\t}\n\tif (!strict && isPlainObject(data)) merge(result, data);\n\treturn [result];\n});\nSchema.extend(\"transform\", (data, { inner, callback, preserve }, options) => {\n\tconst [result, adapted = data] = Schema.resolve(data, inner, options, true);\n\tif (preserve) return [callback(result)];\n\telse return [callback(result), callback(adapted)];\n});\nconst formatters = {};\nfunction defineMethod(name, keys, format) {\n\tformatters[name] = format;\n\tObject.assign(Schema, { [name](...args) {\n\t\tconst schema = new Schema({ type: name });\n\t\tkeys.forEach((key, index) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase \"sKey\":\n\t\t\t\t\tschema.sKey = args[index] ?? Schema.string();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"inner\":\n\t\t\t\t\tschema.inner = Schema.from(args[index]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"list\":\n\t\t\t\t\tschema.list = args[index].map(Schema.from);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"dict\":\n\t\t\t\t\tschema.dict = valueMap(args[index], Schema.from);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"bits\":\n\t\t\t\t\tschema.bits = {};\n\t\t\t\t\tfor (const key in args[index]) {\n\t\t\t\t\t\tif (typeof args[index][key] !== \"number\") continue;\n\t\t\t\t\t\tschema.bits[key] = args[index][key];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"callback\": {\n\t\t\t\t\tconst callback = schema.callback = args[index];\n\t\t\t\t\tcallback[\"toJSON\"] ||= () => callback.toString();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"constructor\": {\n\t\t\t\t\tconst constructor = schema.constructor = args[index];\n\t\t\t\t\tif (typeof constructor === \"function\") constructor[\"toJSON\"] ||= () => constructor[\"name\"];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: schema[key] = args[index];\n\t\t\t}\n\t\t});\n\t\tif (name === \"object\" || name === \"dict\") schema.meta.default = {};\n\t\telse if (name === \"array\" || name === \"tuple\") schema.meta.default = [];\n\t\telse if (name === \"bitset\") schema.meta.default = 0;\n\t\treturn schema;\n\t} });\n}\ndefineMethod(\"is\", [\"constructor\"], ({ constructor }) => {\n\tif (typeof constructor === \"function\") return constructor.name;\n\telse return constructor;\n});\ndefineMethod(\"any\", [], () => \"any\");\ndefineMethod(\"never\", [], () => \"never\");\ndefineMethod(\"const\", [\"value\"], ({ value }) => typeof value === \"string\" ? JSON.stringify(value) : value);\ndefineMethod(\"string\", [], () => \"string\");\ndefineMethod(\"number\", [], () => \"number\");\ndefineMethod(\"boolean\", [], () => \"boolean\");\ndefineMethod(\"bitset\", [\"bits\"], () => \"bitset\");\ndefineMethod(\"function\", [], () => \"function\");\ndefineMethod(\"array\", [\"inner\"], ({ inner }) => `${inner.toString(true)}[]`);\ndefineMethod(\"dict\", [\"inner\", \"sKey\"], ({ inner, sKey }) => `{ [key: ${sKey.toString()}]: ${inner.toString()} }`);\ndefineMethod(\"tuple\", [\"list\"], ({ list }) => `[${list.map((inner) => inner.toString()).join(\", \")}]`);\ndefineMethod(\"object\", [\"dict\"], ({ dict }) => {\n\tif (Object.keys(dict).length === 0) return \"{}\";\n\treturn `{ ${Object.entries(dict).map(([key, inner]) => {\n\t\treturn `${key}${inner.meta.required ? \"\" : \"?\"}: ${inner.toString()}`;\n\t}).join(\", \")} }`;\n});\ndefineMethod(\"union\", [\"list\"], ({ list }, inline) => {\n\tconst result = list.map(({ toString: format }) => format()).join(\" | \");\n\treturn inline ? `(${result})` : result;\n});\ndefineMethod(\"intersect\", [\"list\"], ({ list }) => {\n\treturn `${list.map((inner) => inner.toString(true)).join(\" & \")}`;\n});\ndefineMethod(\"transform\", [\n\t\"inner\",\n\t\"callback\",\n\t\"preserve\"\n], ({ inner }, isInner) => inner.toString(isInner));\n//#endregion\nexport { Schema as default };\n","//#region lib/types/index.js\n/**\n* Shared timeout arithmetic, signal fusion, and classification. The library\n* only notifies through abort signals; each capability still owns the mechanism\n* that stops its work and translates timeout reasons into public outcomes.\n* @module @deepseek-ai/dsh-timeout\n*/\n/**\n* Internal abort reason carrying a capability-owned code and elapsed deadline.\n* Providers translate it through {@link timeoutOf} before returning to callers.\n*/\nvar TimeoutReason = class extends Error {\n\tcode;\n\ttimeoutMs;\n\tname = \"TimeoutReason\";\n\t/**\n\t* @param code Capability-owned timeout code (e.g. `BASH_TIMEOUT`).\n\t* @param timeoutMs The deadline that elapsed, in milliseconds.\n\t*/\n\tconstructor(code, timeoutMs) {\n\t\tsuper(`${code} after ${timeoutMs}ms`);\n\t\tthis.code = code;\n\t\tthis.timeoutMs = timeoutMs;\n\t}\n};\n/** Largest delay Node schedules without clamping it to one millisecond. */\nconst MAX_TIMER_DELAY_MS = 2147483647;\nfunction assertTimerDelay(timeoutMs, name) {\n\tif (!Number.isFinite(timeoutMs) || timeoutMs <= 0 || timeoutMs > 2147483647) throw new Error(`${name} must be a positive finite number no greater than ${MAX_TIMER_DELAY_MS}`);\n}\n/**\n* Validate a caller's optional timeout hint, use the backend default, then cap\n* it. Supplied values must be positive and finite; zero is not a public\n* disable-timeout sentinel.\n*\n* @param requested The caller's optional hint; validated when present.\n* @param def The backend default applied when `requested` is absent.\n* @param max The backend upper bound the result is capped to.\n* @param name Field name used in the thrown message (so the caller sees which input was\n* bad).\n* @returns The effective timeout in milliseconds: `min(requested ?? def, max)`.\n*/\nfunction clampTimeout(requested, def, max, name = \"timeoutMs\") {\n\tif (requested !== void 0 && (!Number.isFinite(requested) || requested <= 0)) throw new Error(`${name} must be a positive finite number`);\n\treturn Math.min(requested ?? def, max);\n}\n/**\n* Fuse upstream cancellation with an identifiable timeout. `timeoutMs <= 0` is\n* the internal no-timer sentinel; the returned disposer clears an armed timer.\n* The signal only notifies, so callers must stop their own work.\n*\n* @param upstream The caller's cancellation signal, if any, fused into the result.\n* @param timeoutMs Deadline in milliseconds; `<= 0` means \"no timeout\" (arm no timer).\n* @param code Capability-owned code stamped onto the timeout's {@link TimeoutReason}.\n* @returns The fused {@link Deadline} (signal + timer cleanup).\n*/\nfunction deadline(upstream, timeoutMs, code) {\n\tif (timeoutMs <= 0) return {\n\t\tsignal: upstream ?? new AbortController().signal,\n\t\t[Symbol.dispose]() {}\n\t};\n\tassertTimerDelay(timeoutMs, \"deadline timeoutMs\");\n\tconst timer = new AbortController();\n\tconst id = setTimeout(() => {\n\t\ttimer.abort(new TimeoutReason(code, timeoutMs));\n\t}, timeoutMs);\n\treturn {\n\t\tsignal: upstream !== void 0 ? AbortSignal.any([upstream, timer.signal]) : timer.signal,\n\t\t[Symbol.dispose]() {\n\t\t\tclearTimeout(id);\n\t\t}\n\t};\n}\n/**\n* Create a rearmable idle watchdog for an async iterator. The timer exists only\n* while {@link IdleWatchdog.next} is outstanding, so consumer think time does\n* not count as provider idle time. The returned signal is stable for the whole\n* call and only notifies; the iterator must observe it to release the resources\n* of a demand the deadline abandoned.\n*\n* @param upstream - caller cancellation fused into the stable signal.\n* @param timeoutMs - positive finite idle interval in milliseconds.\n* @param code - capability-owned code carried by the timeout reason.\n* @returns a stable signal, guarded next operation, and timer disposer.\n*/\nfunction idleWatchdog(upstream, timeoutMs, code) {\n\tassertTimerDelay(timeoutMs, \"idleWatchdog timeoutMs\");\n\tconst timeout = new AbortController();\n\tconst signal = upstream === void 0 ? timeout.signal : AbortSignal.any([upstream, timeout.signal]);\n\tconst reason = new TimeoutReason(code, timeoutMs);\n\tlet timer;\n\tlet outstanding = false;\n\tlet disposed = false;\n\tconst arm = () => {\n\t\tif (timer !== void 0) clearTimeout(timer);\n\t\ttimer = setTimeout(() => {\n\t\t\ttimeout.abort(reason);\n\t\t}, timeoutMs);\n\t};\n\treturn {\n\t\tsignal,\n\t\tasync next(iterator) {\n\t\t\tif (disposed) throw new Error(\"idleWatchdog is disposed\");\n\t\t\tif (outstanding) throw new Error(\"idleWatchdog next is already outstanding\");\n\t\t\toutstanding = true;\n\t\t\tarm();\n\t\t\tconst expired = Promise.withResolvers();\n\t\t\tconst onAbort = () => {\n\t\t\t\texpired.reject(reason);\n\t\t\t};\n\t\t\ttimeout.signal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\ttry {\n\t\t\t\treturn await Promise.race([iterator.next().finally(() => {\n\t\t\t\t\ttimeout.signal.removeEventListener(\"abort\", onAbort);\n\t\t\t\t}), expired.promise]);\n\t\t\t} finally {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = void 0;\n\t\t\t\toutstanding = false;\n\t\t\t}\n\t\t},\n\t\tpulse() {\n\t\t\tif (disposed || !outstanding) return;\n\t\t\tarm();\n\t\t},\n\t\t[Symbol.dispose]() {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tif (timer !== void 0) clearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t};\n}\n/**\n* Recover a timeout reason from a reason-bearing object. Supplying `code`\n* distinguishes this deadline from a nested upstream deadline; a foreign code\n* follows the ordinary cancellation path.\n*\n* @param x An {@link AbortSignal} or any `{ reason }` carrier (e.g. a caught abort error).\n* @param code When provided, only a {@link TimeoutReason} with this exact `code` matches.\n* @returns The matching {@link TimeoutReason}, else `undefined`.\n*/\nfunction timeoutOf(x, code) {\n\tconst reason = x.reason;\n\tif (!(reason instanceof TimeoutReason)) return void 0;\n\treturn code === void 0 || reason.code === code ? reason : void 0;\n}\n//#endregion\nexport { MAX_TIMER_DELAY_MS, TimeoutReason, clampTimeout, deadline, idleWatchdog, timeoutOf };\n","import { createRequire } from \"node:module\";\nimport { Remote, RemoteError, TypertRemoteService } from \"@deepseek-ai/dsh-typert-protocol\";\nimport { assertNever, deepFreeze, snapshotJsonValue } from \"@deepseek-ai/dsh-util-values\";\nimport { randomUUID } from \"@deepseek-ai/dsh-util-crypto\";\nimport { brandString } from \"@deepseek-ai/dsh-brand\";\nimport z from \"@deepseek-ai/schemastery\";\nimport { MAX_TIMER_DELAY_MS } from \"@deepseek-ai/dsh-timeout\";\n//#region lib/types/message.js\n/** Message value types, identity, and immutable construction helpers. */\n/**\n* Bound for a `notice` summary. Producers commit the one-line account to the\n* durable log; its inputs — task labels, goal objectives, tool arguments —\n* are caller text with no length of their own.\n*/\nconst CONTEXT_SUMMARY_MAX_CHARS = 120;\n/**\n* Bound one `notice` summary to {@link CONTEXT_SUMMARY_MAX_CHARS}.\n* @param summary - the producer's one-line account, of any length.\n* @returns the account, ellipsized when it exceeds the bound.\n*/\nfunction boundContextSummary(summary) {\n\treturn summary.length <= 120 ? summary : `${summary.slice(0, 119)}…`;\n}\n/**\n* Detach and deep-freeze a message whose identity already exists.\n* @param message - complete message, including its stable identity.\n* @returns an immutable snapshot that preserves the identity.\n*/\nfunction freezeMessage(message) {\n\treturn deepFreeze(structuredClone(message));\n}\n/**\n* Create one identified message and freeze it before publication.\n* @param input - complete role, content, and source for a new message.\n* @returns an immutable message with a fresh stable identity.\n*/\nfunction createMessage(input) {\n\treturn deepFreeze(structuredClone({\n\t\t...input,\n\t\tid: brandString(randomUUID())\n\t}));\n}\n/**\n* Create an identified, immutable developer message.\n* @param input - content and producer source for the new message.\n* @returns a detached developer message with a fresh identity.\n*/\nfunction createDeveloperMessage(input) {\n\treturn createMessage({\n\t\t...input,\n\t\trole: \"developer\"\n\t});\n}\n/**\n* Create one identified user-role message and freeze it before publication.\n* @param input - complete content and source for a new user message.\n* @returns an immutable user message with a fresh stable identity.\n*/\nfunction createUserMessage(input) {\n\treturn createMessage({\n\t\t...input,\n\t\trole: \"user\"\n\t});\n}\n/**\n* Create one identified model-produced assistant message and freeze it before publication.\n* @param input - complete content plus the provider, model, and optional replay state for a new assistant message.\n* @returns an immutable assistant message with fixed role/source tags and a fresh stable identity.\n*/\nfunction createAssistantMessage(input) {\n\treturn createMessage({\n\t\trole: \"assistant\",\n\t\tcontent: input.content,\n\t\tsource: {\n\t\t\tkind: \"model\",\n\t\t\t...input.source\n\t\t}\n\t});\n}\n/**\n* Create and freeze one identified system-role message holding a rendered\n* system prompt.\n* @param text - the complete rendered prompt; `''` records \"no system prompt\".\n* @returns an immutable system message with a fresh stable identity.\n*/\nfunction createSystemMessage(text) {\n\treturn createMessage({\n\t\trole: \"system\",\n\t\tcontent: text.length === 0 ? [] : [{\n\t\t\ttype: \"text\",\n\t\t\ttext\n\t\t}],\n\t\tsource: { kind: \"system-prompt\" }\n\t});\n}\n/**\n* Create and freeze one identified tool-result message.\n* @param input - call identity, raw result blocks, and outcome.\n* @returns an immutable tool-role message that answers the tool call.\n*/\nfunction createToolResultMessage(input) {\n\treturn createMessage({\n\t\trole: \"tool\",\n\t\tsource: {\n\t\t\tkind: \"tool\",\n\t\t\tcallId: input.callId\n\t\t},\n\t\ttoolCallId: input.callId,\n\t\tcontent: input.content,\n\t\tisError: input.isError\n\t});\n}\n//#endregion\n//#region lib/types/error.js\n/**\n* Harness error base with a stable machine-routable code and chained cause.\n* Package errors extend it so tool results and replay can retain failure class.\n* @module @deepseek-ai/dsh-llm/error\n*/\n/**\n* Base class for all harness errors. Carries a `code` (stable, programmatic —\n* e.g. `NO_ADAPTER`, `INVALID_ARGS`) distinct from the\n* human-readable `message`, and supports `cause` chaining via the standard\n* `ErrorOptions`. `name` defaults to the subclass constructor name.\n*/\nvar HarnessError = class extends Error {\n\t/** Stable machine-routable failure class (e.g. `RATE_LIMIT`); route on this, never by parsing `message`. */\n\tcode;\n\tconstructor(message, code, options) {\n\t\tsuper(message, options);\n\t\tthis.code = code;\n\t\tthis.name = new.target.name;\n\t}\n};\n/** Canonical provider-neutral code for a model request rejected because its context window was exceeded. */\nconst CONTEXT_WINDOW_EXCEEDED_CODE = \"CONTEXT_WINDOW_EXCEEDED\";\n/** Canonical provider-neutral code for an exhausted account quota or balance. */\nconst QUOTA_EXCEEDED_CODE = \"QUOTA\";\n/** Account-token quota that can be replenished through the first-party billing page. */\nconst ACCOUNT_QUOTA_EXCEEDED_CODE = \"ACCOUNT_QUOTA\";\n/**\n* Canonical provider-neutral code for a response that completed normally but\n* carried no content blocks at all. Providers occasionally emit a degenerate\n* completion (a terminal stop with zero output); adapters classify it as this\n* failure instead of yielding an empty assistant message, because an empty\n* message silently ends the turn with nothing for the user or the loop to act\n* on. The attempt produced nothing durable, so retry policy treats it as safe\n* to repeat.\n*/\nconst EMPTY_RESPONSE_CODE = \"EMPTY_RESPONSE\";\n/**\n* Canonical provider-neutral code for a credential that was supplied but\n* cannot be used — malformed rather than absent. Distinct from\n* `MISSING_CREDENTIAL` because the fix differs: correct the stored value\n* rather than supply one. Deliberately outside the default retryable set —\n* a malformed credential fails identically on every attempt.\n*/\nconst INVALID_CREDENTIAL_CODE = \"INVALID_CREDENTIAL\";\n/** Structured codes and plain phrases that explicitly name a context bound being exceeded. */\nconst STRUCTURED_CONTEXT_OVERFLOW = new RegExp(String.raw`(?:^|[^a-z0-9])context[\\s_-](?:length|window)[\\s_-]` + String.raw`(?:exceed(?:ed|s)?|overflow(?:ed)?|limit[\\s_-]exceeded)(?:$|[^a-z0-9])`, \"i\");\n/** Request-size wording that ties \"too large\" directly to model context capacity. */\nconst TOO_LARGE_FOR_CONTEXT = new RegExp(String.raw`\\b(?:request|prompt|input|messages?)\\s+(?:is\\s+|are\\s+)?` + String.raw`too\\s+(?:large|long)\\s+for\\s+(?:(?:this|the)\\s+)?` + String.raw`(?:model(?:'s)?\\s+)?context(?:\\s+window)?\\b`, \"i\");\n/** \"Exceeds\" wording is safe only when its object is explicitly the model context. */\nconst EXCEEDS_MODEL_CONTEXT = new RegExp(String.raw`\\b(?:input|prompt|request|messages?)\\b.{0,40}` + String.raw`\\b(?:exceed(?:s|ed)?|overflows?|is\\s+larger\\s+than)\\b.{0,40}` + String.raw`\\b(?:the\\s+)?(?:model(?:'s)?\\s+)?context(?:\\s+(?:length|window))?\\b`, \"i\");\n/**\n* Recognize the context-overflow wording used by OpenAI-compatible providers\n* and library adapters. Adapters pass all available provider code, type, and\n* message text so both thrown and in-band delivery styles share one classifier.\n* @param detail - provider error code/type/message text joined into one string.\n* @returns true when the detail identifies a request exceeding the model context window.\n*/\nfunction isContextWindowExceededError(detail) {\n\treturn STRUCTURED_CONTEXT_OVERFLOW.test(detail) || /\\b(?:maximum|max)(?:\\s+(?:allowed|supported))?\\s+context\\s+(?:length|window)\\b/i.test(detail) || TOO_LARGE_FOR_CONTEXT.test(detail) || /\\b(?:input|prompt|request)\\s+(?:is\\s+)?too\\s+(?:long|large)\\s+for\\s+(?:this|the)\\s+model\\b/i.test(detail) || EXCEEDS_MODEL_CONTEXT.test(detail);\n}\n/**\n* Recognize provider wording that identifies an exhausted account quota rather\n* than a transient request-rate limit.\n* @param detail - provider error code/type/message text joined into one string.\n* @returns true only for terminal quota, balance, credit, budget, or usage-limit wording.\n*/\nfunction isQuotaExceededError(detail) {\n\treturn /\\binsufficient[\\s_-]+(?:quota|balance|credits?)\\b/i.test(detail) || /\\b(?:quota|usage[\\s_-]+limit)[\\s_-]+(?:exceeded|exhausted|reached)\\b/i.test(detail) || /\\bexceed(?:ed|s)?[\\s_-]+(?:(?:your|the)[\\s_-]+)?(?:current[\\s_-]+)?quota\\b/i.test(detail) || /\\b(?:balance|credits?)[\\s_-]+(?:exhausted|depleted)\\b/i.test(detail) || /\\bout[\\s_-]+of[\\s_-]+(?:credits?|budget)\\b/i.test(detail);\n}\n/**\n* Render a thrown value with its full `cause` chain and AggregateError\n* members, so transport wrappers like undici's `TypeError: fetch failed`\n* surface the underlying failure instead of masking it. Plain structured\n* failures render their own data-backed `message`. Diagnostic-surface\n* rendering only (messages, notices, logs) — never parse the result; route on\n* {@link HarnessError.code}.\n* @param value - the caught value (`unknown` in catch clauses).\n* @returns the outermost message first, each cause appended with `: ` (skipped\n* when it repeats the wrapper message verbatim), and AggregateError members\n* bracketed and `; `-joined.\n*/\nfunction errorChain(value) {\n\tconst path = /* @__PURE__ */ new Set();\n\tconst render = (current) => {\n\t\tif (path.has(current)) return \"<circular cause>\";\n\t\tpath.add(current);\n\t\ttry {\n\t\t\tif (!(current instanceof Error)) {\n\t\t\t\tif (typeof current === \"object\" && current !== null) {\n\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(current, \"message\");\n\t\t\t\t\tif (descriptor !== void 0 && \"value\" in descriptor && typeof descriptor.value === \"string\") return descriptor.value;\n\t\t\t\t}\n\t\t\t\treturn String(current);\n\t\t\t}\n\t\t\tconst message = current.message === \"\" ? current.name : current.message;\n\t\t\tconst members = current instanceof AggregateError && current.errors.length > 0 ? ` [${current.errors.map(render).join(\"; \")}]` : \"\";\n\t\t\tconst causeText = current.cause === void 0 || current.cause === null ? \"\" : render(current.cause);\n\t\t\treturn `${message}${members}${causeText === \"\" || causeText === message ? \"\" : `: ${causeText}`}`;\n\t\t} catch {\n\t\t\treturn \"<unrenderable value>\";\n\t\t} finally {\n\t\t\tpath.delete(current);\n\t\t}\n\t};\n\treturn render(value);\n}\n/**\n* Narrow an arbitrary thrown value to a HarnessError (for `instanceof` at runtime boundaries).\n* @param value - the caught value (`unknown` in catch clauses).\n* @returns true only for real instances; duck-typed or cross-realm errors do not narrow.\n*/\nfunction isHarnessError(value) {\n\treturn value instanceof HarnessError;\n}\n/**\n* Canonical code for a request an image-capable route cannot send until more\n* of its images are offloaded. The failure's `offloadImages` names how many\n* more of the oldest retained occurrences must be offloaded;\n* `dsh-compaction-image-offload` records an `image/offload` selection before\n* the agent or summarizer retries with freshly derived input.\n*/\nconst IMAGE_OFFLOAD_REQUIRED_CODE = \"IMAGE_OFFLOAD_REQUIRED\";\n//#endregion\n//#region lib/types/retry-policy.js\n/**\n* Provider-owned request-retry policy configuration and resolution.\n*\n* Adapters expose one resolved policy per registered provider route; the\n* optional dsh-llm-retry plugin executes it on the agent's failed-step extension point.\n*\n* @module @deepseek-ai/dsh-llm/retry-policy\n*/\nconst DEFAULT_MAX_RETRIES = 5;\nconst DEFAULT_INITIAL_DELAY_MS = 500;\nconst DEFAULT_MAX_DELAY_MS = 1e4;\nconst DEFAULT_JITTER_RATIO = .1;\nconst DEFAULT_RETRYABLE_CODES = Object.freeze([\n\tEMPTY_RESPONSE_CODE,\n\t\"RATE_LIMIT\",\n\t\"SERVER\",\n\t\"TIMEOUT\",\n\t\"TRANSPORT\"\n]);\nconst backoffSchema = z.object({\n\tinitialDelayMs: z.number().max(MAX_TIMER_DELAY_MS).default(DEFAULT_INITIAL_DELAY_MS),\n\tmaxDelayMs: z.number().max(MAX_TIMER_DELAY_MS).default(DEFAULT_MAX_DELAY_MS),\n\tjitterRatio: z.number().min(0).max(1).default(DEFAULT_JITTER_RATIO)\n});\nconst normalPolicySchema = z.object({\n\tmode: z.const(\"normal\").required(),\n\tmaxRetries: z.number().step(1).min(0).max(Number.MAX_SAFE_INTEGER).default(DEFAULT_MAX_RETRIES),\n\tretryableCodes: z.array(z.string()).default([...DEFAULT_RETRYABLE_CODES]),\n\tbackoff: backoffSchema\n});\nconst alwaysPolicySchema = z.object({\n\tmode: z.const(\"always\").required(),\n\tbackoff: backoffSchema\n});\n/** Cordis schema embedded by each concrete provider configuration. */\nconst RetryPolicySchema = z.union([normalPolicySchema, alwaysPolicySchema]);\nconst NORMAL_POLICY_KEYS = new Set([\n\t\"mode\",\n\t\"maxRetries\",\n\t\"retryableCodes\",\n\t\"backoff\"\n]);\nconst ALWAYS_POLICY_KEYS = new Set([\n\t\"mode\",\n\t\"maxRetries\",\n\t\"retryableCodes\",\n\t\"backoff\"\n]);\nconst BACKOFF_KEYS = new Set([\n\t\"initialDelayMs\",\n\t\"maxDelayMs\",\n\t\"jitterRatio\"\n]);\nfunction validateKeys(value, allowed, path) {\n\tfor (const key of Object.keys(value)) if (!allowed.has(key)) throw new Error(`${path}: unknown key \"${key}\"`);\n}\nfunction resolveBackoff(config, path) {\n\tif (config !== void 0) validateKeys(config, BACKOFF_KEYS, path);\n\tconst initialDelayMs = config?.initialDelayMs ?? DEFAULT_INITIAL_DELAY_MS;\n\tconst maxDelayMs = config?.maxDelayMs ?? DEFAULT_MAX_DELAY_MS;\n\tconst jitterRatio = config?.jitterRatio ?? DEFAULT_JITTER_RATIO;\n\tif (!Number.isFinite(initialDelayMs) || initialDelayMs <= 0 || initialDelayMs > MAX_TIMER_DELAY_MS) throw new Error(`${path}.initialDelayMs must be a positive finite number no greater than ${MAX_TIMER_DELAY_MS}`);\n\tif (!Number.isFinite(maxDelayMs) || maxDelayMs <= 0 || maxDelayMs > MAX_TIMER_DELAY_MS) throw new Error(`${path}.maxDelayMs must be a positive finite number no greater than ${MAX_TIMER_DELAY_MS}`);\n\tif (initialDelayMs > maxDelayMs) throw new Error(`${path}.initialDelayMs must be less than or equal to maxDelayMs`);\n\tif (!Number.isFinite(jitterRatio) || jitterRatio < 0 || jitterRatio > 1) throw new Error(`${path}.jitterRatio must be between 0 and 1`);\n\treturn Object.freeze({\n\t\tinitialDelayMs,\n\t\tmaxDelayMs,\n\t\tjitterRatio\n\t});\n}\n/**\n* Validate, default, and detach one provider-owned retry policy.\n* @param config - optional provider configuration; omission selects normal defaults.\n* @param path - diagnostic path naming the provider config that owns the value.\n* @returns an immutable policy safe to capture in provider registration state.\n*/\nfunction resolveRetryPolicy(config, path) {\n\tif (config === void 0) return Object.freeze({\n\t\tmode: \"normal\",\n\t\tmaxRetries: DEFAULT_MAX_RETRIES,\n\t\tretryableCodes: DEFAULT_RETRYABLE_CODES,\n\t\t...resolveBackoff(void 0, `${path}.backoff`)\n\t});\n\tswitch (config.mode) {\n\t\tcase \"normal\": {\n\t\t\tvalidateKeys(config, NORMAL_POLICY_KEYS, path);\n\t\t\tconst maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;\n\t\t\tconst retryableCodes = config.retryableCodes ?? [...DEFAULT_RETRYABLE_CODES];\n\t\t\tif (!Number.isSafeInteger(maxRetries) || maxRetries < 0) throw new Error(`${path}.maxRetries must be a non-negative safe integer`);\n\t\t\tif (retryableCodes.length === 0) throw new Error(`${path}.retryableCodes must not be empty`);\n\t\t\tif (retryableCodes.some((code) => typeof code !== \"string\" || code.length === 0)) throw new Error(`${path}.retryableCodes must contain only non-empty strings`);\n\t\t\tif (new Set(retryableCodes).size !== retryableCodes.length) throw new Error(`${path}.retryableCodes must not contain duplicates`);\n\t\t\treturn Object.freeze({\n\t\t\t\tmode: \"normal\",\n\t\t\t\tmaxRetries,\n\t\t\t\tretryableCodes: Object.freeze([...retryableCodes]),\n\t\t\t\t...resolveBackoff(config.backoff, `${path}.backoff`)\n\t\t\t});\n\t\t}\n\t\tcase \"always\":\n\t\t\tvalidateKeys(config, ALWAYS_POLICY_KEYS, path);\n\t\t\treturn Object.freeze({\n\t\t\t\tmode: \"always\",\n\t\t\t\t...resolveBackoff(config.backoff, `${path}.backoff`)\n\t\t\t});\n\t\tdefault: throw new Error(`${path}.mode must be \"normal\" or \"always\"`);\n\t}\n}\n//#endregion\n//#region lib/types/call-config.js\n/**\n* Conversation call configuration and freeze utilities. Provider routing,\n* model, reasoning effort, and sampling values are request-header state that\n* can affect cache reuse; request waterfalls replace them and the loop logs\n* changed snapshots instead of allowing silent per-call drift.\n* @module dsh-llm/call-config\n*/\n/** Process-local identities of request objects assembled by dsh-agent-loop. */\nconst AGENT_LOOP_REQUESTS = /* @__PURE__ */ new WeakSet();\n/**\n* Field-wise equality over {@link LlmCallConfig} — the comparison a caller\n* runs to decide whether a proposed configuration is a real change (worth a\n* logged header snapshot) or the held one restated.\n* @param a - one configuration.\n* @param b - the other.\n* @returns whether every field (including the `stop` list, element-wise) matches.\n*/\nfunction callConfigEquals(a, b) {\n\tif (a.provider !== b.provider || a.model !== b.model || a.reasoningEffort !== b.reasoningEffort || a.temperature !== b.temperature || a.maxTokens !== b.maxTokens) return false;\n\tif (a.stop === void 0 || b.stop === void 0) return a.stop === b.stop;\n\treturn a.stop.length === b.stop.length && a.stop.every((s, i) => s === b.stop?.[i]);\n}\n/**\n* Mark one exact request object as assembled by dsh-agent-loop.\n* @param request - loop-owned request envelope before LLM dispatch.\n* @returns the same request object marked as created by the process-local agent loop.\n*/\nfunction markAgentLoopRequest(request) {\n\tAGENT_LOOP_REQUESTS.add(request);\n\treturn request;\n}\n/**\n* Test whether the exact request object was assembled by dsh-agent-loop.\n* @param request - request envelope observed at the LLM waterfall.\n* @returns whether {@link markAgentLoopRequest} recorded this object.\n*/\nfunction isAgentLoopRequest(request) {\n\treturn AGENT_LOOP_REQUESTS.has(request);\n}\n//#endregion\n//#region lib/types/adapter-failure.js\n/**\n* Normalization for values thrown by a final LLM adapter boundary.\n*\n* @module @deepseek-ai/dsh-llm/adapter-failure\n*/\n/**\n* Detach serializable provider facts from a value thrown by an adapter.\n* @param value - arbitrary value thrown during adapter dispatch or iteration.\n* @returns immutable provider-neutral facts suitable for a terminal finish chunk.\n* @internal\n*/\nfunction normalizeLlmFailure(value) {\n\tconst error = value instanceof Error ? value : new HarnessError(thrownMessage(value), \"UNKNOWN\", { cause: value });\n\tconst carried = ownFailureSnapshot(error);\n\tif (carried !== void 0 && carried.code === ownErrorCode(error)) return carried;\n\treturn Object.freeze({\n\t\tmessage: errorMessage(error),\n\t\tcode: harnessErrorCode(error)\n\t});\n}\n/** Render a non-Error throw without letting hostile coercion escape normalization. */\nfunction thrownMessage(value) {\n\ttry {\n\t\tconst message = String(value);\n\t\treturn message.length > 0 ? message : \"LLM adapter failed\";\n\t} catch (_hostileThrownValue) {\n\t\treturn \"LLM adapter failed\";\n\t}\n}\n/** Read a foreign error's own data-backed `code` without invoking accessors. */\nfunction ownErrorCode(error) {\n\ttry {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(error, \"code\");\n\t\treturn descriptor !== void 0 && \"value\" in descriptor ? descriptor.value : void 0;\n\t} catch (_sdkPropertyTrap) {\n\t\treturn;\n\t}\n}\n/** Snapshot an own data property without invoking an SDK-defined accessor. */\nfunction ownFailureSnapshot(error) {\n\ttry {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(error, \"failure\");\n\t\treturn descriptor !== void 0 && \"value\" in descriptor ? failureSnapshot(descriptor.value) : void 0;\n\t} catch (_sdkPropertyTrap) {\n\t\treturn;\n\t}\n}\n/** Validate and detach an arbitrary serializable failure payload. */\nfunction failureSnapshot(value) {\n\tif (typeof value !== \"object\" || value === null) return void 0;\n\ttry {\n\t\tconst candidate = value;\n\t\tconst message = candidate.message;\n\t\tconst code = candidate.code;\n\t\tconst status = candidate.status;\n\t\tconst providerRetryAfterMs = candidate.providerRetryAfterMs;\n\t\tconst requestId = candidate.requestId;\n\t\tconst offloadImages = candidate.offloadImages;\n\t\tif (typeof message !== \"string\" || message.length === 0 || typeof code !== \"string\" || code.length === 0 || status !== void 0 && (!Number.isInteger(status) || status < 100 || status > 599) || providerRetryAfterMs !== void 0 && (!Number.isFinite(providerRetryAfterMs) || providerRetryAfterMs <= 0) || requestId !== void 0 && (typeof requestId !== \"string\" || requestId.length === 0) || offloadImages !== void 0 && (!Number.isSafeInteger(offloadImages) || offloadImages <= 0)) return void 0;\n\t\treturn Object.freeze({\n\t\t\tmessage,\n\t\t\tcode,\n\t\t\t...status === void 0 ? {} : { status },\n\t\t\t...providerRetryAfterMs === void 0 ? {} : { providerRetryAfterMs },\n\t\t\t...requestId === void 0 ? {} : { requestId },\n\t\t\t...offloadImages === void 0 ? {} : { offloadImages }\n\t\t});\n\t} catch (_sdkFailureGetter) {\n\t\treturn;\n\t}\n}\n/** Read an SDK error message without letting an accessor replace the primary failure. */\nfunction errorMessage(error) {\n\ttry {\n\t\tconst message = error.message;\n\t\tif (typeof message === \"string\" && message.length > 0) return message;\n\t} catch (_sdkMessageGetter) {}\n\treturn \"LLM adapter failed\";\n}\n/** Trust only Harness-owned codes; third-party SDK codes are not our taxonomy. */\nfunction harnessErrorCode(error) {\n\treturn error instanceof HarnessError ? error.code : \"UNKNOWN\";\n}\n//#endregion\n//#region lib/types/api-key.js\n/**\n* The one definition of a well-formed provider API key, shared by every\n* adapter that puts one in an HTTP header.\n* @module @deepseek-ai/dsh-llm/api-key\n*/\n/**\n* Characters an HTTP header value carries verbatim and every known provider\n* key uses: printable ASCII, space excluded. A key outside this set cannot\n* reach any provider — `fetch` refuses to build the header — so this is a\n* transport invariant rather than one provider's policy. Latin-1 is excluded\n* deliberately: a header could carry it, but no provider issues it, and\n* admitting it trades a local explained refusal for an opaque 401.\n*/\nconst LEGAL_API_KEY = /^[\\x21-\\x7E]+$/;\n/**\n* Judge one *supplied* API key, trimming surrounding whitespace first.\n*\n* Trimming is silent because a padded key has one unambiguous reading; every\n* other defect is reported. Absence is a configuration state this function\n* never sees — a profile naming no credential authenticates through the\n* provider's own ambient discovery or OAuth — so callers decide whether a\n* value was supplied before asking.\n* @param raw - the key exactly as configured, stored, or typed.\n* @returns the trimmed key, or why it cannot be used.\n*/\nfunction normalizeApiKey(raw) {\n\tconst value = raw.trim();\n\tif (value.length === 0) return {\n\t\tok: false,\n\t\treason: \"empty\"\n\t};\n\tif (!LEGAL_API_KEY.test(value)) return {\n\t\tok: false,\n\t\treason: \"illegalCharacters\"\n\t};\n\treturn {\n\t\tok: true,\n\t\tvalue\n\t};\n}\n//#endregion\n//#region lib/types/content.js\n/** Content-block structure helpers. @module @deepseek-ai/dsh-llm/content */\n/**\n* Bridge one attachment provider's host object location into the mounted\n* tool execution world. The consumer supplies the current filesystem\n* provider's mapping without making attachment or LLM definitions depend on it.\n* @param attachments - provider that owns the normalized attachment object.\n* @param mapHostPath - map one absolute host path into the current tool execution world.\n* @param ref - durable normalized attachment reference.\n* @returns a read-only execution-world path, or undefined when either provider exposes no mapping.\n* @throws an attachment error when the durable reference is invalid.\n*/\nfunction resolveImageAttachmentAccess(attachments, mapHostPath, ref) {\n\tconst hostPath = attachments.imageHostPath(ref);\n\tif (hostPath === void 0) return void 0;\n\tconst readonlyPath = mapHostPath(hostPath);\n\treturn readonlyPath === void 0 ? void 0 : { readonlyPath };\n}\nfunction quoted(value) {\n\treturn JSON.stringify(value);\n}\nfunction imageIdentity(ref) {\n\treturn ref.name === void 0 ? String(ref.attachmentId) : `${quoted(ref.name)} (${ref.attachmentId})`;\n}\nfunction extension(mediaType) {\n\tswitch (mediaType) {\n\t\tcase \"image/png\": return \".png\";\n\t\tcase \"image/jpeg\": return \".jpg\";\n\t\tcase \"image/webp\": return \".webp\";\n\t\tcase \"image/gif\": return \".gif\";\n\t\tdefault: return assertNever(mediaType, \"image extension\");\n\t}\n}\nfunction normalizedAccessText(ref, access) {\n\treturn ` Normalized copy (read-only; may be resized or re-encoded): ${quoted(access.readonlyPath)} (${ref.width}x${ref.height}px, ${ref.mediaType}). Source dimensions, format, and byte size may differ. Copy to a writable path ending in ${extension(ref.mediaType)} before editing.`;\n}\n/**\n* Stable text shown to a model that cannot accept one durable image reference.\n* @param ref - durable normalized attachment omitted from the request.\n* @returns deterministic text-only placeholder.\n*/\nfunction textOnlyImageText(ref) {\n\treturn `[image omitted because this model accepts text only; attachment sha256:${String(ref.attachmentId).slice(7, 15)}]`;\n}\n/**\n* Stable model-facing handle for one exact request image. Identity comes from\n* the occurrence's own durable reference: request versions are prepared per\n* attachment id, so one shared version may serve occurrences whose display\n* names differ.\n* @param ref - the occurrence's durable normalized attachment.\n* @param version - exact request-image dimensions shown beside the text.\n* @param access - optional path resolved for the current tool execution world.\n* @returns attachment handle and request-image dimensions.\n*/\nfunction requestImageHandleText(ref, version, access) {\n\tconst preview = `Image ${imageIdentity(ref)}; request preview ${version.width}x${version.height}px.`;\n\treturn access === void 0 ? `${preview} It may be resized or re-encoded; source dimensions, format, and byte size may differ.` : preview + normalizedAccessText(ref, access);\n}\n/**\n* Stable per-image placeholder for a request-limit omission.\n* @param ref - durable normalized attachment omitted from this request.\n* @param access - optional provider-resolved path for model tools.\n* @returns identity, normalized metadata, and the available recovery path.\n*/\nfunction offloadedImageText(ref, access) {\n\tconst identity = `image omitted to fit request image limits; ${imageIdentity(ref)}.`;\n\tif (access === void 0) return `[${identity} No local normalized image path is available; ask the user to attach it again if needed.]`;\n\treturn `[${identity}${normalizedAccessText(ref, access)}]`;\n}\n/**\n* True when typed model content contains an image block. This is the one image\n* walk shared by every image policy (capability gating, text-only\n* serialization, compaction survey), so a consumer cannot silently diverge.\n* @param content - typed model content blocks.\n* @returns whether any block is an image.\n*/\nfunction contentHasImage(content) {\n\treturn content.some((block) => block.type === \"image\");\n}\n/**\n* True when typed model content contains a file block.\n* Reads current content on every call without retaining scan results.\n* @param content - typed model content blocks.\n* @returns whether any block is a file.\n*/\nfunction contentHasFile(content) {\n\tfor (const block of content) if (block.type === \"file\") return true;\n\treturn false;\n}\n/**\n* Stable model-facing handle for one durable file reference: the address of\n* the verbatim stored copy and the instruction to read it on demand. This is\n* the only representation a provider ever receives for a file.\n* @param ref - durable verbatim file reference.\n* @param readonlyPath - execution-world path of the stored copy, when resolvable.\n* @returns deterministic handle text naming the file, its size, and its address.\n*/\nfunction fileHandleText(ref, readonlyPath) {\n\tconst digest = String(ref.attachmentId).slice(7, 15);\n\tconst identity = `File ${quoted(ref.name)} (${ref.bytes} bytes, sha256:${digest})`;\n\tif (readonlyPath === void 0) return `[${identity} was uploaded, but the current execution environment cannot access a readable path. Report that limitation if its contents are needed; do not claim to have read it.]`;\n\treturn `[${identity}: verbatim read-only copy saved at ${quoted(readonlyPath)}. Read that path with your file tools when its contents are needed; copy it to a writable location before modifying it. When delegating file work, include this saved path in the delegation prompt; only subagents sharing this execution environment can read it.]`;\n}\n/** Replace every file occurrence with handle text. */\nfunction replaceFilesWithHandles(blocks, resolvePath) {\n\tlet next;\n\tfor (const [index, block] of blocks.entries()) {\n\t\tif (block.type === \"file\") {\n\t\t\tnext ??= blocks.slice(0, index);\n\t\t\tnext.push({\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: fileHandleText(block.attachment, resolvePath(block.attachment))\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tnext?.push(block);\n\t}\n\treturn next ?? blocks;\n}\nfunction projectFilesToText(messages, resolvePath) {\n\tif (!messages.some((message) => contentHasFile(message.content))) return messages;\n\treturn messages.map((message) => {\n\t\tconst content = replaceFilesWithHandles(message.content, resolvePath);\n\t\treturn content === message.content ? message : {\n\t\t\t...message,\n\t\t\tcontent\n\t\t};\n\t});\n}\n/** Base64 length of raw image bytes, including padding. */\nfunction base64Length(bytes) {\n\treturn Math.ceil(bytes / 3) * 4;\n}\n/**\n* Visit every image occurrence of typed content in message order.\n* @param content - typed model content blocks.\n* @param visit - called once per occurrence.\n*/\nfunction visitImageBlocks(content, visit) {\n\tfor (const block of content) if (block.type === \"image\") visit(block);\n}\n/** Replace every offloaded occurrence with its placeholder. */\nfunction replaceOffloadedImages(blocks, placeholder) {\n\tlet next;\n\tfor (const [index, block] of blocks.entries()) {\n\t\tif (block.type === \"image\" && block.offloaded === true) {\n\t\t\tnext ??= blocks.slice(0, index);\n\t\t\tnext.push({\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: placeholder(block.attachment)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tnext?.push(block);\n\t}\n\treturn next ?? blocks;\n}\nfunction projectOffloadedImages(messages, placeholder) {\n\treturn messages.map((message) => {\n\t\tconst content = replaceOffloadedImages(message.content, placeholder);\n\t\treturn content === message.content ? message : {\n\t\t\t...message,\n\t\t\tcontent\n\t\t};\n\t});\n}\n/**\n* Number of oldest retained image occurrences one route budget removes, in\n* whole count and byte quanta, once the budget is exceeded. The result depends\n* only on the represented lengths, so every route names the count the same\n* way.\n* @param lengths - represented byte length of every retained occurrence, oldest first.\n* @param budget - count/byte budgets and removal quanta; unbounded when absent.\n* @returns how many leading occurrences to offload.\n*/\nfunction offloadedImagePrefixCount(lengths, budget) {\n\tconst total = lengths.reduce((sum, bytes) => sum + bytes, 0);\n\tconst excessCount = budget.maxImages === void 0 ? 0 : Math.max(0, lengths.length - budget.maxImages);\n\tconst excessBytes = budget.maxBytes === void 0 ? 0 : Math.max(0, total - budget.maxBytes);\n\tif (excessCount === 0 && excessBytes === 0) return 0;\n\tconst countQuantum = budget.countQuantum ?? 1;\n\tconst byteQuantum = budget.byteQuantum ?? 1;\n\tconst removeCount = excessCount === 0 ? 0 : Math.ceil(excessCount / countQuantum) * countQuantum;\n\tconst removeBytes = excessBytes === 0 ? 0 : Math.ceil(excessBytes / byteQuantum) * byteQuantum;\n\tlet count = 0;\n\tlet removedBytes = 0;\n\tfor (const imageBytes of lengths) {\n\t\tif (count >= removeCount && (removeBytes === 0 || (byteQuantum === 1 ? removedBytes >= removeBytes : removedBytes > removeBytes))) break;\n\t\tremovedBytes += imageBytes;\n\t\tcount += 1;\n\t}\n\treturn count;\n}\n/**\n* Number of oldest retained occurrences a route must still offload before a\n* derived request fits its budget at the exact byte length the route sends;\n* zero when the request fits. A route fails with `IMAGE_OFFLOAD_REQUIRED`\n* carrying this count instead of offloading on its own.\n* @param messages - derived request history carrying the surface's `offloaded` marks.\n* @param budget - route representation, budgets, and removal quanta.\n* @param versionBytes - exact request-version byte length of one retained occurrence.\n* @returns how many more leading retained occurrences to offload.\n*/\nfunction requiredImageOffload(messages, budget, versionBytes) {\n\tconst lengths = [];\n\tfor (const message of messages) visitImageBlocks(message.content, (block) => {\n\t\tif (block.offloaded === true) return;\n\t\tconst bytes = versionBytes(block);\n\t\tlengths.push(budget.representation === \"base64\" ? base64Length(bytes) : bytes);\n\t});\n\treturn offloadedImagePrefixCount(lengths, budget);\n}\n/** Replace every image occurrence for a text-only model. */\nfunction replaceImagesForTextModel(blocks) {\n\tlet next;\n\tfor (const [index, block] of blocks.entries()) {\n\t\tif (block.type === \"image\") {\n\t\t\tnext ??= blocks.slice(0, index);\n\t\t\tnext.push({\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: textOnlyImageText(block.attachment)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tnext?.push(block);\n\t}\n\treturn next ?? blocks;\n}\nfunction projectImagesForTextModel(messages) {\n\tif (!messages.some((message) => contentHasImage(message.content))) return messages;\n\treturn messages.map((message) => {\n\t\tconst content = replaceImagesForTextModel(message.content);\n\t\treturn content === message.content ? message : {\n\t\t\t...message,\n\t\t\tcontent\n\t\t};\n\t});\n}\nfunction withoutDeveloperMessages(messages) {\n\tconst retained = messages.filter((message) => message.role !== \"developer\");\n\treturn retained.length === messages.length ? messages : retained;\n}\nfunction toolDeclarations(tools, mode, history) {\n\tconst declarations = new Map(history.tools.map((tool) => [tool.name, tool]));\n\tfor (const update of history.updates) for (const tool of update.additions) if (!declarations.has(tool.name)) declarations.set(tool.name, {\n\t\t...tool,\n\t\tdeferLoading: true\n\t});\n\tswitch (mode) {\n\t\tcase \"in-history\": return declarations;\n\t\tcase \"addition-only\": {\n\t\t\tconst activeNames = new Set(tools?.map((tool) => tool.name));\n\t\t\tfor (const name of declarations.keys()) if (!activeNames.has(name)) declarations.delete(name);\n\t\t\treturn declarations;\n\t\t}\n\t\t/* v8 ignore next 2 -- closed-union exhaustiveness guard */\n\t\tdefault: return assertNever(mode);\n\t}\n}\n/**\n* Construct provider declarations from session-folded history without changing logged active tools.\n* Unsupported routes and incomplete history use current declarations without developer updates.\n* Explicitly deferred baseline tools become available only after their first retained addition.\n* @param messages - complete request inputs, or the prefix selected for an auxiliary call.\n* @param tools - currently active tool schemas.\n* @param toolUpdate - the resolved route's update mode.\n* @param history - immutable state folded from committed headers and developer messages.\n* @returns provider declarations and the corresponding filtered history.\n*/\nfunction projectToolUpdates(messages, tools, toolUpdate, history) {\n\tif (toolUpdate === void 0) {\n\t\tlet immediateTools = tools;\n\t\tif (tools?.some((tool) => tool.deferLoading === true)) immediateTools = tools.map(({ deferLoading: _loading, ...tool }) => tool);\n\t\treturn {\n\t\t\tmessages: withoutDeveloperMessages(messages),\n\t\t\ttools: immediateTools\n\t\t};\n\t}\n\tif (history === void 0) return {\n\t\tmessages: withoutDeveloperMessages(messages),\n\t\ttools\n\t};\n\tconst messageIds = new Set(messages.flatMap((message) => message.role === \"developer\" ? [message.id] : []));\n\tif (history.updates.some((update) => !messageIds.has(update.messageId))) return {\n\t\tmessages: withoutDeveloperMessages(messages),\n\t\ttools\n\t};\n\tconst declarations = toolDeclarations(tools, toolUpdate, history);\n\tconst updateIds = new Set(history.updates.map((update) => update.messageId));\n\tconst offered = new Set(history.tools.filter((tool) => !tool.deferLoading).map((tool) => tool.name));\n\tconst projectedMessages = [];\n\tfor (const message of messages) {\n\t\tif (message.role !== \"developer\") {\n\t\t\tprojectedMessages.push(message);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!updateIds.has(message.id)) continue;\n\t\tconst content = message.content.filter((block) => {\n\t\t\tswitch (block.type) {\n\t\t\t\tcase \"tool-addition\":\n\t\t\t\t\tif (!declarations.has(block.toolName) || offered.has(block.toolName)) return false;\n\t\t\t\t\toffered.add(block.toolName);\n\t\t\t\t\treturn true;\n\t\t\t\tcase \"tool-removal\":\n\t\t\t\t\tif (toolUpdate !== \"in-history\") return false;\n\t\t\t\t\treturn offered.delete(block.toolName);\n\t\t\t\tdefault: return true;\n\t\t\t}\n\t\t});\n\t\tif (content.length === 0) continue;\n\t\tif (content.length === message.content.length) projectedMessages.push(message);\n\t\telse projectedMessages.push({\n\t\t\t...message,\n\t\t\tcontent\n\t\t});\n\t}\n\treturn {\n\t\tmessages: projectedMessages.length === messages.length && projectedMessages.every((message, index) => message === messages[index]) ? messages : projectedMessages,\n\t\ttools: [...declarations.values()]\n\t};\n}\n//#endregion\n//#region lib/types/attribution.js\n/**\n* Centralize the non-secret product identity every provider request sends as `User-Agent`, keeping\n* adapters from drifting. See\n* `docs/subsystems/llm-streaming.md#appidentity--app-attribution`.\n*\n* App-attribution vocabulary for provider requests.\n* @module @deepseek-ai/dsh-llm/attribution\n*/\nconst { version } = createRequire(import.meta.url)(\"../package.json\");\n/**\n* The harness's own identity: the default every adapter sends. Deployments\n* that need a white-label identity pass their own {@link AppIdentity} to\n* {@link attributionHeaders} — omission falls back to this default; nothing\n* can suppress attribution entirely.\n*/\nconst APP_IDENTITY = {\n\tproduct: \"deepseek-harness\",\n\tversion,\n\turl: \"https://github.com/deepseek-ai/deepseek-harness\"\n};\n/**\n* The standard `User-Agent` value: `product/version (+url)`. The\n* parenthesized `+url` comment is the conventional self-identification form\n* (RFC 9110 §10.1.5 product + comment syntax).\n* @param identity - the identity to render; defaults to {@link APP_IDENTITY}.\n* @returns the ready-to-send header value.\n*/\nfunction userAgent(identity = APP_IDENTITY) {\n\treturn `${identity.product}/${identity.version} (+${identity.url})`;\n}\n/**\n* Build the attribution headers an adapter must send on every provider\n* request. Header names are lowercase (HTTP field names are case-insensitive\n* on the wire).\n* @param identity - the identity to send; defaults to {@link APP_IDENTITY} — omission cannot suppress attribution.\n* @returns headers to merge into the provider request (currently just `user-agent`).\n*/\nfunction attributionHeaders(identity = APP_IDENTITY) {\n\treturn { \"user-agent\": userAgent(identity) };\n}\n//#endregion\n//#region lib/types/brand.js\n/**\n* dsh-llm's owned branded ids: tool-call correlation and provider request\n* diagnostics.\n*\n* The `Branded<B>` primitive and stateless constructor live in\n* `@deepseek-ai/dsh-brand` so every owner of a cross-boundary id can brand it\n* without depending on dsh-llm; see that package's README for the\n* nominal-typing policy.\n*\n* @module @deepseek-ai/dsh-llm/brand\n*/\n/**\n* Brand a message identifier.\n* @param id - the opaque message identifier.\n* @returns the same string with the message-id brand.\n*/\nfunction MessageId(id) {\n\treturn brandString(id);\n}\n/**\n* Brand a string as a {@link ToolCallId}.\n* @param id - the provider-issued or synthesized call id.\n* @returns the same string with the tool-call-id brand.\n*/\nfunction ToolCallId(id) {\n\treturn brandString(id);\n}\n/**\n* Brand a provider-issued request identifier.\n* @param id - the opaque provider-issued string.\n* @returns the same string, branded; no validation is performed.\n*/\nfunction ProviderRequestId(id) {\n\treturn brandString(id);\n}\n/**\n* Brand one loop-owned streaming attempt identifier.\n* @param id - the opaque Agent-lifecycle-local identifier.\n* @returns the same string with the attempt-id brand.\n*/\nfunction LlmAttemptId(id) {\n\treturn brandString(id);\n}\n/**\n* Brand an adapter-owned reasoning-effort identifier.\n* @param id - the opaque identifier exposed by one model capability.\n* @returns the same string, branded; no validation is performed.\n*/\nfunction ReasoningEffortId(id) {\n\treturn brandString(id);\n}\n//#endregion\n//#region lib/types/assembler.js\n/**\n* Incremental chunk-to-message assembler. This is the single canonical assembly\n* algorithm used by the agent loop to build an assistant message from a chunk\n* stream while logging the raw chunks for replay fidelity.\n*\n* @module @deepseek-ai/dsh-llm/assembler\n*/\n/**\n* Incrementally assembles raw {@link StreamChunk}s into complete\n* {@link ContentBlock}s and a final assistant {@link Message}.\n*\n* The agent loop feeds it while logging raw chunks for replay fidelity, then\n* reads `blocks()` / `message()` / `usage` / `finish` once the stream ends,\n* or `interruptedBlocks()` when cancellation cut the stream short.\n*\n* Tolerant of delta-only protocols (no block-start/end); deltas arriving for\n* an index already closed by `block-end` are ignored (malformed stream) so a\n* misbehaving adapter cannot grow memory or corrupt a completed block.\n*/\nvar BlockAssembler = class {\n\tpartials = /* @__PURE__ */ new Map();\n\torder = [];\n\t_usage;\n\t_finish;\n\t_replayState;\n\t/**\n\t* Feed one chunk into the assembly state.\n\t* @param chunk - the next raw chunk, in stream order.\n\t*/\n\tpush(chunk) {\n\t\tswitch (chunk.type) {\n\t\t\tcase \"block-start\":\n\t\t\t\tif (!this.partials.has(chunk.index)) {\n\t\t\t\t\tthis.order.push(chunk.index);\n\t\t\t\t\tthis.partials.set(chunk.index, {\n\t\t\t\t\t\tblockType: chunk.blockType,\n\t\t\t\t\t\ttext: \"\",\n\t\t\t\t\t\ttoolCallArguments: \"\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\tcase \"text-delta\":\n\t\t\tcase \"reasoning-delta\": {\n\t\t\t\tconst partial = this.ensure(chunk.index, chunk.type === \"text-delta\" ? \"text\" : \"reasoning\");\n\t\t\t\tif (partial.block) return;\n\t\t\t\tpartial.text += chunk.text;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"tool-call-delta\": {\n\t\t\t\tconst partial = this.ensure(chunk.index, \"tool-call\");\n\t\t\t\tif (partial.block) return;\n\t\t\t\tpartial.toolCallId = chunk.id;\n\t\t\t\tif (chunk.name) partial.toolCallName = chunk.name;\n\t\t\t\tpartial.toolCallArguments += chunk.argumentsDelta;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"block-end\": {\n\t\t\t\tconst partial = this.ensure(chunk.index, chunk.block.type);\n\t\t\t\tif (partial.block) return;\n\t\t\t\tpartial.block = chunk.block;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"usage\":\n\t\t\t\tthis._usage = chunk.usage;\n\t\t\t\treturn;\n\t\t\tcase \"finish\":\n\t\t\t\tthis._finish = chunk.reason;\n\t\t\t\tthis._replayState = chunk.replayState;\n\t\t\t\treturn;\n\t\t\tdefault: return assertNever(chunk, \"BlockAssembler.push\");\n\t\t}\n\t}\n\tensure(index, blockType) {\n\t\tlet partial = this.partials.get(index);\n\t\tif (!partial) {\n\t\t\tpartial = {\n\t\t\t\tblockType,\n\t\t\t\ttext: \"\",\n\t\t\t\ttoolCallArguments: \"\"\n\t\t\t};\n\t\t\tthis.partials.set(index, partial);\n\t\t\tthis.order.push(index);\n\t\t}\n\t\treturn partial;\n\t}\n\tassemble(partial, index) {\n\t\tif (partial.block) return partial.block;\n\t\tswitch (partial.blockType) {\n\t\t\tcase \"text\": return {\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: partial.text\n\t\t\t};\n\t\t\tcase \"reasoning\": return {\n\t\t\t\ttype: \"reasoning\",\n\t\t\t\ttext: partial.text\n\t\t\t};\n\t\t\tcase \"tool-call\": return {\n\t\t\t\ttype: \"tool-call\",\n\t\t\t\tid: partial.toolCallId ?? brandString(`call-${index}`),\n\t\t\t\tname: partial.toolCallName ?? \"\",\n\t\t\t\targuments: partial.toolCallArguments\n\t\t\t};\n\t\t\tdefault: throw new Error(`cannot assemble incomplete block of type \"${partial.blockType}\"`);\n\t\t}\n\t}\n\t/** Invariant accessor: every index in `order` has a partial. */\n\tmustGet(index) {\n\t\tconst partial = this.partials.get(index);\n\t\tif (!partial) throw new Error(`BlockAssembler invariant violated: no partial for index ${index}`);\n\t\treturn partial;\n\t}\n\t/**\n\t* The one shared keep/drop decision over all seen blocks: max-token\n\t* truncation drops tool calls that cannot be executed safely. Emitted blocks\n\t* and replay metadata both derive from this result, so they cannot disagree.\n\t*/\n\tassembled() {\n\t\tconst all = this.order.map((index) => this.assemble(this.mustGet(index), index));\n\t\tconst kept = this.finish.kind === \"max-tokens\" ? all.map((block) => block.type !== \"tool-call\") : void 0;\n\t\tconst blocks = kept === void 0 ? all : all.filter((_, position) => kept[position]);\n\t\tconst envelope = this._replayState;\n\t\tif (envelope?.blocks === void 0) return {\n\t\t\tblocks,\n\t\t\treplay: envelope\n\t\t};\n\t\tif (envelope.blocks.length !== all.length) return {\n\t\t\tblocks,\n\t\t\treplay: void 0\n\t\t};\n\t\treturn {\n\t\t\tblocks,\n\t\t\treplay: kept === void 0 || blocks.length === all.length ? envelope : {\n\t\t\t\tresponse: envelope.response,\n\t\t\t\tblocks: envelope.blocks.filter((_, position) => kept[position])\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Assemble all blocks seen so far, in stream order.\n\t* @returns one block per seen index, except that max-token truncation drops\n\t* tool calls that cannot be executed safely; an open block assembles from\n\t* its accumulated deltas (an unknown block type never closed by `block-end` throws).\n\t*/\n\tblocks() {\n\t\treturn this.assembled().blocks;\n\t}\n\t/**\n\t* Assemble the prefix an interrupted stream can safely finalize: closed and\n\t* open text/reasoning blocks with non-whitespace content, in stream order.\n\t* Tool calls are omitted because interruption precedes dispatch; retaining\n\t* one would require a fabricated result. Open unknown blocks are also omitted.\n\t* @returns the kept blocks; empty when nothing streamed before the interruption.\n\t*/\n\tinterruptedBlocks() {\n\t\treturn this.order.map((index) => {\n\t\t\tconst partial = this.mustGet(index);\n\t\t\tconst type = partial.block?.type ?? partial.blockType;\n\t\t\tif (type !== \"text\" && type !== \"reasoning\") return void 0;\n\t\t\treturn this.assemble(partial, index);\n\t\t}).filter((block) => (block?.type === \"text\" || block?.type === \"reasoning\") && block.text.trim() !== \"\");\n\t}\n\t/** Usage from the `usage` chunk; undefined until one arrives. */\n\tget usage() {\n\t\treturn this._usage;\n\t}\n\t/** Finish reason from the `finish` chunk; `{kind: 'stop'}` when the stream ended without one. */\n\tget finish() {\n\t\treturn this._finish ?? { kind: \"stop\" };\n\t}\n\t/**\n\t* Replay metadata from the terminal finish chunk, if any, with per-block\n\t* entries pruned in step with {@link blocks}. Undefined when the envelope's\n\t* entries do not align with the emitted blocks.\n\t*/\n\tget replayState() {\n\t\treturn this.assembled().replay;\n\t}\n\t/**\n\t* The assembled assistant message.\n\t* @param source - provider/model attribution (without the `kind` tag) for the assembled message.\n\t* @returns a frozen assistant-role message over `blocks()` (same open-block assembly rules).\n\t*/\n\tmessage(source) {\n\t\treturn createAssistantMessage({\n\t\t\tcontent: this.blocks(),\n\t\t\tsource\n\t\t});\n\t}\n};\n//#endregion\n//#region lib/types/assistant-stream.js\n/**\n* Lossless compact representation of one model-stream attempt, plus record-level\n* readers that answer common consumer questions without materializing members.\n* Readers trust the static record type; expandAssistantStream is the validating\n* path for records read at a durable boundary.\n*/\nfunction safeTime(value) {\n\tif (!Number.isSafeInteger(value)) throw new TypeError(`Assistant stream time must be a safe integer, got ${String(value)}`);\n\treturn value;\n}\nfunction safeIndex(value, label) {\n\tif (!Number.isSafeInteger(value) || value < 0 || Object.is(value, -0)) throw new TypeError(`${label} index must be a non-negative safe integer`);\n\treturn value;\n}\nfunction snapshotChunk(chunk) {\n\tconst snapshot = snapshotJsonValue(chunk);\n\tif (snapshot === void 0) throw new TypeError(\"Assistant stream chunk must be losslessly JSON-serializable\");\n\treturn snapshot;\n}\nfunction safeGap(previous, next) {\n\tconst gap = next - previous;\n\treturn Number.isSafeInteger(gap) && previous + gap === next ? gap : void 0;\n}\n/** Incrementally compacts one attempt without retaining a second raw-chunk list. */\nvar AssistantStreamAccumulator = class {\n\trecords = [];\n\t/**\n\t* Add one timed chunk to the compact attempt stream.\n\t* @param value - model chunk and its original Session timestamp.\n\t* @returns a detached immutable copy for assembly and live publication.\n\t*/\n\tpush(value) {\n\t\tconst time = safeTime(value.time);\n\t\tconst chunk = snapshotChunk(value.chunk);\n\t\tconst timed = deepFreeze({\n\t\t\ttime,\n\t\t\tchunk\n\t\t});\n\t\tconst previous = this.records.at(-1);\n\t\tswitch (chunk.type) {\n\t\t\tcase \"text-delta\":\n\t\t\tcase \"reasoning-delta\": {\n\t\t\t\tsafeIndex(chunk.index, chunk.type);\n\t\t\t\tif (typeof chunk.text !== \"string\") throw new TypeError(`${chunk.type} text must be a string`);\n\t\t\t\tconst type = chunk.type === \"text-delta\" ? \"text-chunks\" : \"reasoning-chunks\";\n\t\t\t\tconst gap = previous !== void 0 && previous.type === type ? safeGap(previous.lastTime, time) : void 0;\n\t\t\t\tif (previous !== void 0 && previous.type === type && previous.index === chunk.index && gap !== void 0) {\n\t\t\t\t\tprevious.dt.push(gap);\n\t\t\t\t\tprevious.texts.push(chunk.text);\n\t\t\t\t\tprevious.lastTime = time;\n\t\t\t\t} else this.records.push({\n\t\t\t\t\ttype,\n\t\t\t\t\ttime0: time,\n\t\t\t\t\tindex: chunk.index,\n\t\t\t\t\tdt: [],\n\t\t\t\t\ttexts: [chunk.text],\n\t\t\t\t\tlastTime: time\n\t\t\t\t});\n\t\t\t\treturn timed;\n\t\t\t}\n\t\t\tcase \"tool-call-delta\": {\n\t\t\t\tsafeIndex(chunk.index, chunk.type);\n\t\t\t\tif (typeof chunk.id !== \"string\") throw new TypeError(\"tool-call-delta id must be a string\");\n\t\t\t\tif (Object.hasOwn(chunk, \"name\") && typeof chunk.name !== \"string\") throw new TypeError(\"tool-call-delta name must be a string\");\n\t\t\t\tif (typeof chunk.argumentsDelta !== \"string\") throw new TypeError(\"tool-call-delta argumentsDelta must be a string\");\n\t\t\t\tif (chunk.id.length === 0 || chunk.name === \"\") {\n\t\t\t\t\tthis.records.push({\n\t\t\t\t\t\ttype: \"chunk\",\n\t\t\t\t\t\ttime,\n\t\t\t\t\t\tchunk\n\t\t\t\t\t});\n\t\t\t\t\treturn timed;\n\t\t\t\t}\n\t\t\t\tconst gap = previous?.type === \"tool-call-chunks\" ? safeGap(previous.lastTime, time) : void 0;\n\t\t\t\tconst sameName = previous?.type === \"tool-call-chunks\" && Object.hasOwn(previous, \"name\") === Object.hasOwn(chunk, \"name\") && previous.name === chunk.name;\n\t\t\t\tif (previous?.type === \"tool-call-chunks\" && previous.index === chunk.index && previous.id === chunk.id && sameName && gap !== void 0) {\n\t\t\t\t\tprevious.dt.push(gap);\n\t\t\t\t\tprevious.args.push(chunk.argumentsDelta);\n\t\t\t\t\tprevious.lastTime = time;\n\t\t\t\t} else this.records.push({\n\t\t\t\t\ttype: \"tool-call-chunks\",\n\t\t\t\t\ttime0: time,\n\t\t\t\t\tindex: chunk.index,\n\t\t\t\t\tdt: [],\n\t\t\t\t\tid: chunk.id,\n\t\t\t\t\t...Object.hasOwn(chunk, \"name\") ? { name: chunk.name } : {},\n\t\t\t\t\targs: [chunk.argumentsDelta],\n\t\t\t\t\tlastTime: time\n\t\t\t\t});\n\t\t\t\treturn timed;\n\t\t\t}\n\t\t\tcase \"block-start\":\n\t\t\tcase \"block-end\":\n\t\t\tcase \"usage\":\n\t\t\tcase \"finish\":\n\t\t\t\tthis.records.push({\n\t\t\t\t\ttype: \"chunk\",\n\t\t\t\t\ttime,\n\t\t\t\t\tchunk\n\t\t\t\t});\n\t\t\t\treturn timed;\n\t\t\tdefault: return assertNever(chunk, \"AssistantStreamAccumulator.push\");\n\t\t}\n\t}\n\t/**\n\t* Return the current compact attempt stream.\n\t* @returns a detached immutable record list suitable for a durable event.\n\t*/\n\tsnapshot() {\n\t\treturn deepFreeze(this.records.map((record) => {\n\t\t\tif (record.type === \"chunk\") return { ...record };\n\t\t\tconst { lastTime: _lastTime, ...durable } = record;\n\t\t\tif (durable.type === \"tool-call-chunks\") return {\n\t\t\t\t...durable,\n\t\t\t\tdt: [...durable.dt],\n\t\t\t\targs: [...durable.args]\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...durable,\n\t\t\t\tdt: [...durable.dt],\n\t\t\t\ttexts: [...durable.texts]\n\t\t\t};\n\t\t}));\n\t}\n};\n/**\n* Expand compact records into the exact timed chunk sequence.\n* @param stream - compact records from one durable Assistant settlement.\n* @returns detached timed chunks with every original delta boundary preserved.\n* @throws {TypeError} when a record or reconstructed timestamp is invalid.\n*/\nfunction expandAssistantStream(stream) {\n\tconst chunks = [];\n\tfor (const candidate of stream) {\n\t\tconst record = validateRecord(candidate);\n\t\tif (record.type === \"chunk\") {\n\t\t\tchunks.push({\n\t\t\t\ttime: record.time,\n\t\t\t\tchunk: record.chunk\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst members = record.type === \"tool-call-chunks\" ? record.args : record.texts;\n\t\tlet time = record.time0;\n\t\tfor (let index = 0; index < members.length; index += 1) {\n\t\t\tif (index > 0) time += record.dt[index - 1];\n\t\t\tlet chunk;\n\t\t\tif (record.type === \"text-chunks\") chunk = {\n\t\t\t\ttype: \"text-delta\",\n\t\t\t\tindex: record.index,\n\t\t\t\ttext: members[index]\n\t\t\t};\n\t\t\telse if (record.type === \"reasoning-chunks\") chunk = {\n\t\t\t\ttype: \"reasoning-delta\",\n\t\t\t\tindex: record.index,\n\t\t\t\ttext: members[index]\n\t\t\t};\n\t\t\telse chunk = {\n\t\t\t\ttype: \"tool-call-delta\",\n\t\t\t\tindex: record.index,\n\t\t\t\tid: record.id,\n\t\t\t\t...Object.hasOwn(record, \"name\") ? { name: record.name } : {},\n\t\t\t\targumentsDelta: members[index]\n\t\t\t};\n\t\t\tchunks.push({\n\t\t\t\ttime,\n\t\t\t\tchunk\n\t\t\t});\n\t\t}\n\t}\n\treturn chunks;\n}\nfunction hasNonWhitespace(text) {\n\treturn /\\S/.test(text);\n}\nfunction blockIsVisible(block) {\n\tif (block.type === \"tool-call\") return false;\n\tif (block.type === \"text\" || block.type === \"reasoning\") return hasNonWhitespace(block.text);\n\treturn true;\n}\n/**\n* Whether one chunk carries the model's first output token for latency measurement.\n* @param chunk - any stream chunk.\n* @returns true for a non-empty text, reasoning, or Tool-call arguments fragment and for\n* every name-bearing Tool-call delta; false for block, usage, and finish chunks.\n*/\nfunction isTokenDelta(chunk) {\n\tswitch (chunk.type) {\n\t\tcase \"text-delta\":\n\t\tcase \"reasoning-delta\": return chunk.text !== \"\";\n\t\tcase \"tool-call-delta\": return chunk.argumentsDelta !== \"\" || chunk.name !== void 0;\n\t\tdefault: return false;\n\t}\n}\n/**\n* Whether one chunk by itself contributes reader-visible transcript content.\n* Text and reasoning count only with non-whitespace content, streamed as a delta or\n* completed as a block; a block of any other kind counts at its start and its end,\n* except a Tool call, which is protocol rather than content. Usage and finish never count.\n* @param chunk - any stream chunk.\n* @returns whether a transcript reader would see this chunk.\n*/\nfunction isVisibleChunk(chunk) {\n\tswitch (chunk.type) {\n\t\tcase \"text-delta\":\n\t\tcase \"reasoning-delta\": return hasNonWhitespace(chunk.text);\n\t\tcase \"block-start\": return chunk.blockType !== \"text\" && chunk.blockType !== \"reasoning\" && chunk.blockType !== \"tool-call\";\n\t\tcase \"block-end\": return blockIsVisible(chunk.block);\n\t\tdefault: return false;\n\t}\n}\n/**\n* Whether one chunk carries non-whitespace text, as a text delta or a completed text block.\n* Reasoning, Tool calls, and other block kinds never count.\n* @param chunk - any stream chunk.\n* @returns whether the chunk contributes visible text.\n*/\nfunction chunkHasVisibleText(chunk) {\n\tif (chunk.type === \"text-delta\") return hasNonWhitespace(chunk.text);\n\treturn chunk.type === \"block-end\" && chunk.block.type === \"text\" && hasNonWhitespace(chunk.block.text);\n}\nfunction firstRunMemberTime(run, predicate) {\n\tconst fragments = run.type === \"tool-call-chunks\" ? run.args : run.texts;\n\tlet time = run.time0;\n\tfor (let index = 0; index < fragments.length; index += 1) {\n\t\tif (index > 0) time += run.dt[index - 1];\n\t\tif (predicate(fragments[index])) return time;\n\t}\n}\n/**\n* Time of the first member of one packed run that {@link isTokenDelta} accepts: a\n* name-bearing Tool-call run starts at its first member, otherwise the first non-empty fragment.\n* Stops scanning at that member.\n* @param run - one packed delta run.\n* @returns the member's reconstructed time, or undefined when no member qualifies.\n*/\nfunction runFirstTokenTime(run) {\n\tif (run.type === \"tool-call-chunks\" && run.name !== void 0) return run.time0;\n\treturn firstRunMemberTime(run, (fragment) => fragment !== \"\");\n}\n/**\n* Time of the first member of one packed run that {@link isVisibleChunk} accepts: the first\n* non-whitespace text or reasoning fragment. A Tool-call run has none. Stops scanning at that member.\n* @param run - one packed delta run.\n* @returns the member's reconstructed time, or undefined when no member qualifies.\n*/\nfunction runFirstVisibleTime(run) {\n\treturn run.type === \"tool-call-chunks\" ? void 0 : firstRunMemberTime(run, hasNonWhitespace);\n}\n/**\n* Time of the first token in one compact stream per {@link isTokenDelta}, read from the\n* records themselves and stopping at the first qualifying member.\n* @param stream - compact records from one durable Assistant settlement.\n* @returns the first token's time, or undefined when the stream carries no token.\n*/\nfunction assistantStreamFirstTokenTime(stream) {\n\tfor (const record of stream) {\n\t\tconst time = record.type === \"chunk\" ? isTokenDelta(record.chunk) ? record.time : void 0 : runFirstTokenTime(record);\n\t\tif (time !== void 0) return time;\n\t}\n}\n/**\n* Whether one compact stream carries any reader-visible content per {@link isVisibleChunk},\n* stopping at the first qualifying member.\n* @param stream - compact records from one durable Assistant settlement.\n* @returns whether a transcript reader would see anything from this stream.\n*/\nfunction assistantStreamHasVisibleContent(stream) {\n\treturn stream.some((record) => record.type === \"chunk\" ? isVisibleChunk(record.chunk) : runFirstVisibleTime(record) !== void 0);\n}\n/**\n* Whether one compact stream carries non-whitespace text per {@link chunkHasVisibleText},\n* stopping at the first qualifying member.\n* @param stream - compact records from one durable Assistant settlement.\n* @returns whether the stream contributes visible text.\n*/\nfunction assistantStreamHasVisibleText(stream) {\n\treturn stream.some((record) => record.type === \"text-chunks\" ? record.texts.some(hasNonWhitespace) : record.type === \"chunk\" && chunkHasVisibleText(record.chunk));\n}\n/**\n* The last raw chunk of one never-packed type, scanning backwards and stopping at the first hit.\n* @param stream - compact records from one durable Assistant settlement.\n* @param type - chunk type that only appears as a raw record.\n* @returns the stream's final chunk of that type, or undefined when it has none.\n*/\nfunction lastAssistantStreamChunk(stream, type) {\n\tfor (let index = stream.length - 1; index >= 0; index -= 1) {\n\t\tconst record = stream[index];\n\t\tif (record.type === \"chunk\" && record.chunk.type === type) return record.chunk;\n\t}\n}\n/**\n* Every raw chunk of one never-packed type, in stream order.\n* @param stream - compact records from one durable Assistant settlement.\n* @param type - chunk type that only appears as a raw record.\n* @returns the matching chunks; empty when the stream has none.\n*/\nfunction assistantStreamChunks(stream, type) {\n\tconst chunks = [];\n\tfor (const record of stream) if (record.type === \"chunk\" && record.chunk.type === type) chunks.push(record.chunk);\n\treturn chunks;\n}\n/**\n* Every streamed text-delta fragment joined in stream order; reasoning and Tool-call fragments are excluded.\n* @param stream - compact records from one durable Assistant settlement.\n* @returns the joined text, empty when the stream carries no text delta.\n*/\nfunction joinAssistantStreamText(stream) {\n\tconst parts = [];\n\tfor (const record of stream) if (record.type === \"text-chunks\") parts.push(record.texts.join(\"\"));\n\telse if (record.type === \"chunk\" && record.chunk.type === \"text-delta\") parts.push(record.chunk.text);\n\treturn parts.join(\"\");\n}\n/**\n* Feed one compact stream into a {@link BlockAssembler} without materializing members.\n* Each run contributes one delta carrying its joined fragments, which assembles the same\n* blocks as the original per-member deltas because assembly only concatenates them;\n* raw chunks are pushed as recorded. The records are trusted, not validated: validate a\n* stream read at a durable boundary with {@link expandAssistantStream} first.\n* @param stream - compact records from one durable Assistant settlement.\n* @param assembler - assembler to feed; a fresh one by default.\n* @returns the same assembler after every record was pushed.\n*/\nfunction assembleAssistantStream(stream, assembler = new BlockAssembler()) {\n\tfor (const record of stream) switch (record.type) {\n\t\tcase \"chunk\":\n\t\t\tassembler.push(record.chunk);\n\t\t\tbreak;\n\t\tcase \"text-chunks\":\n\t\t\tassembler.push({\n\t\t\t\ttype: \"text-delta\",\n\t\t\t\tindex: record.index,\n\t\t\t\ttext: record.texts.join(\"\")\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"reasoning-chunks\":\n\t\t\tassembler.push({\n\t\t\t\ttype: \"reasoning-delta\",\n\t\t\t\tindex: record.index,\n\t\t\t\ttext: record.texts.join(\"\")\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"tool-call-chunks\":\n\t\t\tassembler.push({\n\t\t\t\ttype: \"tool-call-delta\",\n\t\t\t\tindex: record.index,\n\t\t\t\tid: record.id,\n\t\t\t\t...record.name === void 0 ? {} : { name: record.name },\n\t\t\t\targumentsDelta: record.args.join(\"\")\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault: assertNever(record, \"assembleAssistantStream\");\n\t}\n\treturn assembler;\n}\nfunction validateRecord(value) {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) throw new TypeError(\"Assistant stream record must be an object\");\n\tconst record = value;\n\tswitch (record.type) {\n\t\tcase \"text-chunks\":\n\t\tcase \"reasoning-chunks\": {\n\t\t\texactKeys(record, [\n\t\t\t\t\"type\",\n\t\t\t\t\"time0\",\n\t\t\t\t\"index\",\n\t\t\t\t\"dt\",\n\t\t\t\t\"texts\"\n\t\t\t], record.type);\n\t\t\tconst texts = stringArray(record.texts, `${record.type} texts`);\n\t\t\tif (texts.length === 0) throw new TypeError(`${record.type} texts must be non-empty`);\n\t\t\tvalidateRun(record, texts.length, record.type);\n\t\t\treturn record;\n\t\t}\n\t\tcase \"tool-call-chunks\": {\n\t\t\texactKeys(record, Object.hasOwn(record, \"name\") ? [\n\t\t\t\t\"type\",\n\t\t\t\t\"time0\",\n\t\t\t\t\"index\",\n\t\t\t\t\"dt\",\n\t\t\t\t\"id\",\n\t\t\t\t\"name\",\n\t\t\t\t\"args\"\n\t\t\t] : [\n\t\t\t\t\"type\",\n\t\t\t\t\"time0\",\n\t\t\t\t\"index\",\n\t\t\t\t\"dt\",\n\t\t\t\t\"id\",\n\t\t\t\t\"args\"\n\t\t\t], record.type);\n\t\t\tconst args = stringArray(record.args, \"tool-call-chunks args\");\n\t\t\tif (args.length === 0) throw new TypeError(\"tool-call-chunks args must be non-empty\");\n\t\t\tif (typeof record.id !== \"string\" || record.id.length === 0) throw new TypeError(\"tool-call-chunks id must be a non-empty string\");\n\t\t\tif (record.name !== void 0 && (typeof record.name !== \"string\" || record.name.length === 0)) throw new TypeError(\"tool-call-chunks name must be a non-empty string\");\n\t\t\tvalidateRun(record, args.length, record.type);\n\t\t\treturn record;\n\t\t}\n\t\tcase \"chunk\": {\n\t\t\texactKeys(record, [\n\t\t\t\t\"type\",\n\t\t\t\t\"time\",\n\t\t\t\t\"chunk\"\n\t\t\t], \"chunk\");\n\t\t\tconst time = safeTime(record.time);\n\t\t\tif (typeof record.chunk !== \"object\" || record.chunk === null || Array.isArray(record.chunk)) throw new TypeError(\"Assistant stream raw chunk must be a lossless JSON object\");\n\t\t\tlet chunk;\n\t\t\ttry {\n\t\t\t\tchunk = snapshotChunk(record.chunk);\n\t\t\t} catch (error) {\n\t\t\t\tthrow new TypeError(\"Assistant stream raw chunk must be a lossless JSON object\", { cause: error });\n\t\t\t}\n\t\t\treturn deepFreeze({\n\t\t\t\ttype: \"chunk\",\n\t\t\t\ttime,\n\t\t\t\tchunk\n\t\t\t});\n\t\t}\n\t\tdefault: throw new TypeError(`Unsupported Assistant stream record ${JSON.stringify(record.type)}`);\n\t}\n}\nfunction validateRun(record, members, label) {\n\tsafeTime(record.time0);\n\tsafeIndex(record.index, label);\n\tif (!Array.isArray(record.dt) || record.dt.some((value) => !Number.isSafeInteger(value))) throw new TypeError(`${label} dt must contain safe integers`);\n\tif (record.dt.length !== members - 1) throw new TypeError(`${label} dt length must be one less than its members`);\n\tlet time = record.time0;\n\tfor (const gap of record.dt) {\n\t\ttime += gap;\n\t\tif (!Number.isSafeInteger(time)) throw new TypeError(`${label} member times must stay safe integers`);\n\t}\n}\nfunction stringArray(value, label) {\n\tif (!Array.isArray(value) || value.some((member) => typeof member !== \"string\")) throw new TypeError(`${label} must be a string array`);\n\treturn value;\n}\nfunction exactKeys(record, keys, label) {\n\tif (Object.keys(record).length !== keys.length || !keys.every((key) => Object.hasOwn(record, key))) throw new TypeError(`${label} Assistant stream record must contain exactly ${keys.join(\", \")}`);\n}\n//#endregion\n//#region lib/types/index.js\n/**\n* LLM service: adapter registry with a waterfall-interceptable streaming call\n* API. Exports the `LlmRuntime` default, the abstract `LlmAdapter` for\n* provider backends, and `BlockAssembler` for chunk assembly.\n*\n* @module @deepseek-ai/dsh-llm\n*/\nvar __runInitializers = function(thisArg, initializers, value) {\n\tvar useValue = arguments.length > 2;\n\tfor (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n\treturn useValue ? value : void 0;\n};\nvar __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n\tfunction accept(f) {\n\t\tif (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\");\n\t\treturn f;\n\t}\n\tvar kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n\tvar target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n\tvar descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n\tvar _, done = false;\n\tfor (var i = decorators.length - 1; i >= 0; i--) {\n\t\tvar context = {};\n\t\tfor (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n\t\tfor (var p in contextIn.access) context.access[p] = contextIn.access[p];\n\t\tcontext.addInitializer = function(f) {\n\t\t\tif (done) throw new TypeError(\"Cannot add initializers after decoration has completed\");\n\t\t\textraInitializers.push(accept(f || null));\n\t\t};\n\t\tvar result = (0, decorators[i])(kind === \"accessor\" ? {\n\t\t\tget: descriptor.get,\n\t\t\tset: descriptor.set\n\t\t} : descriptor[key], context);\n\t\tif (kind === \"accessor\") {\n\t\t\tif (result === void 0) continue;\n\t\t\tif (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n\t\t\tif (_ = accept(result.get)) descriptor.get = _;\n\t\t\tif (_ = accept(result.set)) descriptor.set = _;\n\t\t\tif (_ = accept(result.init)) initializers.unshift(_);\n\t\t} else if (_ = accept(result)) if (kind === \"field\") initializers.unshift(_);\n\t\telse descriptor[key] = _;\n\t}\n\tif (target) Object.defineProperty(target, contextIn.name, descriptor);\n\tdone = true;\n};\n/**\n* Typed error for LLM-related failures. Extends {@link HarnessError}, so the\n* `code` string (e.g. `AUTH`, `RATE_LIMIT`, `NO_ADAPTER`) is shared taxonomy.\n*/\nvar LlmError = class extends HarnessError {\n\t/** Serializable facts retained beside this live Error. */\n\tfailure;\n\t/**\n\t* @param message - non-empty human-readable failure summary.\n\t* @param code - non-empty stable provider-neutral machine code.\n\t* @param options - optional cause and validated serializable provider facts.\n\t*/\n\tconstructor(message, code, options) {\n\t\tif (typeof message !== \"string\" || message.length === 0) throw new Error(\"LlmError message must be a non-empty string\");\n\t\tif (typeof code !== \"string\" || code.length === 0) throw new Error(\"LlmError code must be a non-empty string\");\n\t\tif (options?.status !== void 0 && (!Number.isInteger(options.status) || options.status < 100 || options.status > 599)) throw new Error(\"LlmError status must be an integer from 100 through 599\");\n\t\tif (options?.providerRetryAfterMs !== void 0 && (!Number.isFinite(options.providerRetryAfterMs) || options.providerRetryAfterMs <= 0)) throw new Error(\"LlmError providerRetryAfterMs must be a positive finite number\");\n\t\tif (options?.requestId !== void 0 && (typeof options.requestId !== \"string\" || options.requestId.length === 0)) throw new Error(\"LlmError requestId must be a non-empty string\");\n\t\tsuper(message, code, options);\n\t\tthis.name = \"LlmError\";\n\t\tthis.failure = Object.freeze({\n\t\t\tmessage,\n\t\t\tcode,\n\t\t\t...options?.status === void 0 ? {} : { status: options.status },\n\t\t\t...options?.providerRetryAfterMs === void 0 ? {} : { providerRetryAfterMs: options.providerRetryAfterMs },\n\t\t\t...options?.requestId === void 0 ? {} : { requestId: options.requestId },\n\t\t\t...options?.offloadImages === void 0 ? {} : { offloadImages: options.offloadImages }\n\t\t});\n\t}\n};\n/**\n* Accept one supplied credential, or refuse it as unusable.\n*\n* A stored key arrives from the credentials seam, a `.env` line, or a shell\n* export, all of which pick up surrounding whitespace, so trimming is silent.\n* Anything else fails here rather than inside `fetch`, whose ByteString\n* refusal names a UTF-16 code point instead of the setting to change. The key\n* never enters the message: `ref` names where to fix it, and echoing any part\n* of a secret into a log or a UI is the failure this diagnosis avoids.\n*\n* Lives beside {@link LlmError} rather than in `./api-key.ts` so the predicate\n* module stays dependency-free; both adapters share this one diagnosis instead\n* of keeping near-identical local copies.\n* @param raw - the credential exactly as supplied.\n* @param pkg - the refusing package name, prefixed to the diagnostic.\n* @param ref - the credential reference the value resolved through.\n* @returns the trimmed, usable key.\n*/\nfunction assertUsableApiKey(raw, pkg, ref) {\n\tconst checked = normalizeApiKey(raw);\n\tif (checked.ok) return checked.value;\n\tthrow new LlmError(checked.reason === \"empty\" ? `${pkg}: the API key resolved from ${ref} is blank; set ${ref} to the raw key (the web Models page writes it) or export it in the launching environment` : `${pkg}: the API key resolved from ${ref} contains characters no HTTP header can carry; set ${ref} to the raw key alone (the web Models page writes it)`, INVALID_CREDENTIAL_CODE);\n}\n/**\n* Provider-wire adapter for the harness message and stream vocabulary. Register implementations\n* with `ctx.llm.registerAdapter(providers, adapter)`. Every provider HTTP request must include\n* `attributionHeaders()`; prove the headers are added in the wire request or library header hook. The direct-fetch\n* DeepSeek and library-backed pi-ai adapters meet this contract through different internals.\n*/\nvar LlmAdapter = class {\n\t/**\n\t* Describe one provider route owned by this adapter.\n\t* @param provider - a route passed to `registerAdapter()` for this instance.\n\t* @returns detached display metadata whose id must equal `provider`.\n\t*/\n\tproviderInfo(provider) {\n\t\treturn {\n\t\t\tid: provider,\n\t\t\tname: provider\n\t\t};\n\t}\n\t/**\n\t* Return the provider-owned retry policy captured with this route.\n\t* @param _provider - a route passed to `registerAdapter()` for this instance.\n\t* @returns a resolved policy, or `undefined` to use the normal defaults.\n\t*/\n\tproviderRetryPolicy(_provider) {}\n\t/**\n\t* Resolve provider-side request-image pricing for one exact model route.\n\t* The default declares none, so consumers fall back to their own neutral\n\t* estimate. Implementations must answer synchronously without I/O; the\n\t* token meter resolves this per measurement.\n\t* @param _provider - a route passed to `registerAdapter()` for this instance.\n\t* @param _model - exact model id passed to {@link GenerateOptions.model}.\n\t* @returns route-owned image pricing, or `undefined` when the route declares none.\n\t*/\n\timageRequestPricing(_provider, _model) {}\n\t/**\n\t* Resolve the image dimensions and byte target this adapter sends to the model.\n\t* The default preserves normalized images; adapters that resize must override it.\n\t* @param _provider - registered provider route.\n\t* @param _model - exact model id.\n\t* @param image - normalized image whose request projection is being resolved.\n\t* @returns the same target used by request serialization, before provider-internal processing.\n\t*/\n\timageRequestTarget(_provider, _model, image) {\n\t\treturn {\n\t\t\twidth: image.width,\n\t\t\theight: image.height,\n\t\t\tmaxBytes: image.bytes\n\t\t};\n\t}\n\t/**\n\t* List models this adapter can currently advertise for one owned provider.\n\t* Core routing accepts unlisted model ids; catalog-driven entry points such\n\t* as the GUI may require membership. Adapters used there must advertise\n\t* their available models; the base empty catalog offers no GUI selection.\n\t* @param _provider - one provider route owned by this adapter.\n\t* @returns discoverable models in adapter-preferred order.\n\t*/\n\tlistModels(_provider) {\n\t\treturn Promise.resolve([]);\n\t}\n\t/**\n\t* Resolve all metadata available for one exact model. This query is\n\t* independent of the advisory catalog and does not validate request routing.\n\t* @param provider - one provider route owned by this adapter.\n\t* @param model - exact model id passed to {@link GenerateOptions.model}.\n\t* @param _signal - cancellation for this exact-model lookup; asynchronous\n\t* implementations must settle promptly after it aborts.\n\t* @returns provider/model identity plus any context, call-default, and reasoning metadata.\n\t*/\n\tresolveModel(provider, model, _signal) {\n\t\treturn Promise.resolve({\n\t\t\tprovider,\n\t\t\tid: model,\n\t\t\tname: model\n\t\t});\n\t}\n\t/**\n\t* Bind exact model metadata and the eventual request dispatch to one adapter generation.\n\t* Dynamic adapters override this so settings changes between preparation and\n\t* dispatch cannot combine one generation's capabilities with another's endpoint.\n\t* @param provider - registered provider route.\n\t* @param model - exact model id.\n\t* @param signal - cancellation for model resolution.\n\t* @returns model metadata and a one-generation stream entry point.\n\t*/\n\tasync prepareCall(provider, model, signal) {\n\t\treturn {\n\t\t\tmodel: await this.resolveModel(provider, model, signal),\n\t\t\tstream: (options) => this.stream(options)\n\t\t};\n\t}\n};\n/**\n* The abstract `llm` service: an adapter registry plus a streaming model-call\n* API, interceptable via the `llm/stream` waterfall.\n*/\nlet LlmRuntime = (() => {\n\tlet _classSuper = TypertRemoteService;\n\tlet _instanceExtraInitializers = [];\n\tlet _listProviders_decorators;\n\tlet _listConfigurableProviders_decorators;\n\tlet _remoteDiscoverModels_decorators;\n\treturn class LlmRuntime extends _classSuper {\n\t\tstatic {\n\t\t\tconst _metadata = typeof Symbol === \"function\" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;\n\t\t\t_listProviders_decorators = [Remote];\n\t\t\t_listConfigurableProviders_decorators = [Remote];\n\t\t\t_remoteDiscoverModels_decorators = [Remote(\"discoverModels\")];\n\t\t\t__esDecorate(this, null, _listProviders_decorators, {\n\t\t\t\tkind: \"method\",\n\t\t\t\tname: \"listProviders\",\n\t\t\t\tstatic: false,\n\t\t\t\tprivate: false,\n\t\t\t\taccess: {\n\t\t\t\t\thas: (obj) => \"listProviders\" in obj,\n\t\t\t\t\tget: (obj) => obj.listProviders\n\t\t\t\t},\n\t\t\t\tmetadata: _metadata\n\t\t\t}, null, _instanceExtraInitializers);\n\t\t\t__esDecorate(this, null, _listConfigurableProviders_decorators, {\n\t\t\t\tkind: \"method\",\n\t\t\t\tname: \"listConfigurableProviders\",\n\t\t\t\tstatic: false,\n\t\t\t\tprivate: false,\n\t\t\t\taccess: {\n\t\t\t\t\thas: (obj) => \"listConfigurableProviders\" in obj,\n\t\t\t\t\tget: (obj) => obj.listConfigurableProviders\n\t\t\t\t},\n\t\t\t\tmetadata: _metadata\n\t\t\t}, null, _instanceExtraInitializers);\n\t\t\t__esDecorate(this, null, _remoteDiscoverModels_decorators, {\n\t\t\t\tkind: \"method\",\n\t\t\t\tname: \"remoteDiscoverModels\",\n\t\t\t\tstatic: false,\n\t\t\t\tprivate: false,\n\t\t\t\taccess: {\n\t\t\t\t\thas: (obj) => \"remoteDiscoverModels\" in obj,\n\t\t\t\t\tget: (obj) => obj.remoteDiscoverModels\n\t\t\t\t},\n\t\t\t\tmetadata: _metadata\n\t\t\t}, null, _instanceExtraInitializers);\n\t\t\tif (_metadata) Object.defineProperty(this, Symbol.metadata, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: _metadata\n\t\t\t});\n\t\t}\n\t\tadapters = (__runInitializers(this, _instanceExtraInitializers), /* @__PURE__ */ new Map());\n\t\tdirectory = /* @__PURE__ */ new Map();\n\t\tdiscoveries = /* @__PURE__ */ new Map();\n\t\tconstructor(ctx) {\n\t\t\tsuper(ctx, \"llm\");\n\t\t}\n\t\t/** Notify topology observers without letting one broken listener veto the commit. */\n\t\temitAdaptersUpdated() {\n\t\t\tfor (const listener of this.ctx.events.dispatch(\"emit\", [\"llm/adapters-updated\"])) try {\n\t\t\t\tconst returned = listener();\n\t\t\t\tif (returned != null && typeof returned.then === \"function\") Promise.resolve(returned).then(void 0, (error) => {\n\t\t\t\t\tthis.warnAdaptersListenerFailure(error);\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tthis.warnAdaptersListenerFailure(error);\n\t\t\t}\n\t\t}\n\t\t/** Contained-listener diagnostic shared by the sync and async failure paths. */\n\t\twarnAdaptersListenerFailure(error) {\n\t\t\tthis.ctx.logger.warn(\"llm: an llm/adapters-updated listener failed\");\n\t\t\tthis.ctx.logger.warn(error);\n\t\t}\n\t\t/**\n\t\t* Register an adapter for the given provider routes. Throws `LlmError` with code\n\t\t* `DUPLICATE_ADAPTER` if any provider already has an adapter (all-or-nothing).\n\t\t* Disposed with the fiber.\n\t\t* @param providers - every provider route this adapter should serve.\n\t\t* @param adapter - the adapter that streams calls for those providers.\n\t\t* @returns the disposer, carrying {@link AdapterRegistrationHandle.replace}.\n\t\t*/\n\t\tregisterAdapter(providers, adapter) {\n\t\t\tconst owned = /* @__PURE__ */ new Set();\n\t\t\tlet released = false;\n\t\t\tconst dispose = this.ctx.effect(function* () {\n\t\t\t\tif (providers.length === 0) throw new LlmError(\"an adapter must register at least one provider\", \"INVALID_ADAPTER\");\n\t\t\t\tthis.commitRoutes(owned, this.prepareRoutes(providers, adapter, owned));\n\t\t\t\tyield () => {\n\t\t\t\t\treleased = true;\n\t\t\t\t\tfor (const provider of owned) this.adapters.delete(provider);\n\t\t\t\t\towned.clear();\n\t\t\t\t\tthis.emitAdaptersUpdated();\n\t\t\t\t};\n\t\t\t}.bind(this), \"llm.registerAdapter()\");\n\t\t\tconst handle = (() => void dispose());\n\t\t\thandle.replace = (next) => {\n\t\t\t\tif (released) throw new LlmError(\"a disposed adapter registration cannot replace its routes\", \"REGISTRATION_DISPOSED\");\n\t\t\t\tthis.commitRoutes(owned, this.prepareRoutes(next, adapter, owned));\n\t\t\t};\n\t\t\treturn handle;\n\t\t}\n\t\t/**\n\t\t* Validate one candidate route set for `adapter`, treating routes this\n\t\t* registration already holds as available. Nothing is mutated: a rejected\n\t\t* candidate leaves the registry exactly as it was.\n\t\t*/\n\t\tprepareRoutes(providers, adapter, owned) {\n\t\t\tconst unique = /* @__PURE__ */ new Set();\n\t\t\tconst registrations = [];\n\t\t\tfor (const provider of providers) {\n\t\t\t\tif (provider.length === 0) throw new LlmError(\"adapter provider names must be non-empty\", \"INVALID_ADAPTER\");\n\t\t\t\tif (unique.has(provider) || this.adapters.has(provider) && !owned.has(provider)) throw new LlmError(`an adapter for provider \"${provider}\" is already registered`, \"DUPLICATE_ADAPTER\");\n\t\t\t\tconst info = adapter.providerInfo(provider);\n\t\t\t\tif (typeof info.id !== \"string\" || info.id !== provider || typeof info.name !== \"string\" || info.name.length === 0) throw new LlmError(`adapter metadata for provider \"${provider}\" must preserve its id and have a non-empty name`, \"INVALID_ADAPTER\");\n\t\t\t\tunique.add(provider);\n\t\t\t\tconst retryPolicy = adapter.providerRetryPolicy(provider) ?? resolveRetryPolicy(void 0, `llm: provider \"${provider}\" retryPolicy`);\n\t\t\t\tregistrations.push({\n\t\t\t\t\tadapter,\n\t\t\t\t\tprovider: {\n\t\t\t\t\t\tid: info.id,\n\t\t\t\t\t\tname: info.name\n\t\t\t\t\t},\n\t\t\t\t\tretryPolicy\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn registrations;\n\t\t}\n\t\t/**\n\t\t* Swap this registration's routes for the prepared ones in one synchronous\n\t\t* section, so no observer can see the registry between the release and the\n\t\t* re-registration. The route set's one mutation point is also where\n\t\t* `llm/adapters-updated` is published, so a `replace` announces itself\n\t\t* exactly like a first registration.\n\t\t*/\n\t\tcommitRoutes(owned, registrations) {\n\t\t\tfor (const provider of owned) this.adapters.delete(provider);\n\t\t\towned.clear();\n\t\t\tfor (const registration of registrations) {\n\t\t\t\tthis.adapters.set(registration.provider.id, registration);\n\t\t\t\towned.add(registration.provider.id);\n\t\t\t}\n\t\t\tthis.emitAdaptersUpdated();\n\t\t}\n\t\t/**\n\t\t* Describe provider routes with a registered adapter.\n\t\t* @returns detached provider metadata in registration order.\n\t\t*/\n\t\tlistProviders() {\n\t\t\treturn [...this.adapters.values()].map(({ provider }) => ({ ...provider }));\n\t\t}\n\t\t/**\n\t\t* Declare provider routes an adapter plugin can activate through\n\t\t* configuration. Registration is all-or-nothing: an empty list, invalid\n\t\t* entry, or a provider already declared by any registration throws\n\t\t* `LlmError` without registering the rest. Disposed with the fiber.\n\t\t* @param entries - every configurable provider this plugin owns.\n\t\t* @returns a handle that withdraws all of them, and can atomically replace them.\n\t\t*/\n\t\tregisterConfigurableProviders(entries) {\n\t\t\tlet held = [];\n\t\t\tlet disposed = false;\n\t\t\t/**\n\t\t\t* Validate a candidate set in full against everything this registration\n\t\t\t* does not already hold, then publish it. Nothing is written until the\n\t\t\t* whole set passes, so a refused candidate leaves the current entries in\n\t\t\t* place — the property that makes `replace` a swap rather than a\n\t\t\t* delete-then-add that can strand the directory empty.\n\t\t\t*/\n\t\t\tconst commit = (candidates) => {\n\t\t\t\tconst detached = [];\n\t\t\t\tconst own = new Set(held.map((entry) => entry.provider));\n\t\t\t\tfor (const entry of candidates) {\n\t\t\t\t\tif (entry.provider.length === 0 || entry.displayName.length === 0 || entry.settingsNs.length === 0) throw new LlmError(\"configurable providers need a non-empty provider, displayName, and settingsNs\", \"INVALID_DIRECTORY\");\n\t\t\t\t\tif (entry.settingsPath.some((segment) => segment.length === 0)) throw new LlmError(`configurable provider \"${entry.provider}\" has an empty settingsPath segment`, \"INVALID_DIRECTORY\");\n\t\t\t\t\tif (this.directory.has(entry.provider) && !own.has(entry.provider) || detached.some((seen) => seen.provider === entry.provider)) throw new LlmError(`configurable provider \"${entry.provider}\" is already declared`, \"DUPLICATE_DIRECTORY\");\n\t\t\t\t\tdetached.push(detachDirectoryEntry(entry));\n\t\t\t\t}\n\t\t\t\tfor (const entry of held) this.directory.delete(entry.provider);\n\t\t\t\tfor (const entry of detached) this.directory.set(entry.provider, entry);\n\t\t\t\theld = detached;\n\t\t\t\tthis.emitAdaptersUpdated();\n\t\t\t};\n\t\t\tconst dispose = this.ctx.effect(function* () {\n\t\t\t\tif (entries.length === 0) throw new LlmError(\"a configurable-provider registration must declare at least one provider\", \"INVALID_DIRECTORY\");\n\t\t\t\tcommit(entries);\n\t\t\t\tyield () => {\n\t\t\t\t\tdisposed = true;\n\t\t\t\t\tfor (const entry of held) this.directory.delete(entry.provider);\n\t\t\t\t\theld = [];\n\t\t\t\t\tthis.emitAdaptersUpdated();\n\t\t\t\t};\n\t\t\t}.bind(this), \"llm.registerConfigurableProviders()\");\n\t\t\tconst handle = (() => void dispose());\n\t\t\thandle.replace = (next) => {\n\t\t\t\tif (disposed) throw new LlmError(\"this configurable-provider registration was disposed\", \"REGISTRATION_DISPOSED\");\n\t\t\t\tcommit(next);\n\t\t\t};\n\t\t\treturn handle;\n\t\t}\n\t\t/**\n\t\t* List every declared configurable provider, registered or dormant.\n\t\t* @returns detached directory entries in declaration order.\n\t\t*/\n\t\tlistConfigurableProviders() {\n\t\t\treturn [...this.directory.values()].map(detachDirectoryEntry);\n\t\t}\n\t\t/**\n\t\t* Offer to interrogate provider endpoints on behalf of the settings\n\t\t* namespace this plugin owns. The namespace is the key because that is what\n\t\t* a configuration surface already holds from the configurable-provider\n\t\t* directory, and because a provider being *added* has no route to name yet.\n\t\t* Disposed with the fiber.\n\t\t* @param settingsNs - the namespace whose profiles this discovery serves.\n\t\t* @param discover - interrogates one endpoint and must honor the supplied signal.\n\t\t* @returns the disposer that withdraws the offer.\n\t\t*/\n\t\tregisterModelDiscovery(settingsNs, discover) {\n\t\t\tconst dispose = this.ctx.effect(function* () {\n\t\t\t\tif (settingsNs.length === 0) throw new LlmError(\"model discovery needs a non-empty settings namespace\", \"INVALID_DISCOVERY\");\n\t\t\t\tif (this.discoveries.has(settingsNs)) throw new LlmError(`model discovery for \"${settingsNs}\" is already registered`, \"DUPLICATE_DISCOVERY\");\n\t\t\t\tthis.discoveries.set(settingsNs, discover);\n\t\t\t\tyield () => {\n\t\t\t\t\tthis.discoveries.delete(settingsNs);\n\t\t\t\t};\n\t\t\t}.bind(this), \"llm.registerModelDiscovery()\");\n\t\t\treturn () => void dispose();\n\t\t}\n\t\t/**\n\t\t* Interrogate one provider endpoint for the models it advertises. The\n\t\t* request describes a draft, not a stored route, so nothing here reads or\n\t\t* writes settings or credentials — the caller owns both, and the reply is\n\t\t* candidate metadata a surface may offer for adoption.\n\t\t* @param settingsNs - namespace whose registered discovery serves this draft.\n\t\t* @param request - the endpoint, protocol, and one-shot credential to use.\n\t\t* @param signal - caller cancellation.\n\t\t* @returns the advertised models, deduplicated in endpoint order.\n\t\t*/\n\t\tasync discoverModels(settingsNs, request, signal) {\n\t\t\tconst discover = this.discoveries.get(settingsNs);\n\t\t\tif (discover === void 0) throw new LlmError(`no model discovery is registered for \"${settingsNs}\"`, \"NO_DISCOVERY\");\n\t\t\tif ((request.provider ?? \"\").length === 0 && (request.baseURL ?? \"\").length === 0) throw new LlmError(\"model discovery needs a provider route or a baseURL\", \"INVALID_DISCOVERY\");\n\t\t\tconst discovered = signal === void 0 ? await discover(request) : await discover(request, signal);\n\t\t\tconst seen = /* @__PURE__ */ new Set();\n\t\t\tconst models = [];\n\t\t\tfor (const model of discovered) {\n\t\t\t\tif (typeof model.id !== \"string\" || model.id.length === 0 || seen.has(model.id)) continue;\n\t\t\t\tseen.add(model.id);\n\t\t\t\tmodels.push({\n\t\t\t\t\tid: model.id,\n\t\t\t\t\t...model.name === void 0 ? {} : { name: model.name },\n\t\t\t\t\t...model.contextWindow === void 0 ? {} : { contextWindow: model.contextWindow },\n\t\t\t\t\t...model.maxTokens === void 0 ? {} : { maxTokens: model.maxTokens },\n\t\t\t\t\t...model.inputModalities === void 0 ? {} : { inputModalities: [...model.inputModalities] }\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn models;\n\t\t}\n\t\t/**\n\t\t* Remote adapter for one draft provider interrogation.\n\t\t* @param settingsNs - namespace whose registered discovery serves this draft.\n\t\t* @param request - endpoint, protocol, and one-shot credential to use.\n\t\t* @param signal - caller cancellation supplied by the Remote carrier.\n\t\t* @returns advertised models in endpoint order.\n\t\t* @throws RemoteError with `llm/model-discovery-rejected` when discovery refuses or fails.\n\t\t*/\n\t\tasync remoteDiscoverModels(settingsNs, request, signal) {\n\t\t\ttry {\n\t\t\t\treturn await this.discoverModels(settingsNs, request, signal);\n\t\t\t} catch (error) {\n\t\t\t\tthrow new RemoteError(\"llm/model-discovery-rejected\", error instanceof Error ? error.message : String(error), {\n\t\t\t\t\tsettingsNs,\n\t\t\t\t\t...request.baseURL === void 0 ? {} : { baseURL: request.baseURL }\n\t\t\t\t}, { cause: error });\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t* Resolve the retry policy captured when one provider route was registered.\n\t\t* @param provider - registered provider route to inspect.\n\t\t* @returns the provider-owned policy, with normal defaults already resolved.\n\t\t*/\n\t\tproviderRetryPolicy(provider) {\n\t\t\treturn this.registration(provider).retryPolicy;\n\t\t}\n\t\t/**\n\t\t* Resolve provider-side request-image pricing for one exact route, or\n\t\t* `undefined` when the provider is unregistered or declares none. Unknown\n\t\t* providers degrade to `undefined` rather than throwing because callers\n\t\t* price durable history whose route may no longer be mounted.\n\t\t* @param provider - provider route named by a request header.\n\t\t* @param model - exact model id named by the same header.\n\t\t* @returns the owning adapter's image pricing for the route, when declared.\n\t\t*/\n\t\timageRequestPricing(provider, model) {\n\t\t\treturn this.adapters.get(provider)?.adapter.imageRequestPricing(provider, model);\n\t\t}\n\t\t/**\n\t\t* Resolve the image projection for an exact registered model route.\n\t\t* @param provider - registered provider route.\n\t\t* @param model - exact model id.\n\t\t* @param image - normalized image reference.\n\t\t* @returns dimensions and byte target used by the adapter's request serializer.\n\t\t*/\n\t\timageRequestTarget(provider, model, image) {\n\t\t\treturn this.registration(provider).adapter.imageRequestTarget(provider, model, image);\n\t\t}\n\t\t/**\n\t\t* Resolve the exact text one durable file occurrence contributes to every\n\t\t* provider request in the current execution environment.\n\t\t* @param ref - durable verbatim file reference from model history.\n\t\t* @returns the same deterministic handle text used at adapter dispatch.\n\t\t*/\n\t\tfileRequestText(ref) {\n\t\t\treturn fileHandleText(ref, this.fileReadPath(ref));\n\t\t}\n\t\t/** Detach typed adapter-owned modality metadata. */\n\t\tdetachedModalities(modalities) {\n\t\t\treturn modalities === void 0 ? void 0 : [...modalities];\n\t\t}\n\t\t/**\n\t\t* Discover models advertised by one registered provider. Catalog membership\n\t\t* does not constrain core routing. Catalog-driven entry points may restrict\n\t\t* selection and submission to the advertised models.\n\t\t* @param provider - registered provider route to inspect.\n\t\t* @returns detached model metadata in adapter-preferred order.\n\t\t*/\n\t\tasync listModels(provider) {\n\t\t\tconst models = await this.registration(provider).adapter.listModels(provider);\n\t\t\tconst seen = /* @__PURE__ */ new Set();\n\t\t\treturn models.map((model) => {\n\t\t\t\tif (typeof model.provider !== \"string\" || model.provider !== provider || typeof model.id !== \"string\" || model.id.length === 0 || typeof model.name !== \"string\" || model.name.length === 0 || model.description !== void 0 && typeof model.description !== \"string\" || seen.has(model.id)) throw new LlmError(`adapter returned invalid or duplicate model metadata for provider \"${provider}\"`, \"INVALID_CATALOG\");\n\t\t\t\tseen.add(model.id);\n\t\t\t\tconst inputModalities = this.detachedModalities(model.inputModalities);\n\t\t\t\treturn {\n\t\t\t\t\tprovider: model.provider,\n\t\t\t\t\tid: model.id,\n\t\t\t\t\tname: model.name,\n\t\t\t\t\t...model.description === void 0 ? {} : { description: model.description },\n\t\t\t\t\t...inputModalities === void 0 ? {} : { inputModalities }\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\t/**\n\t\t* Resolve and validate all metadata from the adapter that owns one exact\n\t\t* route. The result is detached from adapter-owned objects; catalog\n\t\t* membership remains advisory and does not control request routing.\n\t\t* @param provider - registered provider route to inspect.\n\t\t* @param model - exact model id passed to the adapter.\n\t\t* @param signal - optional cancellation for adapter-owned asynchronous lookup.\n\t\t* @returns exact model identity plus available context and reasoning metadata.\n\t\t*/\n\t\tasync resolveModelInfo(provider, model, signal) {\n\t\t\treturn this.resolveModelInfoFor(this.registration(provider), model, signal);\n\t\t}\n\t\tasync resolveModelInfoFor(registration, model, signal) {\n\t\t\tconst resolved = await registration.adapter.resolveModel(registration.provider.id, model, signal);\n\t\t\treturn this.normalizeModelInfo(registration, model, resolved);\n\t\t}\n\t\t/** Validate and detach one adapter-returned exact model result. */\n\t\tnormalizeModelInfo(registration, model, resolved) {\n\t\t\tconst provider = registration.provider.id;\n\t\t\tif (typeof resolved.provider !== \"string\" || resolved.provider !== provider || typeof resolved.id !== \"string\" || resolved.id !== model || typeof resolved.name !== \"string\" || resolved.name.length === 0 || resolved.description !== void 0 && typeof resolved.description !== \"string\") throw new LlmError(`adapter returned invalid exact model metadata for provider \"${provider}\" model \"${model}\"`, \"INVALID_MODEL_INFO\");\n\t\t\tconst context = resolved.context;\n\t\t\tif (context !== void 0 && (!Number.isInteger(context.contextWindow) || context.contextWindow <= 0)) throw new LlmError(`adapter returned invalid context metadata for provider \"${provider}\" model \"${model}\"`, \"INVALID_MODEL_CONTEXT\");\n\t\t\tconst inputModalities = this.detachedModalities(resolved.inputModalities);\n\t\t\tconst systemPromptUpdate = resolved.systemPromptUpdate;\n\t\t\tif (systemPromptUpdate !== void 0 && systemPromptUpdate !== \"in-history\") throw new LlmError(`adapter returned invalid system prompt update mode for provider \"${provider}\" model \"${model}\"`, \"INVALID_MODEL_INFO\");\n\t\t\tconst toolUpdate = resolved.toolUpdate;\n\t\t\tif (toolUpdate !== void 0 && toolUpdate !== \"in-history\" && toolUpdate !== \"addition-only\") throw new LlmError(`adapter returned invalid tool update mode for provider \"${provider}\" model \"${model}\"`, \"INVALID_MODEL_INFO\");\n\t\t\tconst defaultMaxTokens = resolved.defaultMaxTokens;\n\t\t\tif (defaultMaxTokens !== void 0 && (!Number.isSafeInteger(defaultMaxTokens) || defaultMaxTokens <= 0)) throw new LlmError(`adapter returned invalid default maxTokens for provider \"${provider}\" model \"${model}\"`, \"INVALID_MODEL_MAX_TOKENS\");\n\t\t\tconst info = {\n\t\t\t\tprovider,\n\t\t\t\tid: model,\n\t\t\t\tname: resolved.name,\n\t\t\t\t...resolved.description === void 0 ? {} : { description: resolved.description },\n\t\t\t\t...inputModalities === void 0 ? {} : { inputModalities },\n\t\t\t\t...context === void 0 ? {} : { context: { contextWindow: context.contextWindow } },\n\t\t\t\t...defaultMaxTokens === void 0 ? {} : { defaultMaxTokens },\n\t\t\t\t...resolved.systemPromptUpdate === void 0 ? {} : { systemPromptUpdate: resolved.systemPromptUpdate },\n\t\t\t\t...resolved.toolUpdate === void 0 ? {} : { toolUpdate: resolved.toolUpdate }\n\t\t\t};\n\t\t\tconst reasoning = resolved.reasoning;\n\t\t\tif (reasoning === void 0) return info;\n\t\t\tif (reasoning.efforts.length === 0) throw new LlmError(`adapter returned invalid reasoning metadata for provider \"${provider}\" model \"${model}\"`, \"INVALID_MODEL_REASONING\");\n\t\t\tconst seen = /* @__PURE__ */ new Set();\n\t\t\tconst efforts = reasoning.efforts.map((effort) => {\n\t\t\t\tif (typeof effort.id !== \"string\" || effort.id.length === 0 || typeof effort.name !== \"string\" || effort.name.length === 0 || effort.description !== void 0 && typeof effort.description !== \"string\" || seen.has(effort.id)) throw new LlmError(`adapter returned invalid or duplicate reasoning effort metadata for provider \"${provider}\" model \"${model}\"`, \"INVALID_MODEL_REASONING\");\n\t\t\t\tseen.add(effort.id);\n\t\t\t\treturn {\n\t\t\t\t\tid: effort.id,\n\t\t\t\t\tname: effort.name,\n\t\t\t\t\t...effort.description === void 0 ? {} : { description: effort.description }\n\t\t\t\t};\n\t\t\t});\n\t\t\tif (reasoning.defaultEffort !== void 0 && !seen.has(reasoning.defaultEffort)) throw new LlmError(`adapter returned an unknown default reasoning effort for provider \"${provider}\" model \"${model}\"`, \"INVALID_MODEL_REASONING\");\n\t\t\treturn {\n\t\t\t\t...info,\n\t\t\t\treasoning: {\n\t\t\t\t\tefforts,\n\t\t\t\t\t...reasoning.defaultEffort === void 0 ? {} : { defaultEffort: reasoning.defaultEffort }\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* Validate a conversation call config against its exact model capability and\n\t\t* materialize adapter-configured defaults. Unsupported explicit efforts\n\t\t* reject before provider I/O; no clamping or aliasing is performed. This\n\t\t* standalone query does not bind a later dispatch; use {@link prepareCall}\n\t\t* when logging and streaming must share one adapter registration.\n\t\t* @param config - provider/model route and optional request controls.\n\t\t* @param signal - optional cancellation for adapter-owned capability lookup.\n\t\t* @returns a detached config only when a default must be materialized.\n\t\t*/\n\t\tasync resolveCallConfig(config, signal) {\n\t\t\treturn (await this.resolveCallFor(this.registration(config.provider), config, signal)).config;\n\t\t}\n\t\tasync resolveCallFor(registration, config, signal) {\n\t\t\tconst info = await this.resolveModelInfoFor(registration, config.model, signal);\n\t\t\treturn this.resolveCallWithInfo(config, info);\n\t\t}\n\t\t/** Validate request controls against one already-bound exact model result. */\n\t\tresolveCallWithInfo(config, info) {\n\t\t\tconst defaulted = config.maxTokens === void 0 && info.defaultMaxTokens !== void 0 ? {\n\t\t\t\t...config,\n\t\t\t\tmaxTokens: info.defaultMaxTokens\n\t\t\t} : config;\n\t\t\tconst reasoning = info.reasoning;\n\t\t\tconst requested = defaulted.reasoningEffort;\n\t\t\tlet resolvedConfig = defaulted;\n\t\t\tif (reasoning === void 0) {\n\t\t\t\tif (requested !== void 0) throw new LlmError(`provider \"${config.provider}\" model \"${config.model}\" does not support reasoning effort \"${requested}\"`, \"UNSUPPORTED_REASONING_EFFORT\");\n\t\t\t} else {\n\t\t\t\tconst effective = requested ?? reasoning.defaultEffort;\n\t\t\t\tif (effective !== void 0) {\n\t\t\t\t\tif (!reasoning.efforts.some((effort) => effort.id === effective)) throw new LlmError(`provider \"${config.provider}\" model \"${config.model}\" does not support reasoning effort \"${effective}\"`, \"UNSUPPORTED_REASONING_EFFORT\");\n\t\t\t\t\tif (requested !== effective) resolvedConfig = {\n\t\t\t\t\t\t...defaulted,\n\t\t\t\t\t\treasoningEffort: effective\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tconfig: resolvedConfig,\n\t\t\t\t...info.context === void 0 ? {} : { context: info.context },\n\t\t\t\tmodelInfo: info\n\t\t\t};\n\t\t}\n\t\t/**\n\t\t* Resolve one call under its current adapter registration. The returned\n\t\t* one-shot handle keeps that registration across header logging and dispatch,\n\t\t* so HMR cannot combine one adapter's capability result with another adapter.\n\t\t* An optional synchronous callback selects concrete controls using captured\n\t\t* model metadata. Defaults and validation apply to its result. Callback\n\t\t* failures and cancellation reject preparation before dispatch.\n\t\t* @param config - provider/model route and optional concrete request controls.\n\t\t* @param signal - optional cancellation for adapter-owned capability lookup.\n\t\t* @param configure - pure control selection, called once before defaults and validation.\n\t\t* @returns a prepared config and its registration-bound stream entry point.\n\t\t*/\n\t\tasync prepareCall(config, signal, configure) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\tconst { provider, model, ...controls } = config;\n\t\t\tconst registration = this.registration(provider);\n\t\t\tconst adapterCall = await registration.adapter.prepareCall(provider, model, signal);\n\t\t\tsignal?.throwIfAborted();\n\t\t\tconst modelInfo = this.normalizeModelInfo(registration, model, adapterCall.model);\n\t\t\tconst proposed = configure === void 0 ? config : {\n\t\t\t\t...configure(deepFreeze(structuredClone(controls)), deepFreeze(modelInfo)),\n\t\t\t\tprovider,\n\t\t\t\tmodel\n\t\t\t};\n\t\t\tsignal?.throwIfAborted();\n\t\t\tconst resolved = this.resolveCallWithInfo(proposed, modelInfo);\n\t\t\tconst resolvedConfig = deepFreeze(structuredClone(resolved.config));\n\t\t\tconst context = resolved.context === void 0 ? void 0 : deepFreeze(structuredClone(resolved.context));\n\t\t\tconst adapterDefaults = deepFreeze({\n\t\t\t\t...proposed.reasoningEffort === void 0 && resolvedConfig.reasoningEffort !== void 0 ? { reasoningEffort: true } : {},\n\t\t\t\t...proposed.maxTokens === void 0 && resolvedConfig.maxTokens !== void 0 ? { maxTokens: true } : {}\n\t\t\t});\n\t\t\tlet dispatched = false;\n\t\t\treturn Object.freeze({\n\t\t\t\tconfig: resolvedConfig,\n\t\t\t\tretryPolicy: registration.retryPolicy,\n\t\t\t\tadapterDefaults,\n\t\t\t\t...context === void 0 ? {} : { context },\n\t\t\t\t...modelInfo.inputModalities === void 0 ? {} : { inputModalities: Object.freeze([...modelInfo.inputModalities]) },\n\t\t\t\t...modelInfo.systemPromptUpdate === void 0 ? {} : { systemPromptUpdate: modelInfo.systemPromptUpdate },\n\t\t\t\t...modelInfo.toolUpdate === void 0 ? {} : { toolUpdate: modelInfo.toolUpdate },\n\t\t\t\tstream: (options) => {\n\t\t\t\t\tif (dispatched) throw new LlmError(\"a prepared LLM call can only be dispatched once\", \"INVALID_PREPARED_CALL\");\n\t\t\t\t\tif (!callConfigEquals(options, resolvedConfig)) throw new LlmError(\"prepared LLM call config changed before adapter dispatch\", \"INVALID_PREPARED_CALL\");\n\t\t\t\t\tdispatched = true;\n\t\t\t\t\treturn this.streamWithRegistration(options, {\n\t\t\t\t\t\tregistration,\n\t\t\t\t\t\tconfig: resolvedConfig,\n\t\t\t\t\t\tmodelInfo,\n\t\t\t\t\t\tdispatch: (options) => adapterCall.stream(options)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tregistration(provider) {\n\t\t\tconst registration = this.adapters.get(provider);\n\t\t\tif (!registration) throw new LlmError(`no adapter registered for provider \"${provider}\"`, \"NO_ADAPTER\");\n\t\t\treturn registration;\n\t\t}\n\t\t/** Remove replay state whose historical route is owned by another adapter. */\n\t\tforAdapter(options, adapter) {\n\t\t\tconst messages = options.messages.map((message) => {\n\t\t\t\tif (message.role !== \"assistant\") return message;\n\t\t\t\tconst source = message.source;\n\t\t\t\tif (source.replayState === void 0) return message;\n\t\t\t\tif (this.adapters.get(source.provider)?.adapter === adapter) return message;\n\t\t\t\treturn freezeMessage({\n\t\t\t\t\t...message,\n\t\t\t\t\tsource: {\n\t\t\t\t\t\tkind: \"model\",\n\t\t\t\t\t\tprovider: source.provider,\n\t\t\t\t\t\tmodel: source.model\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (messages.every((message, index) => message === options.messages[index])) return options;\n\t\t\tconst filtered = {\n\t\t\t\t...options,\n\t\t\t\tmessages\n\t\t\t};\n\t\t\treturn Object.isFrozen(options) ? deepFreeze(filtered) : filtered;\n\t\t}\n\t\t/**\n\t\t* Resolve the current execution-world read path of one durable file\n\t\t* reference through the mounted attachment and filesystem providers.\n\t\t*/\n\t\tfileReadPath(ref) {\n\t\t\tlet hostPath;\n\t\t\ttry {\n\t\t\t\thostPath = this.ctx.get(\"attachments\")?.fileHostPath(ref);\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hostPath === void 0) return void 0;\n\t\t\treturn this.ctx.get(\"fs\")?.processPathFromHostPath(hostPath);\n\t\t}\n\t\t/**\n\t\t* Final adapter boundary. Adapter selection, dispatch, iterator construction,\n\t\t* and iteration failures become one terminal failure chunk. Middleware and\n\t\t* downstream consumer failures remain thrown plugin or consumer errors.\n\t\t*/\n\t\tasync *adapterStream(options, prepared) {\n\t\t\tlet iterator;\n\t\t\ttry {\n\t\t\t\tconst registration = prepared?.registration ?? this.registration(options.provider);\n\t\t\t\tconst adapter = registration.adapter;\n\t\t\t\tlet modelInfo;\n\t\t\t\tlet resolvedConfig;\n\t\t\t\tlet dispatch;\n\t\t\t\tif (prepared === void 0) {\n\t\t\t\t\tconst adapterCall = await adapter.prepareCall(options.provider, options.model, options.signal);\n\t\t\t\t\tmodelInfo = this.normalizeModelInfo(registration, options.model, adapterCall.model);\n\t\t\t\t\tresolvedConfig = this.resolveCallWithInfo(options, modelInfo).config;\n\t\t\t\t\tdispatch = (options) => adapterCall.stream(options);\n\t\t\t\t} else {\n\t\t\t\t\tmodelInfo = prepared.modelInfo;\n\t\t\t\t\tresolvedConfig = prepared.config;\n\t\t\t\t\tdispatch = prepared.dispatch;\n\t\t\t\t}\n\t\t\t\tif (prepared !== void 0 && !callConfigEquals(options, resolvedConfig)) throw new LlmError(\"prepared LLM call config changed before adapter dispatch\", \"INVALID_PREPARED_CALL\");\n\t\t\t\tconst resolvedOptions = callConfigEquals(options, resolvedConfig) ? options : Object.isFrozen(options) ? deepFreeze({\n\t\t\t\t\t...options,\n\t\t\t\t\t...resolvedConfig\n\t\t\t\t}) : {\n\t\t\t\t\t...options,\n\t\t\t\t\t...resolvedConfig\n\t\t\t\t};\n\t\t\t\tlet projectedMessages = resolvedOptions.messages;\n\t\t\t\tif (projectedMessages.some((message) => contentHasFile(message.content))) projectedMessages = projectFilesToText(projectedMessages, (ref) => this.fileReadPath(ref));\n\t\t\t\tif (modelInfo.inputModalities !== void 0 && !modelInfo.inputModalities.includes(\"image\") && projectedMessages.some((message) => contentHasImage(message.content))) projectedMessages = projectImagesForTextModel(projectedMessages);\n\t\t\t\tconst projectedTools = projectToolUpdates(projectedMessages, resolvedOptions.tools, modelInfo.toolUpdate, resolvedOptions.toolHistory);\n\t\t\t\tprojectedMessages = projectedTools.messages;\n\t\t\t\tlet projectedOptions = resolvedOptions;\n\t\t\t\tif (projectedMessages !== resolvedOptions.messages || projectedTools.tools !== resolvedOptions.tools) {\n\t\t\t\t\tprojectedOptions = {\n\t\t\t\t\t\t...resolvedOptions,\n\t\t\t\t\t\tmessages: projectedMessages,\n\t\t\t\t\t\t...projectedTools.tools === void 0 ? {} : { tools: projectedTools.tools }\n\t\t\t\t\t};\n\t\t\t\t\tif (Object.isFrozen(resolvedOptions)) deepFreeze(projectedOptions);\n\t\t\t\t}\n\t\t\t\titerator = dispatch(this.forAdapter(projectedOptions, adapter))[Symbol.asyncIterator]();\n\t\t\t} catch (error) {\n\t\t\t\tyield adapterFailureChunk(error, options.signal);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet completed = false;\n\t\t\ttry {\n\t\t\t\twhile (true) {\n\t\t\t\t\tlet item;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst next = await iterator.next();\n\t\t\t\t\t\titem = next.done ? { done: true } : {\n\t\t\t\t\t\t\tdone: false,\n\t\t\t\t\t\t\tvalue: next.value\n\t\t\t\t\t\t};\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tcompleted = true;\n\t\t\t\t\t\tyield adapterFailureChunk(error, options.signal);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (item.done) {\n\t\t\t\t\t\tcompleted = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tyield item.value;\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (!completed) {\n\t\t\t\t\tconst close = iterator.return?.bind(iterator);\n\t\t\t\t\tif (close) await close();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t* Stream one model call as raw chunks (token-level deltas). Replay state is\n\t\t* retained only when the same adapter instance owns its historical provider\n\t\t* and the target provider. Final adapter selection remains fixed through\n\t\t* asynchronous exact-model resolution and dispatch. Adapter selection,\n\t\t* dispatch, and iteration failures become terminal `error` or `aborted`\n\t\t* finish chunks; middleware, nested-call, cleanup, and consumer failures\n\t\t* remain thrown.\n\t\t* @param options - the full request; `options.provider` selects the adapter.\n\t\t* @returns the chunk stream, possibly wrapped by `llm/stream` listeners.\n\t\t*/\n\t\tstream(options) {\n\t\t\treturn this.streamWithRegistration(options);\n\t\t}\n\t\tstreamWithRegistration(options, prepared) {\n\t\t\treturn this.ctx.waterfall(this, \"llm/stream\", options, () => this.adapterStream(options, prepared));\n\t\t}\n\t};\n})();\n/** Convert one adapter throw into the stream protocol's terminal outcome. */\nfunction adapterFailureChunk(error, signal) {\n\tconst failure = normalizeLlmFailure(error);\n\treturn {\n\t\ttype: \"finish\",\n\t\treason: signal?.aborted || failure.code === \"ABORTED\" ? {\n\t\t\tkind: \"aborted\",\n\t\t\tfailure\n\t\t} : {\n\t\t\tkind: \"error\",\n\t\t\tfailure\n\t\t}\n\t};\n}\n/** Copy a directory entry, including its arrays, so neither side can mutate the other's copy. */\nfunction detachDirectoryEntry(entry) {\n\tconst { nativeAuth } = entry;\n\treturn {\n\t\t...entry,\n\t\tsettingsPath: [...entry.settingsPath],\n\t\t...entry.baseURLEnv === void 0 ? {} : { baseURLEnv: [...entry.baseURLEnv] },\n\t\t...nativeAuth === void 0 ? {} : { nativeAuth: {\n\t\t\t...nativeAuth,\n\t\t\tenv: [...nativeAuth.env]\n\t\t} }\n\t};\n}\n//#endregion\nexport { ACCOUNT_QUOTA_EXCEEDED_CODE, APP_IDENTITY, AssistantStreamAccumulator, BlockAssembler, CONTEXT_SUMMARY_MAX_CHARS, CONTEXT_WINDOW_EXCEEDED_CODE, EMPTY_RESPONSE_CODE, HarnessError, IMAGE_OFFLOAD_REQUIRED_CODE, INVALID_CREDENTIAL_CODE, LlmAdapter, LlmAttemptId, LlmError, LlmRuntime, LlmRuntime as default, MessageId, ProviderRequestId, QUOTA_EXCEEDED_CODE, ReasoningEffortId, RetryPolicySchema, ToolCallId, assembleAssistantStream, assertUsableApiKey, assistantStreamChunks, assistantStreamFirstTokenTime, assistantStreamHasVisibleContent, assistantStreamHasVisibleText, attributionHeaders, boundContextSummary, callConfigEquals, chunkHasVisibleText, contentHasFile, contentHasImage, createAssistantMessage, createDeveloperMessage, createMessage, createSystemMessage, createToolResultMessage, createUserMessage, errorChain, expandAssistantStream, fileHandleText, freezeMessage, isAgentLoopRequest, isContextWindowExceededError, isHarnessError, isQuotaExceededError, isTokenDelta, isVisibleChunk, joinAssistantStreamText, lastAssistantStreamChunk, markAgentLoopRequest, normalizeApiKey, offloadedImageText, projectFilesToText, projectImagesForTextModel, projectOffloadedImages, projectToolUpdates, requestImageHandleText, requiredImageOffload, resolveImageAttachmentAccess, resolveRetryPolicy, runFirstTokenTime, runFirstVisibleTime, textOnlyImageText, userAgent };\n","import type { Context } from '@deepseek-ai/cordis'\nimport { createUserMessage } from '@deepseek-ai/dsh-llm'\nimport type {} from '@deepseek-ai/dsh-host-webserver'\nimport {\n sharedWorkspaceInstructionStore,\n sharedSessionInstructionSnapshotStore,\n type SessionInstructionSnapshot,\n type WorkspaceInstructionRecord,\n} from './workspace-instructions.js'\n\nconst SYSTEM_REMINDER_OPEN = '<system-reminder>'\nconst SYSTEM_REMINDER_CLOSE = '</system-reminder>'\nconst INSTRUCTION_INTRO =\n 'The following project instructions are managed by the user for this DSH workspace. Follow them as persistent workspace guidance. They take precedence over repository-provided workspace guidance. System, developer, and direct user instructions take precedence over these project instructions.'\n\nexport interface InstructionSnapshotResult {\n snapshot: SessionInstructionSnapshot\n message: ReturnType<typeof createUserMessage> | undefined\n}\n\nexport function escapeInstructionFrameBody(body: string): string {\n return body.replaceAll(SYSTEM_REMINDER_CLOSE, '<\\\\/system-reminder>')\n}\n\nexport function renderInstructionMessageText(workspaceTitle: string, text: string): string {\n const escaped = escapeInstructionFrameBody(text)\n return `${SYSTEM_REMINDER_OPEN}\\n${INSTRUCTION_INTRO}\\n\\nInstructions for workspace: ${workspaceTitle}\\n\\n${escaped}\\n${SYSTEM_REMINDER_CLOSE}`\n}\n\nexport function createInstructionMessage(\n workspaceId: string,\n workspaceTitle: string,\n snapshot: SessionInstructionSnapshot,\n): ReturnType<typeof createUserMessage> {\n const text = renderInstructionMessageText(workspaceTitle, snapshot.text)\n return createUserMessage({\n content: [{ type: 'text', text }],\n source: {\n kind: 'dshb-workspace-instructions',\n form: 'instructions',\n workspaceId,\n revision: snapshot.workspaceRevision,\n digest: snapshot.digest,\n snapshot: true,\n } as never,\n })\n}\n\ninterface AgentLike {\n session: {\n id: string\n header: { cwd: string }\n surface?: { nodes?: number[] }\n eventAt?: (seq: number) => { type: string; data: { source: { kind: string } } } | undefined\n }\n}\n\ninterface MessageLike {\n id: string\n role: string\n source: { kind: string }\n}\n\ninterface WorkspaceRegistryLike {\n resolveByPath(path: string): Promise<{ id: string; path: string; title: string } | undefined>\n get(id: string): { id: string; path: string; title: string } | undefined\n}\n\nfunction hasDirectUserMessage(messages: MessageLike[]): boolean {\n return messages.some((m) => m.role === 'user' && m.source.kind === 'user')\n}\n\nfunction hasOwnInstructionMessage(agent: AgentLike): boolean {\n const nodes = agent.session.surface?.nodes\n if (!nodes) return false\n for (const seq of nodes) {\n const event = agent.session.eventAt?.(seq)\n if (event?.type === 'user/message' && event.data.source.kind === 'dshb-workspace-instructions') {\n return true\n }\n }\n return false\n}\n\nexport async function resolveSnapshotForSession(\n agent: AgentLike,\n messages: MessageLike[],\n workspaceStore = sharedWorkspaceInstructionStore(),\n snapshotStore = sharedSessionInstructionSnapshotStore(),\n registry?: WorkspaceRegistryLike,\n): Promise<SessionInstructionSnapshot | undefined> {\n const sessionId = agent.session.id\n const existing = snapshotStore.get(sessionId)\n if (existing) return existing\n\n const isFirstDirect = hasDirectUserMessage(messages) && !hasOwnInstructionMessage(agent)\n if (!isFirstDirect) return undefined\n\n let workspaceId: string | undefined\n let workspaceTitle = 'Unknown'\n const cwd = agent.session.header.cwd\n if (registry && cwd) {\n try {\n const ws = await registry.resolveByPath(cwd)\n if (ws) {\n workspaceId = ws.id\n workspaceTitle = ws.title\n }\n } catch {\n // path 不可解析时创建无工作区空快照\n }\n }\n\n const record: WorkspaceInstructionRecord | undefined = workspaceId\n ? workspaceStore.get(workspaceId)\n : undefined\n\n if (!record || record.text.length === 0) {\n return snapshotStore.createIfAbsent(sessionId, {\n kind: 'empty',\n workspaceId,\n })\n }\n\n return snapshotStore.createIfAbsent(sessionId, {\n kind: 'workspace',\n record,\n workspaceId: workspaceId!,\n })\n}\n\nexport function registerWorkspaceInstructionInjector(ctx: Context): void {\n if (typeof (ctx as { on?: unknown }).on !== 'function') return\n const workspaceStore = sharedWorkspaceInstructionStore()\n const snapshotStore = sharedSessionInstructionSnapshotStore()\n\n ;(ctx as unknown as { on: (event: string, handler: (arg: { agent: AgentLike; messages: MessageLike[]; signal: AbortSignal }, next: () => Promise<{ kind: string; messages: MessageLike[] }>) => Promise<unknown>) => void }).on('agent/pre-step', async ({ agent, messages, signal }, next) => {\n const decision = await next()\n if (decision.kind === 'reject') return decision\n signal.throwIfAborted()\n\n const agentLike = agent as unknown as AgentLike\n const messagesLike = messages as unknown as MessageLike[]\n\n const registry = ctx.get('workspaceRegistry') as WorkspaceRegistryLike | undefined\n\n let snapshot = snapshotStore.get(agentLike.session.id)\n if (!snapshot) {\n snapshot = await resolveSnapshotForSession(\n agentLike,\n messagesLike,\n workspaceStore,\n snapshotStore,\n registry,\n )\n }\n signal.throwIfAborted()\n if (!snapshot || snapshot.text.length === 0) return decision\n\n if (hasOwnInstructionMessage(agentLike)) return decision\n\n const workspaceId = snapshot.workspaceId\n if (!workspaceId) return decision\n const ws = registry?.get(workspaceId)\n const workspaceTitle = ws?.title ?? 'Unknown'\n\n const message = createInstructionMessage(workspaceId, workspaceTitle, snapshot)\n const lastClaimedIndex = decision.messages.findLastIndex((m) =>\n (messages as unknown as MessageLike[]).includes(m as unknown as MessageLike),\n )\n const entered = decision.messages.toSpliced(lastClaimedIndex + 1, 0, message)\n return {\n ...decision,\n messages: entered,\n }\n })\n\n try {\n ;(ctx as { on?: (event: string, handler: (sessionId: string) => void) => void }).on?.('session/deleted', (sessionId: string) => {\n snapshotStore.remove(sessionId)\n })\n } catch {\n // session/deleted event may not exist in this DSH version\n }\n}\n\nexport const name = 'dshb-workspace-instruction-injector'\nexport const inject = ['workspaceRegistry']\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7],"mappings":";;;;;;;;;;;;AAUA,IAAI,cAAc,cAAc,MAAM;CACrC;CACA;;CAEA,mBAAmB;;;;;;;CAOnB,YAAY,MAAM,SAAS,SAAS,SAAS;EAC5C,MAAM,SAAS,OAAO;EACtB,KAAK,OAAO;EACZ,KAAK,UAAU;EACf,KAAK,OAAO;CACb;AACD;;;;;;;AAsRA,MAAM,gCAAgC;;;;;;AAMtC,SAAS,sBAAsB,OAAO;CACrC,OAAO,UAAU,OAAO,UAAU,QAAQ,8BAA8B,KAAK,KAAK;AACnF;AACA,MAAM,2BAA2B;;;;;;;;;;;AAWjC,SAAS,iBAAiB,SAAS,YAAY,UAAU,CAAC,GAAG;CAC5D,aAAa,eAAe,UAAU;CACtC,MAAM,YAAY,QAAQ,aAAa;CACvC,aAAa,aAAa,SAAS;CACnC,MAAM,MAAM,QAAQ,IAAI,SAAS,KAAK;CACtC,IAAI,QAAQ,GAAG,GAAG,GAAG,0BAA0B,GAAG;CAClD,OAAO,OAAO,OAAO;EACpB;EACA;EACA;CACD,CAAC;AACF;;AAEA,IAAI,sBAAsB,cAAc,QAAQ;;CAE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