@dsh-mixxed/dsh-client-ui-settings-skills 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../node_modules/.pnpm/@deepseek-ai+dsh-agent-pres_6b14f02c7140633c56994a10e58953ed/node_modules/@deepseek-ai/dsh-agent-presets/lib/index.js", "../node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.2/node_modules/@deepseek-ai/cosmokit/lib/index.js", "../node_modules/.pnpm/@deepseek-ai+cordis@4.0.1_@_d53e407b0055a51d18c4da8d739fec0e/node_modules/@deepseek-ai/cordis/lib/index.js", "../node_modules/.pnpm/@deepseek-ai+schemastery@3.18.1/node_modules/@deepseek-ai/schemastery/lib/index.mjs", "../node_modules/.pnpm/@deepseek-ai+dsh-scope@0.1._6f3351786c779449c277f079a737f571/node_modules/@deepseek-ai/dsh-scope/lib/index.js", "../node_modules/.pnpm/@deepseek-ai+dsh-settings@0_52495af71738a1095726249ceff4fd7b/node_modules/@deepseek-ai/dsh-settings/lib/index.js", "../node_modules/.pnpm/@deepseek-ai+dsh-home-paths_7bedd37cd7bfa44a7560ebd321630d86/node_modules/@deepseek-ai/dsh-home-paths/lib/index.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/common.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/exception.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/snippet.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/schema.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/str.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/seq.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/map.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/schema/failsafe.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/null.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/bool.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/int.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/float.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/schema/json.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/schema/core.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/timestamp.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/merge.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/binary.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/omap.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/pairs.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/type/set.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/schema/default.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/loader.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/dumper.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/index.js", "../node_modules/.pnpm/js-yaml@4.3.1/node_modules/js-yaml/lib/index_vite_proxy.tmp.mjs", "../node_modules/.pnpm/@deepseek-ai+cordis-plugin-_bc36c904ec46027ac66b596a4006ca98/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js", "../node_modules/.pnpm/@deepseek-ai+cordis-plugin-_f50878cb7591e67b1dc525966dbdf170/node_modules/@deepseek-ai/cordis-plugin-include/lib/index.js", "../node_modules/.pnpm/@deepseek-ai+dsh-atomic-wri_413dfe5bd61b96e1026b0591a4519606/node_modules/@deepseek-ai/dsh-atomic-write/lib/index.js", "../src/policy.ts", "../src/index.ts"],
4
+ "sourcesContent": ["import { chmod, cp, readFile, readdir, rm, stat } from \"node:fs/promises\";\nimport { Context, Service } from \"@deepseek-ai/cordis\";\nimport z from \"@deepseek-ai/schemastery\";\nimport { bindScopeParent, createScope, scopeOf, scopeParentOf } from \"@deepseek-ai/dsh-scope\";\nimport { settingsNamespace } from \"@deepseek-ai/dsh-settings\";\nimport { dshHomePath, expandHomePath } from \"@deepseek-ai/dsh-home-paths\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\nimport yaml, { load } from \"js-yaml\";\nimport { Include, entryListSchema } from \"@deepseek-ai/cordis-plugin-include\";\nimport { writeFileAtomic } from \"@deepseek-ai/dsh-atomic-write\";\nimport { pathToFileURL } from \"node:url\";\n//#region lib/types/metadata.js\n/**\n* A preset's display metadata: the name and description a picker shows.\n*\n* It lives in its own file because the composition is a top-level list of\n* plugin rows \u2014 YAML cannot carry sibling keys beside it, and faking a\n* metadata row would hand the Loader something to load. Keeping it separate\n* also keeps the composition exactly what its name says: a Cordis file the\n* loader owns and the cordis preset can author.\n*\n* The file carries display text ONLY. `id` is the directory name and `trust`\n* comes from the root a preset was discovered under, so neither is writable\n* here \u2014 otherwise a locally authored preset could claim to be a shipped one.\n*\n* Every read failure degrades to no metadata. A preset whose display text is\n* missing, malformed, or unreadable still mounts: presentation is not a\n* capability, and a broken name must never become an agent that cannot start.\n* @module @deepseek-ai/dsh-agent-presets/metadata\n*/\n/** The optional display-metadata file beside a preset's composition. */\nconst METADATA_FILE = \"preset.yml\";\n/** A non-empty trimmed string, or undefined for anything else. */\nfunction text(value) {\n\tif (typeof value !== \"string\") return void 0;\n\tconst trimmed = value.trim();\n\treturn trimmed === \"\" ? void 0 : trimmed;\n}\n/**\n* Read one preset directory's display metadata.\n*\n* Absent, unparsable, and wrongly-shaped files are all the same answer \u2014\n* empty metadata \u2014 because the caller renders a picker, not a diagnostic.\n* @param directory - the preset directory.\n* @returns the display text the preset published, possibly empty.\n*/\nasync function readPresetMetadata(directory) {\n\tlet raw;\n\ttry {\n\t\traw = await readFile(join(directory, METADATA_FILE), \"utf8\");\n\t} catch {\n\t\treturn {};\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = yaml.load(raw);\n\t} catch {\n\t\treturn {};\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) return {};\n\tconst record = parsed;\n\tconst name = text(record.name);\n\tconst description = text(record.description);\n\tconst order = typeof record.order === \"number\" && Number.isFinite(record.order) ? record.order : void 0;\n\treturn {\n\t\t...name === void 0 ? {} : { name },\n\t\t...description === void 0 ? {} : { description },\n\t\t...order === void 0 ? {} : { order }\n\t};\n}\n/**\n* Render display metadata as the file's contents.\n*\n* Absent fields are omitted rather than written empty, so a preset with no\n* description does not ship a key that reads as an intentional blank.\n* @param metadata - the display text to store.\n* @returns the YAML document, or undefined when there is nothing to store.\n*/\nfunction renderPresetMetadata(metadata) {\n\tconst name = text(metadata.name);\n\tconst description = text(metadata.description);\n\tconst { order } = metadata;\n\tif (name === void 0 && description === void 0 && order === void 0) return void 0;\n\treturn yaml.dump({\n\t\t...name === void 0 ? {} : { name },\n\t\t...description === void 0 ? {} : { description },\n\t\t...order === void 0 ? {} : { order }\n\t}, { lineWidth: -1 });\n}\n//#endregion\n//#region lib/types/preset.js\n/** Agent-preset vocabulary shared by discovery, mounting, and consumers. */\n/**\n* Ids a preset directory may use.\n*\n* The id becomes a path segment, so this is a containment boundary rather than\n* a style rule: `..`, a separator, or an absolute-looking name would place the\n* composition outside the root the deployment authorised. Discovery shares it:\n* a directory whose name no copy could ever claim is not a preset slot.\n*/\nconst PRESET_ID = /^[a-z0-9][a-z0-9-]*$/;\n/**\n* No configured root supplies the requested preset.\n*\n* Separate from a mount failure because the two mean different things to a\n* caller: an unknown id is a bad request, while an unusable composition is a\n* broken preset the deployment must fix.\n*/\nvar UnknownPresetError = class extends Error {\n\tpresetId;\n\tavailable;\n\tconstructor(presetId, available) {\n\t\tsuper(`agent-presets: preset \"${presetId}\" not found (available: ${available.join(\", \") || \"none\"})`);\n\t\tthis.presetId = presetId;\n\t\tthis.available = available;\n\t}\n};\n/** A preset exists but its composition cannot be installed. */\nvar PresetMountError = class extends Error {\n\tpresetId;\n\treason;\n\tconstructor(presetId, reason, options) {\n\t\tsuper(`agent-presets: preset \"${presetId}\" failed to mount: ${reason}`, options);\n\t\tthis.presetId = presetId;\n\t\tthis.reason = reason;\n\t}\n};\n//#endregion\n//#region lib/types/discovery.js\n/**\n* Filesystem discovery of agent presets. A preset is a directory holding\n* {@link COMPOSITION_FILE}, optionally beside a {@link METADATA_FILE} carrying\n* its display text; the directory name is the preset id. Discovery\n* re-reads the roots on every call so a preset authored while the process is\n* running is visible without a restart.\n*\n* Discovery also owns preset HEALTH: a directory whose composition is\n* missing or unloadable is reported as a broken roster row rather than\n* skipped. A skipped directory would still occupy its id on disk \u2014 the copy\n* path refuses the name while no surface shows anything to delete \u2014 and a\n* malformed composition would otherwise read as an ordinary preset until the\n* first session fails to mount it.\n* @module @deepseek-ai/dsh-agent-presets/discovery\n*/\n/** The composition file that makes a directory a preset. */\nconst COMPOSITION_FILE = \"agent.cordis.yml\";\n/**\n* Harness-home directory holding locally authored presets.\n*\n* This package owns the writable root the way `dsh-skill-filesystem` owns\n* `<dshHome>/skills`. An app must assemble the SHIPPED root, whose path only\n* the installed app can resolve; where a person's own presets go is the same\n* place in every deployment that does not say otherwise, so a launcher that\n* forgets to configure one still finds them.\n*\n* Package-internal on purpose: no consumer outside this package addresses the\n* directory by name, and a test that imported it could not catch this value\n* being wrong \u2014 the expected segment is spelled out where it is asserted.\n*/\nconst USER_PRESET_DIR = \".agent-presets\";\n/**\n* Why `rows` cannot be an entry list, or undefined when it can.\n*\n* A shallow shape check, deliberately short of the loader's work: it does not\n* resolve plugin names or apply configs. What it catches is the hand-edit\n* that produces a file the loader cannot even begin with \u2014 and it must accept\n* everything the loader accepts, which is why rows are only required to be\n* maps carrying a plugin `name` (groups recurse into their own lists).\n* @param rows - the parsed composition document.\n* @param at - row-path prefix for nested diagnostics, empty at the top level.\n* @returns one human-readable reason, or undefined when the shape holds.\n*/\nfunction entryListProblem(rows, at = \"\") {\n\tif (!Array.isArray(rows)) return at === \"\" ? \"the composition must be a top-level list of plugin rows\" : `group ${at} must hold a list of plugin rows`;\n\tfor (const [index, row] of rows.entries()) {\n\t\tconst label = at === \"\" ? `row ${String(index + 1)}` : `${at} row ${String(index + 1)}`;\n\t\tif (typeof row !== \"object\" || row === null || Array.isArray(row)) return `${label} is not a plugin row (expected a map with a \"name\")`;\n\t\tconst { name, group, config } = row;\n\t\tif (typeof name !== \"string\" || name === \"\") return `${label} names no plugin (a \"name\" string is required)`;\n\t\tif (group === true) {\n\t\t\tconst nested = entryListProblem(config, label);\n\t\t\tif (nested !== void 0) return nested;\n\t\t}\n\t}\n}\n/**\n* Why the composition at `path` cannot mount, or undefined when it looks\n* loadable. Parsed with the loader's own YAML dialect ({@link entryListSchema},\n* the one carrying `!!js`), so health can never call a composition broken\n* that the loader would accept.\n* @param path - absolute path of the composition file.\n* @returns one human-readable reason, or undefined when the file is loadable.\n*/\nasync function compositionProblem(path) {\n\tlet content;\n\ttry {\n\t\tcontent = await readFile(path, \"utf8\");\n\t} catch {\n\t\treturn `the composition file ${COMPOSITION_FILE} cannot be read`;\n\t}\n\tlet rows;\n\ttry {\n\t\trows = load(content, { schema: entryListSchema });\n\t} catch (error) {\n\t\treturn `the composition is not valid YAML: ${(error instanceof Error ? error.message : String(error)).replace(/\\n[\\s\\S]*$/, \"\")}`;\n\t}\n\treturn entryListProblem(rows);\n}\n/**\n* Whether `path` names an existing regular file.\n* @param path - absolute path to test.\n* @returns true when the path resolves to a file.\n*/\nasync function isFile(path) {\n\ttry {\n\t\treturn (await stat(path)).isFile();\n\t} catch {\n\t\treturn false;\n\t}\n}\n/**\n* Scan one root for preset directories.\n*\n* An absent root yields no presets rather than throwing: the user root does\n* not exist until the first locally authored preset, and naming a default\n* that no root supplies already fails loud at resolution.\n*\n* Every directory whose name is a usable preset id is a roster row \u2014 broken\n* when its composition is missing or unloadable. A directory named outside\n* {@link PRESET_ID} is skipped instead: no copy could ever claim that name,\n* so it blocks nothing, and reporting `.DS_Store`-grade residue as broken\n* presets would teach users to ignore the marker.\n* @param root - the directory and the trust its presets inherit.\n* @returns the root's presets ordered by id.\n*/\nasync function scanRoot(root) {\n\tconst dir = resolve(expandHomePath(root.path));\n\tlet children;\n\ttry {\n\t\tchildren = await readdir(dir, { withFileTypes: true });\n\t} catch (error) {\n\t\tif (error.code === \"ENOENT\") return [];\n\t\tthrow new Error(`agent-presets: cannot read preset root ${dir}: ${String(error)}`, { cause: error });\n\t}\n\tconst found = [];\n\tfor (const child of children) {\n\t\tif (!child.isDirectory() || !PRESET_ID.test(child.name)) continue;\n\t\tconst directory = join(dir, child.name);\n\t\tconst path = join(directory, COMPOSITION_FILE);\n\t\tconst broken = await isFile(path) ? await compositionProblem(path) : `the composition file ${COMPOSITION_FILE} is missing \u2014 the directory still occupies the id; delete it or restore the file`;\n\t\tconst metadata = await readPresetMetadata(directory);\n\t\tfound.push({\n\t\t\tid: child.name,\n\t\t\ttrust: root.trust,\n\t\t\tpath,\n\t\t\t...metadata,\n\t\t\t...broken === void 0 ? {} : { broken }\n\t\t});\n\t}\n\treturn found.sort((left, right) => {\n\t\tconst byOrder = (left.order ?? Number.POSITIVE_INFINITY) - (right.order ?? Number.POSITIVE_INFINITY);\n\t\treturn byOrder === 0 ? left.id.localeCompare(right.id) : byOrder;\n\t});\n}\n/**\n* Scan every root in precedence order.\n* @param roots - roots in precedence order; an earlier root wins a duplicate id.\n* @returns every discovered preset, first-root-wins per id.\n*/\nasync function discoverPresets(roots) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tfor (const root of roots) for (const preset of await scanRoot(root)) {\n\t\tif (byId.has(preset.id)) continue;\n\t\tbyId.set(preset.id, preset);\n\t}\n\treturn [...byId.values()];\n}\n//#endregion\n//#region lib/types/authoring.js\n/**\n* Copying, reading, and deleting locally authored presets.\n*\n* Authoring is confined to a `user` root: the shipped `.system` set is part of\n* the deployment, and letting a browser rewrite it would turn \"reset to a known\n* preset\" into something the same caller could have broken first.\n*\n* The only authoring write is a whole-directory copy of an existing preset.\n* No caller supplies composition text: the inputs are ids the host resolves\n* against its own roots plus an optional display name, so authoring grants no\n* capability the copied preset did not already carry.\n* @module @deepseek-ai/dsh-agent-presets/authoring\n*/\n/** A preset id that cannot be used as a directory name under a root. */\nvar InvalidPresetIdError = class extends Error {\n\tpresetId;\n\tconstructor(presetId) {\n\t\tsuper(`agent-presets: preset id ${JSON.stringify(presetId)} must match ${String(PRESET_ID)} \u2014 the id is a directory name, so anything else could escape the preset root`);\n\t\tthis.presetId = presetId;\n\t}\n};\n/** A copy target that is already occupied \u2014 a copy never overwrites. */\nvar PresetExistsError = class extends Error {\n\tpresetId;\n\tconstructor(presetId) {\n\t\tsuper(`agent-presets: preset \"${presetId}\" already exists \u2014 a copy never overwrites; delete the existing preset first or choose another id`);\n\t\tthis.presetId = presetId;\n\t}\n};\n/** Authoring was attempted where the deployment allows none. */\nvar PresetNotWritableError = class extends Error {\n\tpresetId;\n\tconstructor(presetId, reason) {\n\t\tsuper(`agent-presets: preset \"${presetId}\" cannot be written: ${reason}`);\n\t\tthis.presetId = presetId;\n\t}\n};\n/**\n* The root locally authored presets are written to.\n* @param roots - the configured roots in precedence order.\n* @returns the absolute path of the first `user` root.\n* @throws when the deployment configured no writable root.\n*/\nfunction writableRoot(roots) {\n\tconst root = roots.find((candidate) => candidate.trust === \"user\");\n\tif (root === void 0) throw new PresetNotWritableError(\"\", \"this deployment configures no user-writable preset root\");\n\treturn resolve(expandHomePath(root.path));\n}\n/**\n* Read one preset's composition text.\n* @param preset - the resolved preset.\n* @returns the file's contents.\n*/\nasync function readComposition(preset) {\n\treturn await readFile(preset.path, \"utf8\");\n}\n/** Whether anything occupies the path (cp's own errorOnExist backstops races). */\nasync function occupied(path) {\n\tlet present = true;\n\ttry {\n\t\tawait stat(path);\n\t} catch {\n\t\tpresent = false;\n\t}\n\treturn present;\n}\n/**\n* Re-tighten a copied tree to owner-only. A shipped preset is world-readable\n* in its install and `cp` preserves that; the copy carries the same weight as\n* the settings document beside it, so group/other access is stripped. A\n* file's owner-execute bit survives \u2014 a preset may ship runnable helpers.\n*/\nasync function tightenModes(dir) {\n\tawait chmod(dir, 448);\n\tfor (const entry of await readdir(dir, { withFileTypes: true })) {\n\t\tconst target = join(dir, entry.name);\n\t\tif (entry.isDirectory()) await tightenModes(target);\n\t\telse\n /* v8 ignore next -- Windows exposes no POSIX owner-execute bit; the POSIX lane covers both file modes. */\n\t\tawait chmod(target, ((await stat(target)).mode & 64) === 0 ? 384 : 448);\n\t}\n}\n/**\n* Create a preset by copying an existing one's whole directory.\n*\n* The copy carries everything the source directory holds \u2014 composition,\n* metadata, skill directories, assets \u2014 because a preset is its directory,\n* not one file. Symlinks are dereferenced so the copy is self-contained\n* rather than a set of links back into the install it was copied from.\n*\n* The copied metadata is then rewritten: the source's description is kept\n* (the file is the author's to edit afterwards), but its name and roster\n* `order` are not \u2014 a copy presenting itself identically to its source, or\n* sorted into the shipped set's declared order, would make the roster stop\n* distinguishing them. With no name given and no description to keep, the\n* file is removed so the copy publishes nothing rather than a blank.\n* @param roots - the configured roots; the first `user` one receives the copy.\n* @param source - the resolved preset the copy starts from.\n* @param id - the new preset's id, which becomes its directory name.\n* @param name - display name for the copy; omitted falls back to the id.\n* @returns the absolute path of the new preset directory.\n* @throws when the id is unusable or already occupied on disk, or the\n* deployment configures no writable root.\n*/\nasync function copyComposition(roots, source, id, name) {\n\tif (!PRESET_ID.test(id)) throw new InvalidPresetIdError(id);\n\tconst dir = join(writableRoot(roots), id);\n\tif (await occupied(dir)) throw new PresetExistsError(id);\n\ttry {\n\t\tawait cp(dirname(source.path), dir, {\n\t\t\trecursive: true,\n\t\t\tdereference: true,\n\t\t\tforce: false,\n\t\t\terrorOnExist: true\n\t\t});\n\t\tawait tightenModes(dir);\n\t\tconst rendered = renderPresetMetadata({\n\t\t\t...name === void 0 ? {} : { name },\n\t\t\t...source.description === void 0 ? {} : { description: source.description }\n\t\t});\n\t\tconst metadataPath = join(dir, METADATA_FILE);\n\t\tif (rendered === void 0) await rm(metadataPath, { force: true });\n\t\telse await writeFileAtomic(metadataPath, rendered, {\n\t\t\tmode: 384,\n\t\t\tdirMode: 448\n\t\t});\n\t} catch (error) {\n\t\tawait rm(dir, {\n\t\t\trecursive: true,\n\t\t\tforce: true\n\t\t});\n\t\tthrow error;\n\t}\n\treturn dir;\n}\n/**\n* Delete a locally authored preset.\n*\n* A shipped preset is refused: it belongs to the deployment. A preset a live\n* session mounted is NOT refused \u2014 the composition was read at creation and is\n* never re-read, so that session keeps running exactly as it was.\n* @param roots - the configured roots.\n* @param preset - the resolved preset to remove.\n* @throws when the preset ships with the deployment or lies outside the writable root.\n*/\nasync function deleteComposition(roots, preset) {\n\tif (preset.trust !== \"user\") throw new PresetNotWritableError(preset.id, \"it ships with the deployment\");\n\tconst dir = join(writableRoot(roots), preset.id);\n\tif (!isAbsolute(preset.path) || !preset.path.startsWith(dir)) throw new PresetNotWritableError(preset.id, \"it does not live under the writable preset root\");\n\tawait rm(dir, {\n\t\trecursive: true,\n\t\tforce: true\n\t});\n}\n//#endregion\n//#region lib/types/mount.js\n/**\n* Mount one preset composition under an agent's scope context, then prove the\n* result is usable before the agent is published.\n*\n* The scope context is what makes the composition per-session: entry contexts\n* chain to the context the subtree was plugged into, so every `ctx.tools`\n* and `ctx.systemPrompt` registration inside the preset files into that\n* agent's layer and unwinds with it. Two guards make that safe. A row that\n* never reached a usable state is rejected, because a directly-plugged subtree\n* is absent from `ctx.loader.entries()` and no boot audit covers it. A row that\n* published a service into the ROOT realm is rejected, because such a service\n* is process-global rather than per-session and the second session mounting the\n* same preset collides with the first.\n* @module @deepseek-ai/dsh-agent-presets/mount\n*/\n/**\n* Subtrees captured by config identity. A subtree plugged directly (rather than\n* created as a loader entry) never links itself to an `Entry`, so this is the\n* only handle to the rows it created; config objects are minted per mount, so\n* concurrent mounts cannot collide.\n*/\nconst mounted = /* @__PURE__ */ new WeakMap();\n/**\n* The base URL bare specifiers resolve against, per pending mount, keyed by the\n* same config object. Recorded before the subtree is plugged, because `Include`\n* rewrites its own context's `baseUrl` to the composition's directory and the\n* pre-mount value is the only handle on where the harness itself lives.\n*/\nconst harnessBase = /* @__PURE__ */ new WeakMap();\n/**\n* Include subclass that publishes its tree and fiber for the audit, and never\n* writes to the file it read.\n*/\nvar PresetTree = class extends Include {\n\tconstructor(ctx, config) {\n\t\tsuper(ctx, config);\n\t\tmounted.set(config, {\n\t\t\ttree: this,\n\t\t\tfiber: ctx.fiber\n\t\t});\n\t}\n\t/**\n\t* Resolve a bare specifier from the harness rather than from the preset.\n\t*\n\t* `EntryTree.import()` resolves against the tree's own `baseUrl`, which\n\t* `Include` sets to the composition's directory. That is right for a\n\t* relative specifier \u2014 a preset's own files travel with it \u2014 and wrong for\n\t* a package name: a locally authored preset lives under the user's home,\n\t* where Node's upward `node_modules` walk never reaches the harness's own\n\t* dependencies, so every `@deepseek-ai/dsh-*` row would fail to import. The\n\t* mount records the host composition's base instead, which is inside the\n\t* installed harness, and bare names resolve from there. An absolute\n\t* filesystem path names neither base and becomes a file URL before Node's\n\t* ESM loader receives it, which is required for drive-letter paths on\n\t* Windows.\n\t* @param name - the module specifier from the row.\n\t* @param getOuterStack - the loader's stack composer for import diagnostics.\n\t* @returns the imported module, or the `cordis:` builtin.\n\t*/\n\timport(name, getOuterStack) {\n\t\tconst specifier = isAbsolute(name) ? pathToFileURL(name).href : name;\n\t\tconst base = harnessBase.get(this.config);\n\t\t/* v8 ignore next -- every PresetTree is constructed by `mountPreset`, which records the base first */\n\t\tif (base === void 0) return super.import(specifier, getOuterStack);\n\t\tif (name.startsWith(\".\") || name.startsWith(\"cordis:\")) return super.import(name, getOuterStack);\n\t\tconst internal = this.ctx.loader.internal;\n\t\t/* v8 ignore next -- Node always supplies the internal module loader; the branch keeps a\n\t\thypothetical embedder from losing the row's name in a resolution error. */\n\t\tif (internal === void 0) return super.import(specifier, getOuterStack);\n\t\treturn internal.import(specifier, base, {});\n\t}\n\t/**\n\t* A preset is an input, never a persistence target.\n\t*\n\t* The Loader writes a tree back through this method whenever it decides the\n\t* config changed \u2014 a plugin self-disposing is enough, and tearing an agent\n\t* down disposes its whole subtree. Inherited, that rewrites the preset file\n\t* with whatever the dying tree held, which in practice means truncating a\n\t* shipped composition to `[]` the first time a session ends. Persisting a\n\t* preset is also meaningless: nothing here is user state, and the same file\n\t* backs every session that names it.\n\t*\n\t* Dropping the write drops the `loader/config-update` the inherited method\n\t* emits with it. Nothing observes one for a preset subtree today, and a\n\t* future \"edit your preset while it runs\" flow needs a deliberate\n\t* persistence path rather than this method's return.\n\t*/\n\twrite() {}\n};\nconst mounts = /* @__PURE__ */ new Set();\n/**\n* Drop every record whose subtree is gone.\n*\n* Records are pruned by observation rather than through a disposal hook\n* because a subtree can be torn down by its owning agent, by a failed mount, or\n* by the whole tree unloading, and a cleared `uid` is what all three share.\n*\n* Pruning therefore has to happen on a path this module owns. Reading is one\n* such path, but not a reliable one: the only production reader is the\n* invariant companion's service listener, and `dsh-invariants` is a\n* development composition \u2014 a shipped host never loads it. Mounting is the\n* other, and it is the one every session takes, which bounds the set at one\n* generation of dead records rather than one per session ever composed. Each\n* record would otherwise retain its whole disposed subtree: the fiber holds\n* its config, and that config is the key its `EntryTree` is stored under.\n*/\nfunction pruneDisposedMounts() {\n\tfor (const mount of mounts) if (mount.fiber.uid === null) mounts.delete(mount);\n}\n/**\n* Every preset composition still installed, pruning fibers disposed since the\n* last read.\n* @returns the live mounts.\n*/\nfunction livePresetMounts() {\n\tpruneDisposedMounts();\n\treturn [...mounts];\n}\n/**\n* Whether `fiber` is `root` itself or is mounted anywhere inside its subtree.\n*\n* Membership is object identity. `uid` looks like a cheaper key but is a\n* per-registry counter, so fibers in two different roots collide on it and a\n* subtree in one runtime would be blamed for a service published in another.\n* @param fiber - the fiber to locate.\n* @param root - the subtree root to test membership against.\n* @returns true when `fiber` belongs to `root`'s subtree.\n*/\nfunction withinFiber(fiber, root) {\n\tlet current = fiber;\n\twhile (true) {\n\t\tif (current === root) return true;\n\t\tconst parent = current.parent.fiber;\n\t\tif (parent === current) return false;\n\t\tcurrent = parent;\n\t}\n}\n/**\n* Service names the mounted subtree published into the root realm.\n*\n* A provider without an `isolate` realm stores its implementation under the\n* root's symbol for that name, which is exactly the comparison below; a\n* provider inside an `isolate` realm stores under a realm-private symbol and\n* is correctly absent here.\n* @param ctx - any context of the runtime whose service store is inspected.\n* @param mount - the mounted subtree's fiber.\n* @returns the leaked service names in lexical order.\n*/\nfunction leakedServices(ctx, mount) {\n\tconst store = ctx.reflect.store;\n\tconst rootIsolate = ctx.root[Context.isolate];\n\tconst leaked = [];\n\tfor (const key of Object.getOwnPropertySymbols(store)) {\n\t\tconst impl = store[key];\n\t\t/* v8 ignore next -- cordis deletes a store slot on disposal rather than\n\t\tclearing it, so an own symbol always resolves; the guard exists only\n\t\tbecause the store's index signature is optional. */\n\t\tif (impl === void 0) continue;\n\t\tif (!withinFiber(impl.fiber, mount)) continue;\n\t\tif (rootIsolate[impl.name] === key) leaked.push(impl.name);\n\t}\n\treturn leaked.sort((left, right) => left.localeCompare(right));\n}\n/**\n* The standing composition one agent is joined to.\n*\n* The agent's own key is parented to its preset's standing key, so the mount\n* is found by matching that parent rather than by walking up from the agent \u2014\n* the mount is not under the agent's fiber. An agent that joined no preset \u2014\n* a deployment composing no roster, or a child agent before its join \u2014 has no\n* parent link and resolves to undefined.\n* @param agentCtx - the agent's scope context.\n* @returns the mount the agent joined, or undefined when it joined none.\n*/\nfunction standingMountFor(agentCtx) {\n\tconst agentKey = scopeOf(agentCtx);\n\tif (agentKey === void 0) return void 0;\n\tconst standingKey = scopeParentOf(agentKey);\n\tif (standingKey === void 0) return void 0;\n\treturn livePresetMounts().find((candidate) => candidate.key === standingKey);\n}\n/**\n* One agent's instance of a service its preset mounted.\n*\n* A preset publishes a service behind an `isolate` realm so two sessions\n* cannot collide, and an entry-local realm is invisible to everything outside\n* the group \u2014 including the agent's own scope context and the host. That is\n* right for the rows inside the group and wrong for one caller: a request that\n* is ABOUT a session but arrives from outside it, which is every browser RPC\n* the api-proxy serves.\n*\n* Ownership is the same relation {@link leakedServices} reads, inverted: there\n* it names implementations a subtree published into the ROOT realm, here it\n* names the one this subtree published anywhere. Fiber membership is object\n* identity for the reason stated on {@link withinFiber}.\n*\n* This is READ addressing for a caller that already holds the agent. It is not\n* a general host handle on a session's internals: a host row that `inject`s a\n* service cannot use it, because injection resolves before any session exists\n* and has no agent to key by \u2014 such a service belongs on the host plane.\n* @param ctx - any context of the runtime whose service store is inspected.\n* @param agent - the agent whose mounted composition to look inside.\n* @param name - the service name as the preset's rows resolve it.\n* @returns the agent's instance, or undefined when its preset mounts none.\n*/\nfunction serviceForAgent(ctx, agent, name) {\n\tconst mount = standingMountFor(agent.ctx);\n\tif (mount === void 0) return void 0;\n\tconst store = ctx.reflect.store;\n\tfor (const key of Object.getOwnPropertySymbols(store)) {\n\t\tconst impl = store[key];\n\t\t/* v8 ignore next -- cordis deletes a store slot on disposal rather than clearing it */\n\t\tif (impl === void 0) continue;\n\t\tif (impl.name !== name) continue;\n\t\tif (withinFiber(impl.fiber, mount.fiber)) return impl.value;\n\t}\n}\n/**\n* Rows that did not reach a usable state, each rendered as one diagnostic line.\n*\n* A row whose module failed to import or whose plugin threw already rejects the\n* mount through the loader; what remains observable here is a row still waiting\n* for a service the composition never supplies.\n* @param tree - the mounted subtree.\n* @returns one line per unusable row, empty when every enabled row is usable.\n*/\nfunction inactiveRows(tree) {\n\tconst lines = [];\n\tfor (const entry of tree.entries()) {\n\t\tif (entry.disabled) continue;\n\t\tconst fiber = entry.fiber;\n\t\t/* v8 ignore next 4 -- the loader rejects an entry whose module or plugin failed,\n\t\tso a settled tree never holds an enabled fiber-less entry; the branch exists\n\t\tonly because `Entry.fiber` is declared optional. */\n\t\tif (fiber === void 0) {\n\t\t\tlines.push(`${entry.options.id} (${entry.options.name}): never started`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst missing = Object.keys(fiber.inject).filter((name) => fiber.ctx.get(name) === void 0);\n\t\tif (missing.length > 0) lines.push(`${entry.options.id} (${entry.options.name}): waiting for ${missing.join(\", \")}`);\n\t}\n\treturn lines;\n}\n/**\n* The reportable text of a mount failure.\n*\n* The loader reports several failed rows as one `AggregateError`, whose own\n* message names none of them; without flattening, a composition that fails on\n* two rows says only \"loader entries failed to apply\" and the operator has\n* nothing to act on.\n* @param error - the value the mount rejected with.\n* @returns a single-line-per-cause description.\n*/\nfunction mountDetail(error) {\n\t/* v8 ignore next -- every path into the mount's catch throws an Error: the loader\n\twraps a row's thrown value before it propagates, and this module's own\n\trejections are Errors. The fallback keeps a hostile value readable. */\n\tif (!(error instanceof Error)) return String(error);\n\tif (!(error instanceof AggregateError)) return error.message;\n\treturn [error.message, ...error.errors.map((cause) => `- ${mountDetail(cause)}`)].join(\"\\n\");\n}\n/**\n* Mount `preset` under `agentCtx` and return only once every row is usable.\n*\n* The subtree is owned by `agentCtx`'s fiber, so it unwinds with the agent and\n* the caller receives no disposer. A rejection leaves nothing mounted.\n* @param agentCtx - the agent's scope context, from the agent factory's `setup`.\n* @param preset - the resolved preset to compose the agent from.\n* @throws when `agentCtx` carries no scope, a row is unusable, or a row\n* published a service into the root realm.\n*/\nasync function mountPreset(agentCtx, preset) {\n\tif (scopeOf(agentCtx) === void 0) throw new Error(`agent-presets: refusing to mount preset \"${preset.id}\" into an unscoped context; its registrations would apply to every agent in the process`);\n\tconst config = { path: pathToFileURL(preset.path).href };\n\t/* v8 ignore next -- the Loader sets `baseUrl` on the root before any scoped context derives from it */\n\tif (agentCtx.baseUrl !== void 0) harnessBase.set(config, agentCtx.baseUrl);\n\tpruneDisposedMounts();\n\tconst handle = agentCtx.plugin(PresetTree, config);\n\ttry {\n\t\tawait handle.await();\n\t\tconst subtree = mounted.get(config);\n\t\t/* v8 ignore next -- the subclass constructor runs before `await()` settles for every mounted tree */\n\t\tif (subtree === void 0) throw new Error(\"mounted subtree did not publish its entry tree\");\n\t\tconst { tree, fiber } = subtree;\n\t\tconst unusable = inactiveRows(tree);\n\t\tif (unusable.length > 0) throw new Error(`${String(unusable.length)} row(s) did not activate:\\n${unusable.join(\"\\n\")}`);\n\t\tconst leaked = leakedServices(agentCtx, fiber);\n\t\tif (leaked.length > 0) throw new Error(`row(s) published process-global service(s) [${leaked.join(\", \")}]; a preset service must sit behind an \\`isolate\\` realm or move to the host composition`);\n\t\tmounts.add({\n\t\t\tpresetId: preset.id,\n\t\t\tfiber,\n\t\t\tkey: scopeOf(agentCtx)\n\t\t});\n\t} catch (error) {\n\t\ttry {\n\t\t\tawait handle.dispose();\n\t\t} catch {}\n\t\tthrow new PresetMountError(preset.id, `${mountDetail(error)} (${preset.path})`, { cause: error });\n\t}\n}\n//#endregion\n//#region lib/types/session.js\n/**\n* The session-log record of which preset a session actually runs.\n*\n* The creation header names the preset a session STARTED with, and it is\n* deep-frozen because that is a creation fact. A session may still change\n* preset while it is blank, and the effect of that change outlives the blank\n* window: the first turn \u2014 and every turn after it \u2014 runs under the newly\n* mounted composition. Recording the change is what keeps the log honest, and\n* it is required outright by the repo's model-visible \u27FA logged rule, since the\n* preset decides the tool schemas and prompt sections the model sees.\n*\n* Reconstruction reads {@link resolveSessionPreset}, never the header alone.\n* @module @deepseek-ai/dsh-agent-presets/session\n*/\n/**\n* The preset a session actually runs, newest selection winning.\n*\n* The header supplies the creation-time value; every later selection is a\n* logged event, so the last one is the answer. Reading the header alone\n* rebuilds a switched session under the composition it was created with, not\n* the one its history was produced under.\n* @param session - the session's header and event log.\n* @returns the preset id, or `undefined` when the deployment composes none.\n*/\nfunction resolveSessionPreset(session) {\n\tfor (let index = session.events.length - 1; index >= 0; index -= 1) {\n\t\tconst event = session.events[index];\n\t\tif (event?.type === \"agent-preset/selected\") return event.data.agentPreset;\n\t}\n\treturn session.header.agentPreset;\n}\n//#endregion\n//#region lib/types/index.js\n/**\n* Agent presets: each session composes its model-facing plugin set from one\n* preset `cordis.yml`, mounted ONCE per preset under a standing scope and\n* joined by every agent that names it.\n*\n* The standing mount is what makes a preset one composition rather than one\n* per session: its plugin instances, tool registrations, prompt sections, and\n* projection units exist exactly once, keyed per session inside the plugins\n* themselves (they predate presets and were written for a shared world). An\n* agent joins by having its scope key parented to the mount's\n* ({@link bindScopeParent}), which makes the mount's registrations visible to\n* that agent's views and the mount's listeners receive that agent's events \u2014\n* and a host reader with no agent at all (a cold transcript read) resolves\n* the same standing registrations by preset id.\n*\n* This package owns the preset vocabulary, filesystem discovery, and the\n* guarded standing mount. It does not decide when an agent is created \u2014 the\n* agent factory's `setup(agentCtx)` hook is the one supported call site,\n* because only there is the join installed while the agent is still\n* unpublished, so a rejected composition rolls the whole creation back.\n* @module @deepseek-ai/dsh-agent-presets\n*/\n/** Settings namespace carrying the user's chosen default preset. */\nconst SETTINGS_NAMESPACE = \"agent-presets\";\n/** Runtime schema for the user-writable slice. */\nconst AgentPresetSettingsSchema = z.object({ default: z.string() });\n/**\n* Registry over the deployment's agent presets.\n*\n* Discovery is unmemoized: `list()` and `resolve()` re-read the roots on every\n* call so a preset authored while the process runs is visible immediately,\n* and a preset deleted underneath a picker disappears from the next read.\n*/\nvar AgentPresets = class extends Service {\n\tconfig;\n\tstatic inject = [\"loader\"];\n\t/** Runtime schema for the preset roster. */\n\tstatic Config = z.object({\n\t\tdefault: z.string().required(),\n\t\troots: z.array(z.object({\n\t\t\tpath: z.string().required(),\n\t\t\ttrust: z.union([\"system\", \"user\"]).default(\"user\")\n\t\t})).default([]),\n\t\tincludeUserRoot: z.boolean().default(true)\n\t});\n\t/**\n\t* The roots discovery and authoring actually scan: every configured root in\n\t* order, then the harness-home user root unless `includeUserRoot` is false.\n\t*\n\t* Derived once, because a root set that changed between `list()` and the\n\t* `copy()` acting on its answer would author into a directory the caller\n\t* never saw. Appending rather than prepending keeps an earlier configured\n\t* root winning a duplicate id, so a shipped preset still shadows a\n\t* locally authored directory that claimed its name.\n\t*/\n\tresolvedRoots;\n\t/**\n\t* The user layer over `config.default`, present only while a settings\n\t* provider is composed. Held rather than snapshotted so a hot-reloaded\n\t* document takes effect without a restart.\n\t*/\n\tsettings;\n\t/**\n\t* The settings service behind {@link settings}, held for the one write this\n\t* service makes: clearing a user default it has just deleted.\n\t*/\n\tsettingsService;\n\t/**\n\t* The service's own untraced context. Methods invoked through the traceable\n\t* proxy see `this.ctx` rebound to the CALLER's context, which carries a\n\t* shadow; a subtree minted from it resolves every service through that\n\t* shadow's fiber instead of each entry's own inject store, so preset rows\n\t* would fail on the very services they declare. Standing mounts must hang\n\t* off the untraced original (the `jobs-local` selfCtx precedent).\n\t*/\n\tselfCtx;\n\tconstructor(ctx, config) {\n\t\tsuper(ctx, \"agentPresets\");\n\t\tthis.config = config;\n\t\tthis.selfCtx = ctx;\n\t\tthis.resolvedRoots = config.includeUserRoot ? [...config.roots, {\n\t\t\tpath: dshHomePath(USER_PRESET_DIR),\n\t\t\ttrust: \"user\"\n\t\t}] : [...config.roots];\n\t\tctx.inject([\"settings\"], (settingsCtx) => {\n\t\t\tthis.settings = settingsCtx.settings.register(settingsNamespace(SETTINGS_NAMESPACE), AgentPresetSettingsSchema, { base: { default: config.default } });\n\t\t\tthis.settingsService = settingsCtx.settings;\n\t\t\tsettingsCtx.effect(() => () => {\n\t\t\t\tthis.settings = void 0;\n\t\t\t\tthis.settingsService = void 0;\n\t\t\t}, \"agentPresets.settings()\");\n\t\t});\n\t\tctx.on(\"agent/created\", ({ agent }) => {\n\t\t\tif (this.resolvedRoots.length === 0) return;\n\t\t\tif (this.composedPreset(agent.ctx) !== void 0) return;\n\t\t\tctx.logger.warn(`agent \"${agent.id}\" was published without joining an agent preset; its tools, prompt sections, and skill catalog resolve against the empty global layer (join through AgentPresets.mount() or composeFrom() in the agent factory setup)`);\n\t\t});\n\t\tctx.on(\"session/event\", (session, event) => {\n\t\t\tif (event.type !== \"agent-preset/selected\") return;\n\t\t\tctx.emit(\"agent-preset/selected\", session.id, event.data.agentPreset);\n\t\t});\n\t}\n\t/**\n\t* The preset id mounted when a caller names none.\n\t*\n\t* Read per call rather than cached: the settings document is hot-reloaded, so\n\t* changing the default takes effect on the next session created and leaves\n\t* every running session on the preset it was composed from.\n\t*/\n\tget defaultId() {\n\t\treturn this.settings?.get().default ?? this.config.default;\n\t}\n\t/**\n\t* Every preset the configured roots currently supply.\n\t* @returns the presets, first-root-wins per id.\n\t*/\n\tasync list() {\n\t\treturn await discoverPresets(this.resolvedRoots);\n\t}\n\t/**\n\t* Resolve one preset by id.\n\t*\n\t* A broken preset resolves \u2014 deleting one, reading one, and reporting one\n\t* all need the row \u2014 and the mounting paths refuse it AFTER resolution\n\t* through {@link resolveMountable}.\n\t* @param id - the preset id, or `undefined` for {@link defaultId}.\n\t* @returns the resolved preset.\n\t* @throws when no configured root supplies that id.\n\t*/\n\tasync resolve(id) {\n\t\tconst wanted = id ?? this.defaultId;\n\t\tconst presets = await this.list();\n\t\tconst found = presets.find((preset) => preset.id === wanted);\n\t\tif (found === void 0) throw new UnknownPresetError(wanted, presets.map((preset) => preset.id));\n\t\treturn found;\n\t}\n\t/**\n\t* Resolve one preset that is about to compose an agent, refusing a broken\n\t* one with its discovery-reported reason. Failing here rather than inside\n\t* the loader keeps the answer the same for every unloadable shape \u2014 ghost\n\t* directory, unparsable YAML, rowless list \u2014 and spends no mount attempt\n\t* on a composition discovery already read as unusable.\n\t* @param id - the preset id, or `undefined` for {@link defaultId}.\n\t* @returns the resolved, mountable preset.\n\t* @throws when the preset is unknown or discovery reports it broken.\n\t*/\n\tasync resolveMountable(id) {\n\t\tconst preset = await this.resolve(id);\n\t\tif (preset.broken !== void 0) throw new PresetMountError(preset.id, preset.broken);\n\t\treturn preset;\n\t}\n\t/**\n\t* Standing mounts by preset id, single-flight so two agents racing the\n\t* first use of one preset share one composition. A settled failure is\n\t* removed so a later session retries a preset whose file has been fixed; a\n\t* settled success serves until the composition FILE visibly changes \u2014 each\n\t* generation records its file stamp, and a stale stamp starts the next\n\t* generation for sessions created afterwards. Sessions already joined keep\n\t* the generation they run on; a superseded one is never disposed while the\n\t* process lives (reclaimed only by whole-tree teardown), so editing files\n\t* is bounded by how often compositions change, not by session count.\n\t*/\n\tstanding = /* @__PURE__ */ new Map();\n\t/**\n\t* Parent bindings of the agents this roster composed, keyed by the agent's\n\t* scope key. The binding is dsh-scope's only re-link capability; holding it\n\t* here makes this service the sole authority that can move an agent between\n\t* standing compositions. WeakMap: entries die with their agents.\n\t*/\n\tbindings = /* @__PURE__ */ new WeakMap();\n\t/**\n\t* Compose one agent from a preset: ensure the preset's standing mount, then\n\t* parent the agent's scope key to it so the mount's registrations and\n\t* listeners cover this agent.\n\t*\n\t* Call from the agent factory's `setup(agentCtx)`; a rejection there rolls\n\t* the agent creation back, so a broken preset never yields a half-composed\n\t* session.\n\t* @param agentCtx - the agent's scope context.\n\t* @param id - the preset id, or `undefined` for {@link defaultId}.\n\t* @returns the preset that was composed, for the caller to record.\n\t* @throws when the preset is unknown or its composition is unusable.\n\t*/\n\tasync mount(agentCtx, id) {\n\t\tconst agentKey = scopeOf(agentCtx);\n\t\tif (agentKey === void 0) throw new Error(\"agent-presets: refusing to compose an unscoped context; the scope key is what joins an agent to its preset\");\n\t\tconst preset = await this.resolveMountable(id);\n\t\tconst standing = await this.ensureStanding(preset);\n\t\tthis.bindings.set(agentKey, bindScopeParent(agentKey, standing.key));\n\t\treturn preset;\n\t}\n\t/**\n\t* Join one agent to the SAME standing composition another already runs on.\n\t*\n\t* This is how a child agent inherits its parent's capabilities. It is a bind,\n\t* not a mount: the parent's generation is already composed, so the child gets\n\t* that exact instance \u2014 the same plugin objects, the same tool registrations,\n\t* the same prompt sections. Re-resolving the parent's preset by id instead\n\t* would re-read the roster, and a composition file edited since the parent\n\t* started would hand the child a DIFFERENT generation than the one its\n\t* parent's history was produced under (and a preset deleted since would fail\n\t* the child outright while its parent keeps running).\n\t*\n\t* Synchronous, and with no composition failure mode of its own \u2014 it reads no\n\t* roster, mounts nothing, and touches no file \u2014 which is what lets a child\n\t* creation window use it: the two in-process subagent drivers compose their\n\t* children inside a synchronous `setup`. It still rejects a caller error, as\n\t* the `@throws` below record.\n\t*\n\t* A parent that joined no preset \u2014 a rosterless deployment \u2014 yields no join\n\t* and no error: there, the model-facing rows sit in the host composition and\n\t* the child already sees them through the global layer.\n\t* @param agentCtx - the joining agent's scope context.\n\t* @param parentCtx - the scope context of the agent whose composition to join.\n\t* @returns the preset id joined, or undefined when the parent joined none.\n\t* @throws when `agentCtx` carries no scope, or has already joined a preset.\n\t*/\n\tcomposeFrom(agentCtx, parentCtx) {\n\t\tconst agentKey = scopeOf(agentCtx);\n\t\tif (agentKey === void 0) throw new Error(\"agent-presets: refusing to compose an unscoped context; the scope key is what joins an agent to its preset\");\n\t\tconst standing = standingMountFor(parentCtx);\n\t\tif (standing === void 0) return void 0;\n\t\tthis.bindings.set(agentKey, bindScopeParent(agentKey, standing.key));\n\t\treturn standing.presetId;\n\t}\n\t/**\n\t* The preset one live agent runs on.\n\t*\n\t* Read from the live scope chain rather than from the session, so it answers\n\t* for an agent whose session has not recorded a preset yet \u2014 a child agent\n\t* whose durable header is being built from its parent's composition.\n\t* @param agentCtx - the agent's scope context.\n\t* @returns the preset id, or undefined when the agent joined none.\n\t*/\n\tcomposedPreset(agentCtx) {\n\t\treturn standingMountFor(agentCtx)?.presetId;\n\t}\n\t/**\n\t* The roots this roster scans, which is not `config.roots`: it is every\n\t* configured root in order, then the harness-home user root unless\n\t* `includeUserRoot` is false. Read this \u2014 not the config field \u2014 to answer\n\t* whether a roster is composed at all, so one derivation decides it.\n\t*/\n\tget roots() {\n\t\treturn this.resolvedRoots;\n\t}\n\t/** Whether this deployment has a root locally authored presets go to. */\n\tget authorable() {\n\t\treturn this.resolvedRoots.some((root) => root.trust === \"user\");\n\t}\n\t/**\n\t* Read one preset's composition text.\n\t* @param id - the preset id.\n\t* @returns the composition exactly as stored.\n\t* @throws when no configured root supplies that id.\n\t*/\n\tasync read(id) {\n\t\treturn await readComposition(await this.resolve(id));\n\t}\n\t/**\n\t* Create a locally authored preset by copying an existing one whole.\n\t*\n\t* Copy is the only authoring write. Composition text never crosses this\n\t* seam: the source is named by id and its directory is copied as it stands,\n\t* so the copy is exactly as loadable as its source and authoring grants no\n\t* capability the roster did not already carry. The copy is NOT mounted to\n\t* validate \u2014 a source that mounts today yields a copy that mounts today.\n\t* @param from - the preset the copy starts from; shipped presets are the\n\t* primary source, so any trust is accepted.\n\t* @param id - the new preset's id, which becomes its directory name.\n\t* @param name - display name for the copy; absent falls back to the id.\n\t* @throws when the source is unknown, the id is unusable or already taken,\n\t* or the deployment configures no writable root.\n\t*/\n\tasync copy(from, id, name) {\n\t\tconst source = await this.resolve(from);\n\t\tif ((await this.list()).some((preset) => preset.id === id)) throw new PresetExistsError(id);\n\t\tawait copyComposition(this.resolvedRoots, source, id, name);\n\t\tthis.standing.delete(id);\n\t}\n\t/**\n\t* Delete a locally authored preset.\n\t* @param id - the preset id.\n\t* @throws when the preset is unknown or ships with the deployment.\n\t*/\n\tasync remove(id) {\n\t\tawait deleteComposition(this.resolvedRoots, await this.resolve(id));\n\t\tthis.standing.delete(id);\n\t\tif (this.settings?.get().default !== id) return;\n\t\tawait this.settingsService?.mutate(settingsNamespace(SETTINGS_NAMESPACE), [{\n\t\t\top: \"unset\",\n\t\t\tpath: [\"default\"]\n\t\t}]);\n\t}\n\t/**\n\t* One agent's instance of a service its preset mounted.\n\t*\n\t* A preset publishes services behind `isolate` realms, which are invisible\n\t* outside the group that declares them \u2014 including to the host. This is how a\n\t* caller holding the agent reads one anyway: a request that is ABOUT a\n\t* session but arrives from outside it, which is every browser RPC.\n\t*\n\t* Read addressing only. A host row that `inject`s a service cannot use this,\n\t* because injection resolves before any session exists and has no agent to\n\t* key by; such a service belongs on the host plane instead.\n\t* @param agent - the agent whose composition to look inside.\n\t* @param name - the service name as the preset's rows resolve it.\n\t* @returns the agent's instance, or undefined when its preset mounts none.\n\t*/\n\tserviceFor(agent, name) {\n\t\treturn serviceForAgent(this.ctx, agent, name);\n\t}\n\t/**\n\t* Re-link one agent to a different preset's standing composition.\n\t*\n\t* Only valid while the agent has produced nothing: swapping tools mid\n\t* conversation would leave logged tool calls the new composition cannot\n\t* make. The CALLER owns that check \u2014 this method does not read session\n\t* history.\n\t*\n\t* The swap is a parent re-link, not an unmount: standing mounts are shared\n\t* and permanent, so the old composition stays for its other agents and the\n\t* new one is ensured BEFORE the link moves. An unknown or unusable preset\n\t* therefore throws with the agent exactly as it was \u2014 there is no torn-down\n\t* state to restore. The re-link runs through the binding this roster kept\n\t* from the agent's mount \u2014 dsh-scope's only re-link authority. An agent\n\t* that never composed one has nothing to re-link: the switch is then the\n\t* agent's first bind, exactly a mount.\n\t* @param agentCtx - the agent's scope context.\n\t* @param id - the preset to compose the agent from instead.\n\t* @returns the preset now installed.\n\t* @throws when the preset is unknown or its composition is unusable.\n\t*/\n\tasync recompose(agentCtx, id) {\n\t\tconst agentKey = scopeOf(agentCtx);\n\t\tif (agentKey === void 0) throw new Error(\"agent-presets: refusing to recompose an unscoped context\");\n\t\tconst preset = await this.resolveMountable(id);\n\t\tconst standing = await this.ensureStanding(preset);\n\t\tconst binding = this.bindings.get(agentKey);\n\t\tif (binding === void 0) this.bindings.set(agentKey, bindScopeParent(agentKey, standing.key));\n\t\telse binding.rebind(standing.key);\n\t\treturn preset;\n\t}\n\t/**\n\t* The standing scope key of one preset, for a host reader with no agent.\n\t*\n\t* A cold transcript read resolves tool presenters against the composition\n\t* the session recorded, and the standing mount makes that possible without\n\t* resuming anything: ensuring the mount composes plugins but starts no\n\t* agent, no session, and no turn.\n\t* @param id - the preset id, or `undefined` for {@link defaultId}.\n\t* @returns the standing scope key readers pass as a registry view scope.\n\t* @throws when the preset is unknown or its composition is unusable.\n\t*/\n\tasync standingKeyFor(id) {\n\t\tconst preset = await this.resolveMountable(id);\n\t\treturn (await this.ensureStanding(preset)).key;\n\t}\n\t/** Resolve (or create, single-flight) the standing mount of one preset. */\n\tasync ensureStanding(preset) {\n\t\tconst pending = this.standing.get(preset.id);\n\t\tif (pending !== void 0) {\n\t\t\tconst mounted = await pending;\n\t\t\tconst current = await compositionStamp(preset.path);\n\t\t\tif (current === void 0 || sameStamp(mounted.stamp, current)) return mounted;\n\t\t\tif (this.standing.get(preset.id) === pending) this.standing.delete(preset.id);\n\t\t\treturn this.ensureStanding(preset);\n\t\t}\n\t\tconst created = (async () => {\n\t\t\tconst key = { agentPreset: preset.id };\n\t\t\tconst scope = createScope(this.selfCtx, key);\n\t\t\ttry {\n\t\t\t\tconst stamp = await compositionStamp(preset.path);\n\t\t\t\tif (stamp === void 0) throw new PresetMountError(preset.id, `composition file is unreadable: ${preset.path}`);\n\t\t\t\tawait mountPreset(scope.ctx, preset);\n\t\t\t\treturn {\n\t\t\t\t\tkey,\n\t\t\t\t\tscope,\n\t\t\t\t\tstamp\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\tthis.standing.delete(preset.id);\n\t\t\t\tawait scope.dispose();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t})();\n\t\tthis.standing.set(preset.id, created);\n\t\treturn created;\n\t}\n};\n/** Read one composition file's stamp, or undefined when it cannot be statted. */\nasync function compositionStamp(path) {\n\ttry {\n\t\tconst { mtimeMs, size } = await stat(path);\n\t\treturn {\n\t\t\tmtimeMs,\n\t\t\tsize\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\n/** Whether two stamps name the same file state. */\nfunction sameStamp(a, b) {\n\treturn a.mtimeMs === b.mtimeMs && a.size === b.size;\n}\n//#endregion\nexport { AgentPresetSettingsSchema, AgentPresets, AgentPresets as default, COMPOSITION_FILE, InvalidPresetIdError, METADATA_FILE, PresetExistsError, PresetMountError, PresetNotWritableError, SETTINGS_NAMESPACE, UnknownPresetError, copyComposition, deleteComposition, discoverPresets, inactiveRows, leakedServices, livePresetMounts, mountPreset, readComposition, readPresetMetadata, renderPresetMetadata, resolveSessionPreset, scanRoot, serviceForAgent, standingMountFor, writableRoot };\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/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/** Deeply compare arrays, dates, regexps, buffers, and plain object fields. */\nfunction deepEqual(a, b, strict) {\n\tif (a === b) return true;\n\tif (!strict && isNullable(a) && isNullable(b)) return true;\n\tif (typeof a !== typeof b) return false;\n\tif (typeof a !== \"object\") return false;\n\tif (!a || !b) return false;\n\tfunction check(test, then) {\n\t\treturn test(a) ? test(b) ? then(a, b) : false : test(b) ? false : void 0;\n\t}\n\treturn check(Array.isArray, (a, b) => a.length === b.length && a.every((item, index) => deepEqual(item, b[index]))) ?? check(is(\"Date\"), (a, b) => a.valueOf() === b.valueOf()) ?? check(is(\"RegExp\"), (a, b) => a.source === b.source && a.flags === b.flags) ?? check(isArrayBufferLike, (a, b) => {\n\t\tif (a.byteLength !== b.byteLength) return false;\n\t\tconst viewA = new Uint8Array(a);\n\t\tconst viewB = new Uint8Array(b);\n\t\tfor (let i = 0; i < viewA.length; i++) if (viewA[i] !== viewB[i]) return false;\n\t\treturn true;\n\t}) ?? Object.keys({\n\t\t...a,\n\t\t...b\n\t}).every((key) => deepEqual(a[key], b[key], strict));\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, deduplicate, deepEqual, defineProperty, difference, filterKeys, formatProperty, hexToArrayBuffer, hyphenate, intersection, is, isNonNullable, isNullable, isPlainObject, makeArray, mapValues, mapValues as valueMap, noop, omit, paramCase, pick, remove, sanitize, snakeCase, trimSlash, uncapitalize, union };\n", "import { defineProperty, hyphenate, isNullable } from \"@deepseek-ai/cosmokit\";\n//#region lib/types/utils.js\n/** Ordered collection of disposable values with O(1) deletion by value. */\nvar DisposableList = class {\n\tsn = 0;\n\tmap = /* @__PURE__ */ new Map();\n\tweak = /* @__PURE__ */ new WeakMap();\n\tget length() {\n\t\treturn this.map.size;\n\t}\n\tpush(value) {\n\t\tconst sn = ++this.sn;\n\t\tthis.map.set(sn, value);\n\t\tthis.weak.set(value, sn);\n\t\treturn () => this.map.delete(sn);\n\t}\n\tdelete(value) {\n\t\tconst sn = this.weak.get(value);\n\t\tif (!sn) return false;\n\t\treturn this.map.delete(sn);\n\t}\n\tclear() {\n\t\tconst values = [...this.map.values()];\n\t\tthis.map.clear();\n\t\treturn values.reverse();\n\t}\n\t[Symbol.iterator]() {\n\t\treturn this.map.values();\n\t}\n\t[Symbol.for(\"nodejs.util.inspect.custom\")]() {\n\t\treturn [...this];\n\t}\n};\n/** Shared symbols used to avoid public property-name collisions. */\nconst symbols = {\n\tshadow: Symbol.for(\"cordis.shadow\"),\n\treceiver: Symbol.for(\"cordis.receiver\"),\n\toriginal: Symbol.for(\"cordis.original\"),\n\tmetadata: Symbol.for(\"cordis.metadata\"),\n\tinitHooks: Symbol.for(\"cordis.initHooks\"),\n\tcheckProto: Symbol.for(\"cordis.checkProto\"),\n\teffect: Symbol.for(\"cordis.effect\"),\n\tfilter: Symbol.for(\"cordis.filter\"),\n\tisolate: Symbol.for(\"cordis.isolate\"),\n\tintercept: Symbol.for(\"cordis.intercept\"),\n\tinit: Symbol.for(\"cordis.init\"),\n\tcheck: Symbol.for(\"cordis.check\"),\n\tconfig: Symbol.for(\"cordis.config\"),\n\tinvoke: Symbol.for(\"cordis.invoke\"),\n\textend: Symbol.for(\"cordis.extend\"),\n\ttracker: Symbol.for(\"cordis.tracker\"),\n\tresolveConfig: Symbol.for(\"cordis.resolveConfig\")\n};\nconst GeneratorFunction = function* () {}.constructor;\nconst AsyncGeneratorFunction = async function* () {}.constructor;\n/** Return true when a plugin callback should be constructed with `new`. */\nfunction isConstructor(func) {\n\tif (!func.prototype) return false;\n\tif (func instanceof GeneratorFunction) return false;\n\tif (AsyncGeneratorFunction !== Function && func instanceof AsyncGeneratorFunction) return false;\n\treturn true;\n}\n/** Merge two prototype chains while preserving descriptors from `proto1`. */\nfunction joinPrototype(proto1, proto2) {\n\tif (proto1 === Object.prototype) return proto2;\n\tconst result = Object.create(joinPrototype(Object.getPrototypeOf(proto1), proto2));\n\tfor (const key of Reflect.ownKeys(proto1)) Object.defineProperty(result, key, Object.getOwnPropertyDescriptor(proto1, key));\n\treturn result;\n}\n/** Return true for non-null objects and functions. */\nfunction isObject(value) {\n\treturn value && (typeof value === \"object\" || typeof value === \"function\");\n}\n/** Find a property descriptor by walking an object's prototype chain. */\nfunction getPropertyDescriptor(target, prop) {\n\tlet proto = target;\n\twhile (proto) {\n\t\tconst desc = Reflect.getOwnPropertyDescriptor(proto, prop);\n\t\tif (desc) return desc;\n\t\tproto = Object.getPrototypeOf(proto);\n\t}\n}\n/** Wrap services/functions so method calls see the caller's active context. */\nfunction getTraceable(ctx, value) {\n\tif (!isObject(value)) return value;\n\tif (Object.hasOwn(value, symbols.shadow)) return Object.getPrototypeOf(value);\n\tconst tracker = value[symbols.tracker];\n\tif (!tracker) return value;\n\treturn createTraceable(ctx, value, tracker);\n}\n/** Return a proxy that overlays readonly or writable properties onto a target. */\nfunction withProps(target, props) {\n\tif (!props) return target;\n\treturn new Proxy(target, {\n\t\tget: (target, prop, receiver) => {\n\t\t\tif (prop in props && prop !== \"constructor\") return Reflect.get(props, prop, receiver);\n\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t},\n\t\tset: (target, prop, value, receiver) => {\n\t\t\tif (prop in props && prop !== \"constructor\") return Reflect.set(props, prop, value, receiver);\n\t\t\treturn Reflect.set(target, prop, value, receiver);\n\t\t}\n\t});\n}\nfunction withProp(target, prop, value) {\n\treturn withProps(target, Object.defineProperty(Object.create(null), prop, {\n\t\tvalue,\n\t\twritable: false\n\t}));\n}\nfunction createShadow(ctx, target, property, receiver) {\n\tif (!property) return receiver;\n\tconst origin = Reflect.getOwnPropertyDescriptor(target, property)?.value;\n\tif (!origin) return receiver;\n\treturn withProp(receiver, property, ctx.extend({ [symbols.shadow]: origin }));\n}\nfunction createShadowMethod(ctx, value, outer, shadow) {\n\treturn new Proxy(value, { apply: (target, thisArg, args) => {\n\t\tif (thisArg === outer) thisArg = shadow;\n\t\treturn getTraceable(ctx, Reflect.apply(target, thisArg, args));\n\t} });\n}\nfunction createTraceable(ctx, value, tracker) {\n\tif (ctx[symbols.shadow] && !tracker.noShadow) ctx = Object.getPrototypeOf(ctx);\n\tconst proxy = new Proxy(value, {\n\t\tget: (target, prop, receiver) => {\n\t\t\tif (prop === symbols.original) return target;\n\t\t\tif (prop === tracker.property) return ctx;\n\t\t\tif (typeof prop === \"symbol\") return Reflect.get(target, prop, receiver);\n\t\t\tif (tracker.associate && ctx.reflect.props[`${tracker.associate}.${prop}`]) return Reflect.get(ctx, `${tracker.associate}.${prop}`, withProp(ctx, symbols.receiver, receiver));\n\t\t\tlet shadow, innerValue;\n\t\t\tconst desc = getPropertyDescriptor(target, prop);\n\t\t\tif (desc && \"value\" in desc) innerValue = desc.value;\n\t\t\telse {\n\t\t\t\tshadow = createShadow(ctx, target, tracker.property, receiver);\n\t\t\t\tinnerValue = Reflect.get(target, prop, shadow);\n\t\t\t}\n\t\t\tconst innerTracker = innerValue?.[symbols.tracker];\n\t\t\tif (innerTracker) return createTraceable(ctx, innerValue, innerTracker);\n\t\t\telse if (!tracker.noShadow && typeof innerValue === \"function\") {\n\t\t\t\tshadow ??= createShadow(ctx, target, tracker.property, receiver);\n\t\t\t\treturn createShadowMethod(ctx, innerValue, receiver, shadow);\n\t\t\t} else return innerValue;\n\t\t},\n\t\tset: (target, prop, value, receiver) => {\n\t\t\tif (prop === symbols.original) return false;\n\t\t\tif (prop === tracker.property) return false;\n\t\t\tif (typeof prop === \"symbol\") return Reflect.set(target, prop, value, receiver);\n\t\t\tif (tracker.associate && ctx.reflect.props[`${tracker.associate}.${prop}`]) return Reflect.set(ctx, `${tracker.associate}.${prop}`, value, withProp(ctx, symbols.receiver, receiver));\n\t\t\tconst shadow = createShadow(ctx, target, tracker.property, receiver);\n\t\t\treturn Reflect.set(target, prop, value, shadow);\n\t\t},\n\t\tapply: (target, thisArg, args) => {\n\t\t\treturn applyTraceable(proxy, target, thisArg, args);\n\t\t}\n\t});\n\treturn proxy;\n}\nfunction applyTraceable(proxy, value, thisArg, args) {\n\tif (!value[symbols.invoke]) return Reflect.apply(value, thisArg, args);\n\treturn value[symbols.invoke].apply(proxy, args);\n}\n/** Create a callable service object that dispatches through `symbols.invoke`. */\nfunction createCallable(name, proto, tracker) {\n\tconst self = function(...args) {\n\t\treturn applyTraceable(createTraceable(self[\"ctx\"], self, tracker), self, this, args);\n\t};\n\tdefineProperty(self, \"name\", name);\n\treturn Object.setPrototypeOf(self, proto);\n}\nfunction handleError(info, reason, getOuterStack) {\n\tconst innerLines = info.error.stack.split(\"\\n\");\n\tif (typeof reason?.stack !== \"string\") {\n\t\tconst outerError = new Error(reason);\n\t\tconst lines = outerError.stack.split(\"\\n\");\n\t\tlines.splice(1, Infinity, ...getOuterStack());\n\t\touterError.stack = lines.join(\"\\n\");\n\t\tthrow outerError;\n\t}\n\tconst lines = reason.stack.split(\"\\n\");\n\tlet index = lines.indexOf(innerLines[2]);\n\tif (index === -1) throw reason;\n\tindex -= info.offset;\n\twhile (index > 0) {\n\t\tif (!lines[index - 1].endsWith(\" (<anonymous>)\")) break;\n\t\tindex -= 1;\n\t}\n\tlines.splice(index, Infinity, ...getOuterStack());\n\treason.stack = lines.join(\"\\n\");\n\tthrow reason;\n}\n/** Run a callback and splice outer call-site frames into thrown async errors. */\nfunction composeError(callback, getOuterStack = buildOuterStack()) {\n\tconst info = {\n\t\toffset: 1,\n\t\terror: /* @__PURE__ */ new Error()\n\t};\n\ttry {\n\t\tconst result = callback(info);\n\t\tif (isObject(result) && \"then\" in result) return result.then(void 0, (reason) => handleError(info, reason, getOuterStack));\n\t\telse return result;\n\t} catch (reason) {\n\t\thandleError(info, reason, getOuterStack);\n\t}\n}\n/** Capture a lazy stack-frame supplier for later error composition. */\nfunction buildOuterStack(offset = 0) {\n\tconst outerError = /* @__PURE__ */ new Error();\n\treturn () => outerError.stack.split(\"\\n\").slice(3 + offset);\n}\n//#endregion\n//#region lib/types/events.js\n/**\n* Return whether an event result should stop a bail-style dispatch.\n*\n* @param value \u2014 a listener's return value.\n* @returns `true` unless `value` is `null`, `false`, or `undefined`.\n*/\nfunction isBailed(value) {\n\treturn value !== null && value !== false && value !== void 0;\n}\n/**\n* Event bus installed as `ctx.events` and mixed into every context.\n*\n* The service supports concurrent, synchronous, serial, bail, and waterfall\n* dispatch and automatically disposes listeners with their owning fiber.\n*/\nvar EventsService = class {\n\tctx;\n\t_hooks = {};\n\tconstructor(ctx) {\n\t\tthis.ctx = ctx;\n\t\tdefineProperty(this, symbols.tracker, {\n\t\t\tproperty: \"ctx\",\n\t\t\tnoShadow: true\n\t\t});\n\t\tthis.on(\"internal/listener\", function(name, listener, options) {\n\t\t\tif (name === \"internal/update\" && !options.global) return (this.fiber._hooks[\"internal/update\"] ??= new DisposableList())[options.prepend ? \"unshift\" : \"push\"](listener);\n\t\t});\n\t\tthis.on(\"internal/update\", function(config, noSave, next) {\n\t\t\tconst cbs = [...this._hooks[\"internal/update\"] || []];\n\t\t\tconst _next = () => {\n\t\t\t\treturn (cbs.shift() ?? next).call(this, config, noSave, _next);\n\t\t\t};\n\t\t\treturn _next();\n\t\t}, {\n\t\t\tglobal: true,\n\t\t\tprepend: true\n\t\t});\n\t}\n\t/**\n\t* Resolve listeners for one dispatch and apply context filtering.\n\t*\n\t* @param type \u2014 the dispatch mode, reported on `internal/dispatch`.\n\t* @param args \u2014 the raw dispatch arguments; consumed up to the event name.\n\t* @returns the matching listener callbacks, bound to the dispatch `this`.\n\t*/\n\tdispatch(type, args) {\n\t\tconst thisArg = typeof args[0] === \"object\" || typeof args[0] === \"function\" ? args.shift() : null;\n\t\tconst name = args.shift();\n\t\tif (!name.startsWith(\"internal/\")) this.emit(\"internal/dispatch\", type, name, args, thisArg);\n\t\tconst filter = thisArg?.[Context.filter];\n\t\treturn (this._hooks[name] || []).filter((hook) => hook.global || !filter || filter.call(thisArg, hook.ctx)).map((hook) => hook.callback.bind(thisArg));\n\t}\n\t/**\n\t* Run listeners concurrently and wait for all of them.\n\t*\n\t* @param args \u2014 optional `this`, the event name, then listener arguments.\n\t* @returns a promise resolving once every listener has settled.\n\t*/\n\tasync parallel(...args) {\n\t\tconst errors = (await Promise.allSettled(this.dispatch(\"emit\", args).map(async (cb) => cb(...args)))).filter((result) => result.status === \"rejected\");\n\t\tif (errors.length) throw new AggregateError(errors.map((error) => error.reason));\n\t}\n\t/**\n\t* Run listeners synchronously without waiting for returned promises.\n\t*\n\t* @param args \u2014 optional `this`, the event name, then listener arguments.\n\t*/\n\temit(...args) {\n\t\tthis.dispatch(\"emit\", args).map((cb) => cb(...args));\n\t}\n\t/**\n\t* Run listeners in order, awaiting each, until one returns a bail value.\n\t*\n\t* @param args \u2014 optional `this`, the event name, then listener arguments.\n\t* @returns the first bail value (see {@link isBailed}), if any.\n\t*/\n\tasync serial(...args) {\n\t\tfor (const cb of this.dispatch(\"serial\", args)) {\n\t\t\tconst result = await cb(...args);\n\t\t\tif (isBailed(result)) return result;\n\t\t}\n\t}\n\t/**\n\t* Run listeners synchronously until one returns a bail value.\n\t*\n\t* @param args \u2014 optional `this`, the event name, then listener arguments.\n\t* @returns the first bail value (see {@link isBailed}), if any.\n\t*/\n\tbail(...args) {\n\t\tfor (const cb of this.dispatch(\"bail\", args)) {\n\t\t\tconst result = cb(...args);\n\t\t\tif (isBailed(result)) return result;\n\t\t}\n\t}\n\t/**\n\t* Compose listeners around the final `next` callback.\n\t*\n\t* The last dispatch argument is treated as the innermost `next`. Listeners\n\t* run outermost-first; a listener that does not call `next()` vetoes the\n\t* rest of the chain, including the built-in behavior.\n\t*\n\t* @param args \u2014 optional `this`, the event name, listener arguments, then `next`.\n\t* @returns the outermost listener's return value.\n\t*/\n\twaterfall(...args) {\n\t\tconst cbs = this.dispatch(\"waterfall\", args);\n\t\tconst inner = args.pop();\n\t\tconst next = () => {\n\t\t\treturn (cbs.shift() ?? inner)(...args);\n\t\t};\n\t\targs.push(next);\n\t\treturn next();\n\t}\n\t/**\n\t* Store a listener record as an effect on the current fiber.\n\t*\n\t* @param label \u2014 effect label shown in fiber diagnostics.\n\t* @param hooks \u2014 the listener list for one event.\n\t* @param callback \u2014 the listener to store.\n\t* @param options \u2014 placement and filtering options.\n\t* @returns a disposer that unregisters the listener.\n\t*/\n\tregister(label, hooks, callback, options) {\n\t\tconst method = options.prepend ? \"unshift\" : \"push\";\n\t\treturn this.ctx.fiber.effect(() => {\n\t\t\thooks[method]({\n\t\t\t\tctx: this.ctx,\n\t\t\t\tcallback,\n\t\t\t\t...options\n\t\t\t});\n\t\t\treturn () => this.unregister(hooks, callback);\n\t\t}, label);\n\t}\n\t/**\n\t* Remove a stored listener record.\n\t*\n\t* @param hooks \u2014 the listener list for one event.\n\t* @param callback \u2014 the listener to remove.\n\t* @returns `true` if the listener was found and removed.\n\t*/\n\tunregister(hooks, callback) {\n\t\tconst index = hooks.findIndex((hook) => hook.callback === callback);\n\t\tif (index >= 0) {\n\t\t\thooks.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t}\n\t/**\n\t* Register an event listener owned by the current fiber.\n\t*\n\t* The listener is removed automatically when the fiber unloads. Throws\n\t* `CordisError('INACTIVE_EFFECT')` if the fiber is already disposed.\n\t*\n\t* @param name \u2014 the event name to listen for.\n\t* @param listener \u2014 called with the dispatch arguments.\n\t* @param options \u2014 listener options; a boolean is shorthand for `prepend`.\n\t* @returns a disposer removing the listener; `true` if it was still registered.\n\t*/\n\ton(name, listener, options) {\n\t\tif (typeof options !== \"object\") options = { prepend: options };\n\t\tthis.ctx.fiber.assertActive();\n\t\tlistener = this.ctx.reflect.bind(listener);\n\t\tconst result = this.bail(this.ctx, \"internal/listener\", name, listener, options);\n\t\tif (result) return result;\n\t\tconst hooks = this._hooks[name] ||= [];\n\t\tconst label = `ctx.on(${typeof name === \"string\" ? JSON.stringify(name) : name.toString()})`;\n\t\treturn this.register(label, hooks, listener, options);\n\t}\n\t/**\n\t* Register an event listener that disposes itself after the first call.\n\t*\n\t* @param name \u2014 the event name to listen for.\n\t* @param listener \u2014 called at most once with the dispatch arguments.\n\t* @param options \u2014 listener options; a boolean is shorthand for `prepend`.\n\t* @returns a disposer removing the listener; `true` if it was still registered.\n\t*/\n\tonce(name, listener, options) {\n\t\tconst dispose = this.on(name, function(...args) {\n\t\t\tdispose();\n\t\t\treturn listener.apply(this, args);\n\t\t}, options);\n\t\treturn dispose;\n\t}\n};\n//#endregion\n//#region lib/types/logger.js\n/** Built-in placeholder formatters used by `Logger.format()`. */\nconst defaultFormatters = {\n\ts: (value) => String(value),\n\td: (value) => Math.trunc(Number(value)),\n\ti: (value) => Math.trunc(Number(value)),\n\tf: (value) => Number(value),\n\to: (value) => JSON.stringify(value),\n\tO: (value) => JSON.stringify(value),\n\tc: () => \"\",\n\tC: (value, exporter, message) => {\n\t\treturn Logger.color(exporter, Logger.code(message.name, exporter.colors), value);\n\t}\n};\nfunction isAggregateError(error) {\n\treturn error instanceof Error && Array.isArray(error[\"errors\"]);\n}\n/** Logger facade for one named subsystem. */\nvar Logger = class {\n\tservice;\n\tstatic color(exporter, code, value, decoration = \"\") {\n\t\tif (!exporter.colors) return \"\" + value;\n\t\treturn `\\u001b[3${code < 8 ? code : \"8;5;\" + code}${exporter.colors >= 2 ? decoration : \"\"}m${value}\\u001b[0m`;\n\t}\n\tstatic code(name, level) {\n\t\tlet hash = 0;\n\t\tfor (let i = 0; i < name.length; i++) {\n\t\t\thash = (hash << 3) - hash + name.charCodeAt(i) + 13;\n\t\t\thash |= 0;\n\t\t}\n\t\tconst colors = !level ? [] : level >= 2 ? c256 : c16;\n\t\treturn colors[Math.abs(hash) % colors.length];\n\t}\n\tstatic format(exporter, message) {\n\t\tconst args = message.args.slice();\n\t\tif (args[0] instanceof Error) {\n\t\t\targs[0] = args[0].stack || args[0].message;\n\t\t\targs.unshift(\"%s\");\n\t\t} else if (typeof args[0] !== \"string\") args.unshift(\"%o\");\n\t\tlet format = args.shift();\n\t\tformat = format.replace(/%([a-zA-Z%])/g, (match, char) => {\n\t\t\tif (match === \"%%\") return \"%\";\n\t\t\tconst formatter = exporter.formatters?.[char] ?? defaultFormatters[char];\n\t\t\tif (typeof formatter === \"function\") return formatter(args.shift(), exporter, message);\n\t\t\treturn match;\n\t\t});\n\t\tconst oFormatter = exporter.formatters?.o ?? defaultFormatters.o;\n\t\tfor (let arg of args) {\n\t\t\tif (typeof arg === \"object\" && arg) arg = oFormatter(arg, exporter, message);\n\t\t\tformat += \" \" + arg;\n\t\t}\n\t\tconst { maxLength = 10240 } = exporter;\n\t\treturn format.split(/\\r?\\n/g).map((line) => {\n\t\t\treturn line.slice(0, maxLength) + (line.length > maxLength ? \"...\" : \"\");\n\t\t}).join(\"\\n\");\n\t}\n\tconstructor(options, service) {\n\t\tthis.service = service;\n\t\tObject.assign(this, options);\n\t\tthis.error = this._method(\"error\", 0);\n\t\tthis.info = this._method(\"info\", 1);\n\t\tthis.warn = this._method(\"warn\", 2);\n\t\tthis.debug = this._method(\"debug\", 3);\n\t}\n\t_method(type, level) {\n\t\treturn (...args) => {\n\t\t\tif (args.length === 1 && args[0] instanceof Error) {\n\t\t\t\tif (args[0].cause) this[type](args[0].cause);\n\t\t\t\telse if (isAggregateError(args[0])) {\n\t\t\t\t\targs[0].errors.forEach((error) => this[type](error));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst sn = ++this.service._snMessage;\n\t\t\tconst ts = Date.now();\n\t\t\tfor (const exporter of this.service.exporters.values()) {\n\t\t\t\tif ((exporter.levels?.[this.name] ?? exporter.levels?.default ?? this.level ?? 1) < level) continue;\n\t\t\t\tconst message = {\n\t\t\t\t\tsn,\n\t\t\t\t\tts,\n\t\t\t\t\ttype,\n\t\t\t\t\tlevel,\n\t\t\t\t\tname: this.name,\n\t\t\t\t\t...this.meta,\n\t\t\t\t\targs\n\t\t\t\t};\n\t\t\t\texporter.export(message);\n\t\t\t}\n\t\t};\n\t}\n};\n/** ANSI 16-color palette indexes used for logger name coloring. */\nconst c16 = [\n\t6,\n\t2,\n\t3,\n\t4,\n\t5,\n\t1\n];\n/** ANSI 256-color palette indexes used for logger name coloring. */\nconst c256 = [\n\t20,\n\t21,\n\t26,\n\t27,\n\t32,\n\t33,\n\t38,\n\t39,\n\t40,\n\t41,\n\t42,\n\t43,\n\t44,\n\t45,\n\t56,\n\t57,\n\t62,\n\t63,\n\t68,\n\t69,\n\t74,\n\t75,\n\t76,\n\t77,\n\t78,\n\t79,\n\t80,\n\t81,\n\t92,\n\t93,\n\t98,\n\t99,\n\t112,\n\t113,\n\t129,\n\t134,\n\t135,\n\t148,\n\t149,\n\t160,\n\t161,\n\t162,\n\t163,\n\t164,\n\t165,\n\t166,\n\t167,\n\t168,\n\t169,\n\t170,\n\t171,\n\t172,\n\t173,\n\t178,\n\t179,\n\t184,\n\t185,\n\t196,\n\t197,\n\t198,\n\t199,\n\t200,\n\t201,\n\t202,\n\t203,\n\t204,\n\t205,\n\t206,\n\t207,\n\t208,\n\t209,\n\t214,\n\t215,\n\t220,\n\t221\n];\n/**\n* Built-in logging service.\n*\n* Call `ctx.logger()` to create a named logger, or call `ctx.logger.info()`\n* directly to log with the current fiber-derived name.\n*/\nvar LoggerService = class LoggerService {\n\tbufferSize = 1e3;\n\tbuffer = [];\n\tctx;\n\t_snMessage = 0;\n\t_snExporter = 0;\n\texporters = /* @__PURE__ */ new Map();\n\tconstructor(ctx) {\n\t\tconst tracker = {\n\t\t\tproperty: \"ctx\",\n\t\t\tnoShadow: true\n\t\t};\n\t\tconst self = createCallable(\"logger\", joinPrototype(Object.getPrototypeOf(this), Function.prototype), tracker);\n\t\tObject.assign(self, this);\n\t\tself.ctx = ctx;\n\t\tdefineProperty(self, symbols.tracker, tracker);\n\t\tself.exporter({\n\t\t\tcolors: 3,\n\t\t\texport: (message) => {\n\t\t\t\tself.buffer.push(message);\n\t\t\t\tif (self.buffer.length > self.bufferSize) self.buffer = self.buffer.slice(-self.bufferSize);\n\t\t\t}\n\t\t});\n\t\treturn self;\n\t}\n\t/**\n\t* Register an exporter and dispose it with the current fiber.\n\t*\n\t* @param exporter \u2014 the sink that receives structured log messages.\n\t* @returns a disposer that removes the exporter.\n\t*/\n\texporter(exporter) {\n\t\treturn this.ctx.effect(() => {\n\t\t\tthis.exporters.set(++this._snExporter, exporter);\n\t\t\treturn () => this.exporters.delete(this._snExporter);\n\t\t}, \"ctx.logger.exporter()\");\n\t}\n\t_resolveConfig() {\n\t\tlet intercept = this.ctx[symbols.intercept];\n\t\tconst configs = [];\n\t\twhile (\"logger\" in intercept) {\n\t\t\tif (Object.hasOwn(intercept, \"logger\")) configs.unshift(intercept[\"logger\"]);\n\t\t\tintercept = Object.getPrototypeOf(intercept);\n\t\t}\n\t\treturn Object.assign({}, ...configs);\n\t}\n\t[symbols.invoke](name) {\n\t\tconst config = this._resolveConfig();\n\t\tconst fiber = (this.ctx[symbols.shadow] ?? this.ctx).fiber;\n\t\tname ??= config.name;\n\t\tname ??= hyphenate(fiber.name);\n\t\treturn new Logger({\n\t\t\tname,\n\t\t\tlevel: config.level,\n\t\t\tmeta: { fiber: new WeakRef(fiber) }\n\t\t}, this);\n\t}\n\tstatic {\n\t\tfor (const type of [\n\t\t\t\"error\",\n\t\t\t\"info\",\n\t\t\t\"warn\",\n\t\t\t\"debug\"\n\t\t]) LoggerService.prototype[type] = function(...args) {\n\t\t\treturn this()[type](...args);\n\t\t};\n\t}\n};\n//#endregion\n//#region lib/types/reflect.js\nfunction enhanceError(error) {\n\tconst lines = error.stack.split(\"\\n\");\n\tlines.splice(0, 2, `Error: ${error.message}`);\n\terror.stack = lines.join(\"\\n\");\n\treturn error;\n}\nconst RESERVED_WORDS = [\"prototype\", \"then\"];\nfunction isSpecialProperty(prop) {\n\treturn typeof prop === \"symbol\" || RESERVED_WORDS.includes(prop) || parseInt(prop).toString() === prop || prop.startsWith(\"_\");\n}\n/**\n* Reflection and service-resolution layer installed as `ctx.reflect`.\n*\n* This service powers the context proxy, service registration, accessors, and\n* the mixins that expose core service methods directly on `ctx`.\n*/\nvar ReflectService = class {\n\tctx;\n\t/** Proxy traps implementing service resolution for every context object. */\n\tstatic handler = {\n\t\tget: (target, prop, ctx) => {\n\t\t\tif (isSpecialProperty(prop)) return Reflect.get(target, prop, ctx);\n\t\t\tif (Reflect.has(target, prop)) return getTraceable(ctx, Reflect.get(target, prop, ctx));\n\t\t\tconst error = /* @__PURE__ */ new Error(`cannot get property \"${prop}\" without inject`);\n\t\t\ttry {\n\t\t\t\tconst def = target.reflect.props[prop];\n\t\t\t\tif (def?.type === \"accessor\") return def.get.call(ctx, ctx[symbols.receiver], error);\n\t\t\t\tif (!ctx.fiber.runtime) return ctx.reflect.get(prop, false);\n\t\t\t\treturn ctx.events.waterfall(\"internal/get\", ctx, prop, error, () => {\n\t\t\t\t\tconst key = target[symbols.isolate][prop];\n\t\t\t\t\tlet fiber = (ctx[symbols.shadow] ?? ctx).fiber;\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tconst impl = fiber.store?.[prop];\n\t\t\t\t\t\tif (impl) return getTraceable(ctx, impl.value);\n\t\t\t\t\t\tif (prop in fiber.inject) {\n\t\t\t\t\t\t\terror.message = `cannot get required service \"${prop}\" in inactive context`;\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!fiber.runtime) throw error;\n\t\t\t\t\t\tif (fiber.parent[symbols.isolate][prop] !== key) throw error;\n\t\t\t\t\t\tfiber = fiber.parent.fiber;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} catch (e) {\n\t\t\t\tthrow e === error ? enhanceError(e) : e;\n\t\t\t}\n\t\t},\n\t\tset: (target, prop, value, ctx) => {\n\t\t\tif (isSpecialProperty(prop)) return Reflect.set(target, prop, value, ctx);\n\t\t\tconst error = /* @__PURE__ */ new Error(`cannot set property \"${prop}\" without provide`);\n\t\t\tconst def = target.reflect.props[prop];\n\t\t\tif (!def) {\n\t\t\t\tif (!ctx.fiber.runtime) return Reflect.set(target, prop, value, ctx);\n\t\t\t\tthrow enhanceError(error);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (def.type === \"accessor\") {\n\t\t\t\t\tif (!def.set) return false;\n\t\t\t\t\treturn def.set.call(ctx, value, ctx[symbols.receiver], error);\n\t\t\t\t}\n\t\t\t\treturn ctx.events.waterfall(\"internal/set\", ctx, prop, value, error, () => {\n\t\t\t\t\treturn ctx.reflect.set(prop, value, error);\n\t\t\t\t});\n\t\t\t} catch (e) {\n\t\t\t\tthrow e === error ? enhanceError(e) : e;\n\t\t\t}\n\t\t},\n\t\thas: (target, prop) => {\n\t\t\tif (isSpecialProperty(prop)) return Reflect.has(target, prop);\n\t\t\tif (Reflect.has(target, prop)) return true;\n\t\t\treturn !!target.reflect.props[prop];\n\t\t}\n\t};\n\t/** Service implementations, keyed by isolation label. */\n\tstore = Object.create(null);\n\t/** Declared context properties (services and accessors), by name. */\n\tprops = Object.create(null);\n\tconstructor(ctx) {\n\t\tthis.ctx = ctx;\n\t\tdefineProperty(this, symbols.tracker, {\n\t\t\tproperty: \"ctx\",\n\t\t\tnoShadow: true\n\t\t});\n\t\tthis.mixin(\"reflect\", [\n\t\t\t\"get\",\n\t\t\t\"set\",\n\t\t\t\"provide\",\n\t\t\t\"accessor\",\n\t\t\t\"mixin\"\n\t\t]);\n\t\tthis.mixin(\"fiber\", [\"runtime\", \"effect\"]);\n\t\tthis.mixin(\"registry\", [\"inject\", \"plugin\"]);\n\t\tthis.mixin(\"events\", [\n\t\t\t\"on\",\n\t\t\t\"once\",\n\t\t\t\"parallel\",\n\t\t\t\"emit\",\n\t\t\t\"serial\",\n\t\t\t\"bail\",\n\t\t\t\"waterfall\"\n\t\t]);\n\t}\n\t/**\n\t* Read a service from the store without the inject requirement.\n\t*\n\t* @param name \u2014 the service name.\n\t* @param strict \u2014 when `true`, only return implementations whose providing\n\t* fiber is currently active.\n\t* @returns the service value, or `undefined` when not (yet) provided.\n\t*/\n\tget(name, strict = true) {\n\t\treturn getTraceable(this.ctx, this._getImpl(name, strict)?.value);\n\t}\n\t_getImpl(name, strict = true) {\n\t\tconst key = this.ctx[symbols.isolate][name];\n\t\tconst impl = key && this.store[key];\n\t\tif (!impl) return;\n\t\tif (strict && impl.fiber.state !== 2) return;\n\t\treturn impl;\n\t}\n\t/**\n\t* Overwrite a provided service's value.\n\t*\n\t* @param name \u2014 the service name.\n\t* @param value \u2014 the new service value.\n\t* @param error \u2014 carrier for the caller stack in diagnostics.\n\t* @returns `true` on success.\n\t* @throws when `name` was never provided, or was provided by another fiber.\n\t*/\n\tset(name, value, error) {\n\t\tconst key = this.ctx[symbols.isolate][name];\n\t\tconst impl = this.store[key];\n\t\tif (!impl) throw new Error(`cannot set property \"${name}\" without provide`);\n\t\tif (impl.fiber !== this.ctx.fiber) throw new Error(`cannot set property \"${name}\" in multiple fibers`);\n\t\timpl.value = value;\n\t\treturn true;\n\t}\n\t/**\n\t* Register a service implementation owned by the current fiber.\n\t*\n\t* See the `ctx.provide()` overload above for the full contract.\n\t*\n\t* @param name \u2014 the service name.\n\t* @param value \u2014 the service value.\n\t* @param check \u2014 optional availability predicate for dependents.\n\t* @returns a disposer that unregisters the service.\n\t*/\n\tprovide(name, value, check) {\n\t\treturn this.ctx.fiber.effect(() => {\n\t\t\tif (!this.props[name]) this.props[name] ??= { type: \"service\" };\n\t\t\telse if (this.props[name].type !== \"service\") throw new Error(`property \"${name}\" is already declared as ${this.props[name].type}`);\n\t\t\tthis.props[name] = { type: \"service\" };\n\t\t\tthis.ctx.root[symbols.isolate][name] ??= Symbol(name);\n\t\t\tconst key = this.ctx[symbols.isolate][name];\n\t\t\tconst impl = {\n\t\t\t\tname,\n\t\t\t\tvalue,\n\t\t\t\tfiber: this.ctx.fiber,\n\t\t\t\tcheck\n\t\t\t};\n\t\t\tif (this.store[key]) throw new Error(`service \"${name}\" has been registered at <${this.store[key].fiber.name}>`);\n\t\t\tthis.store[key] = impl;\n\t\t\tthis.ctx.fiber.store[name] = impl;\n\t\t\tif (this.ctx.fiber.state === 2) this.notify([name]);\n\t\t\treturn async () => {\n\t\t\t\tdelete this.store[key];\n\t\t\t\tconst fibers = this.notify([name]);\n\t\t\t\tawait Promise.allSettled(fibers.map((fiber) => fiber.await()));\n\t\t\t\tdelete this.ctx.fiber.store[name];\n\t\t\t};\n\t\t}, `ctx.provide(${JSON.stringify(name)})`);\n\t}\n\t/**\n\t* Re-evaluate every fiber that requires one of the given services.\n\t*\n\t* @param names \u2014 the service names that changed.\n\t* @param filter \u2014 restricts notification to matching isolation scopes.\n\t* @returns the fibers whose dependency state was refreshed.\n\t*/\n\tnotify(names, filter = (ctx, name) => ctx[symbols.isolate][name] === this.ctx[symbols.isolate][name]) {\n\t\tconst fibers = [];\n\t\tfor (const runtime of this.ctx.registry.values()) for (const fiber of runtime.fibers) {\n\t\t\tlet hasUpdate = false;\n\t\t\tfor (const name of names) {\n\t\t\t\tif (!(name in fiber.inject)) continue;\n\t\t\t\tif (!filter(fiber.ctx, name)) continue;\n\t\t\t\thasUpdate = true;\n\t\t\t\tfiber._checkImpl(name);\n\t\t\t}\n\t\t\tif (!hasUpdate) continue;\n\t\t\tfiber._refresh();\n\t\t\tfibers.push(fiber);\n\t\t}\n\t\tfor (const name of names) {\n\t\t\tconst self = Object.create(this.ctx);\n\t\t\tself[symbols.filter] = (target) => filter(target, name);\n\t\t\tthis.ctx.events.emit(self, \"internal/service\", name, this._getImpl(name, false)?.value);\n\t\t}\n\t\treturn fibers;\n\t}\n\t/**\n\t* Define a computed context property backed by get/set hooks.\n\t*\n\t* @param name \u2014 the context property name.\n\t* @param options \u2014 the `get` hook and optional `set` hook.\n\t* @returns a disposer that removes the accessor.\n\t*/\n\taccessor(name, options) {\n\t\treturn this.ctx.fiber.effect(() => {\n\t\t\tif (name in this.props) throw new Error(`property \"${name}\" is already declared as ${this.props[name].type}`);\n\t\t\tthis.props[name] = {\n\t\t\t\ttype: \"accessor\",\n\t\t\t\t...options\n\t\t\t};\n\t\t\treturn () => delete this.props[name];\n\t\t}, `ctx.accessor(${JSON.stringify(name)})`);\n\t}\n\t/**\n\t* Expose selected members of a service directly on `ctx`.\n\t*\n\t* See the `ctx.mixin()` overload above for the full contract.\n\t*\n\t* @param source \u2014 a context property name or a source object.\n\t* @param mixins \u2014 keys to forward, or a source-key \u2192 ctx-key map.\n\t* @returns a disposer that removes all created accessors.\n\t*/\n\tmixin(source, mixins) {\n\t\tconst self = this;\n\t\treturn this.ctx.fiber.effect(function* () {\n\t\t\tconst entries = Array.isArray(mixins) ? mixins.map((key) => [key, key]) : Object.entries(mixins);\n\t\t\tconst getTarget = (ctx, error) => {\n\t\t\t\treturn ctx[source];\n\t\t\t};\n\t\t\tfor (const [key, value] of entries) yield self.accessor(value, {\n\t\t\t\tget(receiver, error) {\n\t\t\t\t\tconst service = getTarget(this, error);\n\t\t\t\t\tif (isNullable(service)) return service;\n\t\t\t\t\tconst mixin = receiver ? withProps(receiver, service) : service;\n\t\t\t\t\tconst value = Reflect.get(service, key, mixin);\n\t\t\t\t\tif (typeof value !== \"function\") return value;\n\t\t\t\t\treturn value.bind(mixin ?? service);\n\t\t\t\t},\n\t\t\t\tset(value, receiver, error) {\n\t\t\t\t\tconst service = getTarget(this, error);\n\t\t\t\t\tconst mixin = receiver ? withProps(receiver, service) : service;\n\t\t\t\t\treturn Reflect.set(service, key, value, mixin);\n\t\t\t\t}\n\t\t\t});\n\t\t}, `ctx.mixin(${JSON.stringify(source)})`);\n\t}\n\t/**\n\t* Attach this context's tracing wrapper to a value.\n\t*\n\t* @param value \u2014 the value to wrap.\n\t* @returns the traceable wrapper (or the value itself when not applicable).\n\t*/\n\ttrace(value) {\n\t\treturn getTraceable(this.ctx, value);\n\t}\n\t/**\n\t* Wrap a callback so calls trace `this` and arguments to this context.\n\t*\n\t* @param callback \u2014 the function to wrap.\n\t* @returns a proxy delegating to `callback` with traced values.\n\t*/\n\tbind(callback) {\n\t\treturn new Proxy(callback, {\n\t\t\tapply: (target, thisArg, args) => {\n\t\t\t\treturn Reflect.apply(target, this.trace(thisArg), args.map((arg) => this.trace(arg)));\n\t\t\t},\n\t\t\tconstruct: (target, args, newTarget) => {\n\t\t\t\treturn Reflect.construct(target, args.map((arg) => this.trace(arg)), newTarget);\n\t\t\t}\n\t\t});\n\t}\n};\n//#endregion\n//#region lib/types/fiber.js\nconst kValidationError = Symbol.for(\"ValidationError\");\n/** Error raised when plugin configuration fails standard-schema validation. */\nvar ValidationError = class extends TypeError {\n\tname = \"ValidationError\";\n\t/**\n\t* Build the aggregated message from schema issues.\n\t*\n\t* @param issues \u2014 the standard-schema issues, one message line each.\n\t*/\n\tconstructor(issues) {\n\t\tsuper(`invalid config:\\n` + issues.map((issue) => {\n\t\t\tif (issue.path) return ` - ${issue.message} (at ${issue.path.join(\".\")})`;\n\t\t\telse return ` - ${issue.message}`;\n\t\t}).join(\"\\n\"));\n\t}\n};\nObject.defineProperty(ValidationError.prototype, kValidationError, { value: true });\n/**\n* Validate and normalize config for a plugin runtime before it starts.\n*\n* @param runtime \u2014 the plugin runtime whose `Config` schema to apply.\n* @param config \u2014 the raw user config.\n* @returns the validated config, or `config` unchanged if the runtime has no schema.\n* @throws {ValidationError} when validation reports issues.\n*/\nfunction resolveConfig(runtime, config) {\n\tif (!runtime.Config) return config;\n\tconst result = runtime.Config[\"~standard\"].validate(config);\n\tif (\"then\" in result) throw new TypeError(\"Async config validation is not supported\");\n\tif (result.issues) throw new ValidationError(result.issues);\n\telse return result.value;\n}\nconst effectInertia = /* @__PURE__ */ new WeakMap();\nfunction runDisposable(dispose) {\n\tconst result = dispose();\n\treturn effectInertia.get(dispose)?.() ?? result;\n}\n/** Notify plugin teardown without allowing one observer to break ownership cleanup. */\nfunction emitPluginDisposed(context, fiber) {\n\tconst args = [\"internal/plugin\", fiber];\n\tlet callbacks;\n\ttry {\n\t\tcallbacks = context.events.dispatch(\"emit\", args);\n\t} catch (error) {\n\t\tcontext.logger.error(error);\n\t\treturn;\n\t}\n\tfor (const callback of callbacks) try {\n\t\tconst returned = callback(...args);\n\t\tPromise.resolve(returned).catch((error) => context.logger.error(error));\n\t} catch (error) {\n\t\tcontext.logger.error(error);\n\t}\n}\n/** Framework error with a stable machine-readable code. */\nvar CordisError = class CordisError extends Error {\n\tcode;\n\t/**\n\t* @param code \u2014 the stable error code; also the default message.\n\t* @param message \u2014 optional human-readable override.\n\t*/\n\tconstructor(code, message) {\n\t\tsuper(message ?? CordisError.Code[code]);\n\t\tthis.code = code;\n\t}\n};\n/** Cordis error code definitions. */\n(function(CordisError) {\n\tCordisError.Code = { INACTIVE_EFFECT: \"cannot create effect on inactive context\" };\n})(CordisError || (CordisError = {}));\nconst INACTIVE = \"__INACTIVE__\";\n/**\n* Runtime instance of one plugin application.\n*\n* A fiber tracks dependency state, validated config, lifecycle effects, and\n* cleanup for the plugin context returned by `ctx.plugin()`.\n*/\nvar Fiber = class {\n\tparent;\n\tinject;\n\truntime;\n\t/** Unique id within the registry; 0 for the root fiber, `null` once disposed. */\n\tuid;\n\t/** The context this fiber's plugin runs in (extends the parent context). */\n\tctx;\n\t/** The validated plugin config (updated by `update()`). */\n\tconfig;\n\t/** The raw plugin config, re-resolved before each activation. */\n\t_config;\n\t/** Current lifecycle state; transitions emit `internal/status`. */\n\tstate = 0;\n\t/** Dispose this fiber: unload the plugin, then settle once cleanup finished. */\n\tdispose;\n\t/** Snapshot of required service implementations while loaded; `undefined` otherwise. */\n\tstore;\n\t/** The in-flight load/unload transition, if one is currently running. */\n\tinertia;\n\t_hooks = Object.create(null);\n\t_disposables = new DisposableList();\n\tcontext;\n\t_error;\n\t_runner;\n\t_store = Object.create(null);\n\t/**\n\t* Create a fiber. Plugin authors normally obtain fibers from `ctx.plugin()`\n\t* rather than constructing them directly.\n\t*\n\t* @param parent \u2014 the context the plugin was loaded from.\n\t* @param config \u2014 raw config, validated against the runtime's schema.\n\t* @param inject \u2014 resolved dependency map (service name \u2192 intercept config).\n\t* @param runtime \u2014 the shared plugin runtime, or `null` for the root fiber.\n\t* @param getOuterStack \u2014 captures the caller stack for effect diagnostics.\n\t*/\n\tconstructor(parent, config, inject, runtime, getOuterStack) {\n\t\tthis.parent = parent;\n\t\tthis.inject = inject;\n\t\tthis.runtime = runtime;\n\t\tthis._config = config;\n\t\tconst collect = (dispose) => {\n\t\t\tthis._disposables.push(dispose);\n\t\t};\n\t\tif (runtime) {\n\t\t\tthis.uid = parent.registry.counter;\n\t\t\tthis.ctx = this.context = parent.extend({ fiber: this });\n\t\t\tconst injectEntries = Object.entries(this.inject);\n\t\t\tif (injectEntries.length) {\n\t\t\t\tthis.ctx[Context.intercept] = Object.create(parent[Context.intercept]);\n\t\t\t\tfor (const [name, config] of injectEntries) {\n\t\t\t\t\tif (isNullable(config)) continue;\n\t\t\t\t\tthis.ctx[Context.intercept][name] = config;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._runner = {\n\t\t\t\tepoch: INACTIVE,\n\t\t\t\tgetOuterStack,\n\t\t\t\texecute: function() {\n\t\t\t\t\tif (isConstructor(runtime.callback)) {\n\t\t\t\t\t\tconst instance = new runtime.callback(this.ctx, this.config);\n\t\t\t\t\t\tfor (const hook of instance?.[symbols.initHooks] ?? []) hook();\n\t\t\t\t\t\treturn instance?.[symbols.init]?.();\n\t\t\t\t\t} else return runtime.callback(this.ctx, this.config);\n\t\t\t\t},\n\t\t\t\tcollect\n\t\t\t};\n\t\t\tthis.dispose = parent.fiber.effect(() => {\n\t\t\t\tconst remove = runtime.fibers.push(this);\n\t\t\t\treturn async () => {\n\t\t\t\t\tthis.uid = null;\n\t\t\t\t\temitPluginDisposed(this.context, this);\n\t\t\t\t\tif (this.ctx.registry.has(runtime.callback)) {\n\t\t\t\t\t\tremove();\n\t\t\t\t\t\tif (!runtime.fibers.length) this.ctx.registry.delete(runtime.callback);\n\t\t\t\t\t}\n\t\t\t\t\tthis._setEpoch(INACTIVE);\n\t\t\t\t\tif (!this.inertia) this._updateState(() => {\n\t\t\t\t\t\tthis.inertia = this._unload();\n\t\t\t\t\t\treturn 5;\n\t\t\t\t\t});\n\t\t\t\t\twhile (this.inertia) await this.inertia;\n\t\t\t\t};\n\t\t\t}, \"ctx.plugin()\");\n\t\t\ttry {\n\t\t\t\tthis.context.emit(\"internal/plugin\", this);\n\t\t\t} catch (error) {\n\t\t\t\tPromise.resolve(this.dispose()).catch((reason) => this.ctx.logger.error(reason));\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tif (this.uid !== null && parent.fiber.state !== 5) {\n\t\t\t\tfor (const name of Object.keys(this.inject)) this._checkImpl(name);\n\t\t\t\tthis._refresh();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.uid = 0;\n\t\t\tthis.ctx = this.context = parent;\n\t\t\tthis.state = 2;\n\t\t\tthis.store = Object.create(null);\n\t\t\tthis._runner = {\n\t\t\t\tepoch: \"\",\n\t\t\t\tgetOuterStack,\n\t\t\t\texecute: () => {},\n\t\t\t\tcollect\n\t\t\t};\n\t\t\tthis.dispose = () => this.restart();\n\t\t}\n\t}\n\t/** The plugin's display name, inherited from the nearest named ancestor, else `'root'`. */\n\tget name() {\n\t\tlet fiber = this;\n\t\tdo {\n\t\t\tif (fiber.runtime?.name) return fiber.runtime.name;\n\t\t\tfiber = fiber.parent.fiber;\n\t\t} while (fiber !== fiber.parent.fiber);\n\t\treturn \"root\";\n\t}\n\t/**\n\t* Throw if the fiber has already been disposed.\n\t*\n\t* @returns nothing when the fiber is still active.\n\t* @throws {CordisError} `INACTIVE_EFFECT` when the fiber's uid has been cleared.\n\t*/\n\tassertActive() {\n\t\tif (this.uid !== null) return;\n\t\tthrow new CordisError(\"INACTIVE_EFFECT\");\n\t}\n\t_execute(runner) {\n\t\tconst oldEpoch = runner.epoch;\n\t\treturn composeError((info) => {\n\t\t\tconst safeCollect = (dispose) => {\n\t\t\t\tif (typeof dispose === \"function\") runner.collect(dispose);\n\t\t\t\telse if (!isNullable(dispose)) throw new TypeError(\"Invalid effect\");\n\t\t\t};\n\t\t\tconst effect = runner.execute.call(this);\n\t\t\tif (typeof effect === \"function\") return runner.collect(effect);\n\t\t\telse if (isNullable(effect)) {} else if (!isObject(effect)) throw new TypeError(\"Invalid effect\");\n\t\t\telse if (\"then\" in effect) return effect.then(safeCollect);\n\t\t\telse if (Symbol.iterator in effect) {\n\t\t\t\tinfo.error = /* @__PURE__ */ new Error();\n\t\t\t\tconst iter = effect[Symbol.iterator]();\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst result = iter.next();\n\t\t\t\t\tsafeCollect(result.value);\n\t\t\t\t\tif (result.done) return;\n\t\t\t\t}\n\t\t\t} else if (Symbol.asyncIterator in effect) {\n\t\t\t\tconst iter = effect[Symbol.asyncIterator]();\n\t\t\t\treturn (async () => {\n\t\t\t\t\tawait Promise.resolve();\n\t\t\t\t\tinfo.error = /* @__PURE__ */ new Error();\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tif (runner.epoch !== oldEpoch) return;\n\t\t\t\t\t\tconst result = await iter.next();\n\t\t\t\t\t\tsafeCollect(result.value);\n\t\t\t\t\t\tif (result.done) return;\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t} else throw new TypeError(\"Invalid effect\");\n\t\t}, runner.getOuterStack);\n\t}\n\teffect(execute, label = \"anonymous\") {\n\t\tthis.assertActive();\n\t\tif (this.state === 5) throw new CordisError(\"INACTIVE_EFFECT\");\n\t\tconst disposables = [];\n\t\tlet disposing = false;\n\t\tlet disposalTask;\n\t\tconst dispose = () => {\n\t\t\tif (disposing) return disposalTask;\n\t\t\tdisposing = true;\n\t\t\tlet task;\n\t\t\tfor (const disposable of disposables.splice(0).reverse()) if (task) task = task.then(() => runDisposable(disposable));\n\t\t\telse {\n\t\t\t\tconst result = runDisposable(disposable);\n\t\t\t\tif (isObject(result) && \"then\" in result) task = result;\n\t\t\t}\n\t\t\treturn disposalTask = task;\n\t\t};\n\t\tconst meta = {\n\t\t\tlabel,\n\t\t\tchildren: []\n\t\t};\n\t\tconst runner = {\n\t\t\texecute,\n\t\t\tepoch: true,\n\t\t\tcollect: (dispose) => {\n\t\t\t\tdisposables.push(dispose);\n\t\t\t\tthis._disposables.delete(dispose);\n\t\t\t\tif (dispose[symbols.effect]) meta.children.push(dispose[symbols.effect]);\n\t\t\t},\n\t\t\tgetOuterStack: buildOuterStack()\n\t\t};\n\t\tlet task;\n\t\tlet executing = true;\n\t\tlet resolveSetup;\n\t\tlet rejectSetup;\n\t\tlet setupBarrier;\n\t\tlet setupFailed = false;\n\t\tlet inFlight;\n\t\tlet removeWrapper = () => false;\n\t\tconst waitForSetup = () => {\n\t\t\tsetupBarrier ??= new Promise((resolve, reject) => {\n\t\t\t\tresolveSetup = resolve;\n\t\t\t\trejectSetup = reject;\n\t\t\t});\n\t\t\treturn setupBarrier;\n\t\t};\n\t\tconst disposeAfter = (setup) => {\n\t\t\treturn Promise.resolve(setup).then(() => dispose(), async (reason) => {\n\t\t\t\tawait dispose();\n\t\t\t\tthrow reason;\n\t\t\t});\n\t\t};\n\t\tconst finalizeDisposal = (callback) => {\n\t\t\tlet result;\n\t\t\ttry {\n\t\t\t\tresult = callback();\n\t\t\t} catch (error) {\n\t\t\t\tremoveWrapper();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tif (isObject(result) && \"then\" in result) {\n\t\t\t\tconst pending = Promise.resolve(result).finally(() => {\n\t\t\t\t\tremoveWrapper();\n\t\t\t\t\tif (inFlight === pending) inFlight = void 0;\n\t\t\t\t});\n\t\t\t\treturn inFlight = pending;\n\t\t\t}\n\t\t\tremoveWrapper();\n\t\t\treturn result;\n\t\t};\n\t\tconst wrapper = defineProperty(() => {\n\t\t\tif (!runner.epoch) return setupFailed ? inFlight : void 0;\n\t\t\trunner.epoch = false;\n\t\t\treturn finalizeDisposal(() => {\n\t\t\t\tif (executing) return disposeAfter(waitForSetup());\n\t\t\t\treturn task ? disposeAfter(task) : dispose();\n\t\t\t});\n\t\t}, symbols.effect, meta);\n\t\teffectInertia.set(wrapper, () => inFlight);\n\t\tremoveWrapper = this._disposables.push(wrapper);\n\t\ttry {\n\t\t\ttask = this._execute(runner);\n\t\t} catch (reason) {\n\t\t\texecuting = false;\n\t\t\tsetupFailed = true;\n\t\t\trunner.epoch = false;\n\t\t\tlet cleanup;\n\t\t\ttry {\n\t\t\t\tcleanup = finalizeDisposal(dispose);\n\t\t\t} finally {\n\t\t\t\trejectSetup?.(reason);\n\t\t\t}\n\t\t\tif (isObject(cleanup) && \"then\" in cleanup) cleanup.catch((error) => this.ctx.logger.error(error));\n\t\t\tthrow reason;\n\t\t}\n\t\texecuting = false;\n\t\tif (setupBarrier) Promise.resolve(task).then(resolveSetup, rejectSetup);\n\t\ttask?.catch(() => {\n\t\t\tif (!runner.epoch) return dispose();\n\t\t\treturn finalizeDisposal(dispose);\n\t\t}).catch((error) => this.ctx.logger.error(error));\n\t\tconst disposeAsync = () => {\n\t\t\tif (!runner.epoch) return;\n\t\t\trunner.epoch = false;\n\t\t\treturn finalizeDisposal(dispose);\n\t\t};\n\t\twrapper.then = async (onFulfilled, onRejected) => {\n\t\t\treturn Promise.resolve(task).then(() => disposeAsync).then(onFulfilled, onRejected);\n\t\t};\n\t\treturn wrapper;\n\t}\n\t/**\n\t* Return metadata for currently registered effects.\n\t*\n\t* @returns one {@link EffectMeta} tree per labeled live effect.\n\t*/\n\tgetEffects() {\n\t\treturn [...this._disposables].map((dispose) => dispose[symbols.effect]).filter(Boolean);\n\t}\n\t_getState() {\n\t\tif (this.uid === null) return 4;\n\t\tif (this._error) return 3;\n\t\tif (this._runner.epoch !== INACTIVE) return 2;\n\t\treturn 0;\n\t}\n\t_updateState(callback) {\n\t\tconst oldState = this.state;\n\t\tthis.state = callback() ?? this._getState();\n\t\tif (oldState === this.state) return;\n\t\tthis.context.emit(\"internal/status\", this, oldState);\n\t\tif (oldState !== 2 && this.state !== 2) return;\n\t\tfor (const key of Reflect.ownKeys(this.ctx.reflect.store)) {\n\t\t\tconst impl = this.ctx.reflect.store[key];\n\t\t\tif (impl.fiber !== this) continue;\n\t\t\tthis.ctx.reflect.notify([impl.name]);\n\t\t}\n\t}\n\t_checkImpl(name) {\n\t\tconst impl = this.ctx.reflect._getImpl(name, true);\n\t\tif (!impl) return delete this._store[name];\n\t\ttry {\n\t\t\tif (impl.check && !impl.check.call(getTraceable(this.ctx, impl.value))) return delete this._store[name];\n\t\t} catch (error) {\n\t\t\timpl.fiber.ctx.logger.error(error);\n\t\t\treturn delete this._store[name];\n\t\t}\n\t\tthis._store[name] = impl;\n\t}\n\t_refresh() {\n\t\tlet epoch = false;\n\t\tepoch = \"\";\n\t\tfor (const name of Object.keys(this.inject)) {\n\t\t\tconst impl = this._store[name];\n\t\t\tif (!impl) {\n\t\t\t\tepoch = INACTIVE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tepoch += \":\" + impl.fiber.uid;\n\t\t}\n\t\tthis._setEpoch(epoch);\n\t}\n\t_setEpoch(epoch) {\n\t\tconst oldEpoch = this._runner.epoch;\n\t\tif (epoch === oldEpoch) return;\n\t\tthis._runner.epoch = epoch;\n\t\tif (this.inertia) return;\n\t\tthis._updateState(() => {\n\t\t\tif (epoch !== INACTIVE && oldEpoch === INACTIVE) {\n\t\t\t\tthis.inertia = this._reload();\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\tthis.inertia = this._unload();\n\t\t\t\treturn 5;\n\t\t\t}\n\t\t});\n\t}\n\t_resolveConfig(config) {\n\t\tconfig = this.context.waterfall(this, \"internal/config\", config, () => config);\n\t\treturn this.runtime ? resolveConfig(this.runtime, config) : config;\n\t}\n\tasync _reload() {\n\t\tthis.store = { ...this._store };\n\t\tconst oldEpoch = this._runner.epoch;\n\t\ttry {\n\t\t\tawait Promise.resolve();\n\t\t\tif (this._runner.epoch === oldEpoch) {\n\t\t\t\tthis.config = this._resolveConfig(this._config);\n\t\t\t\tawait this._execute(this._runner);\n\t\t\t\tthis._error = void 0;\n\t\t\t}\n\t\t} catch (reason) {\n\t\t\tthis.ctx.logger.error(reason);\n\t\t\tthis._error = reason;\n\t\t\tthis._runner.epoch = INACTIVE;\n\t\t}\n\t\tthis._updateState(() => {\n\t\t\tif (this._runner.epoch === oldEpoch) this.inertia = void 0;\n\t\t\telse {\n\t\t\t\tthis.inertia = this._unload();\n\t\t\t\treturn 5;\n\t\t\t}\n\t\t});\n\t}\n\tasync _unload() {\n\t\tawait Promise.all(this._disposables.clear().map(async (dispose) => {\n\t\t\ttry {\n\t\t\t\tawait composeError(async (info) => {\n\t\t\t\t\tawait Promise.resolve();\n\t\t\t\t\tinfo.error = /* @__PURE__ */ new Error();\n\t\t\t\t\tawait runDisposable(dispose);\n\t\t\t\t}, this._runner.getOuterStack);\n\t\t\t} catch (reason) {\n\t\t\t\tthis.ctx.logger.error(reason);\n\t\t\t}\n\t\t}));\n\t\tthis.store = void 0;\n\t\tthis._updateState(() => {\n\t\t\tif (this._runner.epoch === INACTIVE) this.inertia = void 0;\n\t\t\telse {\n\t\t\t\tthis.inertia = this._reload();\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Wait for current lifecycle work and rethrow startup errors.\n\t*\n\t* @returns this fiber, once it has settled into a stable state.\n\t* @throws the config-validation or plugin-startup error, if any.\n\t*/\n\tasync await() {\n\t\twhile (this.inertia) await this.inertia;\n\t\tif (this._error) throw this._error;\n\t\treturn this;\n\t}\n\t/**\n\t* Dispose and immediately reload this plugin with its current config.\n\t*\n\t* @returns a promise resolving once the reload settled.\n\t* @throws {CordisError} `INACTIVE_EFFECT` when the fiber is already disposed.\n\t*/\n\tasync restart() {\n\t\tthis.assertActive();\n\t\tthis._setEpoch(INACTIVE);\n\t\tthis._refresh();\n\t\tawait this.await();\n\t}\n\t/**\n\t* Validate and apply new config, then restart the plugin.\n\t*\n\t* Runs the `internal/update` waterfall first, so update hooks (and HMR)\n\t* can veto or replace the restart.\n\t*\n\t* @param config \u2014 the new raw config; validated before anything restarts.\n\t* @param noSave \u2014 hint for persistence hooks not to write the change back.\n\t* @returns the update waterfall result; the default restart returns a promise.\n\t* @throws when validation, an update listener, or the restarted plugin fails.\n\t*/\n\tupdate(config, noSave = false) {\n\t\tthis.assertActive();\n\t\tthis._config = config;\n\t\tif (this.state !== 2) {\n\t\t\tthis._error = void 0;\n\t\t\tthis._setEpoch(INACTIVE);\n\t\t\tthis._refresh();\n\t\t\treturn;\n\t\t}\n\t\tconfig = this._resolveConfig(config);\n\t\treturn this.context.waterfall(this, \"internal/update\", config, noSave, () => {\n\t\t\tthis.config = config;\n\t\t\tthis._error = void 0;\n\t\t\treturn this.restart();\n\t\t});\n\t}\n};\n//#endregion\n//#region lib/types/registry.js\nfunction isApplicable(object) {\n\treturn object && typeof object === \"object\" && typeof object.apply === \"function\";\n}\n/**\n* Decorator for declaring service dependencies on classes or class methods.\n*\n* On classes it contributes to the plugin's static `inject` map. On methods it\n* delays the method call until the declared services are available.\n*/\n/**\n* @param name \u2014 the required service name.\n* @param config \u2014 optional intercept config applied for that service.\n* @returns the class or method decorator.\n*/\nfunction Inject(name, config) {\n\treturn function(value, decorator) {\n\t\tif (decorator.kind === \"class\") {\n\t\t\tif (!Object.hasOwn(value, \"inject\")) {\n\t\t\t\tdefineProperty(value, \"inject\", Object.create(Object.getPrototypeOf(value).inject ?? null));\n\t\t\t\tdefineProperty(value.inject, symbols.checkProto, true);\n\t\t\t}\n\t\t\tvalue.inject[name] = config;\n\t\t} else if (decorator.kind === \"method\") {\n\t\t\tconst inject = (value[symbols.metadata] ??= {}).inject ??= Object.create(null);\n\t\t\tinject[name] = config;\n\t\t\tdecorator.addInitializer(function() {\n\t\t\t\tconst property = this[symbols.tracker]?.property;\n\t\t\t\t(this[symbols.initHooks] ??= []).push(() => {\n\t\t\t\t\tthis.ctx.inject(inject, (ctx) => {\n\t\t\t\t\t\treturn value.call(property ? withProps(this, { [property]: ctx }) : this);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t} else throw new Error(\"@Inject() can only be used on class or class methods\");\n\t};\n}\n/** Utilities for normalizing plugin dependency declarations. */\n(function(Inject) {\n\t/**\n\t* Convert array/object/class-inherited inject metadata into a plain map.\n\t*\n\t* @param inject \u2014 the declaration to normalize; `null`/`undefined` add nothing.\n\t* @param result \u2014 the map to fill (service name \u2192 intercept config or `null`).\n\t* @returns `result`.\n\t*/\n\tfunction resolve(inject, result = Object.create(null)) {\n\t\tif (!inject) return result;\n\t\tif (Array.isArray(inject)) for (const name of inject) result[name] = null;\n\t\telse if (Reflect.has(inject, symbols.checkProto)) {\n\t\t\tObject.assign(result, resolve(Object.getPrototypeOf(inject)));\n\t\t\tfor (const name of Object.keys(inject)) result[name] = inject[name] ?? null;\n\t\t} else for (const name of Object.keys(inject)) result[name] = inject[name] ?? null;\n\t\treturn result;\n\t}\n\tInject.resolve = resolve;\n})(Inject || (Inject = {}));\n/**\n* Plugin registry installed as `ctx.registry` and mixed into every context.\n*\n* It normalizes plugin shapes, tracks plugin runtimes, starts fibers, and\n* exposes map-like inspection over active plugin callbacks.\n*/\nvar RegistryService = class {\n\tctx;\n\t_counter = 0;\n\t_internal = /* @__PURE__ */ new Map();\n\tconstructor(ctx) {\n\t\tthis.ctx = ctx;\n\t\tdefineProperty(this, symbols.tracker, {\n\t\t\tproperty: \"ctx\",\n\t\t\tnoShadow: true\n\t\t});\n\t}\n\t/** Allocate the next fiber uid (increments on every read). */\n\tget counter() {\n\t\treturn ++this._counter;\n\t}\n\t/** Number of registered plugin runtimes. */\n\tget size() {\n\t\treturn this._internal.size;\n\t}\n\t/**\n\t* Resolve a supported plugin shape to its executable callback.\n\t*\n\t* @param plugin \u2014 a function, class, or `{ apply }` object plugin.\n\t* @returns the callback identifying the plugin, or `undefined` if invalid.\n\t*/\n\tresolve(plugin) {\n\t\ttry {\n\t\t\tif (typeof plugin === \"function\") return plugin;\n\t\t\tif (isApplicable(plugin)) return plugin.apply;\n\t\t} catch {}\n\t}\n\t/**\n\t* Look up the runtime record for a plugin.\n\t*\n\t* @param plugin \u2014 any supported plugin shape.\n\t* @returns the runtime, or `undefined` when the plugin is not registered.\n\t*/\n\tget(plugin) {\n\t\tconst key = this.resolve(plugin);\n\t\treturn key && this._internal.get(key);\n\t}\n\t/**\n\t* Check whether a plugin has a registered runtime.\n\t*\n\t* @param plugin \u2014 any supported plugin shape.\n\t* @returns `true` when at least one fiber of the plugin exists.\n\t*/\n\thas(plugin) {\n\t\tconst key = this.resolve(plugin);\n\t\treturn !!key && this._internal.has(key);\n\t}\n\t/**\n\t* Dispose every running fiber for a plugin and remove its runtime record.\n\t*\n\t* @param plugin \u2014 any supported plugin shape.\n\t* @returns the removed runtime, or `undefined` when none was registered.\n\t*/\n\tdelete(plugin) {\n\t\tconst key = this.resolve(plugin);\n\t\tconst runtime = key && this._internal.get(key);\n\t\tif (!runtime) return;\n\t\tthis._internal.delete(key);\n\t\tfor (const fiber of runtime.fibers) fiber.dispose();\n\t\treturn runtime;\n\t}\n\t/** Iterate the registered plugin callbacks. */\n\tkeys() {\n\t\treturn this._internal.keys();\n\t}\n\t/** Iterate the registered plugin runtimes. */\n\tvalues() {\n\t\treturn this._internal.values();\n\t}\n\t/** Iterate `[callback, runtime]` pairs. */\n\tentries() {\n\t\treturn this._internal.entries();\n\t}\n\t/**\n\t* Visit every registered runtime.\n\t*\n\t* @param callback \u2014 receives each runtime and its identifying callback.\n\t*/\n\tforEach(callback) {\n\t\treturn this._internal.forEach(callback);\n\t}\n\t/**\n\t* Start a callback once the requested dependencies are available.\n\t*\n\t* @param inject \u2014 required services, as an array or a name \u2192 config map.\n\t* @param callback \u2014 plugin body called with `(ctx, config)`.\n\t* @returns the fiber; awaiting it settles once loading finished.\n\t*/\n\tinject(inject, callback) {\n\t\treturn this.plugin({\n\t\t\tinject,\n\t\t\tapply: callback,\n\t\t\tname: callback.name\n\t\t});\n\t}\n\t/**\n\t* Start a plugin in the current context and return its fiber.\n\t*\n\t* Creates (or reuses) the plugin's runtime record, then starts a new fiber\n\t* under the current context. Throws if `plugin` is not a supported shape or\n\t* if the current fiber is already disposed.\n\t*\n\t* @param plugin \u2014 a function, class, or `{ apply }` object plugin.\n\t* @param config \u2014 the plugin config, validated against its `Config` schema.\n\t* @param getOuterStack \u2014 captures the caller stack for effect diagnostics.\n\t* @returns the fiber; awaiting it settles once loading finished.\n\t*/\n\tplugin(plugin, config, getOuterStack = buildOuterStack()) {\n\t\tconst callback = this.resolve(plugin);\n\t\tif (!callback) throw new Error(\"invalid plugin, expect function or object with an \\\"apply\\\" method, received \" + typeof plugin);\n\t\tthis.ctx.fiber.assertActive();\n\t\tlet runtime = this._internal.get(callback);\n\t\tif (!runtime) {\n\t\t\tlet name = plugin.name;\n\t\t\tif (name === \"apply\") name = void 0;\n\t\t\truntime = {\n\t\t\t\tname,\n\t\t\t\tcallback,\n\t\t\t\tfibers: new DisposableList(),\n\t\t\t\tConfig: plugin.Config\n\t\t\t};\n\t\t\tthis._internal.set(callback, runtime);\n\t\t}\n\t\tconst fiber = new Fiber(this.ctx, config, Inject.resolve(plugin.inject), runtime, getOuterStack);\n\t\tconst wrapped = Object.create(fiber);\n\t\twrapped.then = (onFulfilled, onRejected) => {\n\t\t\treturn fiber.await().then(onFulfilled, onRejected);\n\t\t};\n\t\treturn wrapped;\n\t}\n};\n//#endregion\n//#region lib/types/context.js\n/**\n* Root and child dependency containers for Cordis plugins.\n*\n* A context is a proxy: normal property reads go through the service resolver,\n* while `extend()`, `isolate()`, and `intercept()` create scoped child\n* contexts without mutating their parent.\n*/\nvar Context = class Context {\n\t/** Symbol key under which a disposer exposes its {@link EffectMeta} diagnostics tree. */\n\tstatic effect = symbols.effect;\n\t/** Symbol key for a context's listener filter, consulted on every event dispatch. */\n\tstatic filter = symbols.filter;\n\t/** Symbol key of the isolation map (see the `Context[symbols.isolate]` property). */\n\tstatic isolate = symbols.isolate;\n\t/** Symbol key of the intercept map (see the `Context[symbols.intercept]` property). */\n\tstatic intercept = symbols.intercept;\n\t/**\n\t* Returns true for Cordis context proxies and context prototypes.\n\t*\n\t* Works across realms and across multiple copies of cordis, because the\n\t* brand is keyed by a global symbol rather than by `instanceof`.\n\t*\n\t* @param value \u2014 the value to test.\n\t* @returns `true` if `value` is a Cordis context, narrowing its type.\n\t*/\n\tstatic is(value) {\n\t\treturn !!value?.[Context.is];\n\t}\n\tstatic {\n\t\tContext.is[Symbol.toPrimitive] = () => Symbol.for(\"cordis.is\");\n\t\tContext.prototype[Context.is] = true;\n\t}\n\t/** Create the root context and install the built-in services. */\n\tconstructor() {\n\t\tthis[symbols.isolate] = Object.create(null);\n\t\tthis[symbols.intercept] = Object.create(null);\n\t\tconst self = new Proxy(this, ReflectService.handler);\n\t\tthis.root = self;\n\t\tthis.baseUrl = void 0;\n\t\tthis.fiber = new Fiber(self, {}, Object.create(null), null, () => []);\n\t\tthis.reflect = new ReflectService(self);\n\t\tthis.registry = new RegistryService(self);\n\t\tthis.events = new EventsService(self);\n\t\tthis.logger = new LoggerService(self);\n\t\tthis.fiber._disposables.clear();\n\t\treturn self;\n\t}\n\t[Symbol.for(\"nodejs.util.inspect.custom\")]() {\n\t\treturn `Context <${this.fiber.name}>`;\n\t}\n\t/**\n\t* Create a child context with extra metadata on top of the current scope.\n\t*\n\t* The child prototypally inherits every property of this context; own\n\t* properties of `meta` shadow the inherited ones. The parent is not mutated.\n\t*\n\t* @param meta \u2014 own properties (including symbol keys) to define on the child.\n\t* @returns a child context inheriting from this one.\n\t*/\n\textend(meta = {}) {\n\t\tconst shadow = Reflect.getOwnPropertyDescriptor(this, symbols.shadow)?.value;\n\t\tconst self = Object.create(getTraceable(this, this));\n\t\tfor (const prop of Reflect.ownKeys(meta)) Object.defineProperty(self, prop, Reflect.getOwnPropertyDescriptor(meta, prop));\n\t\tif (!shadow) return self;\n\t\treturn Object.assign(Object.create(self), { [symbols.shadow]: shadow });\n\t}\n\t/**\n\t* Create a child context with an independent service scope for `name`.\n\t*\n\t* Below the returned context, reads and writes of the service `name`\n\t* resolve against the new label instead of the parent's, so a different\n\t* implementation can be provided without affecting the parent scope.\n\t* Passing the same `label` to two `isolate()` calls joins their scopes.\n\t*\n\t* @param name \u2014 the service name to isolate.\n\t* @param label \u2014 scope label to join; defaults to a fresh unique symbol.\n\t* @returns a child context whose `name` service resolves in the new scope.\n\t*/\n\tisolate(name, label) {\n\t\tconst shadow = Object.create(this[symbols.isolate]);\n\t\tshadow[name] = label ?? Symbol(name);\n\t\treturn this.extend({ [symbols.isolate]: shadow });\n\t}\n\tintercept(name, config) {\n\t\tconst intercept = Object.create(this[symbols.intercept]);\n\t\tintercept[name] = config;\n\t\treturn this.extend({ [symbols.intercept]: intercept });\n\t}\n};\n//#endregion\n//#region lib/types/service.js\n/**\n* Base class for services that expose a named API on `ctx`.\n*\n* Subclasses call `super(ctx, name)` from their constructor. The service is\n* registered immediately and is automatically removed with the owning fiber.\n*/\nvar Service = class Service {\n\tctx;\n\t/** Symbol key of an instance method run after construction (class plugins). */\n\tstatic init = symbols.init;\n\t/** Symbol key of the availability predicate passed to `ctx.provide()`. */\n\tstatic check = symbols.check;\n\t/** Symbol key of the phantom intercept-config type parameter. */\n\tstatic config = symbols.config;\n\t/** Symbol key of the call body making a service callable (e.g. `ctx.logger()`). */\n\tstatic invoke = symbols.invoke;\n\t/** Symbol key of the helper deriving an extended service instance. */\n\tstatic extend = symbols.extend;\n\t/** Symbol key of the tracker metadata used for context tracing. */\n\tstatic tracker = symbols.tracker;\n\t/** Symbol key of the intercept-config resolution helper below. */\n\tstatic resolveConfig = symbols.resolveConfig;\n\t/** The service name this instance is registered under. */\n\tname;\n\t/**\n\t* Register this instance as `name` in the current context.\n\t*\n\t* Calls `ctx.reflect.provide(name, this, this[Service.check])`, so the\n\t* service is unregistered automatically when the owning fiber unloads.\n\t* Services with a `[Service.invoke]` body return a callable instance.\n\t*\n\t* @param ctx \u2014 the context to register in (stored as `this.ctx`).\n\t* @param name \u2014 the service name; defaults to the static `provide` field.\n\t*/\n\tconstructor(ctx, name) {\n\t\tthis.ctx = ctx;\n\t\tname ??= this.constructor[\"provide\"];\n\t\tlet self = this;\n\t\tconst tracker = {\n\t\t\tassociate: name,\n\t\t\tproperty: \"ctx\"\n\t\t};\n\t\tif (self[symbols.invoke]) self = createCallable(name, joinPrototype(Object.getPrototypeOf(this), Function.prototype), tracker);\n\t\tself.ctx = ctx;\n\t\tself.name = name;\n\t\tdefineProperty(self, symbols.tracker, tracker);\n\t\tself.ctx.reflect.provide(name, self, this[symbols.check]);\n\t\treturn self;\n\t}\n\t[symbols.filter](ctx) {\n\t\treturn ctx[symbols.isolate][this.name] === this.ctx[symbols.isolate][this.name];\n\t}\n\t[symbols.extend](props) {\n\t\tlet self;\n\t\tif (this[Service.invoke]) self = createCallable(this.name, this, this[symbols.tracker]);\n\t\telse self = Object.create(this);\n\t\treturn Object.assign(self, props);\n\t}\n\t/**\n\t* Merge intercept config from ancestors with optional base and head values.\n\t*\n\t* Entries added closer to the root apply first; `base` is prepended and\n\t* `head` appended. Uses `Config.merge` when the service declares one,\n\t* otherwise a shallow `Object.assign`.\n\t*\n\t* @param base \u2014 lowest-precedence config merged before all intercepts.\n\t* @param head \u2014 highest-precedence config merged after all intercepts.\n\t* @returns the merged config.\n\t*/\n\t[symbols.resolveConfig](base, head) {\n\t\tlet intercept = this.ctx[Context.intercept];\n\t\tconst configs = [];\n\t\twhile (this.name in intercept) {\n\t\t\tif (Object.hasOwn(intercept, this.name)) configs.unshift(intercept[this.name]);\n\t\t\tintercept = Object.getPrototypeOf(intercept);\n\t\t}\n\t\tif (base) configs.unshift(base);\n\t\tif (head) configs.push(head);\n\t\tif (this[\"Config\"]?.merge) return this[\"Config\"].merge(...configs);\n\t\telse return Object.assign({}, ...configs);\n\t}\n\tstatic [Symbol.hasInstance](instance) {\n\t\tif (!instance) return false;\n\t\tlet constructor = instance.constructor;\n\t\twhile (constructor) {\n\t\t\tconstructor = constructor.prototype?.constructor;\n\t\t\tif (constructor === this) return true;\n\t\t\tconstructor &&= Object.getPrototypeOf(constructor);\n\t\t}\n\t\treturn false;\n\t}\n};\n//#endregion\nexport { Context, CordisError, DisposableList, EventsService, Fiber, Inject, Logger, LoggerService, RegistryService, Service, ValidationError, buildOuterStack, c16, c256, composeError, createCallable, defaultFormatters, getPropertyDescriptor, getTraceable, isBailed, isConstructor, isObject, joinPrototype, resolveConfig, symbols, withProps };\n", "import { Binary, clone, deepEqual, filterKeys, isNullable, isPlainObject, 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 (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} });\nconst resolvers = {};\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.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}\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.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", "import { Context } from \"@deepseek-ai/cordis\";\n//#region lib/types/store.js\n/**\n* Shared insertion-ordered storage and effect ownership for scope-aware registries.\n*\n* @module @deepseek-ai/dsh-scope\n*/\n/**\n* Insertion-ordered named entries with caller-owned duplicate diagnostics.\n*\n* Values are borrowed. Iterators are live within one nonempty table\n* generation; draining the table detaches them from later insertions. Each\n* successful insertion returns an idempotent undo for that exact entry.\n*/\nvar NamedEntries = class {\n\tduplicateError;\n\tdata = /* @__PURE__ */ new Map();\n\tconstructor(duplicateError) {\n\t\tthis.duplicateError = duplicateError;\n\t}\n\t/**\n\t* Insert one unique name.\n\t* @param name - name unique within this table.\n\t* @param value - borrowed value to retain.\n\t* @returns an idempotent undo that removes only this insertion.\n\t*/\n\tinsert(name, value) {\n\t\tconst data = this.data;\n\t\tif (data.has(name)) throw this.duplicateError(name);\n\t\tdata.set(name, value);\n\t\tlet active = true;\n\t\treturn () => {\n\t\t\tif (!active) return;\n\t\t\tactive = false;\n\t\t\tdata.delete(name);\n\t\t\tif (data.size === 0 && this.data === data) this.data = /* @__PURE__ */ new Map();\n\t\t};\n\t}\n\t/**\n\t* Read one named value.\n\t* @param name - name to resolve.\n\t* @returns the retained value, or `undefined` when absent.\n\t*/\n\tget(name) {\n\t\treturn this.data.get(name);\n\t}\n\t/**\n\t* Test one name for membership.\n\t* @param name - name to test.\n\t* @returns whether the table contains that name.\n\t*/\n\thas(name) {\n\t\treturn this.data.has(name);\n\t}\n\t/**\n\t* Iterate live names in insertion order.\n\t* @returns the native live key iterator.\n\t*/\n\tkeys() {\n\t\treturn this.data.keys();\n\t}\n\t/**\n\t* Iterate live entries in insertion order.\n\t* @returns the native live entry iterator.\n\t*/\n\tentries() {\n\t\treturn this.data.entries();\n\t}\n\t/**\n\t* Iterate live values in insertion order.\n\t* @returns the native live value iterator.\n\t*/\n\tvalues() {\n\t\treturn this.data.values();\n\t}\n\t/**\n\t* Test whether this table has no entries.\n\t* @returns whether the table is empty.\n\t*/\n\tisEmpty() {\n\t\treturn this.data.size === 0;\n\t}\n};\n/**\n* Insertion-ordered anonymous entries with independent registration identity.\n*\n* Equal values remain separate registrations. Values are borrowed, and\n* iterators are live within one nonempty table generation; draining the table\n* detaches them from later appends.\n*/\nvar AnonymousEntries = class {\n\tdata = /* @__PURE__ */ new Map();\n\t/**\n\t* Append one independently owned value.\n\t* @param value - borrowed value to retain.\n\t* @returns an idempotent undo for this exact append.\n\t*/\n\tappend(value) {\n\t\tconst data = this.data;\n\t\tconst key = Symbol();\n\t\tdata.set(key, value);\n\t\tlet active = true;\n\t\treturn () => {\n\t\t\tif (!active) return;\n\t\t\tactive = false;\n\t\t\tdata.delete(key);\n\t\t\tif (data.size === 0 && this.data === data) this.data = /* @__PURE__ */ new Map();\n\t\t};\n\t}\n\t/**\n\t* Iterate live values in insertion order.\n\t* @returns the native live value iterator.\n\t*/\n\tvalues() {\n\t\treturn this.data.values();\n\t}\n\t/**\n\t* Test whether this table has no entries.\n\t* @returns whether the table is empty.\n\t*/\n\tisEmpty() {\n\t\treturn this.data.size === 0;\n\t}\n};\n/**\n* Own the global and exact-scope layers for one registry.\n*\n* Reads never create scoped layers. Registrations derive both visibility and\n* effect ownership from the supplied Cordis context, collect undo before\n* notification, and reclaim only a completely empty aggregate layer.\n*/\nvar ScopedLayers = class {\n\tcreateLayer;\n\tonChange;\n\t/** The eagerly constructed context-global layer. */\n\tglobal;\n\tscoped = /* @__PURE__ */ new Map();\n\tconstructor(createLayer, onChange) {\n\t\tthis.createLayer = createLayer;\n\t\tthis.onChange = onChange;\n\t\tthis.global = createLayer(void 0);\n\t}\n\t/**\n\t* Read an existing exact-scope overlay. Deliberately chain-blind: callers\n\t* addressing one scope's OWN contributions (its restrictions, its guards)\n\t* must not silently pick up an ancestor's \u2014 use {@link chainLayers} where\n\t* inheritance is the point.\n\t* @param scope - exact scope key; `undefined` denotes no overlay.\n\t* @returns the existing scoped layer, or `undefined` without creating one.\n\t*/\n\tpeek(scope) {\n\t\tif (scope === void 0) return void 0;\n\t\treturn this.scoped.get(scope);\n\t}\n\t/**\n\t* Existing overlays along the scope's parent chain ({@link scopeChainOf}),\n\t* farthest ancestor first and the exact scope last, so a caller layering\n\t* them in order gives the nearest scope the final word.\n\t* @param scope - viewing scope, or `undefined` for no overlays.\n\t* @returns the existing layers, nearest last; absent overlays are skipped.\n\t*/\n\tchainLayers(scope) {\n\t\tconst layers = [];\n\t\tfor (const key of scopeChainOf(scope).reverse()) {\n\t\t\tconst layer = this.scoped.get(key);\n\t\t\tif (layer !== void 0) layers.push(layer);\n\t\t}\n\t\treturn layers;\n\t}\n\t/**\n\t* Materialize global named entries followed by scope-chain shadows,\n\t* farthest ancestor first, so the nearest scope's entry wins a name.\n\t* @param scope - viewing scope, or `undefined` for the global view.\n\t* @param pick - select the named table from a layer.\n\t* @returns an insertion-ordered effective map.\n\t*/\n\tmerge(scope, pick) {\n\t\tconst merged = new Map(pick(this.global).entries());\n\t\tfor (const layer of this.chainLayers(scope)) for (const [name, value] of pick(layer).entries()) merged.set(name, value);\n\t\treturn merged;\n\t}\n\t/**\n\t* Attach one synchronous layer mutation to its registration context.\n\t* @param ctx - context that determines both scope visibility and effect ownership.\n\t* @param action - atomic mutation returning its synchronous undo.\n\t* @param options - Cordis effect label and optional change notification.\n\t* @returns the exact disposer returned by `ctx.effect()`.\n\t*/\n\teffect(ctx, action, options) {\n\t\tconst scope = scopeOf(ctx);\n\t\tconst notify = options.notify ?? true;\n\t\treturn ctx.effect(function* () {\n\t\t\tlet layer;\n\t\t\tlet created = false;\n\t\t\tif (scope === void 0) layer = this.global;\n\t\t\telse {\n\t\t\t\tconst existing = this.scoped.get(scope);\n\t\t\t\tif (existing === void 0) {\n\t\t\t\t\tlayer = this.createLayer(scope);\n\t\t\t\t\tthis.scoped.set(scope, layer);\n\t\t\t\t\tcreated = true;\n\t\t\t\t} else layer = existing;\n\t\t\t}\n\t\t\tlet undo;\n\t\t\ttry {\n\t\t\t\tundo = action(layer);\n\t\t\t} catch (error) {\n\t\t\t\tif (scope !== void 0 && created && layer.isEmpty()) this.scoped.delete(scope);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tyield () => {\n\t\t\t\tundo();\n\t\t\t\tif (scope !== void 0 && layer.isEmpty()) this.scoped.delete(scope);\n\t\t\t\tif (notify) this.onChange();\n\t\t\t};\n\t\t\tif (notify) this.onChange();\n\t\t}.bind(this), options.label);\n\t}\n};\n//#endregion\n//#region lib/types/index.js\n/**\n* Scoped-context primitive: mint a Cordis context that tags registrations with\n* an opaque identity and build routing-only event carriers for that identity.\n*\n* @module @deepseek-ai/dsh-scope\n*/\n/** Context tag written by {@link createScope}. */\nconst kScope = Symbol(\"dsh.scope\");\n/** The key associated with each carrier. Presence distinguishes an unkeyed carrier from a non-carrier. */\nconst carrierKeys = /* @__PURE__ */ new WeakMap();\n/**\n* The enclosing scope of each key. One relation powers both directions of\n* scope nesting: registration views inherit DOWN the chain (a child scope\n* sees its ancestors' layers \u2014 {@link ScopedLayers}), and event admission\n* extends UP it (a listener tagged with an ancestor receives events dispatched\n* to a descendant key \u2014 {@link scopeTarget}).\n*/\nconst scopeParents = /* @__PURE__ */ new WeakMap();\n/** Cycle-checked write shared by the bind and every rebind. */\nfunction linkScopeParent(key, parent) {\n\tfor (let cursor = parent; cursor !== void 0; cursor = scopeParents.get(cursor)) if (cursor === key) throw new Error(\"dsh-scope: scope parent link would form a cycle\");\n\tscopeParents.set(key, parent);\n}\n/**\n* Bind `parent` as `key`'s enclosing scope, once.\n*\n* A key that already has a parent throws: there is no open re-link path, so a\n* scope's ancestry cannot be moved by anyone but the original binder, who\n* alone receives the {@link ScopeParentBinding}. A link that would close a\n* cycle is rejected, because every chain consumer walks parents to the root.\n* @param key - the child scope key.\n* @param parent - its enclosing scope key.\n* @returns the binding that alone may re-link this key.\n*/\nfunction bindScopeParent(key, parent) {\n\tif (scopeParents.has(key)) throw new Error(\"dsh-scope: scope key is already bound to a parent; re-linking requires the binding returned by the original bind\");\n\tlinkScopeParent(key, parent);\n\treturn { rebind(next) {\n\t\tlinkScopeParent(key, next);\n\t} };\n}\n/**\n* Read one key's enclosing scope.\n* @param key - the scope key to inspect.\n* @returns its parent key, or `undefined` for a root scope.\n*/\nfunction scopeParentOf(key) {\n\treturn scopeParents.get(key);\n}\n/**\n* The chain from a key to its root ancestor.\n* @param key - the starting key, or `undefined` for the empty chain.\n* @returns keys nearest-first: `[key, parent, grandparent, \u2026]`.\n*/\nfunction scopeChainOf(key) {\n\tconst chain = [];\n\tfor (let cursor = key; cursor !== void 0; cursor = scopeParents.get(cursor)) chain.push(cursor);\n\treturn chain;\n}\n/** Follow a Cordis fiber through asynchronous teardown even if its raw disposer was already claimed. */\nasync function quiesceFiber(fiber) {\n\tawait Promise.resolve(fiber.dispose());\n\twhile (fiber.inertia !== void 0) await fiber.inertia;\n}\n/** Shared no-op plugin used as the backing scope fiber. */\nfunction scope() {}\n/**\n* Mint a scope under `ctx`. The scoped context inherits the minting plugin's\n* dependency API and owns every registration made through it.\n* @param ctx - active context whose dependency API the scope inherits.\n* @param key - opaque identity used for listener routing.\n* @param options - optional scope-chain placement.\n* @returns the scoped context and exact/shared disposal boundaries.\n*/\nfunction createScope(ctx, key, options) {\n\tif (options?.parent !== void 0) bindScopeParent(key, options.parent);\n\tconst fiber = ctx.plugin(scope);\n\tconst scoped = fiber.ctx.extend({ [kScope]: key });\n\tlet disposing;\n\treturn {\n\t\tctx: scoped,\n\t\trawDispose: fiber.dispose,\n\t\tdispose: () => disposing ??= quiesceFiber(fiber)\n\t};\n}\n/**\n* Read the nearest scope tag inherited by a context.\n* @param ctx - context to inspect.\n* @returns its scope key, or `undefined` for an unscoped context.\n*/\nfunction scopeOf(ctx) {\n\treturn ctx[kScope];\n}\n/**\n* Build an opaque receiver that preserves the base filter, admits untagged\n* listeners globally, and admits tagged listeners for a matching key or any\n* of its ancestors ({@link bindScopeParent}): a listener owned by an enclosing\n* scope receives every descendant scope's events, which is what lets one\n* standing composition observe each of the agents composed under it. A tag\n* BELOW the dispatch key stays excluded \u2014 events flow up the chain, never\n* down.\n* @param base - subject or service whose existing Cordis filter is preserved.\n* @param key - routed scope identity, or `undefined` for an unscoped subject.\n* @returns a carrier whose subject remains available only through event arguments.\n*/\nfunction scopeTarget(base, key) {\n\tconst baseFilter = base[Context.filter];\n\tconst carrier = { [Context.filter](ctx) {\n\t\tif (baseFilter !== void 0 && !baseFilter.call(base, ctx)) return false;\n\t\tconst tag = scopeOf(ctx);\n\t\tif (tag === void 0) return true;\n\t\tfor (let cursor = key; cursor !== void 0; cursor = scopeParents.get(cursor)) if (cursor === tag) return true;\n\t\treturn false;\n\t} };\n\tcarrierKeys.set(carrier, key);\n\treturn carrier;\n}\n/**\n* Test whether a value is a scope carrier.\n* @param value - dispatch receiver to inspect.\n* @returns whether {@link scopeTarget} created it.\n*/\nfunction isScopeCarrier(value) {\n\treturn typeof value === \"object\" && value !== null && carrierKeys.has(value);\n}\n/**\n* Read a carrier's routing key.\n* @param value - dispatch receiver to inspect.\n* @returns the carrier key, or `undefined` for an unkeyed/non-carrier value.\n*/\nfunction carrierKeyOf(value) {\n\tif (!isScopeCarrier(value)) return void 0;\n\treturn carrierKeys.get(value);\n}\n//#endregion\nexport { AnonymousEntries, NamedEntries, ScopedLayers, bindScopeParent, carrierKeyOf, createScope, isScopeCarrier, scopeChainOf, scopeOf, scopeParentOf, scopeTarget };\n", "import { Service } from \"@deepseek-ai/cordis\";\n//#region lib/types/redact.js\n/**\n* Structural secret redaction for settings values. `role('secret')` fields are\n* removed from a value before it crosses a wire boundary; a sidecar records\n* each schema-declared secret position and whether it currently holds a value,\n* so a configuration surface can render a write-only input without ever\n* receiving the secret itself.\n* @module @deepseek-ai/dsh-settings/redact\n*/\n/** Whether a value is a plain data object the walker may recurse into. */\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction walk(node, value, path, secrets) {\n\tif (node === void 0) return value;\n\tif (node.meta?.role === \"secret\") {\n\t\tsecrets.push({\n\t\t\tpath,\n\t\t\tset: value !== void 0\n\t\t});\n\t\treturn;\n\t}\n\tswitch (node.type) {\n\t\tcase \"object\": {\n\t\t\tconst properties = node.dict ?? {};\n\t\t\tconst source = isRecord(value) ? value : void 0;\n\t\t\tconst rebuilt = {};\n\t\t\tif (source !== void 0) for (const [key, entry] of Object.entries(source)) {\n\t\t\t\tif (key in properties) continue;\n\t\t\t\trebuilt[key] = entry;\n\t\t\t}\n\t\t\tfor (const [key, child] of Object.entries(properties)) {\n\t\t\t\tconst stripped = walk(child, source?.[key], [...path, key], secrets);\n\t\t\t\tif (stripped !== void 0) rebuilt[key] = stripped;\n\t\t\t}\n\t\t\treturn source === void 0 && Object.keys(rebuilt).length === 0 ? value : rebuilt;\n\t\t}\n\t\tcase \"dict\": {\n\t\t\tif (!isRecord(value)) return value;\n\t\t\tconst rebuilt = {};\n\t\t\tfor (const [key, entry] of Object.entries(value)) {\n\t\t\t\tconst stripped = walk(node.inner, entry, [...path, key], secrets);\n\t\t\t\tif (stripped !== void 0) rebuilt[key] = stripped;\n\t\t\t}\n\t\t\treturn rebuilt;\n\t\t}\n\t\tcase \"array\":\n\t\t\tif (!Array.isArray(value)) return value;\n\t\t\treturn value.map((entry, index) => walk(node.inner, entry, [...path, String(index)], secrets));\n\t\tdefault: return value;\n\t}\n}\n/**\n* Remove every `role('secret')` field a schema declares from a value. The\n* walker follows `object`, `dict`, and `array` containers; a secret must be\n* declared directly on a field reachable through those containers (a secret\n* buried inside a union branch or transform is not reachable and must not be\n* modeled that way). The input is never mutated.\n* @param schema - live schemastery schema describing the value.\n* @param value - the value to strip; `undefined` yields an empty record with\n* object-property secret slots still enumerated.\n* @returns the stripped detached value and the ordered secret positions.\n*/\nfunction redactSecrets(schema, value) {\n\tconst secrets = [];\n\treturn {\n\t\tvalue: walk(schema, value, [], secrets),\n\t\tsecrets\n\t};\n}\n//#endregion\n//#region lib/types/index.js\n/**\n* Service Definition for the user-settings capability seam (`ctx.settings`). Providers store one raw document of\n* per-namespace sections; plugins register a namespace schema and read the\n* resolved value, which layers schema defaults, the registrant's composition\n* `base`, and the user document section, in that order.\n* @module @deepseek-ai/dsh-settings\n*/\nconst NAMESPACE_PATTERN = /^[a-z][a-z0-9-]*$/;\n/**\n* Brand a raw string as a {@link SettingsNamespace}.\n* @param value - candidate namespace; lowercase kebab-case, as in plugin short names.\n* @returns the branded namespace.\n*/\nfunction settingsNamespace(value) {\n\tif (!NAMESPACE_PATTERN.test(value)) throw new TypeError(`settings namespace \"${value}\" must match ${String(NAMESPACE_PATTERN)}`);\n\treturn value;\n}\n/**\n* Deep equality over JSON-compatible data (objects, arrays, primitives) \u2014 the\n* Service Definition's single change-detection predicate, exported so the invariant\n* companion checks exactly the implementation's relation.\n* @param a - one JSON-compatible value.\n* @param b - the other JSON-compatible value.\n* @returns whether the two values are structurally equal.\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* A write refused because the namespace moved since the caller read it. The\n* Service Definition's serialized write queue orders writes; it cannot tell a fresh writer\n* from one holding a stale snapshot, which is what this reports.\n*/\nvar SettingsConflictError = class extends Error {\n\t/** Stable machine code for wire layers mapping this to their own taxonomy. */\n\tcode = \"SETTINGS_CONFLICT\";\n\t/** The revision the write expected. */\n\texpected;\n\t/** The revision the namespace actually stands at. */\n\tactual;\n\t/**\n\t* @param ns - the namespace whose write was refused.\n\t* @param expected - the revision the caller sent.\n\t* @param actual - the revision now stored.\n\t*/\n\tconstructor(ns, expected, actual) {\n\t\tsuper(`settings namespace \"${ns}\" changed since it was read (expected revision ${String(expected)}, now ${String(actual)})`);\n\t\tthis.name = \"SettingsConflictError\";\n\t\tthis.expected = expected;\n\t\tthis.actual = actual;\n\t}\n};\n/** Whether a value is a plain data object (not an array, null, or class instance). */\nfunction isPlainObject(value) {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tconst proto = Object.getPrototypeOf(value);\n\treturn proto === Object.prototype || proto === null;\n}\n/** Apply one path op to a detached section, returning the next section. */\nfunction applyPathOp(section, op) {\n\tconst [head, ...rest] = op.path;\n\tif (head === void 0) {\n\t\tif (op.op === \"unset\") return {};\n\t\tif (!isPlainObject(op.value)) throw new TypeError(\"settings mutate: setting the section root requires a plain object\");\n\t\treturn { ...op.value };\n\t}\n\tif (rest.length === 0) {\n\t\tif (op.op === \"set\") return {\n\t\t\t...section,\n\t\t\t[head]: op.value\n\t\t};\n\t\tconst { [head]: _removed, ...kept } = section;\n\t\treturn kept;\n\t}\n\tconst child = section[head];\n\tif (!isPlainObject(child)) {\n\t\tif (op.op === \"unset\") return section;\n\t\treturn {\n\t\t\t...section,\n\t\t\t[head]: applyPathOp({}, {\n\t\t\t\t...op,\n\t\t\t\tpath: rest\n\t\t\t})\n\t\t};\n\t}\n\treturn {\n\t\t...section,\n\t\t[head]: applyPathOp(child, {\n\t\t\t...op,\n\t\t\tpath: rest\n\t\t})\n\t};\n}\n/** Human label for a value that lossless JSON cannot represent (numbers reject inline). */\nfunction describeRejected(value) {\n\tif (value === void 0) return \"undefined\";\n\tif (typeof value === \"object\" && value !== null) {\n\t\tconst name = Object.getPrototypeOf(value)?.constructor?.name;\n\t\treturn name === void 0 || name === \"Object\" ? \"a non-plain object\" : `a ${name}`;\n\t}\n\treturn `a ${typeof value}`;\n}\n/**\n* Detach and validate one write input in a single walk before persistence:\n* only JSON data (plain objects, arrays, strings, finite numbers,\n* booleans, `null`) may reach a provider document. `structuredClone` alone\n* would admit Dates, Maps, BigInts, and cycles that YAML/JSON storage then\n* silently distorts on the reload round-trip. `undefined` entries in objects\n* are skipped \u2014 the same sparse-patch semantics as {@link mergeLayers} \u2014 while\n* an `undefined` array entry is rejected rather than coerced.\n* @param root - plain-object write input (caller-checked).\n* @param reject - builds the validation error from a value label and its `$`-rooted path.\n* @returns the detached JSON-compatible clone.\n*/\nfunction cloneJsonShaped(root, reject) {\n\tconst visiting = /* @__PURE__ */ new WeakSet();\n\tconst clone = (value, path) => {\n\t\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return value;\n\t\tif (typeof value === \"number\") {\n\t\t\tif (!Number.isFinite(value)) throw reject(\"a non-finite number\", path);\n\t\t\treturn value;\n\t\t}\n\t\tif (Array.isArray(value)) {\n\t\t\tif (visiting.has(value)) throw reject(\"a circular reference\", path);\n\t\t\tvisiting.add(value);\n\t\t\tconst entries = value.map((entry, index) => clone(entry, `${path}[${index}]`));\n\t\t\tvisiting.delete(value);\n\t\t\treturn entries;\n\t\t}\n\t\tif (isPlainObject(value)) {\n\t\t\tif (visiting.has(value)) throw reject(\"a circular reference\", path);\n\t\t\tvisiting.add(value);\n\t\t\tconst out = {};\n\t\t\tfor (const [key, entry] of Object.entries(value)) {\n\t\t\t\tif (entry === void 0) continue;\n\t\t\t\tout[key] = clone(entry, `${path}.${key}`);\n\t\t\t}\n\t\t\tvisiting.delete(value);\n\t\t\treturn out;\n\t\t}\n\t\tthrow reject(describeRejected(value), path);\n\t};\n\treturn clone(root, \"$\");\n}\n/**\n* Layer `over` onto `under`: plain objects merge recursively, every other\n* value (arrays included) replaces the lower layer wholesale. `over` never\n* carries `undefined` entries \u2014 sections come from parsed documents and write\n* snapshots pass {@link cloneJsonShaped}, which strips them so a sparse patch\n* cannot erase lower keys.\n*/\nfunction mergeLayers(under, over) {\n\tif (over === void 0) return under;\n\tif (!isPlainObject(under) || !isPlainObject(over)) return over;\n\tconst merged = { ...under };\n\tfor (const [key, value] of Object.entries(over)) merged[key] = key in merged ? mergeLayers(merged[key], value) : value;\n\treturn merged;\n}\n/** Recursively freeze one resolved value so handed-out snapshots stay immutable. */\nfunction deepFreeze(value) {\n\tif (typeof value !== \"object\" || value === null || Object.isFrozen(value)) return value;\n\tfor (const entry of Object.values(value)) deepFreeze(entry);\n\treturn Object.freeze(value);\n}\n/**\n* Abstract settings service. Providers implement raw-document storage\n* (`load`/`persist`) and push external changes through {@link Settings.publish};\n* the base class owns namespace registration, resolution, validation, change\n* detection, and the `settings/updated` commit event.\n*/\nvar SettingsProvider = class extends Service {\n\tregistrations = /* @__PURE__ */ new Map();\n\t/** Latest published raw document; empty until the provider's first publish. */\n\tdocument = {};\n\t/** Per-namespace write chains; settled tails, so a failure never poisons the queue. */\n\twriteQueues = /* @__PURE__ */ new Map();\n\t/** In-flight watcher invocation segments, drained by the dispose teardown. */\n\tpendingTails = /* @__PURE__ */ new Set();\n\t/** Set at service dispose: refuse new writes while queued ones drain. */\n\tstopped = false;\n\t/** Opaque read of {@link stopped}: control flow cannot narrow it across awaits. */\n\tisStopped() {\n\t\treturn this.stopped;\n\t}\n\tconstructor(ctx) {\n\t\tsuper(ctx, \"settings\");\n\t}\n\t/**\n\t* Load the provider's document once and publish it before the service\n\t* becomes injectable, and register the write-drain teardown. Providers with\n\t* their own init (watchers, connections) delegate here first via\n\t* `yield* super[Service.init]()`; their disposers then run before the drain.\n\t*/\n\tasync *[Service.init]() {\n\t\tyield async () => {\n\t\t\tthis.stopped = true;\n\t\t\tawait Promise.allSettled([...this.writeQueues.values(), ...this.pendingTails]);\n\t\t};\n\t\tthis.publish(await this.load());\n\t}\n\t/**\n\t* Absolute path of the provider's user-editable document, when its storage\n\t* is one local file. Configuration surfaces use this only as availability\n\t* metadata; the guarded open operation resolves the path again Host-side.\n\t* Non-file providers leave it undefined and expose no open-document affordance.\n\t* @returns the absolute local document path, or undefined for non-file storage.\n\t*/\n\tget documentPath() {}\n\t/**\n\t* Prepare the provider's user-editable document for a native editor. File\n\t* providers may materialize an absent document before returning its path;\n\t* non-file providers return undefined.\n\t* @returns the absolute local document path, or undefined for non-file storage.\n\t*/\n\tprepareDocument() {\n\t\treturn Promise.resolve(this.documentPath);\n\t}\n\t/**\n\t* Register a namespace schema and receive its owner scope. The registration\n\t* is an effect on the calling plugin's fiber: disposing that fiber removes\n\t* the namespace and its observers. An invalid stored section fails the\n\t* registration itself \u2014 the earliest point where the schema can judge it.\n\t* @param ns - unique namespace; duplicate registration fails loud.\n\t* @param schema - schemastery schema resolving this namespace's value.\n\t* @param options - composition `base` layer and effect timing.\n\t* @returns the owner scope for reads, observation, and updates.\n\t*/\n\tregister(ns, schema, options) {\n\t\tif (this.registrations.has(ns)) throw new Error(`settings namespace \"${ns}\" is already registered`);\n\t\tconst registration = {\n\t\t\tns,\n\t\t\tschema,\n\t\t\tbase: options?.base,\n\t\t\tapplies: options?.applies ?? \"live\",\n\t\t\t...options?.validate === void 0 ? {} : { validate: options.validate },\n\t\t\tresolved: deepFreeze(this.resolve(schema, options?.base, this.section(ns), options?.validate)),\n\t\t\trevision: 0,\n\t\t\twatchers: /* @__PURE__ */ new Set()\n\t\t};\n\t\tthis.ctx.effect(() => {\n\t\t\tthis.registrations.set(ns, registration);\n\t\t\treturn () => this.registrations.delete(ns);\n\t\t}, `settings.register(${JSON.stringify(String(ns))})`);\n\t\treturn {\n\t\t\tget: () => registration.resolved,\n\t\t\twatch: (callback) => {\n\t\t\t\tconst watcher = {\n\t\t\t\t\tcallback,\n\t\t\t\t\ttail: Promise.resolve(),\n\t\t\t\t\tactive: true\n\t\t\t\t};\n\t\t\t\tregistration.watchers.add(watcher);\n\t\t\t\treturn () => {\n\t\t\t\t\twatcher.active = false;\n\t\t\t\t\tregistration.watchers.delete(watcher);\n\t\t\t\t};\n\t\t\t},\n\t\t\tupdate: (patch) => this.update(ns, patch),\n\t\t\treplace: (section) => this.replace(ns, section)\n\t\t};\n\t}\n\t/**\n\t* Describe every registered namespace for configuration surfaces, including\n\t* the composition `base` and raw user layers so a form can mark which fields\n\t* the user overrode (presence in `user`) and what a reset returns to.\n\t* @param options - redaction switch; wire surfaces must redact.\n\t* @returns one descriptor per registered namespace, in registration order.\n\t*/\n\tdescribe(options) {\n\t\treturn [...this.registrations.values()].map((registration) => {\n\t\t\tlet user;\n\t\t\ttry {\n\t\t\t\tuser = this.section(registration.ns);\n\t\t\t} catch {\n\t\t\t\tuser = void 0;\n\t\t\t}\n\t\t\tconst base = registration.base === void 0 ? void 0 : structuredClone(registration.base);\n\t\t\tconst detachedUser = user === void 0 ? void 0 : structuredClone(user);\n\t\t\tconst descriptor = {\n\t\t\t\tns: registration.ns,\n\t\t\t\tschema: registration.schema.toJSON(),\n\t\t\t\tvalue: registration.resolved,\n\t\t\t\trevision: registration.revision,\n\t\t\t\t...base === void 0 ? {} : { base },\n\t\t\t\t...detachedUser === void 0 ? {} : { user: detachedUser },\n\t\t\t\tapplies: registration.applies\n\t\t\t};\n\t\t\tif (options?.redactSecrets !== true) return descriptor;\n\t\t\tconst schema = registration.schema;\n\t\t\tconst redacted = redactSecrets(schema, registration.resolved);\n\t\t\treturn {\n\t\t\t\t...descriptor,\n\t\t\t\tvalue: redacted.value,\n\t\t\t\t...base === void 0 ? {} : { base: redactSecrets(schema, base).value },\n\t\t\t\t...detachedUser === void 0 ? {} : { user: redactSecrets(schema, detachedUser).value },\n\t\t\t\tsecrets: redacted.secrets\n\t\t\t};\n\t\t});\n\t}\n\t/**\n\t* Read one registered namespace's resolved value.\n\t* @param ns - the namespace to read.\n\t* @returns the resolved value, or `undefined` while unregistered.\n\t*/\n\tget(ns) {\n\t\treturn this.registrations.get(ns)?.resolved;\n\t}\n\t/**\n\t* Merge a patch into one registered namespace's user layer, validate the\n\t* resolved candidate, persist through the provider, then commit and emit.\n\t* A validation failure rejects before anything is persisted. Writes to one\n\t* namespace are serialized: concurrent updates apply in call order, each\n\t* merging over the previous write's committed section.\n\t* @param ns - the registered namespace to update.\n\t* @param patch - plain-object patch over the user section.\n\t* @param expectedRevision - the descriptor `revision` the caller read; a\n\t* namespace that moved past it rejects with {@link SettingsConflictError}.\n\t*/\n\tasync update(ns, patch, expectedRevision) {\n\t\treturn this.write(ns, patch, \"merge\", expectedRevision);\n\t}\n\t/**\n\t* Replace one registered namespace's user section wholesale, validate,\n\t* persist, then commit and emit. Keys absent from `section` fall back to the\n\t* composition `base` and schema defaults \u2014 this is the removal/reset path a\n\t* merge-only patch cannot express (`replace({})` re-inherits everything).\n\t* @param ns - the registered namespace to replace.\n\t* @param section - the complete next user section.\n\t* @param expectedRevision - the descriptor `revision` the caller read; a\n\t* namespace that moved past it rejects with {@link SettingsConflictError}.\n\t*/\n\tasync replace(ns, section, expectedRevision) {\n\t\treturn this.write(ns, section, \"replace\", expectedRevision);\n\t}\n\t/**\n\t* Apply path-addressed edits to one registered namespace's user section,\n\t* validate, persist, then commit and emit. The ops are applied to the\n\t* section as it stands when the write reaches the front of the queue, so a\n\t* caller never has to restate fields it did not touch \u2014 and, crucially,\n\t* cannot delete fields it never saw. This is the write path for any caller\n\t* holding a redacted view; `replace` remains the wholesale reset.\n\t* @param ns - the registered namespace to edit.\n\t* @param ops - ordered path edits; later ops observe earlier ones.\n\t* @param expectedRevision - the descriptor `revision` the caller read; a\n\t* namespace that moved past it rejects with {@link SettingsConflictError}.\n\t*/\n\tasync mutate(ns, ops, expectedRevision) {\n\t\tif (!Array.isArray(ops)) throw new TypeError(`settings mutate for \"${ns}\" must be an array of path ops`);\n\t\tfor (const op of ops) {\n\t\t\tif (!isPlainObject(op) || op[\"op\"] !== \"set\" && op[\"op\"] !== \"unset\") throw new TypeError(`settings mutate for \"${ns}\" ops must be {op:'set'|'unset', path}`);\n\t\t\tif (!Array.isArray(op[\"path\"]) || op[\"path\"].some((part) => typeof part !== \"string\")) throw new TypeError(`settings mutate for \"${ns}\" op paths must be arrays of strings`);\n\t\t}\n\t\treturn this.write(ns, ops, \"mutate\", expectedRevision);\n\t}\n\t/** Validate a write, then queue it on the namespace's serialized write chain. */\n\twrite(ns, input, mode, expectedRevision) {\n\t\tconst verb = mode === \"merge\" ? \"update\" : mode === \"replace\" ? \"replace\" : \"mutate\";\n\t\tconst registration = this.registrations.get(ns);\n\t\tif (registration === void 0) throw new Error(`settings namespace \"${ns}\" is not registered`);\n\t\tif (this.isStopped()) throw new Error(`settings service is disposed: \"${ns}\" cannot be written`);\n\t\tif (!this.writable) throw new Error(`settings provider is read-only: \"${ns}\" cannot be updated in-process`);\n\t\tlet payload;\n\t\tif (mode === \"mutate\") payload = { ops: input };\n\t\telse {\n\t\t\tif (!isPlainObject(input)) throw new TypeError(`settings ${verb} for \"${ns}\" must be a plain object`);\n\t\t\tpayload = input;\n\t\t}\n\t\tconst snapshot = cloneJsonShaped(payload, (label, path) => /* @__PURE__ */ new TypeError(`settings ${verb} for \"${ns}\" must contain only JSON-compatible data (found ${label} at ${path})`));\n\t\tconst run = (this.writeQueues.get(ns) ?? Promise.resolve()).catch(() => void 0).then(async () => {\n\t\t\tif (this.isStopped()) throw new Error(`settings service was disposed before the queued \"${ns}\" ${verb} ran`);\n\t\t\tif (this.registrations.get(ns) !== registration) throw new Error(`settings namespace \"${ns}\" registration was disposed before the queued ${verb} ran`);\n\t\t\tconst current = this.section(ns) ?? {};\n\t\t\tif (expectedRevision !== void 0 && expectedRevision !== registration.revision) throw new SettingsConflictError(ns, expectedRevision, registration.revision);\n\t\t\tconst section = mode === \"merge\" ? mergeLayers(current, snapshot) : mode === \"replace\" ? snapshot : snapshot[\"ops\"].reduce(applyPathOp, current);\n\t\t\tconst next = deepFreeze(this.resolve(registration.schema, registration.base, section, registration.validate));\n\t\t\tawait this.persist(ns, section);\n\t\t\tthis.document[ns] = section;\n\t\t\tif (this.registrations.get(ns) === registration && !this.isStopped()) {\n\t\t\t\tthis.bumpRevision(registration, current, section);\n\t\t\t\tthis.commit(registration, next, \"update\");\n\t\t\t}\n\t\t});\n\t\tthis.writeQueues.set(ns, run);\n\t\treturn run;\n\t}\n\t/**\n\t* Provider hook: commit a complete raw document observed in storage. Each\n\t* registered namespace re-resolves; an invalid section keeps that\n\t* namespace's last good value and warns, other namespaces still commit.\n\t* @param doc - the detached raw document (unregistered sections preserved).\n\t* @param source - change origin; defaults to `provider`.\n\t*/\n\tpublish(doc, source = \"provider\") {\n\t\tconst before = /* @__PURE__ */ new Map();\n\t\tfor (const registration of this.registrations.values()) try {\n\t\t\tbefore.set(registration.ns, this.section(registration.ns));\n\t\t} catch {\n\t\t\tbefore.set(registration.ns, void 0);\n\t\t}\n\t\tthis.document = doc;\n\t\tfor (const registration of this.registrations.values()) {\n\t\t\tlet next;\n\t\t\ttry {\n\t\t\t\tnext = deepFreeze(this.resolve(registration.schema, registration.base, this.section(registration.ns), registration.validate));\n\t\t\t} catch (error) {\n\t\t\t\tthis.ctx.logger.warn(\"settings: keeping last good \\\"%s\\\" after invalid stored section\", registration.ns);\n\t\t\t\tthis.ctx.logger.warn(error);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.bumpRevision(registration, before.get(registration.ns), this.section(registration.ns));\n\t\t\tthis.commit(registration, next, source);\n\t\t}\n\t}\n\t/** Read one namespace's raw user section, rejecting non-object sections. */\n\tsection(ns) {\n\t\tconst section = this.document[ns];\n\t\tif (section === void 0) return void 0;\n\t\tif (!isPlainObject(section)) throw new TypeError(`settings section \"${ns}\" must be an object of keys`);\n\t\treturn section;\n\t}\n\t/** Resolve one namespace value: schema defaults, then `base`, then the user layer. */\n\tresolve(schema, base, section, validate) {\n\t\tconst value = schema(mergeLayers(base, section));\n\t\tvalidate?.(value);\n\t\treturn value;\n\t}\n\t/**\n\t* Advance a namespace's revision when its RAW section changed, and announce\n\t* it. Deliberately independent of {@link commit}'s resolved-value equality:\n\t* storing an override equal to the composition base leaves the resolved\n\t* value alone but changes what the document says, which is exactly what a\n\t* configuration surface must re-read.\n\t*/\n\tbumpRevision(registration, before, after) {\n\t\tif (deepEqualJson(before, after)) return;\n\t\tregistration.revision += 1;\n\t\tthis.emitDocumentUpdated(registration.ns, registration.revision);\n\t}\n\t/** Contained fan-out of `settings/document-updated`, mirroring {@link commit}'s. */\n\temitDocumentUpdated(ns, revision) {\n\t\tlet invariantFailure;\n\t\tconst args = [\n\t\t\t\"settings/document-updated\",\n\t\t\tns,\n\t\t\trevision\n\t\t];\n\t\tfor (const listener of this.ctx.events.dispatch(\"emit\", args)) try {\n\t\t\tconst returned = listener(ns, revision);\n\t\t\tif (returned != null && typeof returned.then === \"function\") Promise.resolve(returned).then(void 0, (error) => {\n\t\t\t\tthis.warnListenerFailure(ns, error);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error?.code === \"INVARIANT\") {\n\t\t\t\tinvariantFailure ??= error;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.warnListenerFailure(ns, error);\n\t\t}\n\t\tif (invariantFailure !== void 0) throw invariantFailure;\n\t}\n\t/** Commit a resolved value when changed: swap, notify watchers, emit the event. */\n\tcommit(registration, next, source) {\n\t\tconst prev = registration.resolved;\n\t\tif (deepEqualJson(next, prev)) return;\n\t\tregistration.resolved = next;\n\t\tfor (const watcher of [...registration.watchers]) {\n\t\t\tconst segment = watcher.tail.then(() => {\n\t\t\t\tif (!watcher.active || this.isStopped()) return;\n\t\t\t\treturn watcher.callback(next, prev);\n\t\t\t}).then(() => void 0, (error) => {\n\t\t\t\tthis.warnWatcherFailure(registration.ns, error);\n\t\t\t});\n\t\t\twatcher.tail = segment;\n\t\t\tthis.pendingTails.add(segment);\n\t\t\tsegment.then(() => this.pendingTails.delete(segment));\n\t\t}\n\t\tlet invariantFailure;\n\t\tconst args = [\n\t\t\t\"settings/updated\",\n\t\t\tregistration.ns,\n\t\t\tnext,\n\t\t\tprev,\n\t\t\tsource\n\t\t];\n\t\tfor (const listener of this.ctx.events.dispatch(\"emit\", args)) try {\n\t\t\tconst returned = listener(registration.ns, next, prev, source);\n\t\t\tif (returned != null && typeof returned.then === \"function\") Promise.resolve(returned).then(void 0, (error) => {\n\t\t\t\tthis.warnListenerFailure(registration.ns, error);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error?.code === \"INVARIANT\") {\n\t\t\t\tinvariantFailure ??= error;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.warnListenerFailure(registration.ns, error);\n\t\t}\n\t\tif (invariantFailure !== void 0) throw invariantFailure;\n\t}\n\t/** Contained-watcher diagnostic shared by the sync and async failure paths. */\n\twarnWatcherFailure(ns, error) {\n\t\tthis.ctx.logger.warn(\"settings: watcher for \\\"%s\\\" failed\", ns);\n\t\tthis.ctx.logger.warn(error);\n\t}\n\t/** Contained-listener diagnostic shared by the sync and async failure paths. */\n\twarnListenerFailure(ns, error) {\n\t\tthis.ctx.logger.warn(\"settings: a settings/updated listener for \\\"%s\\\" failed\", ns);\n\t\tthis.ctx.logger.warn(error);\n\t}\n};\n/**\n* Value mirror of the `FiberState` members {@link isUnloading} compares\n* against: a const enum has no runtime object to import, and the value is\n* needed at runtime (same rationale as the CLI boot driver's mirror).\n*/\nconst FIBER_DISPOSED = 4;\nconst FIBER_UNLOADING = 5;\n/** Whether the consumer's own fiber is tearing down (not just losing the settings service). */\nfunction isUnloading(ctx) {\n\tconst state = ctx.fiber.state;\n\treturn state === FIBER_UNLOADING || state === FIBER_DISPOSED;\n}\n/**\n* Install the canonical optional-settings consumer wiring: while a settings\n* service exists, register `ns` with the consumer's composition entry as the\n* `base` layer and point the source thunk at the resolved scope; when the\n* service goes away (disposal, provider reload), fall back to the entry so\n* the consumer keeps working exactly as composed. The registration rides the\n* scoped fiber, so no settings service ever mounted means none of this runs.\n* @param ctx - consumer plugin context owning the wiring.\n* @param ns - the consumer-owned settings namespace.\n* @param schema - schema resolving the namespace (typically the plugin Config).\n* @param entry - the consumer's composition entry config, used as `base`.\n* @param hooks - source sink and change notification.\n*/\nfunction installSettingsSection(ctx, ns, schema, entry, hooks) {\n\tctx.inject([\"settings\"], (sctx) => {\n\t\tconst scope = sctx.settings.register(ns, schema, {\n\t\t\tbase: entry,\n\t\t\t...hooks.validate === void 0 ? {} : { validate: hooks.validate }\n\t\t});\n\t\thooks.setSource(() => scope.get());\n\t\tsctx.effect(() => () => {\n\t\t\tif (isUnloading(ctx)) return;\n\t\t\thooks.setSource(() => entry);\n\t\t\thooks.onChange();\n\t\t});\n\t\thooks.onChange();\n\t\tscope.watch(() => {\n\t\t\tif (isUnloading(ctx)) return;\n\t\t\thooks.onChange();\n\t\t});\n\t});\n}\n//#endregion\nexport { SettingsConflictError, SettingsProvider, SettingsProvider as default, deepEqualJson, installSettingsSection, redactSecrets, settingsNamespace };\n", "import { opendir, realpath } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { basename, dirname, join, resolve } from \"node:path\";\n//#region lib/types/index.js\n/**\n* Shared filesystem path helpers for DeepSeek Harness user data.\n*\n* @module @deepseek-ai/dsh-home-paths\n*/\n/** Directory name for the default DeepSeek Harness home under the OS home. */\nconst DSH_HOME_DIR_NAME = \".dsh\";\n/** Stable user-facing display form for the default DeepSeek Harness home. */\nconst DEFAULT_DSH_HOME_DISPLAY = `~/${DSH_HOME_DIR_NAME}`;\n/** Environment variable that overrides the default DeepSeek Harness home. */\nconst DSH_HOME_ENV = \"DSH_HOME\";\n/**\n* Give a native filesystem watcher one canonical spelling of a path, even\n* when its final components do not exist yet. The deepest existing ancestor\n* is resolved through {@link realpath}; when a suffix is missing, that\n* ancestor is also proved to be an enumerable directory before the suffix is\n* restored. This prevents Windows from treating a regular-file ancestor as\n* ordinary absence, and prevents short-name aliases from being mixed with\n* long paths emitted by the native watcher backend.\n* @param path - Watch target or root, resolved against the current directory.\n* @returns the target with its existing ancestor canonicalized.\n* @throws when ancestor traversal encounters an error other than absence, or\n* the existing ancestor of a missing suffix is not an enumerable directory.\n*/\nasync function canonicalizeWatchPath(path) {\n\tlet current = resolve(path);\n\tconst missing = [];\n\twhile (true) try {\n\t\tconst canonical = await realpath(current);\n\t\tif (missing.length > 0) await (await opendir(canonical)).close();\n\t\treturn join(canonical, ...missing.reverse());\n\t} catch (error) {\n\t\tif (error.code !== \"ENOENT\") throw error;\n\t\tconst parent = dirname(current);\n\t\t/* v8 ignore next -- a filesystem root exists, so traversal resolves before this guard */\n\t\tif (parent === current) throw error;\n\t\tmissing.push(basename(current));\n\t\tcurrent = parent;\n\t}\n}\n/**\n* Resolve the default DeepSeek Harness home using Node's platform path rules.\n* @returns the absolute default harness home path.\n*/\nfunction defaultDshHome() {\n\treturn join(homedir(), DSH_HOME_DIR_NAME);\n}\n/**\n* Expand supported tilde prefixes against the operating-system home.\n* @param path - configured path that may begin with `~`, `~/`, or `~\\`.\n* @returns the expanded path, or the original value when no supported prefix is present.\n*/\nfunction expandHomePath(path) {\n\tif (path === \"~\") return homedir();\n\tif (path.startsWith(\"~/\") || path.startsWith(\"~\\\\\")) return join(homedir(), path.slice(2));\n\treturn path;\n}\n/**\n* Resolve the single-root DeepSeek Harness home.\n*\n* Precedence, highest first: an explicit configured path, `$DSH_HOME`, then\n* `~/.dsh`. The harness keeps all user data under one root. An empty or\n* whitespace-only `$DSH_HOME` is treated as unset, so a blank override never\n* resolves the home to the current working directory.\n* @param configured - explicit harness-home override, which has highest precedence.\n* @param env - environment mapping used to read `DSH_HOME`.\n* @returns the normalized absolute harness home path.\n*/\nfunction resolveDshHome(configured, env = process.env) {\n\tconst fromEnv = env[DSH_HOME_ENV];\n\treturn resolve(expandHomePath(configured ?? (fromEnv !== void 0 && fromEnv.trim().length > 0 ? fromEnv : defaultDshHome())));\n}\n/**\n* Join path segments onto the resolved DeepSeek Harness home.\n* @param segments - path segments appended to the Harness home; an empty list returns the home itself.\n* @returns the normalized absolute joined path.\n*/\nfunction dshHomePath(...segments) {\n\treturn join(resolveDshHome(), ...segments);\n}\n/**\n* Describe a resolved harness home symbolically for user-facing display.\n*\n* It never returns an absolute machine path: the default home is labelled\n* `~/.dsh`, and any configured home is labelled `$DSH_HOME`.\n* @param resolvedHome - the absolute path returned by {@link resolveDshHome}.\n* @returns `~/.dsh` for the default home, otherwise `$DSH_HOME`.\n*/\nfunction dshHomeDisplay(resolvedHome) {\n\treturn resolvedHome === resolve(defaultDshHome()) ? DEFAULT_DSH_HOME_DISPLAY : `$${DSH_HOME_ENV}`;\n}\n//#endregion\nexport { DEFAULT_DSH_HOME_DISPLAY, DSH_HOME_DIR_NAME, DSH_HOME_ENV, canonicalizeWatchPath, defaultDshHome, dshHomeDisplay, dshHomePath, expandHomePath, resolveDshHome };\n", "'use strict'\n\nfunction isNothing (subject) {\n return (typeof subject === 'undefined') || (subject === null)\n}\n\nfunction isObject (subject) {\n return (typeof subject === 'object') && (subject !== null)\n}\n\nfunction toArray (sequence) {\n if (Array.isArray(sequence)) return sequence\n else if (isNothing(sequence)) return []\n\n return [sequence]\n}\n\nfunction extend (target, source) {\n if (source) {\n const sourceKeys = Object.keys(source)\n\n for (let index = 0, length = sourceKeys.length; index < length; index += 1) {\n const key = sourceKeys[index]\n target[key] = source[key]\n }\n }\n\n return target\n}\n\nfunction repeat (string, count) {\n let result = ''\n\n for (let cycle = 0; cycle < count; cycle += 1) {\n result += string\n }\n\n return result\n}\n\nfunction isNegativeZero (number) {\n return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number)\n}\n\nmodule.exports.isNothing = isNothing\nmodule.exports.isObject = isObject\nmodule.exports.toArray = toArray\nmodule.exports.repeat = repeat\nmodule.exports.isNegativeZero = isNegativeZero\nmodule.exports.extend = extend\n", "// YAML error class. http://stackoverflow.com/questions/8458984\n//\n'use strict'\n\nfunction formatError (exception, compact) {\n let where = ''\n const message = exception.reason || '(unknown reason)'\n\n if (!exception.mark) return message\n\n if (exception.mark.name) {\n where += 'in \"' + exception.mark.name + '\" '\n }\n\n where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'\n\n if (!compact && exception.mark.snippet) {\n where += '\\n\\n' + exception.mark.snippet\n }\n\n return message + ' ' + where\n}\n\nfunction YAMLException (reason, mark) {\n // Super constructor\n Error.call(this)\n\n this.name = 'YAMLException'\n this.reason = reason\n this.mark = mark\n this.message = formatError(this, false)\n\n // Include stack trace in error object\n if (Error.captureStackTrace) {\n // Chrome and NodeJS\n Error.captureStackTrace(this, this.constructor)\n } else {\n // FF, IE 10+ and Safari 6+. Fallback for others\n this.stack = (new Error()).stack || ''\n }\n}\n\n// Inherit from Error\nYAMLException.prototype = Object.create(Error.prototype)\nYAMLException.prototype.constructor = YAMLException\n\nYAMLException.prototype.toString = function toString (compact) {\n return this.name + ': ' + formatError(this, compact)\n}\n\nmodule.exports = YAMLException\n", "'use strict'\n\nconst common = require('./common')\n\n// get snippet for a single line, respecting maxLength\nfunction getLine (buffer, lineStart, lineEnd, position, maxLineLength) {\n let head = ''\n let tail = ''\n const maxHalfLength = Math.floor(maxLineLength / 2) - 1\n\n if (position - lineStart > maxHalfLength) {\n head = ' ... '\n lineStart = position - maxHalfLength + head.length\n }\n\n if (lineEnd - position > maxHalfLength) {\n tail = ' ...'\n lineEnd = position + maxHalfLength - tail.length\n }\n\n return {\n str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, '→') + tail,\n pos: position - lineStart + head.length // relative position\n }\n}\n\nfunction padStart (string, max) {\n return common.repeat(' ', max - string.length) + string\n}\n\nfunction makeSnippet (mark, options) {\n options = Object.create(options || null)\n\n if (!mark.buffer) return null\n\n if (!options.maxLength) options.maxLength = 79\n if (typeof options.indent !== 'number') options.indent = 1\n if (typeof options.linesBefore !== 'number') options.linesBefore = 3\n if (typeof options.linesAfter !== 'number') options.linesAfter = 2\n\n const re = /\\r?\\n|\\r|\\0/g\n const lineStarts = [0]\n const lineEnds = []\n let match\n let foundLineNo = -1\n\n while ((match = re.exec(mark.buffer))) {\n lineEnds.push(match.index)\n lineStarts.push(match.index + match[0].length)\n\n if (mark.position <= match.index && foundLineNo < 0) {\n foundLineNo = lineStarts.length - 2\n }\n }\n\n if (foundLineNo < 0) foundLineNo = lineStarts.length - 1\n\n let result = ''\n const lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length\n const maxLineLength = options.maxLength - (options.indent + lineNoLength + 3)\n\n for (let i = 1; i <= options.linesBefore; i++) {\n if (foundLineNo - i < 0) break\n const line = getLine(\n mark.buffer,\n lineStarts[foundLineNo - i],\n lineEnds[foundLineNo - i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n maxLineLength\n )\n result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n' + result\n }\n\n const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength)\n result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n'\n result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\\n'\n\n for (let i = 1; i <= options.linesAfter; i++) {\n if (foundLineNo + i >= lineEnds.length) break\n const line = getLine(\n mark.buffer,\n lineStarts[foundLineNo + i],\n lineEnds[foundLineNo + i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n maxLineLength\n )\n result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n'\n }\n\n return result.replace(/\\n$/, '')\n}\n\nmodule.exports = makeSnippet\n", "'use strict'\n\nconst YAMLException = require('./exception')\n\nconst TYPE_CONSTRUCTOR_OPTIONS = [\n 'kind',\n 'multi',\n 'resolve',\n 'construct',\n 'instanceOf',\n 'predicate',\n 'represent',\n 'representName',\n 'defaultStyle',\n 'styleAliases'\n]\n\nconst YAML_NODE_KINDS = [\n 'scalar',\n 'sequence',\n 'mapping'\n]\n\nfunction compileStyleAliases (map) {\n const result = {}\n\n if (map !== null) {\n Object.keys(map).forEach(function (style) {\n map[style].forEach(function (alias) {\n result[String(alias)] = style\n })\n })\n }\n\n return result\n}\n\nfunction Type (tag, options) {\n options = options || {}\n\n Object.keys(options).forEach(function (name) {\n if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {\n throw new YAMLException('Unknown option \"' + name + '\" is met in definition of \"' + tag + '\" YAML type.')\n }\n })\n\n // TODO: Add tag format check.\n this.options = options // keep original options in case user wants to extend this type later\n this.tag = tag\n this.kind = options['kind'] || null\n this.resolve = options['resolve'] || function () { return true }\n this.construct = options['construct'] || function (data) { return data }\n this.instanceOf = options['instanceOf'] || null\n this.predicate = options['predicate'] || null\n this.represent = options['represent'] || null\n this.representName = options['representName'] || null\n this.defaultStyle = options['defaultStyle'] || null\n this.multi = options['multi'] || false\n this.styleAliases = compileStyleAliases(options['styleAliases'] || null)\n\n if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {\n throw new YAMLException('Unknown kind \"' + this.kind + '\" is specified for \"' + tag + '\" YAML type.')\n }\n}\n\nmodule.exports = Type\n", "'use strict'\n\nconst YAMLException = require('./exception')\nconst Type = require('./type')\n\nfunction compileList (schema, name) {\n const result = []\n\n schema[name].forEach(function (currentType) {\n let newIndex = result.length\n\n result.forEach(function (previousType, previousIndex) {\n if (previousType.tag === currentType.tag &&\n previousType.kind === currentType.kind &&\n previousType.multi === currentType.multi) {\n newIndex = previousIndex\n }\n })\n\n result[newIndex] = currentType\n })\n\n return result\n}\n\nfunction compileMap (/* lists... */) {\n const result = {\n scalar: {},\n sequence: {},\n mapping: {},\n fallback: {},\n multi: {\n scalar: [],\n sequence: [],\n mapping: [],\n fallback: []\n }\n }\n function collectType (type) {\n if (type.multi) {\n result.multi[type.kind].push(type)\n result.multi['fallback'].push(type)\n } else {\n result[type.kind][type.tag] = result['fallback'][type.tag] = type\n }\n }\n\n for (let index = 0, length = arguments.length; index < length; index += 1) {\n arguments[index].forEach(collectType)\n }\n return result\n}\n\nfunction Schema (definition) {\n return this.extend(definition)\n}\n\nSchema.prototype.extend = function extend (definition) {\n let implicit = []\n let explicit = []\n\n if (definition instanceof Type) {\n // Schema.extend(type)\n explicit.push(definition)\n } else if (Array.isArray(definition)) {\n // Schema.extend([ type1, type2, ... ])\n explicit = explicit.concat(definition)\n } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {\n // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })\n if (definition.implicit) implicit = implicit.concat(definition.implicit)\n if (definition.explicit) explicit = explicit.concat(definition.explicit)\n } else {\n throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +\n 'or a schema definition ({ implicit: [...], explicit: [...] })')\n }\n\n implicit.forEach(function (type) {\n if (!(type instanceof Type)) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')\n }\n\n if (type.loadKind && type.loadKind !== 'scalar') {\n throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.')\n }\n\n if (type.multi) {\n throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.')\n }\n })\n\n explicit.forEach(function (type) {\n if (!(type instanceof Type)) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.')\n }\n })\n\n const result = Object.create(Schema.prototype)\n\n result.implicit = (this.implicit || []).concat(implicit)\n result.explicit = (this.explicit || []).concat(explicit)\n\n result.compiledImplicit = compileList(result, 'implicit')\n result.compiledExplicit = compileList(result, 'explicit')\n result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit)\n\n return result\n}\n\nmodule.exports = Schema\n", "'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:str', {\n kind: 'scalar',\n construct: function (data) { return data !== null ? data : '' }\n})\n", "'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:seq', {\n kind: 'sequence',\n construct: function (data) { return data !== null ? data : [] }\n})\n", "'use strict'\n\nconst Type = require('../type')\n\nmodule.exports = new Type('tag:yaml.org,2002:map', {\n kind: 'mapping',\n construct: function (data) { return data !== null ? data : {} }\n})\n", "// Standard YAML's Failsafe schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2802346\n\n'use strict'\n\nconst Schema = require('../schema')\n\nmodule.exports = new Schema({\n explicit: [\n require('../type/str'),\n require('../type/seq'),\n require('../type/map')\n ]\n})\n", "'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlNull (data) {\n if (data === null) return true\n\n const max = data.length\n\n return (max === 1 && data === '~') ||\n (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'))\n}\n\nfunction constructYamlNull () {\n return null\n}\n\nfunction isNull (object) {\n return object === null\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:null', {\n kind: 'scalar',\n resolve: resolveYamlNull,\n construct: constructYamlNull,\n predicate: isNull,\n represent: {\n canonical: function () { return '~' },\n lowercase: function () { return 'null' },\n uppercase: function () { return 'NULL' },\n camelcase: function () { return 'Null' },\n empty: function () { return '' }\n },\n defaultStyle: 'lowercase'\n})\n", "'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlBoolean (data) {\n if (data === null) return false\n\n const max = data.length\n\n return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||\n (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'))\n}\n\nfunction constructYamlBoolean (data) {\n return data === 'true' ||\n data === 'True' ||\n data === 'TRUE'\n}\n\nfunction isBoolean (object) {\n return Object.prototype.toString.call(object) === '[object Boolean]'\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:bool', {\n kind: 'scalar',\n resolve: resolveYamlBoolean,\n construct: constructYamlBoolean,\n predicate: isBoolean,\n represent: {\n lowercase: function (object) { return object ? 'true' : 'false' },\n uppercase: function (object) { return object ? 'TRUE' : 'FALSE' },\n camelcase: function (object) { return object ? 'True' : 'False' }\n },\n defaultStyle: 'lowercase'\n})\n", "'use strict'\n\nconst common = require('../common')\nconst Type = require('../type')\n\nfunction isHexCode (c) {\n return ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) ||\n ((c >= 0x41/* A */) && (c <= 0x46/* F */)) ||\n ((c >= 0x61/* a */) && (c <= 0x66/* f */))\n}\n\nfunction isOctCode (c) {\n return ((c >= 0x30/* 0 */) && (c <= 0x37/* 7 */))\n}\n\nfunction isDecCode (c) {\n return ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */))\n}\n\nfunction resolveYamlInteger (data) {\n if (data === null) return false\n\n const max = data.length\n let index = 0\n let hasDigits = false\n\n if (!max) return false\n\n let ch = data[index]\n\n // sign\n if (ch === '-' || ch === '+') {\n ch = data[++index]\n }\n\n if (ch === '0') {\n // 0\n if (index + 1 === max) return true\n ch = data[++index]\n\n // base 2, base 8, base 16\n\n if (ch === 'b') {\n // base 2\n index++\n\n for (; index < max; index++) {\n ch = data[index]\n if (ch !== '0' && ch !== '1') return false\n hasDigits = true\n }\n return hasDigits && isFinite(parseYamlInteger(data))\n }\n\n if (ch === 'x') {\n // base 16\n index++\n\n for (; index < max; index++) {\n if (!isHexCode(data.charCodeAt(index))) return false\n hasDigits = true\n }\n return hasDigits && isFinite(parseYamlInteger(data))\n }\n\n if (ch === 'o') {\n // base 8\n index++\n\n for (; index < max; index++) {\n if (!isOctCode(data.charCodeAt(index))) return false\n hasDigits = true\n }\n return hasDigits && isFinite(parseYamlInteger(data))\n }\n }\n\n // base 10 (except 0)\n\n for (; index < max; index++) {\n if (!isDecCode(data.charCodeAt(index))) {\n return false\n }\n hasDigits = true\n }\n\n if (!hasDigits) return false\n\n return isFinite(parseYamlInteger(data))\n}\n\nfunction parseYamlInteger (data) {\n let value = data\n let sign = 1\n\n let ch = value[0]\n\n if (ch === '-' || ch === '+') {\n if (ch === '-') sign = -1\n value = value.slice(1)\n ch = value[0]\n }\n\n if (value === '0') return 0\n\n if (ch === '0') {\n if (value[1] === 'b') return sign * parseInt(value.slice(2), 2)\n if (value[1] === 'x') return sign * parseInt(value.slice(2), 16)\n if (value[1] === 'o') return sign * parseInt(value.slice(2), 8)\n }\n\n return sign * parseInt(value, 10)\n}\n\nfunction constructYamlInteger (data) {\n return parseYamlInteger(data)\n}\n\nfunction isInteger (object) {\n return (Object.prototype.toString.call(object)) === '[object Number]' &&\n (object % 1 === 0 && !common.isNegativeZero(object))\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:int', {\n kind: 'scalar',\n resolve: resolveYamlInteger,\n construct: constructYamlInteger,\n predicate: isInteger,\n represent: {\n binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1) },\n octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1) },\n decimal: function (obj) { return obj.toString(10) },\n hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1) }\n },\n defaultStyle: 'decimal',\n styleAliases: {\n binary: [2, 'bin'],\n octal: [8, 'oct'],\n decimal: [10, 'dec'],\n hexadecimal: [16, 'hex']\n }\n})\n", "'use strict'\n\nconst common = require('../common')\nconst Type = require('../type')\n\nconst YAML_FLOAT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?(?:[0-9]+)(?:\\\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?' +\n // .2e4, .2\n // special case, seems not from spec\n '|\\\\.[0-9]+(?:[eE][-+]?[0-9]+)?' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nconst YAML_FLOAT_SPECIAL_PATTERN = new RegExp(\n '^(?:' +\n // .inf\n '[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$')\n\nfunction resolveYamlFloat (data) {\n if (data === null) return false\n\n if (!YAML_FLOAT_PATTERN.test(data)) {\n return false\n }\n\n if (isFinite(parseFloat(data, 10))) {\n return true\n }\n\n return YAML_FLOAT_SPECIAL_PATTERN.test(data)\n}\n\nfunction constructYamlFloat (data) {\n let value = data.toLowerCase()\n const sign = value[0] === '-' ? -1 : 1\n\n if ('+-'.indexOf(value[0]) >= 0) {\n value = value.slice(1)\n }\n\n if (value === '.inf') {\n return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY\n } else if (value === '.nan') {\n return NaN\n }\n return sign * parseFloat(value, 10)\n}\n\nconst SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/\n\nfunction representYamlFloat (object, style) {\n if (isNaN(object)) {\n switch (style) {\n case 'lowercase': return '.nan'\n case 'uppercase': return '.NAN'\n case 'camelcase': return '.NaN'\n }\n } else if (Number.POSITIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '.inf'\n case 'uppercase': return '.INF'\n case 'camelcase': return '.Inf'\n }\n } else if (Number.NEGATIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '-.inf'\n case 'uppercase': return '-.INF'\n case 'camelcase': return '-.Inf'\n }\n } else if (common.isNegativeZero(object)) {\n return '-0.0'\n }\n\n const res = object.toString(10)\n\n // JS stringifier can build scientific format without dots: 5e-100,\n // while YAML requres dot: 5.e-100. Fix it with simple hack\n\n return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res\n}\n\nfunction isFloat (object) {\n return (Object.prototype.toString.call(object) === '[object Number]') &&\n (object % 1 !== 0 || common.isNegativeZero(object))\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:float', {\n kind: 'scalar',\n resolve: resolveYamlFloat,\n construct: constructYamlFloat,\n predicate: isFloat,\n represent: representYamlFloat,\n defaultStyle: 'lowercase'\n})\n", "// Standard YAML's JSON schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2803231\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, this schema is not such strict as defined in the YAML specification.\n// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.\n\n'use strict'\n\nmodule.exports = require('./failsafe').extend({\n implicit: [\n require('../type/null'),\n require('../type/bool'),\n require('../type/int'),\n require('../type/float')\n ]\n})\n", "// Standard YAML's Core schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2804923\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, Core schema has no distinctions from JSON schema is JS-YAML.\n\n'use strict'\n\nmodule.exports = require('./json')\n", "'use strict'\n\nconst Type = require('../type')\n\nconst YAML_DATE_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9])' + // [2] month\n '-([0-9][0-9])$') // [3] day\n\nconst YAML_TIMESTAMP_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9]?)' + // [2] month\n '-([0-9][0-9]?)' + // [3] day\n '(?:[Tt]|[ \\\\t]+)' + // ...\n '([0-9][0-9]?)' + // [4] hour\n ':([0-9][0-9])' + // [5] minute\n ':([0-9][0-9])' + // [6] second\n '(?:\\\\.([0-9]*))?' + // [7] fraction\n '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tzHour\n '(?::([0-9][0-9]))?))?$') // [11] tzMinute\n\nfunction resolveYamlTimestamp (data) {\n if (data === null) return false\n if (YAML_DATE_REGEXP.exec(data) !== null) return true\n if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true\n return false\n}\n\nfunction constructYamlTimestamp (data) {\n let fraction = 0\n let delta = null\n\n let match = YAML_DATE_REGEXP.exec(data)\n if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data)\n\n if (match === null) throw new Error('Date resolve error')\n\n // match: [1] year [2] month [3] day\n\n const year = +(match[1])\n const month = +(match[2]) - 1 // JS month starts with 0\n const day = +(match[3])\n\n if (!match[4]) { // no hour\n return new Date(Date.UTC(year, month, day))\n }\n\n // match: [4] hour [5] minute [6] second [7] fraction\n\n const hour = +(match[4])\n const minute = +(match[5])\n const second = +(match[6])\n\n if (match[7]) {\n fraction = match[7].slice(0, 3)\n while (fraction.length < 3) { // milli-seconds\n fraction += '0'\n }\n fraction = +fraction\n }\n\n // match: [8] tz [9] tz_sign [10] tzHour [11] tzMinute\n\n if (match[9]) {\n const tzHour = +(match[10])\n const tzMinute = +(match[11] || 0)\n delta = (tzHour * 60 + tzMinute) * 60000 // delta in mili-seconds\n if (match[9] === '-') delta = -delta\n }\n\n const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction))\n\n if (delta) date.setTime(date.getTime() - delta)\n\n return date\n}\n\nfunction representYamlTimestamp (object /*, style */) {\n return object.toISOString()\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:timestamp', {\n kind: 'scalar',\n resolve: resolveYamlTimestamp,\n construct: constructYamlTimestamp,\n instanceOf: Date,\n represent: representYamlTimestamp\n})\n", "'use strict'\n\nconst Type = require('../type')\n\nfunction resolveYamlMerge (data) {\n return data === '<<' || data === null\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:merge', {\n kind: 'scalar',\n resolve: resolveYamlMerge\n})\n", "'use strict'\n\nconst Type = require('../type')\n\n// [ 64, 65, 66 ] -> [ padding, CR, LF ]\nconst BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r'\n\nfunction resolveYamlBinary (data) {\n if (data === null) return false\n\n let bitlen = 0\n const max = data.length\n const map = BASE64_MAP\n\n // Convert one by one.\n for (let idx = 0; idx < max; idx++) {\n const code = map.indexOf(data.charAt(idx))\n\n // Skip CR/LF\n if (code > 64) continue\n\n // Fail on illegal characters\n if (code < 0) return false\n\n bitlen += 6\n }\n\n // If there are any bits left, source was corrupted\n return (bitlen % 8) === 0\n}\n\nfunction constructYamlBinary (data) {\n const input = data.replace(/[\\r\\n=]/g, '') // remove CR/LF & padding to simplify scan\n const max = input.length\n const map = BASE64_MAP\n let bits = 0\n const result = []\n\n // Collect by 6*4 bits (3 bytes)\n\n for (let idx = 0; idx < max; idx++) {\n if ((idx % 4 === 0) && idx) {\n result.push((bits >> 16) & 0xFF)\n result.push((bits >> 8) & 0xFF)\n result.push(bits & 0xFF)\n }\n\n bits = (bits << 6) | map.indexOf(input.charAt(idx))\n }\n\n // Dump tail\n\n const tailbits = (max % 4) * 6\n\n if (tailbits === 0) {\n result.push((bits >> 16) & 0xFF)\n result.push((bits >> 8) & 0xFF)\n result.push(bits & 0xFF)\n } else if (tailbits === 18) {\n result.push((bits >> 10) & 0xFF)\n result.push((bits >> 2) & 0xFF)\n } else if (tailbits === 12) {\n result.push((bits >> 4) & 0xFF)\n }\n\n return new Uint8Array(result)\n}\n\nfunction representYamlBinary (object /*, style */) {\n let result = ''\n let bits = 0\n const max = object.length\n const map = BASE64_MAP\n\n // Convert every three bytes to 4 ASCII characters.\n\n for (let idx = 0; idx < max; idx++) {\n if ((idx % 3 === 0) && idx) {\n result += map[(bits >> 18) & 0x3F]\n result += map[(bits >> 12) & 0x3F]\n result += map[(bits >> 6) & 0x3F]\n result += map[bits & 0x3F]\n }\n\n bits = (bits << 8) + object[idx]\n }\n\n // Dump tail\n\n const tail = max % 3\n\n if (tail === 0) {\n result += map[(bits >> 18) & 0x3F]\n result += map[(bits >> 12) & 0x3F]\n result += map[(bits >> 6) & 0x3F]\n result += map[bits & 0x3F]\n } else if (tail === 2) {\n result += map[(bits >> 10) & 0x3F]\n result += map[(bits >> 4) & 0x3F]\n result += map[(bits << 2) & 0x3F]\n result += map[64]\n } else if (tail === 1) {\n result += map[(bits >> 2) & 0x3F]\n result += map[(bits << 4) & 0x3F]\n result += map[64]\n result += map[64]\n }\n\n return result\n}\n\nfunction isBinary (obj) {\n return Object.prototype.toString.call(obj) === '[object Uint8Array]'\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:binary', {\n kind: 'scalar',\n resolve: resolveYamlBinary,\n construct: constructYamlBinary,\n predicate: isBinary,\n represent: representYamlBinary\n})\n", "'use strict'\n\nconst Type = require('../type')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\nconst _toString = Object.prototype.toString\n\nfunction resolveYamlOmap (data) {\n if (data === null) return true\n\n const objectKeys = {}\n const object = data\n\n for (let index = 0, length = object.length; index < length; index += 1) {\n const pair = object[index]\n let pairHasKey = false\n\n if (_toString.call(pair) !== '[object Object]') return false\n\n let pairKey\n for (pairKey in pair) {\n if (_hasOwnProperty.call(pair, pairKey)) {\n if (!pairHasKey) pairHasKey = true\n else return false\n }\n }\n\n if (!pairHasKey) return false\n\n if (_hasOwnProperty.call(objectKeys, pairKey)) return false\n Object.defineProperty(objectKeys, pairKey, { value: true })\n }\n\n return true\n}\n\nfunction constructYamlOmap (data) {\n return data !== null ? data : []\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:omap', {\n kind: 'sequence',\n resolve: resolveYamlOmap,\n construct: constructYamlOmap\n})\n", "'use strict'\n\nconst Type = require('../type')\n\nconst _toString = Object.prototype.toString\n\nfunction resolveYamlPairs (data) {\n if (data === null) return true\n\n const object = data\n\n const result = new Array(object.length)\n\n for (let index = 0, length = object.length; index < length; index += 1) {\n const pair = object[index]\n\n if (_toString.call(pair) !== '[object Object]') return false\n\n const keys = Object.keys(pair)\n\n if (keys.length !== 1) return false\n\n result[index] = [keys[0], pair[keys[0]]]\n }\n\n return true\n}\n\nfunction constructYamlPairs (data) {\n if (data === null) return []\n\n const object = data\n const result = new Array(object.length)\n\n for (let index = 0, length = object.length; index < length; index += 1) {\n const pair = object[index]\n\n const keys = Object.keys(pair)\n\n result[index] = [keys[0], pair[keys[0]]]\n }\n\n return result\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:pairs', {\n kind: 'sequence',\n resolve: resolveYamlPairs,\n construct: constructYamlPairs\n})\n", "'use strict'\n\nconst Type = require('../type')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nfunction resolveYamlSet (data) {\n if (data === null) return true\n\n const object = data\n\n for (const key in object) {\n if (_hasOwnProperty.call(object, key)) {\n if (object[key] !== null) return false\n }\n }\n\n return true\n}\n\nfunction constructYamlSet (data) {\n return data !== null ? data : {}\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:set', {\n kind: 'mapping',\n resolve: resolveYamlSet,\n construct: constructYamlSet\n})\n", "// JS-YAML's default schema for `safeLoad` function.\n// It is not described in the YAML specification.\n//\n// This schema is based on standard YAML's Core schema and includes most of\n// extra types described at YAML tag repository. (http://yaml.org/type/)\n\n'use strict'\n\nmodule.exports = require('./core').extend({\n implicit: [\n require('../type/timestamp'),\n require('../type/merge')\n ],\n explicit: [\n require('../type/binary'),\n require('../type/omap'),\n require('../type/pairs'),\n require('../type/set')\n ]\n})\n", "'use strict'\n\nconst common = require('./common')\nconst YAMLException = require('./exception')\nconst makeSnippet = require('./snippet')\nconst DEFAULT_SCHEMA = require('./schema/default')\n\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nconst CONTEXT_FLOW_IN = 1\nconst CONTEXT_FLOW_OUT = 2\nconst CONTEXT_BLOCK_IN = 3\nconst CONTEXT_BLOCK_OUT = 4\n\nconst CHOMPING_CLIP = 1\nconst CHOMPING_STRIP = 2\nconst CHOMPING_KEEP = 3\n\n// eslint-disable-next-line no-control-regex\nconst PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/\nconst PATTERN_NON_ASCII_LINE_BREAKS = /[\\x85\\u2028\\u2029]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_FLOW_INDICATORS = /[,\\[\\]{}]/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/\n// eslint-disable-next-line no-useless-escape\nconst PATTERN_TAG_URI = /^(?:!|[^,\\[\\]{}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;/?:@&=+$,_.!~*'()\\[\\]])*$/i\n\nfunction _class (obj) { return Object.prototype.toString.call(obj) }\n\nfunction isEol (c) {\n return (c === 0x0A/* LF */) || (c === 0x0D/* CR */)\n}\n\nfunction isWhiteSpace (c) {\n return (c === 0x09/* Tab */) || (c === 0x20/* Space */)\n}\n\nfunction isWsOrEol (c) {\n return (c === 0x09/* Tab */) ||\n (c === 0x20/* Space */) ||\n (c === 0x0A/* LF */) ||\n (c === 0x0D/* CR */)\n}\n\nfunction isFlowIndicator (c) {\n return c === 0x2C/* , */ ||\n c === 0x5B/* [ */ ||\n c === 0x5D/* ] */ ||\n c === 0x7B/* { */ ||\n c === 0x7D/* } */\n}\n\nfunction fromHexCode (c) {\n if ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) {\n return c - 0x30\n }\n\n const lc = c | 0x20\n\n if ((lc >= 0x61/* a */) && (lc <= 0x66/* f */)) {\n return lc - 0x61 + 10\n }\n\n return -1\n}\n\nfunction escapedHexLen (c) {\n if (c === 0x78/* x */) { return 2 }\n if (c === 0x75/* u */) { return 4 }\n if (c === 0x55/* U */) { return 8 }\n return 0\n}\n\nfunction fromDecimalCode (c) {\n if ((c >= 0x30/* 0 */) && (c <= 0x39/* 9 */)) {\n return c - 0x30\n }\n\n return -1\n}\n\nfunction simpleEscapeSequence (c) {\n switch (c) {\n case 0x30/* 0 */: return '\\x00'\n case 0x61/* a */: return '\\x07'\n case 0x62/* b */: return '\\x08'\n case 0x74/* t */: return '\\x09'\n case 0x09/* Tab */: return '\\x09'\n case 0x6E/* n */: return '\\x0A'\n case 0x76/* v */: return '\\x0B'\n case 0x66/* f */: return '\\x0C'\n case 0x72/* r */: return '\\x0D'\n case 0x65/* e */: return '\\x1B'\n case 0x20/* Space */: return ' '\n case 0x22/* \" */: return '\\x22'\n case 0x2F/* / */: return '/'\n case 0x5C/* \\ */: return '\\x5C'\n case 0x4E/* N */: return '\\x85'\n case 0x5F/* _ */: return '\\xA0'\n case 0x4C/* L */: return '\\u2028'\n case 0x50/* P */: return '\\u2029'\n default: return ''\n }\n}\n\nfunction charFromCodepoint (c) {\n if (c <= 0xFFFF) {\n return String.fromCharCode(c)\n }\n // Encode UTF-16 surrogate pair\n // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF\n return String.fromCharCode(\n ((c - 0x010000) >> 10) + 0xD800,\n ((c - 0x010000) & 0x03FF) + 0xDC00\n )\n}\n\n// set a property of a literal object, while protecting against prototype pollution,\n// see https://github.com/nodeca/js-yaml/issues/164 for more details\nfunction setProperty (object, key, value) {\n // used for this specific key only because Object.defineProperty is slow\n if (key === '__proto__') {\n Object.defineProperty(object, key, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: value\n })\n } else {\n object[key] = value\n }\n}\n\nconst simpleEscapeCheck = new Array(256) // integer, for fast access\nconst simpleEscapeMap = new Array(256)\nfor (let i = 0; i < 256; i++) {\n simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0\n simpleEscapeMap[i] = simpleEscapeSequence(i)\n}\n\nfunction State (input, options) {\n this.input = input\n\n this.filename = options['filename'] || null\n this.schema = options['schema'] || DEFAULT_SCHEMA\n this.onWarning = options['onWarning'] || null\n // (Hidden) Remove? makes the loader to expect YAML 1.1 documents\n // if such documents have no explicit %YAML directive\n this.legacy = options['legacy'] || false\n\n this.json = options['json'] || false\n this.listener = options['listener'] || null\n this.maxDepth = typeof options['maxDepth'] === 'number' ? options['maxDepth'] : 100\n this.maxTotalMergeKeys = typeof options['maxTotalMergeKeys'] === 'number' ? options['maxTotalMergeKeys'] : 10000\n\n this.implicitTypes = this.schema.compiledImplicit\n this.typeMap = this.schema.compiledTypeMap\n\n this.length = input.length\n this.position = 0\n this.line = 0\n this.lineStart = 0\n this.lineIndent = 0\n this.depth = 0\n this.totalMergeKeys = 0\n\n // position of first leading tab in the current line,\n // used to make sure there are no tabs in the indentation\n this.firstTabInLine = -1\n\n this.documents = []\n this.anchorMapTransactions = []\n\n /*\n this.version;\n this.checkLineBreaks;\n this.tagMap;\n this.anchorMap;\n this.tag;\n this.anchor;\n this.kind;\n this.result; */\n}\n\nfunction generateError (state, message) {\n const mark = {\n name: state.filename,\n buffer: state.input.slice(0, -1), // omit trailing \\0\n position: state.position,\n line: state.line,\n column: state.position - state.lineStart\n }\n\n mark.snippet = makeSnippet(mark)\n\n return new YAMLException(message, mark)\n}\n\nfunction throwError (state, message) {\n throw generateError(state, message)\n}\n\nfunction throwWarning (state, message) {\n if (state.onWarning) {\n state.onWarning.call(null, generateError(state, message))\n }\n}\n\nfunction storeAnchor (state, name, value) {\n const transactions = state.anchorMapTransactions\n\n if (transactions.length !== 0) {\n const transaction = transactions[transactions.length - 1]\n\n if (!_hasOwnProperty.call(transaction, name)) {\n transaction[name] = {\n existed: _hasOwnProperty.call(state.anchorMap, name),\n value: state.anchorMap[name]\n }\n }\n }\n\n state.anchorMap[name] = value\n}\n\nfunction beginAnchorTransaction (state) {\n state.anchorMapTransactions.push(Object.create(null))\n}\n\nfunction commitAnchorTransaction (state) {\n const transaction = state.anchorMapTransactions.pop()\n const transactions = state.anchorMapTransactions\n\n if (transactions.length === 0) return\n\n const parent = transactions[transactions.length - 1]\n const names = Object.keys(transaction)\n\n for (let index = 0, length = names.length; index < length; index += 1) {\n const name = names[index]\n\n if (!_hasOwnProperty.call(parent, name)) {\n parent[name] = transaction[name]\n }\n }\n}\n\nfunction rollbackAnchorTransaction (state) {\n const transaction = state.anchorMapTransactions.pop()\n const names = Object.keys(transaction)\n\n for (let index = names.length - 1; index >= 0; index -= 1) {\n const entry = transaction[names[index]]\n\n if (entry.existed) {\n state.anchorMap[names[index]] = entry.value\n } else {\n delete state.anchorMap[names[index]]\n }\n }\n}\n\nfunction snapshotState (state) {\n return {\n position: state.position,\n line: state.line,\n lineStart: state.lineStart,\n lineIndent: state.lineIndent,\n firstTabInLine: state.firstTabInLine,\n tag: state.tag,\n anchor: state.anchor,\n kind: state.kind,\n result: state.result\n }\n}\n\nfunction restoreState (state, snapshot) {\n state.position = snapshot.position\n state.line = snapshot.line\n state.lineStart = snapshot.lineStart\n state.lineIndent = snapshot.lineIndent\n state.firstTabInLine = snapshot.firstTabInLine\n state.tag = snapshot.tag\n state.anchor = snapshot.anchor\n state.kind = snapshot.kind\n state.result = snapshot.result\n}\n\nconst directiveHandlers = {\n\n YAML: function handleYamlDirective (state, name, args) {\n if (state.version !== null) {\n throwError(state, 'duplication of %YAML directive')\n }\n\n if (args.length !== 1) {\n throwError(state, 'YAML directive accepts exactly one argument')\n }\n\n const match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0])\n\n if (match === null) {\n throwError(state, 'ill-formed argument of the YAML directive')\n }\n\n const major = parseInt(match[1], 10)\n const minor = parseInt(match[2], 10)\n\n if (major !== 1) {\n throwError(state, 'unacceptable YAML version of the document')\n }\n\n state.version = args[0]\n state.checkLineBreaks = (minor < 2)\n\n if (minor !== 1 && minor !== 2) {\n throwWarning(state, 'unsupported YAML version of the document')\n }\n },\n\n TAG: function handleTagDirective (state, name, args) {\n let prefix\n\n if (args.length !== 2) {\n throwError(state, 'TAG directive accepts exactly two arguments')\n }\n\n const handle = args[0]\n prefix = args[1]\n\n if (!PATTERN_TAG_HANDLE.test(handle)) {\n throwError(state, 'ill-formed tag handle (first argument) of the TAG directive')\n }\n\n if (_hasOwnProperty.call(state.tagMap, handle)) {\n throwError(state, 'there is a previously declared suffix for \"' + handle + '\" tag handle')\n }\n\n if (!PATTERN_TAG_URI.test(prefix)) {\n throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive')\n }\n\n try {\n prefix = decodeURIComponent(prefix)\n } catch (err) {\n throwError(state, 'tag prefix is malformed: ' + prefix)\n }\n\n state.tagMap[handle] = prefix\n }\n}\n\nfunction captureSegment (state, start, end, checkJson) {\n if (start < end) {\n const _result = state.input.slice(start, end)\n\n if (checkJson) {\n for (let _position = 0, _length = _result.length; _position < _length; _position += 1) {\n const _character = _result.charCodeAt(_position)\n if (!(_character === 0x09 ||\n (_character >= 0x20 && _character <= 0x10FFFF))) {\n throwError(state, 'expected valid JSON character')\n }\n }\n } else if (PATTERN_NON_PRINTABLE.test(_result)) {\n throwError(state, 'the stream contains non-printable characters')\n }\n\n state.result += _result\n }\n}\n\nfunction mergeMappings (state, destination, source, overridableKeys) {\n if (!common.isObject(source)) {\n throwError(state, 'cannot merge mappings; the provided source object is unacceptable')\n }\n\n const sourceKeys = Object.keys(source)\n\n for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {\n const key = sourceKeys[index]\n\n if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {\n throwError(state, 'merge keys exceeded maxTotalMergeKeys (' + state.maxTotalMergeKeys + ')')\n }\n\n if (!_hasOwnProperty.call(destination, key)) {\n setProperty(destination, key, source[key])\n overridableKeys[key] = true\n }\n }\n}\n\nfunction storeMappingPair (state, _result, overridableKeys, keyTag, keyNode, valueNode,\n startLine, startLineStart, startPos) {\n // The output is a plain object here, so keys can only be strings.\n // We need to convert keyNode to a string, but doing so can hang the process\n // (deeply nested arrays that explode exponentially using aliases).\n if (Array.isArray(keyNode)) {\n keyNode = Array.prototype.slice.call(keyNode)\n\n for (let index = 0, quantity = keyNode.length; index < quantity; index += 1) {\n if (Array.isArray(keyNode[index])) {\n throwError(state, 'nested arrays are not supported inside keys')\n }\n\n if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {\n keyNode[index] = '[object Object]'\n }\n }\n }\n\n // Avoid code execution in load() via toString property\n // (still use its own toString for arrays, timestamps,\n // and whatever user schema extensions happen to have @@toStringTag)\n if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {\n keyNode = '[object Object]'\n }\n\n keyNode = String(keyNode)\n\n if (_result === null) {\n _result = {}\n }\n\n if (keyTag === 'tag:yaml.org,2002:merge') {\n if (Array.isArray(valueNode)) {\n for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {\n mergeMappings(state, _result, valueNode[index], overridableKeys)\n }\n } else {\n mergeMappings(state, _result, valueNode, overridableKeys)\n }\n } else {\n if (!state.json &&\n !_hasOwnProperty.call(overridableKeys, keyNode) &&\n _hasOwnProperty.call(_result, keyNode)) {\n state.line = startLine || state.line\n state.lineStart = startLineStart || state.lineStart\n state.position = startPos || state.position\n throwError(state, 'duplicated mapping key')\n }\n\n setProperty(_result, keyNode, valueNode)\n delete overridableKeys[keyNode]\n }\n\n return _result\n}\n\nfunction readLineBreak (state) {\n const ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x0A/* LF */) {\n state.position++\n } else if (ch === 0x0D/* CR */) {\n state.position++\n if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {\n state.position++\n }\n } else {\n throwError(state, 'a line break is expected')\n }\n\n state.line += 1\n state.lineStart = state.position\n state.firstTabInLine = -1\n}\n\nfunction skipSeparationSpace (state, allowComments, checkIndent) {\n let lineBreaks = 0\n let ch = state.input.charCodeAt(state.position)\n\n while (ch !== 0) {\n while (isWhiteSpace(ch)) {\n if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n state.firstTabInLine = state.position\n }\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (allowComments && ch === 0x23/* # */) {\n do {\n ch = state.input.charCodeAt(++state.position)\n } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0)\n }\n\n if (isEol(ch)) {\n readLineBreak(state)\n\n ch = state.input.charCodeAt(state.position)\n lineBreaks++\n state.lineIndent = 0\n\n while (ch === 0x20/* Space */) {\n state.lineIndent++\n ch = state.input.charCodeAt(++state.position)\n }\n } else {\n break\n }\n }\n\n if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {\n throwWarning(state, 'deficient indentation')\n }\n\n return lineBreaks\n}\n\nfunction testDocumentSeparator (state) {\n let _position = state.position\n let ch = state.input.charCodeAt(_position)\n\n // Condition state.position === state.lineStart is tested\n // in parent on each call, for efficiency. No needs to test here again.\n if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n ch === state.input.charCodeAt(_position + 1) &&\n ch === state.input.charCodeAt(_position + 2)) {\n _position += 3\n\n ch = state.input.charCodeAt(_position)\n\n if (ch === 0 || isWsOrEol(ch)) {\n return true\n }\n }\n\n return false\n}\n\nfunction writeFoldedLines (state, count) {\n if (count === 1) {\n state.result += ' '\n } else if (count > 1) {\n state.result += common.repeat('\\n', count - 1)\n }\n}\n\nfunction readPlainScalar (state, nodeIndent, withinFlowCollection) {\n let captureStart\n let captureEnd\n let hasPendingContent\n let _line\n let _lineStart\n let _lineIndent\n const _kind = state.kind\n const _result = state.result\n\n let ch = state.input.charCodeAt(state.position)\n\n if (isWsOrEol(ch) ||\n isFlowIndicator(ch) ||\n ch === 0x23/* # */ ||\n ch === 0x26/* & */ ||\n ch === 0x2A/* * */ ||\n ch === 0x21/* ! */ ||\n ch === 0x7C/* | */ ||\n ch === 0x3E/* > */ ||\n ch === 0x27/* ' */ ||\n ch === 0x22/* \" */ ||\n ch === 0x25/* % */ ||\n ch === 0x40/* @ */ ||\n ch === 0x60/* ` */) {\n return false\n }\n\n if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n const following = state.input.charCodeAt(state.position + 1)\n\n if (isWsOrEol(following) ||\n (withinFlowCollection && isFlowIndicator(following))) {\n return false\n }\n }\n\n state.kind = 'scalar'\n state.result = ''\n captureStart = captureEnd = state.position\n hasPendingContent = false\n\n while (ch !== 0) {\n if (ch === 0x3A/* : */) {\n const following = state.input.charCodeAt(state.position + 1)\n\n if (isWsOrEol(following) ||\n (withinFlowCollection && isFlowIndicator(following))) {\n break\n }\n } else if (ch === 0x23/* # */) {\n const preceding = state.input.charCodeAt(state.position - 1)\n\n if (isWsOrEol(preceding)) {\n break\n }\n } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||\n (withinFlowCollection && isFlowIndicator(ch))) {\n break\n } else if (isEol(ch)) {\n _line = state.line\n _lineStart = state.lineStart\n _lineIndent = state.lineIndent\n skipSeparationSpace(state, false, -1)\n\n if (state.lineIndent >= nodeIndent) {\n hasPendingContent = true\n ch = state.input.charCodeAt(state.position)\n continue\n } else {\n state.position = captureEnd\n state.line = _line\n state.lineStart = _lineStart\n state.lineIndent = _lineIndent\n break\n }\n }\n\n if (hasPendingContent) {\n captureSegment(state, captureStart, captureEnd, false)\n writeFoldedLines(state, state.line - _line)\n captureStart = captureEnd = state.position\n hasPendingContent = false\n }\n\n if (!isWhiteSpace(ch)) {\n captureEnd = state.position + 1\n }\n\n ch = state.input.charCodeAt(++state.position)\n }\n\n captureSegment(state, captureStart, captureEnd, false)\n\n if (state.result) {\n return true\n }\n\n state.kind = _kind\n state.result = _result\n return false\n}\n\nfunction readSingleQuotedScalar (state, nodeIndent) {\n let captureStart\n let captureEnd\n\n let ch = state.input.charCodeAt(state.position)\n\n if (ch !== 0x27/* ' */) {\n return false\n }\n\n state.kind = 'scalar'\n state.result = ''\n state.position++\n captureStart = captureEnd = state.position\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x27/* ' */) {\n captureSegment(state, captureStart, state.position, true)\n ch = state.input.charCodeAt(++state.position)\n\n if (ch === 0x27/* ' */) {\n captureStart = state.position\n state.position++\n captureEnd = state.position\n } else {\n return true\n }\n } else if (isEol(ch)) {\n captureSegment(state, captureStart, captureEnd, true)\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent))\n captureStart = captureEnd = state.position\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a single quoted scalar')\n } else {\n state.position++\n if (!isWhiteSpace(ch)) {\n captureEnd = state.position\n }\n }\n }\n\n throwError(state, 'unexpected end of the stream within a single quoted scalar')\n}\n\nfunction readDoubleQuotedScalar (state, nodeIndent) {\n let captureStart\n let captureEnd\n let tmp\n\n let ch = state.input.charCodeAt(state.position)\n\n if (ch !== 0x22/* \" */) {\n return false\n }\n\n state.kind = 'scalar'\n state.result = ''\n state.position++\n captureStart = captureEnd = state.position\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x22/* \" */) {\n captureSegment(state, captureStart, state.position, true)\n state.position++\n return true\n } else if (ch === 0x5C/* \\ */) {\n captureSegment(state, captureStart, state.position, true)\n ch = state.input.charCodeAt(++state.position)\n\n if (isEol(ch)) {\n skipSeparationSpace(state, false, nodeIndent)\n\n // TODO: rework to inline fn with no type cast?\n } else if (ch < 256 && simpleEscapeCheck[ch]) {\n state.result += simpleEscapeMap[ch]\n state.position++\n } else if ((tmp = escapedHexLen(ch)) > 0) {\n let hexLength = tmp\n let hexResult = 0\n\n for (; hexLength > 0; hexLength--) {\n ch = state.input.charCodeAt(++state.position)\n\n if ((tmp = fromHexCode(ch)) >= 0) {\n hexResult = (hexResult << 4) + tmp\n } else {\n throwError(state, 'expected hexadecimal character')\n }\n }\n\n state.result += charFromCodepoint(hexResult)\n\n state.position++\n } else {\n throwError(state, 'unknown escape sequence')\n }\n\n captureStart = captureEnd = state.position\n } else if (isEol(ch)) {\n captureSegment(state, captureStart, captureEnd, true)\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent))\n captureStart = captureEnd = state.position\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a double quoted scalar')\n } else {\n state.position++\n if (!isWhiteSpace(ch)) {\n captureEnd = state.position\n }\n }\n }\n\n throwError(state, 'unexpected end of the stream within a double quoted scalar')\n}\n\nfunction readFlowCollection (state, nodeIndent) {\n let readNext = true\n let _line\n let _lineStart\n let _pos\n const _tag = state.tag\n let _result\n const _anchor = state.anchor\n let terminator\n let isPair\n let isExplicitPair\n let isMapping\n const overridableKeys = Object.create(null)\n let keyNode\n let keyTag\n let valueNode\n\n let ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x5B/* [ */) {\n terminator = 0x5D/* ] */\n isMapping = false\n _result = []\n } else if (ch === 0x7B/* { */) {\n terminator = 0x7D/* } */\n isMapping = true\n _result = {}\n } else {\n return false\n }\n\n if (state.anchor !== null) {\n storeAnchor(state, state.anchor, _result)\n }\n\n ch = state.input.charCodeAt(++state.position)\n\n while (ch !== 0) {\n skipSeparationSpace(state, true, nodeIndent)\n\n ch = state.input.charCodeAt(state.position)\n\n if (ch === terminator) {\n state.position++\n state.tag = _tag\n state.anchor = _anchor\n state.kind = isMapping ? 'mapping' : 'sequence'\n state.result = _result\n return true\n } else if (!readNext) {\n throwError(state, 'missed comma between flow collection entries')\n } else if (ch === 0x2C/* , */) {\n // \"flow collection entries can never be completely empty\", as per YAML 1.2, section 7.4\n throwError(state, \"expected the node content, but found ','\")\n }\n\n keyTag = keyNode = valueNode = null\n isPair = isExplicitPair = false\n\n if (ch === 0x3F/* ? */) {\n const following = state.input.charCodeAt(state.position + 1)\n\n if (isWsOrEol(following)) {\n isPair = isExplicitPair = true\n state.position++\n skipSeparationSpace(state, true, nodeIndent)\n }\n }\n\n _line = state.line // Save the current line.\n _lineStart = state.lineStart\n _pos = state.position\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n keyTag = state.tag\n keyNode = state.result\n skipSeparationSpace(state, true, nodeIndent)\n\n ch = state.input.charCodeAt(state.position)\n\n if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {\n isPair = true\n ch = state.input.charCodeAt(++state.position)\n skipSeparationSpace(state, true, nodeIndent)\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true)\n valueNode = state.result\n }\n\n if (isMapping) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)\n } else if (isPair) {\n _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos))\n } else {\n _result.push(keyNode)\n }\n\n skipSeparationSpace(state, true, nodeIndent)\n\n ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x2C/* , */) {\n readNext = true\n ch = state.input.charCodeAt(++state.position)\n } else {\n readNext = false\n }\n }\n\n throwError(state, 'unexpected end of the stream within a flow collection')\n}\n\nfunction readBlockScalar (state, nodeIndent) {\n let folding\n let chomping = CHOMPING_CLIP\n let didReadContent = false\n let detectedIndent = false\n let textIndent = nodeIndent\n let emptyLines = 0\n let atMoreIndented = false\n let tmp\n\n let ch = state.input.charCodeAt(state.position)\n\n if (ch === 0x7C/* | */) {\n folding = false\n } else if (ch === 0x3E/* > */) {\n folding = true\n } else {\n return false\n }\n\n state.kind = 'scalar'\n state.result = ''\n\n while (ch !== 0) {\n ch = state.input.charCodeAt(++state.position)\n\n if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {\n if (CHOMPING_CLIP === chomping) {\n chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP\n } else {\n throwError(state, 'repeat of a chomping mode identifier')\n }\n } else if ((tmp = fromDecimalCode(ch)) >= 0) {\n if (tmp === 0) {\n throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one')\n } else if (!detectedIndent) {\n textIndent = nodeIndent + tmp - 1\n detectedIndent = true\n } else {\n throwError(state, 'repeat of an indentation width identifier')\n }\n } else {\n break\n }\n }\n\n if (isWhiteSpace(ch)) {\n do { ch = state.input.charCodeAt(++state.position) }\n while (isWhiteSpace(ch))\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position) }\n while (!isEol(ch) && (ch !== 0))\n }\n }\n\n while (ch !== 0) {\n readLineBreak(state)\n state.lineIndent = 0\n\n ch = state.input.charCodeAt(state.position)\n\n // eslint-disable-next-line no-unmodified-loop-condition\n while ((!detectedIndent || state.lineIndent < textIndent) &&\n (ch === 0x20/* Space */)) {\n state.lineIndent++\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (!detectedIndent && state.lineIndent > textIndent) {\n textIndent = state.lineIndent\n }\n\n if (isEol(ch)) {\n emptyLines++\n continue\n }\n\n if (!detectedIndent && textIndent === 0) {\n throwError(state, 'missing indentation for block scalar')\n }\n\n // End of the scalar.\n if (state.lineIndent < textIndent) {\n // Perform the chomping.\n if (chomping === CHOMPING_KEEP) {\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n } else if (chomping === CHOMPING_CLIP) {\n if (didReadContent) { // i.e. only if the scalar is not empty.\n state.result += '\\n'\n }\n }\n\n // Break this `while` cycle and go to the funciton's epilogue.\n break\n }\n\n // Folded style: use fancy rules to handle line breaks.\n if (folding) {\n // Lines starting with white space characters (more-indented lines) are not folded.\n if (isWhiteSpace(ch)) {\n atMoreIndented = true\n // except for the first content line (cf. Example 8.1)\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n\n // End of more-indented block.\n } else if (atMoreIndented) {\n atMoreIndented = false\n state.result += common.repeat('\\n', emptyLines + 1)\n\n // Just one line break - perceive as the same line.\n } else if (emptyLines === 0) {\n if (didReadContent) { // i.e. only if we have already read some scalar content.\n state.result += ' '\n }\n\n // Several line breaks - perceive as different lines.\n } else {\n state.result += common.repeat('\\n', emptyLines)\n }\n\n // Literal style: just add exact number of line breaks between content lines.\n } else {\n // Keep all line breaks except the header line break.\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines)\n }\n\n didReadContent = true\n detectedIndent = true\n emptyLines = 0\n const captureStart = state.position\n\n while (!isEol(ch) && (ch !== 0)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n captureSegment(state, captureStart, state.position, false)\n }\n\n return true\n}\n\nfunction readBlockSequence (state, nodeIndent) {\n const _tag = state.tag\n const _anchor = state.anchor\n const _result = []\n let detected = false\n\n // there is a leading tab before this token, so it can't be a block sequence/mapping;\n // it can still be flow sequence/mapping or a scalar\n if (state.firstTabInLine !== -1) return false\n\n if (state.anchor !== null) {\n storeAnchor(state, state.anchor, _result)\n }\n\n let ch = state.input.charCodeAt(state.position)\n\n while (ch !== 0) {\n if (state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine\n throwError(state, 'tab characters must not be used in indentation')\n }\n\n if (ch !== 0x2D/* - */) {\n break\n }\n\n const following = state.input.charCodeAt(state.position + 1)\n\n if (!isWsOrEol(following)) {\n break\n }\n\n detected = true\n state.position++\n\n if (skipSeparationSpace(state, true, -1)) {\n if (state.lineIndent <= nodeIndent) {\n _result.push(null)\n ch = state.input.charCodeAt(state.position)\n continue\n }\n }\n\n const _line = state.line\n composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true)\n _result.push(state.result)\n skipSeparationSpace(state, true, -1)\n\n ch = state.input.charCodeAt(state.position)\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a sequence entry')\n } else if (state.lineIndent < nodeIndent) {\n break\n }\n }\n\n if (detected) {\n state.tag = _tag\n state.anchor = _anchor\n state.kind = 'sequence'\n state.result = _result\n return true\n }\n return false\n}\n\nfunction readBlockMapping (state, nodeIndent, flowIndent) {\n let allowCompact\n let _keyLine\n let _keyLineStart\n let _keyPos\n const _tag = state.tag\n const _anchor = state.anchor\n const _result = {}\n const overridableKeys = Object.create(null)\n let keyTag = null\n let keyNode = null\n let valueNode = null\n let atExplicitKey = false\n let detected = false\n\n // there is a leading tab before this token, so it can't be a block sequence/mapping;\n // it can still be flow sequence/mapping or a scalar\n if (state.firstTabInLine !== -1) return false\n\n if (state.anchor !== null) {\n storeAnchor(state, state.anchor, _result)\n }\n\n let ch = state.input.charCodeAt(state.position)\n\n while (ch !== 0) {\n if (!atExplicitKey && state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine\n throwError(state, 'tab characters must not be used in indentation')\n }\n\n const following = state.input.charCodeAt(state.position + 1)\n const _line = state.line // Save the current line.\n\n //\n // Explicit notation case. There are two separate blocks:\n // first for the key (denoted by \"?\") and second for the value (denoted by \":\")\n //\n if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && isWsOrEol(following)) {\n if (ch === 0x3F/* ? */) {\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n keyTag = keyNode = valueNode = null\n }\n\n detected = true\n atExplicitKey = true\n allowCompact = true\n } else if (atExplicitKey) {\n // i.e. 0x3A/* : */ === character after the explicit key.\n atExplicitKey = false\n allowCompact = true\n } else {\n throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line')\n }\n\n state.position += 1\n ch = following\n\n //\n // Implicit notation case. Flow-style node as the key first, then \":\", and the value.\n //\n } else {\n _keyLine = state.line\n _keyLineStart = state.lineStart\n _keyPos = state.position\n\n if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n // Neither implicit nor explicit notation.\n // Reading is done. Go to the epilogue.\n break\n }\n\n if (state.line === _line) {\n ch = state.input.charCodeAt(state.position)\n\n while (isWhiteSpace(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (ch === 0x3A/* : */) {\n ch = state.input.charCodeAt(++state.position)\n\n if (!isWsOrEol(ch)) {\n throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping')\n }\n\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n keyTag = keyNode = valueNode = null\n }\n\n detected = true\n atExplicitKey = false\n allowCompact = false\n keyTag = state.tag\n keyNode = state.result\n } else if (detected) {\n throwError(state, 'can not read an implicit mapping pair; a colon is missed')\n } else {\n state.tag = _tag\n state.anchor = _anchor\n return true // Keep the result of `composeNode`.\n }\n } else if (detected) {\n throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key')\n } else {\n state.tag = _tag\n state.anchor = _anchor\n return true // Keep the result of `composeNode`.\n }\n }\n\n //\n // Common reading code for both explicit and implicit notations.\n //\n if (state.line === _line || state.lineIndent > nodeIndent) {\n if (atExplicitKey) {\n _keyLine = state.line\n _keyLineStart = state.lineStart\n _keyPos = state.position\n }\n\n if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {\n if (atExplicitKey) {\n keyNode = state.result\n } else {\n valueNode = state.result\n }\n }\n\n if (!atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos)\n keyTag = keyNode = valueNode = null\n }\n\n skipSeparationSpace(state, true, -1)\n ch = state.input.charCodeAt(state.position)\n }\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a mapping entry')\n } else if (state.lineIndent < nodeIndent) {\n break\n }\n }\n\n //\n // Epilogue.\n //\n\n // Special case: last mapping's node contains only the key in explicit notation.\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos)\n }\n\n // Expose the resulting mapping.\n if (detected) {\n state.tag = _tag\n state.anchor = _anchor\n state.kind = 'mapping'\n state.result = _result\n }\n\n return detected\n}\n\nfunction readTagProperty (state) {\n let isVerbatim = false\n let isNamed = false\n let tagHandle\n let tagName\n\n let ch = state.input.charCodeAt(state.position)\n\n if (ch !== 0x21/* ! */) return false\n\n if (state.tag !== null) {\n throwError(state, 'duplication of a tag property')\n }\n\n ch = state.input.charCodeAt(++state.position)\n\n if (ch === 0x3C/* < */) {\n isVerbatim = true\n ch = state.input.charCodeAt(++state.position)\n } else if (ch === 0x21/* ! */) {\n isNamed = true\n tagHandle = '!!'\n ch = state.input.charCodeAt(++state.position)\n } else {\n tagHandle = '!'\n }\n\n let _position = state.position\n\n if (isVerbatim) {\n do { ch = state.input.charCodeAt(++state.position) }\n while (ch !== 0 && ch !== 0x3E/* > */)\n\n if (state.position < state.length) {\n tagName = state.input.slice(_position, state.position)\n ch = state.input.charCodeAt(++state.position)\n } else {\n throwError(state, 'unexpected end of the stream within a verbatim tag')\n }\n } else {\n while (ch !== 0 && !isWsOrEol(ch)) {\n if (ch === 0x21/* ! */) {\n if (!isNamed) {\n tagHandle = state.input.slice(_position - 1, state.position + 1)\n\n if (!PATTERN_TAG_HANDLE.test(tagHandle)) {\n throwError(state, 'named tag handle cannot contain such characters')\n }\n\n isNamed = true\n _position = state.position + 1\n } else {\n throwError(state, 'tag suffix cannot contain exclamation marks')\n }\n }\n\n ch = state.input.charCodeAt(++state.position)\n }\n\n tagName = state.input.slice(_position, state.position)\n\n if (PATTERN_FLOW_INDICATORS.test(tagName)) {\n throwError(state, 'tag suffix cannot contain flow indicator characters')\n }\n }\n\n if (tagName && !PATTERN_TAG_URI.test(tagName)) {\n throwError(state, 'tag name cannot contain such characters: ' + tagName)\n }\n\n try {\n tagName = decodeURIComponent(tagName)\n } catch (err) {\n throwError(state, 'tag name is malformed: ' + tagName)\n }\n\n if (isVerbatim) {\n state.tag = tagName\n } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {\n state.tag = state.tagMap[tagHandle] + tagName\n } else if (tagHandle === '!') {\n state.tag = '!' + tagName\n } else if (tagHandle === '!!') {\n state.tag = 'tag:yaml.org,2002:' + tagName\n } else {\n throwError(state, 'undeclared tag handle \"' + tagHandle + '\"')\n }\n\n return true\n}\n\nfunction readAnchorProperty (state) {\n let ch = state.input.charCodeAt(state.position)\n\n if (ch !== 0x26/* & */) return false\n\n if (state.anchor !== null) {\n throwError(state, 'duplication of an anchor property')\n }\n\n ch = state.input.charCodeAt(++state.position)\n const _position = state.position\n\n while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an anchor node must contain at least one character')\n }\n\n state.anchor = state.input.slice(_position, state.position)\n return true\n}\n\nfunction readAlias (state) {\n let ch = state.input.charCodeAt(state.position)\n\n if (ch !== 0x2A/* * */) return false\n\n ch = state.input.charCodeAt(++state.position)\n const _position = state.position\n\n while (ch !== 0 && !isWsOrEol(ch) && !isFlowIndicator(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an alias node must contain at least one character')\n }\n\n const alias = state.input.slice(_position, state.position)\n\n if (!_hasOwnProperty.call(state.anchorMap, alias)) {\n throwError(state, 'unidentified alias \"' + alias + '\"')\n }\n\n state.result = state.anchorMap[alias]\n skipSeparationSpace(state, true, -1)\n return true\n}\n\nfunction tryReadBlockMappingFromProperty (state, propertyStart, nodeIndent, flowIndent) {\n const fallbackState = snapshotState(state)\n\n beginAnchorTransaction(state)\n restoreState(state, propertyStart)\n\n // Re-read the leading properties as part of the first implicit key, not as\n // properties of the current node.\n state.tag = null\n state.anchor = null\n state.kind = null\n state.result = null\n\n if (readBlockMapping(state, nodeIndent, flowIndent) && state.kind === 'mapping') {\n commitAnchorTransaction(state)\n return true\n }\n\n rollbackAnchorTransaction(state)\n restoreState(state, fallbackState)\n return false\n}\n\nfunction composeNode (state, parentIndent, nodeContext, allowToSeek, allowCompact) {\n let allowBlockScalars\n let allowBlockCollections\n let indentStatus = 1 // 1: this>parent, 0: this=parent, -1: this<parent\n let atNewLine = false\n let hasContent = false\n let propertyStart = null\n let type\n let flowIndent\n let blockIndent\n\n if (state.depth >= state.maxDepth) {\n throwError(state, 'nesting exceeded maxDepth (' + state.maxDepth + ')')\n }\n\n state.depth += 1\n\n if (state.listener !== null) {\n state.listener('open', state)\n }\n\n state.tag = null\n state.anchor = null\n state.kind = null\n state.result = null\n\n const allowBlockStyles = allowBlockScalars = allowBlockCollections =\n CONTEXT_BLOCK_OUT === nodeContext ||\n CONTEXT_BLOCK_IN === nodeContext\n\n if (allowToSeek) {\n if (skipSeparationSpace(state, true, -1)) {\n atNewLine = true\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1\n }\n }\n }\n\n if (indentStatus === 1) {\n while (true) {\n const ch = state.input.charCodeAt(state.position)\n const propertyState = snapshotState(state)\n\n // A duplicate property token after a line break can be the first key of\n // a nested block mapping, e.g. `!!map\\n !!str key: value`.\n if (atNewLine &&\n ((ch === 0x21/* ! */ && state.tag !== null) ||\n (ch === 0x26/* & */ && state.anchor !== null))) {\n break\n }\n\n if (!readTagProperty(state) && !readAnchorProperty(state)) {\n break\n }\n\n if (propertyStart === null) {\n propertyStart = propertyState\n }\n\n if (skipSeparationSpace(state, true, -1)) {\n atNewLine = true\n allowBlockCollections = allowBlockStyles\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1\n }\n } else {\n allowBlockCollections = false\n }\n }\n }\n\n if (allowBlockCollections) {\n allowBlockCollections = atNewLine || allowCompact\n }\n\n if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {\n if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {\n flowIndent = parentIndent\n } else {\n flowIndent = parentIndent + 1\n }\n\n blockIndent = state.position - state.lineStart\n\n if (indentStatus === 1) {\n if ((allowBlockCollections &&\n (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent))) ||\n readFlowCollection(state, flowIndent)) {\n hasContent = true\n } else {\n const ch = state.input.charCodeAt(state.position)\n\n if (propertyStart !== null && allowBlockStyles && !allowBlockCollections &&\n ch !== 0x7C/* | */ && ch !== 0x3E/* > */ &&\n tryReadBlockMappingFromProperty(\n state,\n propertyStart,\n propertyStart.position - propertyStart.lineStart,\n flowIndent\n )) {\n hasContent = true\n } else if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||\n readSingleQuotedScalar(state, flowIndent) ||\n readDoubleQuotedScalar(state, flowIndent)) {\n hasContent = true\n } else if (readAlias(state)) {\n hasContent = true\n\n if (state.tag !== null || state.anchor !== null) {\n throwError(state, 'alias node should not have any properties')\n }\n } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {\n hasContent = true\n\n if (state.tag === null) {\n state.tag = '?'\n }\n }\n\n if (state.anchor !== null) {\n storeAnchor(state, state.anchor, state.result)\n }\n }\n } else if (indentStatus === 0) {\n // Special case: block sequences are allowed to have same indentation level as the parent.\n // http://www.yaml.org/spec/1.2/spec.html#id2799784\n hasContent = allowBlockCollections && readBlockSequence(state, blockIndent)\n }\n }\n\n if (state.tag === null) {\n if (state.anchor !== null) {\n storeAnchor(state, state.anchor, state.result)\n }\n } else if (state.tag === '?') {\n // Implicit resolving is not allowed for non-scalar types, and '?'\n // non-specific tag is only automatically assigned to plain scalars.\n //\n // We only need to check kind conformity in case user explicitly assigns '?'\n // tag, for example like this: \"!<?> [0]\"\n //\n if (state.result !== null && state.kind !== 'scalar') {\n throwError(state, 'unacceptable node kind for !<?> tag; it should be \"scalar\", not \"' + state.kind + '\"')\n }\n\n for (let typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {\n type = state.implicitTypes[typeIndex]\n\n if (type.resolve(state.result)) { // `state.result` updated in resolver if matched\n state.result = type.construct(state.result)\n state.tag = type.tag\n if (state.anchor !== null) {\n storeAnchor(state, state.anchor, state.result)\n }\n break\n }\n }\n } else if (state.tag !== '!') {\n if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {\n type = state.typeMap[state.kind || 'fallback'][state.tag]\n } else {\n // looking for multi type\n type = null\n const typeList = state.typeMap.multi[state.kind || 'fallback']\n\n for (let typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {\n if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {\n type = typeList[typeIndex]\n break\n }\n }\n }\n\n if (!type) {\n throwError(state, 'unknown tag !<' + state.tag + '>')\n }\n\n if (state.result !== null && type.kind !== state.kind) {\n throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be \"' + type.kind + '\", not \"' + state.kind + '\"')\n }\n\n if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched\n throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag')\n } else {\n state.result = type.construct(state.result, state.tag)\n if (state.anchor !== null) {\n storeAnchor(state, state.anchor, state.result)\n }\n }\n }\n\n if (state.listener !== null) {\n state.listener('close', state)\n }\n\n state.depth -= 1\n return state.tag !== null || state.anchor !== null || hasContent\n}\n\nfunction readDocument (state) {\n const documentStart = state.position\n let hasDirectives = false\n let ch\n\n state.version = null\n state.checkLineBreaks = state.legacy\n state.tagMap = Object.create(null)\n state.anchorMap = Object.create(null)\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n skipSeparationSpace(state, true, -1)\n\n ch = state.input.charCodeAt(state.position)\n\n if (state.lineIndent > 0 || ch !== 0x25/* % */) {\n break\n }\n\n hasDirectives = true\n ch = state.input.charCodeAt(++state.position)\n let _position = state.position\n\n while (ch !== 0 && !isWsOrEol(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n const directiveName = state.input.slice(_position, state.position)\n const directiveArgs = []\n\n if (directiveName.length < 1) {\n throwError(state, 'directive name must not be less than one character in length')\n }\n\n while (ch !== 0) {\n while (isWhiteSpace(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position) }\n while (ch !== 0 && !isEol(ch))\n break\n }\n\n if (isEol(ch)) break\n\n _position = state.position\n\n while (ch !== 0 && !isWsOrEol(ch)) {\n ch = state.input.charCodeAt(++state.position)\n }\n\n directiveArgs.push(state.input.slice(_position, state.position))\n }\n\n if (ch !== 0) readLineBreak(state)\n\n if (_hasOwnProperty.call(directiveHandlers, directiveName)) {\n directiveHandlers[directiveName](state, directiveName, directiveArgs)\n } else {\n throwWarning(state, 'unknown document directive \"' + directiveName + '\"')\n }\n }\n\n skipSeparationSpace(state, true, -1)\n\n if (state.lineIndent === 0 &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {\n state.position += 3\n skipSeparationSpace(state, true, -1)\n } else if (hasDirectives) {\n throwError(state, 'directives end mark is expected')\n }\n\n composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true)\n skipSeparationSpace(state, true, -1)\n\n if (state.checkLineBreaks &&\n PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {\n throwWarning(state, 'non-ASCII line breaks are interpreted as content')\n }\n\n state.documents.push(state.result)\n\n if (state.position === state.lineStart && testDocumentSeparator(state)) {\n if (state.input.charCodeAt(state.position) === 0x2E/* . */) {\n state.position += 3\n skipSeparationSpace(state, true, -1)\n }\n return\n }\n\n if (state.position < (state.length - 1)) {\n throwError(state, 'end of the stream or a document separator is expected')\n }\n}\n\nfunction loadDocuments (input, options) {\n input = String(input)\n options = options || {}\n\n if (input.length !== 0) {\n // Add tailing `\\n` if not exists\n if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&\n input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {\n input += '\\n'\n }\n\n // Strip BOM\n if (input.charCodeAt(0) === 0xFEFF) {\n input = input.slice(1)\n }\n }\n\n const state = new State(input, options)\n\n const nullpos = input.indexOf('\\0')\n\n if (nullpos !== -1) {\n state.position = nullpos\n throwError(state, 'null byte is not allowed in input')\n }\n\n // Use 0 as string terminator. That significantly simplifies bounds check.\n state.input += '\\0'\n\n while (state.input.charCodeAt(state.position) === 0x20/* Space */) {\n state.lineIndent += 1\n state.position += 1\n }\n\n while (state.position < (state.length - 1)) {\n readDocument(state)\n }\n\n return state.documents\n}\n\nfunction loadAll (input, iterator, options) {\n if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {\n options = iterator\n iterator = null\n }\n\n const documents = loadDocuments(input, options)\n\n if (typeof iterator !== 'function') {\n return documents\n }\n\n for (let index = 0, length = documents.length; index < length; index += 1) {\n iterator(documents[index])\n }\n}\n\nfunction load (input, options) {\n const documents = loadDocuments(input, options)\n\n if (documents.length === 0) {\n return undefined\n } else if (documents.length === 1) {\n return documents[0]\n }\n throw new YAMLException('expected a single document in the stream, but found more')\n}\n\nmodule.exports.loadAll = loadAll\nmodule.exports.load = load\n", "'use strict'\n\nconst common = require('./common')\nconst YAMLException = require('./exception')\nconst DEFAULT_SCHEMA = require('./schema/default')\n\nconst _toString = Object.prototype.toString\nconst _hasOwnProperty = Object.prototype.hasOwnProperty\n\nconst CHAR_BOM = 0xFEFF\nconst CHAR_TAB = 0x09 /* Tab */\nconst CHAR_LINE_FEED = 0x0A /* LF */\nconst CHAR_CARRIAGE_RETURN = 0x0D /* CR */\nconst CHAR_SPACE = 0x20 /* Space */\nconst CHAR_EXCLAMATION = 0x21 /* ! */\nconst CHAR_DOUBLE_QUOTE = 0x22 /* \" */\nconst CHAR_SHARP = 0x23 /* # */\nconst CHAR_PERCENT = 0x25 /* % */\nconst CHAR_AMPERSAND = 0x26 /* & */\nconst CHAR_SINGLE_QUOTE = 0x27 /* ' */\nconst CHAR_ASTERISK = 0x2A /* * */\nconst CHAR_COMMA = 0x2C /* , */\nconst CHAR_MINUS = 0x2D /* - */\nconst CHAR_COLON = 0x3A /* : */\nconst CHAR_EQUALS = 0x3D /* = */\nconst CHAR_GREATER_THAN = 0x3E /* > */\nconst CHAR_QUESTION = 0x3F /* ? */\nconst CHAR_COMMERCIAL_AT = 0x40 /* @ */\nconst CHAR_LEFT_SQUARE_BRACKET = 0x5B /* [ */\nconst CHAR_RIGHT_SQUARE_BRACKET = 0x5D /* ] */\nconst CHAR_GRAVE_ACCENT = 0x60 /* ` */\nconst CHAR_LEFT_CURLY_BRACKET = 0x7B /* { */\nconst CHAR_VERTICAL_LINE = 0x7C /* | */\nconst CHAR_RIGHT_CURLY_BRACKET = 0x7D /* } */\n\nconst ESCAPE_SEQUENCES = {}\n\nESCAPE_SEQUENCES[0x00] = '\\\\0'\nESCAPE_SEQUENCES[0x07] = '\\\\a'\nESCAPE_SEQUENCES[0x08] = '\\\\b'\nESCAPE_SEQUENCES[0x09] = '\\\\t'\nESCAPE_SEQUENCES[0x0A] = '\\\\n'\nESCAPE_SEQUENCES[0x0B] = '\\\\v'\nESCAPE_SEQUENCES[0x0C] = '\\\\f'\nESCAPE_SEQUENCES[0x0D] = '\\\\r'\nESCAPE_SEQUENCES[0x1B] = '\\\\e'\nESCAPE_SEQUENCES[0x22] = '\\\\\"'\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\'\nESCAPE_SEQUENCES[0x85] = '\\\\N'\nESCAPE_SEQUENCES[0xA0] = '\\\\_'\nESCAPE_SEQUENCES[0x2028] = '\\\\L'\nESCAPE_SEQUENCES[0x2029] = '\\\\P'\n\nconst DEPRECATED_BOOLEANS_SYNTAX = [\n 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',\n 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'\n]\n\nconst DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/\n\nfunction compileStyleMap (schema, map) {\n if (map === null) return {}\n\n const result = {}\n const keys = Object.keys(map)\n\n for (let index = 0, length = keys.length; index < length; index += 1) {\n let tag = keys[index]\n let style = String(map[tag])\n\n if (tag.slice(0, 2) === '!!') {\n tag = 'tag:yaml.org,2002:' + tag.slice(2)\n }\n const type = schema.compiledTypeMap['fallback'][tag]\n\n if (type && _hasOwnProperty.call(type.styleAliases, style)) {\n style = type.styleAliases[style]\n }\n\n result[tag] = style\n }\n\n return result\n}\n\nfunction encodeHex (character) {\n let handle\n let length\n\n const string = character.toString(16).toUpperCase()\n\n if (character <= 0xFF) {\n handle = 'x'\n length = 2\n } else if (character <= 0xFFFF) {\n handle = 'u'\n length = 4\n } else if (character <= 0xFFFFFFFF) {\n handle = 'U'\n length = 8\n } else {\n throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF')\n }\n\n return '\\\\' + handle + common.repeat('0', length - string.length) + string\n}\n\nconst QUOTING_TYPE_SINGLE = 1\nconst QUOTING_TYPE_DOUBLE = 2\n\nfunction State (options) {\n this.schema = options['schema'] || DEFAULT_SCHEMA\n this.indent = Math.max(1, (options['indent'] || 2))\n this.noArrayIndent = options['noArrayIndent'] || false\n this.skipInvalid = options['skipInvalid'] || false\n this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel'])\n this.styleMap = compileStyleMap(this.schema, options['styles'] || null)\n this.sortKeys = options['sortKeys'] || false\n this.lineWidth = options['lineWidth'] || 80\n this.noRefs = options['noRefs'] || false\n this.noCompatMode = options['noCompatMode'] || false\n this.condenseFlow = options['condenseFlow'] || false\n this.quotingType = options['quotingType'] === '\"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE\n this.forceQuotes = options['forceQuotes'] || false\n this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null\n\n this.implicitTypes = this.schema.compiledImplicit\n this.explicitTypes = this.schema.compiledExplicit\n\n this.tag = null\n this.result = ''\n\n this.duplicates = []\n this.usedDuplicates = null\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString (string, spaces) {\n const ind = common.repeat(' ', spaces)\n let position = 0\n let result = ''\n const length = string.length\n\n while (position < length) {\n let line\n const next = string.indexOf('\\n', position)\n if (next === -1) {\n line = string.slice(position)\n position = length\n } else {\n line = string.slice(position, next + 1)\n position = next + 1\n }\n\n if (line.length && line !== '\\n') result += ind\n\n result += line\n }\n\n return result\n}\n\nfunction generateNextLine (state, level) {\n return '\\n' + common.repeat(' ', state.indent * level)\n}\n\nfunction testImplicitResolving (state, str) {\n for (let index = 0, length = state.implicitTypes.length; index < length; index += 1) {\n const type = state.implicitTypes[index]\n\n if (type.resolve(str)) {\n return true\n }\n }\n\n return false\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace (c) {\n return c === CHAR_SPACE || c === CHAR_TAB\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isn’t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable (c) {\n return (c >= 0x00020 && c <= 0x00007E) ||\n ((c >= 0x000A1 && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) ||\n ((c >= 0x0E000 && c <= 0x00FFFD) && c !== CHAR_BOM) ||\n (c >= 0x10000 && c <= 0x10FFFF)\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char ::= b-line-feed | b-carriage-return\n// Including s-white (for some reason, examples doesn't match specs in this aspect)\n// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark\nfunction isNsCharOrWhitespace (c) {\n return isPrintable(c) &&\n c !== CHAR_BOM &&\n // - b-char\n c !== CHAR_CARRIAGE_RETURN &&\n c !== CHAR_LINE_FEED\n}\n\n// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out\n// c = flow-in ⇒ ns-plain-safe-in\n// c = block-key ⇒ ns-plain-safe-out\n// c = flow-key ⇒ ns-plain-safe-in\n// [128] ns-plain-safe-out ::= ns-char\n// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator\n// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )\n// | ( /* An ns-char preceding */ “#” )\n// | ( “:” /* Followed by an ns-plain-safe(c) */ )\nfunction isPlainSafe (c, prev, inblock) {\n const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c)\n const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c)\n return (\n (\n // ns-plain-safe\n inblock // c = flow-in\n ? cIsNsCharOrWhitespace\n : cIsNsCharOrWhitespace &&\n // - c-flow-indicator\n c !== CHAR_COMMA &&\n c !== CHAR_LEFT_SQUARE_BRACKET &&\n c !== CHAR_RIGHT_SQUARE_BRACKET &&\n c !== CHAR_LEFT_CURLY_BRACKET &&\n c !== CHAR_RIGHT_CURLY_BRACKET\n ) &&\n // ns-plain-char\n c !== CHAR_SHARP && // false on '#'\n !(prev === CHAR_COLON && !cIsNsChar)\n ) || // false on ': '\n (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) || // change to true on '[^ ]#'\n (prev === CHAR_COLON && cIsNsChar) // change to true on ':[^ ]'\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst (c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n return isPrintable(c) &&\n c !== CHAR_BOM &&\n !isWhitespace(c) && // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n c !== CHAR_MINUS &&\n c !== CHAR_QUESTION &&\n c !== CHAR_COLON &&\n c !== CHAR_COMMA &&\n c !== CHAR_LEFT_SQUARE_BRACKET &&\n c !== CHAR_RIGHT_SQUARE_BRACKET &&\n c !== CHAR_LEFT_CURLY_BRACKET &&\n c !== CHAR_RIGHT_CURLY_BRACKET &&\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n c !== CHAR_SHARP &&\n c !== CHAR_AMPERSAND &&\n c !== CHAR_ASTERISK &&\n c !== CHAR_EXCLAMATION &&\n c !== CHAR_VERTICAL_LINE &&\n c !== CHAR_EQUALS &&\n c !== CHAR_GREATER_THAN &&\n c !== CHAR_SINGLE_QUOTE &&\n c !== CHAR_DOUBLE_QUOTE &&\n // | “%” | “@” | “`”)\n c !== CHAR_PERCENT &&\n c !== CHAR_COMMERCIAL_AT &&\n c !== CHAR_GRAVE_ACCENT\n}\n\n// Simplified test for values allowed as the last character in plain style.\nfunction isPlainSafeLast (c) {\n // just not whitespace or colon, it will be checked to be plain character later\n return !isWhitespace(c) && c !== CHAR_COLON\n}\n\n// Same as 'string'.codePointAt(pos), but works in older browsers.\nfunction codePointAt (string, pos) {\n const first = string.charCodeAt(pos)\n let second\n\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1)\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n }\n }\n return first\n}\n\n// Determines whether block indentation indicator is required.\nfunction needIndentIndicator (string) {\n const leadingSpaceRe = /^\\n* /\n return leadingSpaceRe.test(string)\n}\n\nconst STYLE_PLAIN = 1\nconst STYLE_SINGLE = 2\nconst STYLE_LITERAL = 3\nconst STYLE_FOLDED = 4\nconst STYLE_DOUBLE = 5\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n// STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle (string, singleLineOnly, indentPerLevel, lineWidth,\n testAmbiguousType, quotingType, forceQuotes, inblock) {\n let i\n let char = 0\n let prevChar = null\n let hasLineBreak = false\n let hasFoldableLine = false // only checked if shouldTrackWidth\n const shouldTrackWidth = lineWidth !== -1\n let previousLineBreak = -1 // count the first line correctly\n let plain = isPlainSafeFirst(codePointAt(string, 0)) &&\n isPlainSafeLast(codePointAt(string, string.length - 1))\n\n if (singleLineOnly || forceQuotes) {\n // Case: no block styles.\n // Check for disallowed characters to rule out plain and single.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i)\n if (!isPrintable(char)) {\n return STYLE_DOUBLE\n }\n plain = plain && isPlainSafe(char, prevChar, inblock)\n prevChar = char\n }\n } else {\n // Case: block styles permitted.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i)\n if (char === CHAR_LINE_FEED) {\n hasLineBreak = true\n // Check if any line can be folded.\n if (shouldTrackWidth) {\n hasFoldableLine = hasFoldableLine ||\n // Foldable line = too long, and not more-indented.\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' ')\n previousLineBreak = i\n }\n } else if (!isPrintable(char)) {\n return STYLE_DOUBLE\n }\n plain = plain && isPlainSafe(char, prevChar, inblock)\n prevChar = char\n }\n // in case the end is missing a \\n\n hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' '))\n }\n // Although every style can represent \\n without escaping, prefer block styles\n // for multiline, since they're more readable and they don't add empty lines.\n // Also prefer folding a super-long line.\n if (!hasLineBreak && !hasFoldableLine) {\n // Strings interpretable as another type have to be quoted;\n // e.g. the string 'true' vs. the boolean true.\n if (plain && !forceQuotes && !testAmbiguousType(string)) {\n return STYLE_PLAIN\n }\n return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE\n }\n // Edge case: block indentation indicator can only have one digit.\n if (indentPerLevel > 9 && needIndentIndicator(string)) {\n return STYLE_DOUBLE\n }\n // At this point we know block styles are valid.\n // Prefer literal style unless we want to fold.\n if (!forceQuotes) {\n return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL\n }\n return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE\n}\n\n// Note: line breaking/folding is implemented for only the folded style.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n// since the dumper adds its own newline. This always works:\n// • No ending newline => unaffected; already using strip \"-\" chomping.\n// • Ending newline => removed then restored.\n// Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction writeScalar (state, string, level, iskey, inblock) {\n state.dump = (function () {\n if (string.length === 0) {\n return state.quotingType === QUOTING_TYPE_DOUBLE ? '\"\"' : \"''\"\n }\n if (!state.noCompatMode) {\n if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {\n return state.quotingType === QUOTING_TYPE_DOUBLE ? ('\"' + string + '\"') : (\"'\" + string + \"'\")\n }\n }\n\n const indent = state.indent * Math.max(1, level) // no 0-indent scalars\n // As indentation gets deeper, let the width decrease monotonically\n // to the lower bound min(state.lineWidth, 40).\n // Note that this implies\n // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.\n // state.lineWidth > 40 + state.indent: width decreases until the lower bound.\n // This behaves better than a constant minimum width which disallows narrower options,\n // or an indent threshold which causes the width to suddenly increase.\n const lineWidth = (state.lineWidth === -1)\n ? -1\n : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent)\n\n // Without knowing if keys are implicit/explicit, assume implicit for safety.\n const singleLineOnly = iskey ||\n // No block styles in flow mode.\n (state.flowLevel > -1 && level >= state.flowLevel)\n function testAmbiguity (string) {\n return testImplicitResolving(state, string)\n }\n\n switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,\n testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {\n case STYLE_PLAIN:\n return string\n case STYLE_SINGLE:\n return \"'\" + string.replace(/'/g, \"''\") + \"'\"\n case STYLE_LITERAL:\n return '|' + blockHeader(string, state.indent) +\n dropEndingNewline(indentString(string, indent))\n case STYLE_FOLDED:\n return '>' + blockHeader(string, state.indent) +\n dropEndingNewline(indentString(foldString(string, lineWidth), indent))\n case STYLE_DOUBLE:\n return '\"' + escapeString(string, lineWidth) + '\"'\n default:\n throw new YAMLException('impossible error: invalid scalar style')\n }\n }())\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader (string, indentPerLevel) {\n const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n const clip = string[string.length - 1] === '\\n'\n const keep = clip && (string[string.length - 2] === '\\n' || string === '\\n')\n const chomp = keep ? '+' : (clip ? '' : '-')\n\n return indentIndicator + chomp + '\\n'\n}\n\n// (See the note for writeScalar.)\nfunction dropEndingNewline (string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldString (string, width) {\n // In folded style, $k$ consecutive newlines output as $k+1$ newlines—\n // unless they're before or after a more-indented line, or at the very\n // beginning or end, in which case $k$ maps to $k$.\n // Therefore, parse each chunk as newline(s) followed by a content line.\n const lineRe = /(\\n+)([^\\n]*)/g\n\n // first line (possibly an empty line)\n let result = (function () {\n let nextLF = string.indexOf('\\n')\n nextLF = nextLF !== -1 ? nextLF : string.length\n lineRe.lastIndex = nextLF\n return foldLine(string.slice(0, nextLF), width)\n }())\n // If we haven't reached the first content line yet, don't add an extra \\n.\n let prevMoreIndented = string[0] === '\\n' || string[0] === ' '\n let moreIndented\n\n // rest of the lines\n let match\n while ((match = lineRe.exec(string))) {\n const prefix = match[1]\n const line = match[2]\n\n moreIndented = (line[0] === ' ')\n result += prefix +\n ((!prevMoreIndented && !moreIndented && line !== '') ? '\\n' : '') +\n foldLine(line, width)\n prevMoreIndented = moreIndented\n }\n\n return result\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine (line, width) {\n if (line === '' || line[0] === ' ') return line\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n const breakRe = / [^ ]/g // note: the match index will always be <= length-2.\n let match\n // start is an inclusive index. end, curr, and next are exclusive.\n let start = 0\n let end\n let curr = 0\n let next = 0\n let result = ''\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next // derive end <= length-2\n result += '\\n' + line.slice(start, end)\n // skip the space that was output as \\n\n start = end + 1 // derive start <= length-1\n }\n curr = next\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n'\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1)\n } else {\n result += line.slice(start)\n }\n\n return result.slice(1) // drop extra \\n joiner\n}\n\n// Escapes a double-quoted string.\nfunction escapeString (string) {\n let result = ''\n let char = 0\n\n for (let i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i)\n const escapeSeq = ESCAPE_SEQUENCES[char]\n\n if (!escapeSeq && isPrintable(char)) {\n result += string[i]\n if (char >= 0x10000) result += string[i + 1]\n } else {\n result += escapeSeq || encodeHex(char)\n }\n }\n\n return result\n}\n\nfunction writeFlowSequence (state, level, object) {\n let _result = ''\n const _tag = state.tag\n\n for (let index = 0, length = object.length; index < length; index += 1) {\n let value = object[index]\n\n if (state.replacer) {\n value = state.replacer.call(object, String(index), value)\n }\n\n // Write only valid elements, put null instead of invalid elements.\n if (writeNode(state, level, value, false, false) ||\n (typeof value === 'undefined' &&\n writeNode(state, level, null, false, false))) {\n if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '')\n _result += state.dump\n }\n }\n\n state.tag = _tag\n state.dump = '[' + _result + ']'\n}\n\nfunction writeBlockSequence (state, level, object, compact) {\n let _result = ''\n const _tag = state.tag\n\n for (let index = 0, length = object.length; index < length; index += 1) {\n let value = object[index]\n\n if (state.replacer) {\n value = state.replacer.call(object, String(index), value)\n }\n\n // Write only valid elements, put null instead of invalid elements.\n if (writeNode(state, level + 1, value, true, true, false, true) ||\n (typeof value === 'undefined' &&\n writeNode(state, level + 1, null, true, true, false, true))) {\n if (!compact || _result !== '') {\n _result += generateNextLine(state, level)\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n _result += '-'\n } else {\n _result += '- '\n }\n\n _result += state.dump\n }\n }\n\n state.tag = _tag\n state.dump = _result || '[]' // Empty sequence if no valid values.\n}\n\nfunction writeFlowMapping (state, level, object) {\n let _result = ''\n const _tag = state.tag\n const objectKeyList = Object.keys(object)\n\n for (let index = 0, length = objectKeyList.length; index < length; index += 1) {\n let pairBuffer = ''\n if (_result !== '') pairBuffer += ', '\n\n if (state.condenseFlow) pairBuffer += '\"'\n\n const objectKey = objectKeyList[index]\n let objectValue = object[objectKey]\n\n if (state.replacer) {\n objectValue = state.replacer.call(object, objectKey, objectValue)\n }\n\n if (!writeNode(state, level, objectKey, false, false)) {\n continue // Skip this pair because of invalid key;\n }\n\n if (state.dump.length > 1024) pairBuffer += '? '\n\n pairBuffer += state.dump + (state.condenseFlow ? '\"' : '') + ':' + (state.condenseFlow ? '' : ' ')\n\n if (!writeNode(state, level, objectValue, false, false)) {\n continue // Skip this pair because of invalid value.\n }\n\n pairBuffer += state.dump\n\n // Both key and value are valid.\n _result += pairBuffer\n }\n\n state.tag = _tag\n state.dump = '{' + _result + '}'\n}\n\nfunction writeBlockMapping (state, level, object, compact) {\n let _result = ''\n const _tag = state.tag\n const objectKeyList = Object.keys(object)\n\n // Allow sorting keys so that the output file is deterministic\n if (state.sortKeys === true) {\n // Default sorting\n objectKeyList.sort()\n } else if (typeof state.sortKeys === 'function') {\n // Custom sort function\n objectKeyList.sort(state.sortKeys)\n } else if (state.sortKeys) {\n // Something is wrong\n throw new YAMLException('sortKeys must be a boolean or a function')\n }\n\n for (let index = 0, length = objectKeyList.length; index < length; index += 1) {\n let pairBuffer = ''\n\n if (!compact || _result !== '') {\n pairBuffer += generateNextLine(state, level)\n }\n\n const objectKey = objectKeyList[index]\n let objectValue = object[objectKey]\n\n if (state.replacer) {\n objectValue = state.replacer.call(object, objectKey, objectValue)\n }\n\n if (!writeNode(state, level + 1, objectKey, true, true, true)) {\n continue // Skip this pair because of invalid key.\n }\n\n const explicitPair = (state.tag !== null && state.tag !== '?') ||\n (state.dump && state.dump.length > 1024)\n\n if (explicitPair) {\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += '?'\n } else {\n pairBuffer += '? '\n }\n }\n\n pairBuffer += state.dump\n\n if (explicitPair) {\n pairBuffer += generateNextLine(state, level)\n }\n\n if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {\n continue // Skip this pair because of invalid value.\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += ':'\n } else {\n pairBuffer += ': '\n }\n\n pairBuffer += state.dump\n\n // Both key and value are valid.\n _result += pairBuffer\n }\n\n state.tag = _tag\n state.dump = _result || '{}' // Empty mapping if no valid pairs.\n}\n\nfunction detectType (state, object, explicit) {\n const typeList = explicit ? state.explicitTypes : state.implicitTypes\n\n for (let index = 0, length = typeList.length; index < length; index += 1) {\n const type = typeList[index]\n\n if ((type.instanceOf || type.predicate) &&\n (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&\n (!type.predicate || type.predicate(object))) {\n if (explicit) {\n if (type.multi && type.representName) {\n state.tag = type.representName(object)\n } else {\n state.tag = type.tag\n }\n } else {\n state.tag = '?'\n }\n\n if (type.represent) {\n const style = state.styleMap[type.tag] || type.defaultStyle\n\n let _result\n if (_toString.call(type.represent) === '[object Function]') {\n _result = type.represent(object, style)\n } else if (_hasOwnProperty.call(type.represent, style)) {\n _result = type.represent[style](object, style)\n } else {\n throw new YAMLException('!<' + type.tag + '> tag resolver accepts not \"' + style + '\" style')\n }\n\n state.dump = _result\n }\n\n return true\n }\n }\n\n return false\n}\n\n// Serializes `object` and writes it to global `result`.\n// Returns true on success, or false on invalid object.\n//\nfunction writeNode (state, level, object, block, compact, iskey, isblockseq) {\n state.tag = null\n state.dump = object\n\n if (!detectType(state, object, false)) {\n detectType(state, object, true)\n }\n\n const type = _toString.call(state.dump)\n const inblock = block\n\n if (block) {\n block = (state.flowLevel < 0 || state.flowLevel > level)\n }\n\n const objectOrArray = type === '[object Object]' || type === '[object Array]'\n let duplicateIndex\n let duplicate\n\n if (objectOrArray) {\n duplicateIndex = state.duplicates.indexOf(object)\n duplicate = duplicateIndex !== -1\n }\n\n if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {\n compact = false\n }\n\n if (duplicate && state.usedDuplicates[duplicateIndex]) {\n state.dump = '*ref_' + duplicateIndex\n } else {\n if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {\n state.usedDuplicates[duplicateIndex] = true\n }\n if (type === '[object Object]') {\n if (block && (Object.keys(state.dump).length !== 0)) {\n writeBlockMapping(state, level, state.dump, compact)\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump\n }\n } else {\n writeFlowMapping(state, level, state.dump)\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump\n }\n }\n } else if (type === '[object Array]') {\n if (block && (state.dump.length !== 0)) {\n if (state.noArrayIndent && !isblockseq && level > 0) {\n writeBlockSequence(state, level - 1, state.dump, compact)\n } else {\n writeBlockSequence(state, level, state.dump, compact)\n }\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump\n }\n } else {\n writeFlowSequence(state, level, state.dump)\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump\n }\n }\n } else if (type === '[object String]') {\n if (state.tag !== '?') {\n writeScalar(state, state.dump, level, iskey, inblock)\n }\n } else if (type === '[object Undefined]') {\n return false\n } else {\n if (state.skipInvalid) return false\n throw new YAMLException('unacceptable kind of an object to dump ' + type)\n }\n\n if (state.tag !== null && state.tag !== '?') {\n // Need to encode all characters except those allowed by the spec:\n //\n // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */\n // [36] ns-hex-digit ::= ns-dec-digit\n // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */\n // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */\n // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-”\n // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#”\n // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,”\n // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]”\n //\n // Also need to encode '!' because it has special meaning (end of tag prefix).\n //\n let tagStr = encodeURI(\n state.tag[0] === '!' ? state.tag.slice(1) : state.tag\n ).replace(/!/g, '%21')\n\n if (state.tag[0] === '!') {\n tagStr = '!' + tagStr\n } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {\n tagStr = '!!' + tagStr.slice(18)\n } else {\n tagStr = '!<' + tagStr + '>'\n }\n\n state.dump = tagStr + ' ' + state.dump\n }\n }\n\n return true\n}\n\nfunction getDuplicateReferences (object, state) {\n const objects = []\n const duplicatesIndexes = []\n\n inspectNode(object, objects, duplicatesIndexes)\n\n const length = duplicatesIndexes.length\n for (let index = 0; index < length; index += 1) {\n state.duplicates.push(objects[duplicatesIndexes[index]])\n }\n state.usedDuplicates = new Array(length)\n}\n\nfunction inspectNode (object, objects, duplicatesIndexes) {\n if (object !== null && typeof object === 'object') {\n const index = objects.indexOf(object)\n if (index !== -1) {\n if (duplicatesIndexes.indexOf(index) === -1) {\n duplicatesIndexes.push(index)\n }\n } else {\n objects.push(object)\n\n if (Array.isArray(object)) {\n for (let i = 0, length = object.length; i < length; i += 1) {\n inspectNode(object[i], objects, duplicatesIndexes)\n }\n } else {\n const objectKeyList = Object.keys(object)\n\n for (let i = 0, length = objectKeyList.length; i < length; i += 1) {\n inspectNode(object[objectKeyList[i]], objects, duplicatesIndexes)\n }\n }\n }\n }\n}\n\nfunction dump (input, options) {\n options = options || {}\n\n const state = new State(options)\n\n if (!state.noRefs) getDuplicateReferences(input, state)\n\n let value = input\n\n if (state.replacer) {\n value = state.replacer.call({ '': value }, '', value)\n }\n\n if (writeNode(state, 0, value, true, true)) return state.dump + '\\n'\n\n return ''\n}\n\nmodule.exports.dump = dump\n", "'use strict'\n\nconst loader = require('./lib/loader')\nconst dumper = require('./lib/dumper')\n\nfunction renamed (from, to) {\n return function () {\n throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +\n 'Use yaml.' + to + ' instead, which is now safe by default.')\n }\n}\n\nmodule.exports.Type = require('./lib/type')\nmodule.exports.Schema = require('./lib/schema')\nmodule.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe')\nmodule.exports.JSON_SCHEMA = require('./lib/schema/json')\nmodule.exports.CORE_SCHEMA = require('./lib/schema/core')\nmodule.exports.DEFAULT_SCHEMA = require('./lib/schema/default')\nmodule.exports.load = loader.load\nmodule.exports.loadAll = loader.loadAll\nmodule.exports.dump = dumper.dump\nmodule.exports.YAMLException = require('./lib/exception')\n\n// Re-export all types in case user wants to create custom schema\nmodule.exports.types = {\n binary: require('./lib/type/binary'),\n float: require('./lib/type/float'),\n map: require('./lib/type/map'),\n null: require('./lib/type/null'),\n pairs: require('./lib/type/pairs'),\n set: require('./lib/type/set'),\n timestamp: require('./lib/type/timestamp'),\n bool: require('./lib/type/bool'),\n int: require('./lib/type/int'),\n merge: require('./lib/type/merge'),\n omap: require('./lib/type/omap'),\n seq: require('./lib/type/seq'),\n str: require('./lib/type/str')\n}\n\n// Removed functions from JS-YAML 3.0.x\nmodule.exports.safeLoad = renamed('safeLoad', 'load')\nmodule.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll')\nmodule.exports.safeDump = renamed('safeDump', 'dump')\n", "import yaml from '../index.js'\n\nconst {\n Type,\n Schema,\n FAILSAFE_SCHEMA,\n JSON_SCHEMA,\n CORE_SCHEMA,\n DEFAULT_SCHEMA,\n load,\n loadAll,\n dump,\n YAMLException,\n types,\n safeLoad,\n safeLoadAll,\n safeDump\n} = yaml\n\nexport {\n Type,\n Schema,\n FAILSAFE_SCHEMA,\n JSON_SCHEMA,\n CORE_SCHEMA,\n DEFAULT_SCHEMA,\n load,\n loadAll,\n dump,\n YAMLException,\n types,\n safeLoad,\n safeLoadAll,\n safeDump\n}\n\nexport default yaml\n", "import { createRequire } from \"node:module\";\nimport { Context, Inject, Service, composeError } from \"@deepseek-ai/cordis\";\nimport { deepEqual, defineProperty, isNonNullable, isNullable, valueMap } from \"@deepseek-ai/cosmokit\";\n//#region lib/types/internal.js\n/** Helpers for locating the current Node internal module loader. */\nvar ModuleLoader;\n(function(ModuleLoader) {\n\tlet _cachedLoader;\n\tfunction requireInternal(id) {\n\t\tconst require = createRequire(import.meta.url);\n\t\tif (process.execArgv.includes(\"--expose-internals\")) try {\n\t\t\treturn require(id);\n\t\t} catch {}\n\t\ttry {\n\t\t\treturn require(\"node-addon-require-builtin\").requireBuiltin(id);\n\t\t} catch {}\n\t}\n\tfunction fromInternal() {\n\t\tif (_cachedLoader) return _cachedLoader;\n\t\tconst [major] = process.versions.node.split(\".\").map(Number);\n\t\tif (major >= 24) {\n\t\t\tconst raw = requireInternal(\"internal/modules/esm/loader\")?.getOrInitializeCascadedLoader();\n\t\t\tif (raw) return _cachedLoader = Object.assign(raw, { version: \"v2\" });\n\t\t} else if (major >= 22) {\n\t\t\tconst raw = requireInternal(\"internal/modules/esm/loader\")?.getOrInitializeCascadedLoader();\n\t\t\tif (raw) return _cachedLoader = Object.assign(raw, { version: \"v1\" });\n\t\t}\n\t}\n\tModuleLoader.fromInternal = fromInternal;\n})(ModuleLoader || (ModuleLoader = {}));\n//#endregion\n//#region lib/types/config/group.js\n/** Runtime owner for a list of child loader entries. */\nvar EntryGroup = class {\n\tctx;\n\ttree;\n\tstatic key = Symbol.for(\"cordis.group\");\n\tdata = [];\n\tconstructor(ctx, tree) {\n\t\tthis.ctx = ctx;\n\t\tthis.tree = tree;\n\t\tconst entry = ctx.fiber.entry;\n\t\tif (entry) entry.subgroup = this;\n\t}\n\tget context() {\n\t\treturn this.ctx;\n\t}\n\tasync create(options) {\n\t\tconst id = this.tree.ensureId(options);\n\t\tconst existing = this.tree.store[id];\n\t\tconst entry = existing ?? (this.tree.store[id] = new Entry(this.ctx.loader));\n\t\tconst previousParent = entry.parent;\n\t\tentry.parent = this;\n\t\ttry {\n\t\t\tawait entry.update(options, true, true);\n\t\t} catch (error) {\n\t\t\tif (existing) entry.parent = previousParent;\n\t\t\telse delete this.tree.store[id];\n\t\t\tthrow error;\n\t\t}\n\t\treturn entry.id;\n\t}\n\tunlink(options) {\n\t\tconst config = this.data;\n\t\tconst index = config.indexOf(options);\n\t\tif (index >= 0) config.splice(index, 1);\n\t}\n\tasync remove(id, isDispose = false) {\n\t\tconst entry = this.tree.store[id];\n\t\tif (!entry) return;\n\t\tawait entry._dispose();\n\t\tif (!isDispose) this.unlink(entry.options);\n\t\tdelete this.tree.store[id];\n\t\tthis.context.emit(\"loader/partial-dispose\", entry, entry.options, false);\n\t}\n\tasync update(config) {\n\t\tconst oldConfig = this.data;\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tfor (const options of config) {\n\t\t\tconst id = this.tree.ensureId(options);\n\t\t\tif (seen.has(id)) throw new TypeError(`duplicate loader entry id: ${id}`);\n\t\t\tseen.add(id);\n\t\t}\n\t\tconst oldMap = Object.fromEntries(oldConfig.map((options) => [options.id, options]));\n\t\tconst newMap = Object.fromEntries(config.map((options) => [options.id, options]));\n\t\ttry {\n\t\t\tconst outcomes = await Promise.allSettled(config.map((options) => this.create(options)));\n\t\t\tif (this.ctx.fiber.uid === null) return;\n\t\t\tconst failures = outcomes.filter((outcome) => outcome.status === \"rejected\").map((outcome) => outcome.reason);\n\t\t\tif (failures.length === 1) throw failures[0];\n\t\t\tif (failures.length > 1) throw new AggregateError(failures, \"loader entries failed to apply\");\n\t\t\tfor (const id of Object.keys(oldMap)) if (!newMap[id]) await this.remove(id, true);\n\t\t\tthis.data = config;\n\t\t} catch (error) {\n\t\t\tconst rollbackErrors = [];\n\t\t\tfor (const id of Object.keys(newMap).reverse()) {\n\t\t\t\tif (oldMap[id]) continue;\n\t\t\t\ttry {\n\t\t\t\t\tawait this.remove(id, true);\n\t\t\t\t} catch (rollbackError) {\n\t\t\t\t\trollbackErrors.push(rollbackError);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const options of oldConfig) try {\n\t\t\t\tawait this.create(options);\n\t\t\t} catch (rollbackError) {\n\t\t\t\trollbackErrors.push(rollbackError);\n\t\t\t}\n\t\t\tthis.data = oldConfig;\n\t\t\tif (rollbackErrors.length) throw new AggregateError([error, ...rollbackErrors], \"loader entry rollback failed\");\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync stop() {\n\t\tfor (const options of this.data) await this.remove(options.id, true);\n\t}\n};\n/** Plugin that mounts a nested loader entry group. */\nvar Group = class extends EntryGroup {\n\tctx;\n\tconfig;\n\tstatic initial = [];\n\tstatic [EntryGroup.key] = true;\n\tconstructor(ctx, config) {\n\t\tsuper(ctx, ctx.fiber.entry.parent.tree);\n\t\tthis.ctx = ctx;\n\t\tthis.config = config;\n\t\tctx.on(\"internal/update\", (config) => this.update(config));\n\t}\n\tasync *[Service.init]() {\n\t\tyield () => this.stop();\n\t\tawait this.update(this.config);\n\t}\n};\n//#endregion\n//#region lib/types/config/tree.js\nvar __rewriteRelativeImportExtension = function(path, preserveJsx) {\n\tif (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {\n\t\treturn tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : d + ext + \".\" + cm.toLowerCase() + \"js\";\n\t});\n\treturn path;\n};\n/** Mutable tree of loader entries. Persistence is supplied by subclasses. */\nvar EntryTree = class EntryTree {\n\tstatic sep = \":\";\n\tctx;\n\tenableLogs;\n\troot;\n\tstore = Object.create(null);\n\tconstructor(ctx) {\n\t\tthis.ctx = ctx.extend({ baseUrl: ctx.baseUrl });\n\t\tthis.root = new EntryGroup(this.ctx, this);\n\t\tconst entry = this.ctx.fiber.entry;\n\t\tif (entry) entry.subtree = this;\n\t}\n\tget context() {\n\t\treturn this.ctx;\n\t}\n\t/** Iterate entries in this tree and any nested subtrees. */\n\t*entries() {\n\t\tfor (const entry of Object.values(this.store)) {\n\t\t\tyield entry;\n\t\t\tif (!entry.subtree) continue;\n\t\t\tyield* entry.subtree.entries();\n\t\t}\n\t}\n\t/** Return pending import and lifecycle tasks owned by this tree. */\n\tgetTasks() {\n\t\treturn [...this.entries()].map((entry) => entry._initTask || entry.fiber?.inertia).filter(isNonNullable);\n\t}\n\t/**\n\t* Wait until this tree has no active import or lifecycle tasks.\n\t* @throws a settled fiber failure, or an aggregate when several fibers failed.\n\t*/\n\tasync await() {\n\t\twhile (true) {\n\t\t\tconst tasks = this.getTasks();\n\t\t\tif (tasks.length) {\n\t\t\t\tawait Promise.allSettled(tasks);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst failures = (await Promise.allSettled([...this.entries()].map((entry) => entry._await()))).filter((outcome) => outcome.status === \"rejected\").map((outcome) => outcome.reason);\n\t\t\tif (failures.length === 1) throw failures[0];\n\t\t\tif (failures.length > 1) throw new AggregateError(failures, \"loader fibers failed\");\n\t\t\tthis.ctx.reflect.notify([\"loader\"]);\n\t\t\tif (!this.getTasks().length) return;\n\t\t}\n\t}\n\tensureId(options) {\n\t\tif (!options.id) do\n\t\t\toptions.id = Math.random().toString(16).slice(2, 10);\n\t\twhile (this.store[options.id]);\n\t\treturn options.id;\n\t}\n\t/** Resolve an entry by id, including nested ids separated by `EntryTree.sep`. */\n\tresolve(id) {\n\t\tconst parts = id.split(EntryTree.sep);\n\t\tlet tree = this;\n\t\tconst final = parts.pop();\n\t\tfor (const part of parts) {\n\t\t\ttree = tree.store[part]?.subtree;\n\t\t\tif (!tree) throw new Error(`cannot resolve entry ${id}`);\n\t\t}\n\t\tconst entry = tree.store[final];\n\t\tif (!entry) throw new Error(`cannot resolve entry ${id}`);\n\t\treturn entry;\n\t}\n\tresolveGroup(id) {\n\t\tif (!id) return this.root;\n\t\tconst entry = this.resolve(id);\n\t\tif (!entry.subgroup) throw new Error(`entry ${id} is not a group`);\n\t\treturn entry.subgroup;\n\t}\n\t/** Create an entry in the root group or a nested group. */\n\tasync create(options, parent = null, position = Infinity) {\n\t\tconst group = this.resolveGroup(parent);\n\t\tconst id = await group.create(options);\n\t\tconst entry = this.resolve(id);\n\t\tgroup.data.splice(position, 0, entry.options);\n\t\tgroup.tree.write();\n\t\treturn id;\n\t}\n\t/** Stop and remove an entry from its parent group. */\n\tasync remove(id) {\n\t\tconst entry = this.resolve(id);\n\t\tawait entry.parent.remove(id);\n\t\tentry.parent.tree.write();\n\t}\n\t/** Update an entry and optionally move it to another group. */\n\tasync update(id, options, parent, position) {\n\t\tconst entry = this.resolve(id);\n\t\tconst source = entry.parent;\n\t\tconst sourceIndex = source.data.indexOf(entry.options);\n\t\tlet target = source;\n\t\tif (parent !== void 0) {\n\t\t\ttarget = this.resolveGroup(parent);\n\t\t\tsource.unlink(entry.options);\n\t\t\ttarget.data.splice(position ?? Infinity, 0, entry.options);\n\t\t\tentry.parent = target;\n\t\t}\n\t\ttry {\n\t\t\tawait entry.update(options, false, true);\n\t\t} catch (error) {\n\t\t\tif (parent !== void 0) {\n\t\t\t\ttarget.unlink(entry.options);\n\t\t\t\tsource.data.splice(sourceIndex < 0 ? source.data.length : sourceIndex, 0, entry.options);\n\t\t\t\tentry.parent = source;\n\t\t\t\ttry {\n\t\t\t\t\tawait entry.update({}, false, true);\n\t\t\t\t} catch (rollbackError) {\n\t\t\t\t\tthrow new AggregateError([error, rollbackError], `failed to roll back loader entry move ${id}`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tsource.tree.write();\n\t\tif (target !== source) target.tree.write();\n\t}\n\t/** Import a plugin module from a specifier or `cordis:` builtin. */\n\timport(name, getOuterStack) {\n\t\tif (name.startsWith(\"cordis:\")) return this.ctx.loader.builtins[name.slice(7)];\n\t\treturn composeError(async (info) => {\n\t\t\tinfo.offset += 3;\n\t\t\tif (this.ctx.loader.internal) return await this.ctx.loader.internal.import(name, this.ctx.baseUrl, {});\n\t\t\telse if (name.startsWith(\".\")) return await import(__rewriteRelativeImportExtension(\n\t\t\t\t/* @vite-ignore */\n\t\t\t\tnew URL(name, this.ctx.baseUrl).href\n\t\t\t));\n\t\t\telse return await import(__rewriteRelativeImportExtension(\n\t\t\t\t/* @vite-ignore */\n\t\t\t\tname\n\t\t\t));\n\t\t}, getOuterStack);\n\t}\n};\n//#endregion\n//#region lib/types/config/utils.js\n/** Evaluate a JavaScript expression against a loader context scope. */\nconst evaluate = new Function(\"ctx\", \"expr\", `\n with (ctx) {\n return eval(expr)\n }\n`);\n/** Recursively replace YAML `!js` expression nodes with evaluated values. */\nfunction interpolate(ctx, value) {\n\tif (isJsExpr(value)) return evaluate(ctx, value.__jsExpr);\n\telse if (!value || typeof value !== \"object\") return value;\n\telse if (Array.isArray(value)) return value.map((item) => interpolate(ctx, item));\n\telse return valueMap(value, (item) => interpolate(ctx, item));\n}\n/** Return true when a value is a serialized loader JavaScript expression. */\nfunction isJsExpr(value) {\n\treturn value instanceof Object && \"__jsExpr\" in value;\n}\n//#endregion\n//#region lib/types/config/entry.js\nfunction updateError(stage, options, cause) {\n\tconst detail = cause instanceof Error ? cause.message : String(cause);\n\treturn new Error(`failed to ${stage} loader entry ${options.id} (${options.name}): ${detail}`, { cause });\n}\nfunction takeEntries(object, keys) {\n\tconst result = [];\n\tfor (const key of keys) {\n\t\tif (!(key in object)) continue;\n\t\tresult.push([key, object[key]]);\n\t\tdelete object[key];\n\t}\n\treturn result;\n}\nfunction sortKeys(object, prepend = [\"id\", \"name\"], append = [\"config\"]) {\n\tconst part1 = takeEntries(object, prepend);\n\tconst part2 = takeEntries(object, append);\n\tconst rest = takeEntries(object, Object.keys(object)).sort(([a], [b]) => a.localeCompare(b));\n\treturn Object.assign(object, Object.fromEntries([\n\t\t...part1,\n\t\t...rest,\n\t\t...part2\n\t]));\n}\nfunction replaceKeys(target, source) {\n\tfor (const key of Object.keys(target)) Reflect.deleteProperty(target, key);\n\treturn Object.assign(target, source);\n}\n/** One configured plugin node inside an `EntryTree`. */\nvar Entry = class Entry {\n\tloader;\n\tstatic key = Symbol.for(\"cordis.entry\");\n\tctx;\n\tfiber;\n\tparent;\n\toptions = {};\n\tsubgroup;\n\tsubtree;\n\t_initTask;\n\t_disposing = 0;\n\tconstructor(loader) {\n\t\tthis.loader = loader;\n\t\tthis.ctx = loader.ctx.extend({ [Entry.key]: this });\n\t\tthis.context.emit(\"loader/entry-init\", this);\n\t}\n\tget context() {\n\t\treturn this.ctx;\n\t}\n\tget id() {\n\t\tlet id = this.options.id;\n\t\tif (this.parent.tree.ctx.fiber.entry) id = this.parent.tree.ctx.fiber.entry.id + EntryTree.sep + id;\n\t\treturn id;\n\t}\n\t/** True when this entry or any owning parent entry is disabled. */\n\tget disabled() {\n\t\treturn this._disabled(this.options);\n\t}\n\t_disabled(options) {\n\t\tif (options.group) return false;\n\t\tif (this.disabledOf(options)) return true;\n\t\tlet entry = this.parent.ctx.fiber.entry;\n\t\twhile (entry) {\n\t\t\tif (this.disabledOf(entry.options)) return true;\n\t\t\tentry = entry.parent.ctx.fiber.entry;\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t* Effective disabled state: a `!!js` expression evaluates against the loader\n\t* context. The raw node stays in the options, so write-back keeps the form.\n\t*/\n\tdisabledOf(options) {\n\t\treturn isJsExpr(options.disabled) ? Boolean(this.evaluate(options.disabled.__jsExpr)) : Boolean(options.disabled);\n\t}\n\tevaluate(expr) {\n\t\treturn evaluate(this.ctx, expr);\n\t}\n\tasync _patchContext(diff) {\n\t\tawait this.context.waterfall(\"loader/patch-context\", this, async () => {\n\t\t\tObject.setPrototypeOf(this.ctx, this.parent.ctx);\n\t\t\tif (this.fiber?.uid && (diff.includes(\"config\") || this.options.group)) await this.fiber.update(this.options.config, true);\n\t\t});\n\t}\n\tasync refresh() {\n\t\tif (this.fiber) return;\n\t\tif (this.disabled) return;\n\t\tawait this.init();\n\t}\n\tasync _dispose(fiber = this.fiber) {\n\t\tif (!fiber) return;\n\t\tif (this.fiber === fiber) this.fiber = void 0;\n\t\tthis._disposing += 1;\n\t\ttry {\n\t\t\tawait fiber.dispose();\n\t\t} finally {\n\t\t\tthis._disposing -= 1;\n\t\t}\n\t}\n\t/** Merge new options, restart as needed, and persist through the parent tree. */\n\tasync update(options, create = false, force = false) {\n\t\tconst previousOptions = this.options;\n\t\tconst legacy = { ...previousOptions };\n\t\tconst candidate = create ? options : { ...previousOptions };\n\t\tif (!create) for (const [key, value] of Object.entries(options)) if (isNullable(value)) delete candidate[key];\n\t\telse candidate[key] = value;\n\t\tsortKeys(candidate);\n\t\tconst diff = Object.keys({\n\t\t\t...candidate,\n\t\t\t...legacy\n\t\t}).filter((key) => !deepEqual(candidate[key], legacy[key]));\n\t\tif (!diff.length && !force) return;\n\t\tconst commit = () => {\n\t\t\tif (create) return;\n\t\t\tthis.options = replaceKeys(previousOptions, candidate);\n\t\t};\n\t\tconst previous = this.fiber;\n\t\tif (!previous?.uid) {\n\t\t\tthis.fiber = void 0;\n\t\t\tthis.options = candidate;\n\t\t\ttry {\n\t\t\t\tif (!this._disabled(candidate)) await this.init();\n\t\t\t} catch (error) {\n\t\t\t\tthis.options = previousOptions;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tcommit();\n\t\t\treturn;\n\t\t}\n\t\tif (this._disabled(candidate)) {\n\t\t\tthis.options = candidate;\n\t\t\ttry {\n\t\t\t\tawait this._dispose(previous);\n\t\t\t} catch (error) {\n\t\t\t\tthis.options = previousOptions;\n\t\t\t\tthrow updateError(\"dispose\", candidate, error);\n\t\t\t}\n\t\t\tcommit();\n\t\t\tthis.context.emit(\"loader/partial-dispose\", this, legacy, true);\n\t\t\treturn;\n\t\t}\n\t\tif (!diff.some((key) => key === \"name\" || key === \"inject\" || key === \"group\")) {\n\t\t\tthis.options = candidate;\n\t\t\ttry {\n\t\t\t\tawait this._patchContext(diff);\n\t\t\t} catch (error) {\n\t\t\t\tthis.options = previousOptions;\n\t\t\t\ttry {\n\t\t\t\t\tawait this._patchContext(diff);\n\t\t\t\t} catch (rollbackError) {\n\t\t\t\t\tthrow updateError(\"rollback\", legacy, new AggregateError([error, rollbackError]));\n\t\t\t\t}\n\t\t\t\tthis.context.emit(\"loader/partial-dispose\", this, candidate, true);\n\t\t\t\tthrow updateError(\"apply\", candidate, error);\n\t\t\t}\n\t\t\tcommit();\n\t\t\tthis.context.emit(\"loader/partial-dispose\", this, legacy, true);\n\t\t\treturn;\n\t\t}\n\t\tlet plugin;\n\t\ttry {\n\t\t\tplugin = diff.includes(\"name\") ? this.loader.unwrapExports(await this.parent.tree.import(candidate.name, this.getOuterStack)) : previous.runtime.callback;\n\t\t} catch (error) {\n\t\t\tthrow updateError(\"import\", candidate, error);\n\t\t}\n\t\tconst previousPlugin = previous.runtime.callback;\n\t\tthis.options = candidate;\n\t\ttry {\n\t\t\tawait this._dispose(previous);\n\t\t} catch (error) {\n\t\t\tthis.options = previousOptions;\n\t\t\tthrow updateError(\"dispose\", candidate, error);\n\t\t}\n\t\ttry {\n\t\t\tawait this._start(plugin);\n\t\t} catch (error) {\n\t\t\tthis.options = previousOptions;\n\t\t\ttry {\n\t\t\t\tawait this._start(previousPlugin);\n\t\t\t} catch (rollbackError) {\n\t\t\t\tthrow updateError(\"rollback\", legacy, new AggregateError([error, rollbackError]));\n\t\t\t}\n\t\t\tthis.context.emit(\"loader/partial-dispose\", this, candidate, true);\n\t\t\tthrow updateError(\"apply\", candidate, error);\n\t\t}\n\t\tcommit();\n\t\tthis.context.emit(\"loader/partial-dispose\", this, legacy, true);\n\t}\n\tgetOuterStack = () => {\n\t\tlet entry = this;\n\t\tconst result = [];\n\t\tdo {\n\t\t\tresult.push(` at ${entry.parent.tree.ctx.baseUrl}#${entry.options.id}`);\n\t\t\tentry = entry.parent.ctx.fiber.entry;\n\t\t} while (entry);\n\t\treturn result;\n\t};\n\t/** Import and start the configured plugin if it is not already running. */\n\tasync init() {\n\t\ttry {\n\t\t\tawait (this._initTask ??= this._init());\n\t\t} finally {\n\t\t\tthis._initTask = void 0;\n\t\t\tif (!this.loader.getTasks().length) this.ctx.reflect.notify([\"loader\"]);\n\t\t}\n\t\tawait this._await();\n\t}\n\tasync _await() {\n\t\ttry {\n\t\t\tawait this.fiber?.await();\n\t\t} catch (error) {\n\t\t\tthrow updateError(\"apply\", this.options, error);\n\t\t}\n\t}\n\tasync _init() {\n\t\tlet plugin;\n\t\ttry {\n\t\t\tplugin = this.loader.unwrapExports(await this.parent.tree.import(this.options.name, this.getOuterStack));\n\t\t} catch (error) {\n\t\t\tthrow updateError(\"import\", this.options, error);\n\t\t}\n\t\ttry {\n\t\t\tawait this._start(plugin);\n\t\t} catch (error) {\n\t\t\tthrow updateError(\"apply\", this.options, error);\n\t\t}\n\t}\n\tasync _start(plugin) {\n\t\tlet fiber;\n\t\ttry {\n\t\t\tawait this._patchContext([]);\n\t\t\tthis.loader.showLog(this, \"apply\");\n\t\t\tfiber = this.fiber = this.ctx.registry.plugin(plugin, this.options.config, this.getOuterStack);\n\t\t\tawait fiber.await();\n\t\t} catch (error) {\n\t\t\tawait this._dispose(fiber);\n\t\t\tthrow error;\n\t\t}\n\t}\n};\n//#endregion\n//#region lib/types/config/isolate.js\nfunction swap(target, source) {\n\tfor (const key of Reflect.ownKeys(target)) Reflect.deleteProperty(target, key);\n\tfor (const key of Reflect.ownKeys(source || {})) Reflect.defineProperty(target, key, Reflect.getOwnPropertyDescriptor(source, key));\n}\n/** Symbol realm used to isolate service implementations by entry or label. */\nvar Realm = class {\n\tstore = Object.create(null);\n\taccess(key, create = false) {\n\t\tif (create) return this.store[key] ??= Symbol(`${key}${this.suffix}`);\n\t\telse return this.store[key] ?? Symbol(`${key}${this.suffix}`);\n\t}\n\tdelete(key) {\n\t\tdelete this.store[key];\n\t}\n\tget size() {\n\t\treturn Object.keys(this.store).length;\n\t}\n};\n/** Entry-local isolation realm. */\nvar LocalRealm = class extends Realm {\n\tentry;\n\tconstructor(entry) {\n\t\tsuper();\n\t\tthis.entry = entry;\n\t}\n\tget suffix() {\n\t\treturn \"#\" + this.entry.options.id;\n\t}\n};\n/** Named isolation realm shared by entries that use the same label. */\nvar GlobalRealm = class extends Realm {\n\tlabel;\n\tconstructor(label) {\n\t\tsuper();\n\t\tthis.label = label;\n\t}\n\tget suffix() {\n\t\treturn \"@\" + this.label;\n\t}\n};\n/** Install loader hooks that apply `intercept` and `isolate` entry options. */\nfunction isolate(ctx) {\n\tconst realms = Object.create(null);\n\tconst delims = Object.create(null);\n\tfunction access(entry, name, create = false) {\n\t\tlet realm;\n\t\tconst label = entry.options.isolate?.[name];\n\t\tif (!label) return;\n\t\tif (label === true) realm = entry.realm ??= new LocalRealm(entry);\n\t\telse if (create) realm = realms[label] ??= new GlobalRealm(label);\n\t\telse realm = realms[label];\n\t\treturn realm?.access(name, create);\n\t}\n\tctx.on(\"loader/entry-init\", (entry) => {\n\t\tentry.ctx[Context.intercept] = Object.create(entry.ctx[Context.intercept]);\n\t\tentry.ctx[Context.isolate] = Object.create(entry.ctx[Context.isolate]);\n\t});\n\tctx.on(\"loader/patch-context\", async (entry, next) => {\n\t\tconst newMap = Object.create(entry.parent.ctx[Context.isolate]);\n\t\tfor (const name of Object.keys(entry.options.isolate ?? {})) newMap[name] = access(entry, name, true);\n\t\tconst diff = Object.create(null);\n\t\tconst oldMap = entry.ctx[Context.isolate];\n\t\tfor (const name in {\n\t\t\t...newMap,\n\t\t\t...delims\n\t\t}) {\n\t\t\tif (newMap[name] === oldMap[name]) continue;\n\t\t\tconst delim = delims[name] ??= Symbol(`delim:${name}`);\n\t\t\tentry.ctx[delim] = Symbol(`${name}#${entry.id}`);\n\t\t\tfor (const symbol of [oldMap[name], newMap[name]]) {\n\t\t\t\tconst impl = symbol && entry.ctx.reflect.store[symbol];\n\t\t\t\tif (!impl) continue;\n\t\t\t\tif (!impl.fiber) {\n\t\t\t\t\tentry.ctx.logger.warn(/* @__PURE__ */ new Error(`expected service ${name} to be implemented`));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tdiff[name] = [\n\t\t\t\t\toldMap[name],\n\t\t\t\t\tnewMap[name],\n\t\t\t\t\tentry.ctx[delim],\n\t\t\t\t\timpl.fiber.ctx[delim]\n\t\t\t\t];\n\t\t\t\tif (entry.ctx[delim] !== impl.fiber.ctx[delim]) break;\n\t\t\t}\n\t\t}\n\t\tObject.setPrototypeOf(entry.ctx[Context.isolate], entry.parent.ctx[Context.isolate]);\n\t\tObject.setPrototypeOf(entry.ctx[Context.intercept], entry.parent.ctx[Context.intercept]);\n\t\tswap(entry.ctx[Context.isolate], newMap);\n\t\tswap(entry.ctx[Context.intercept], entry.options.intercept);\n\t\tawait next();\n\t\tfor (const [symbol1, symbol2, flag1, flag2] of Object.values(diff)) if (flag1 === flag2 && entry.ctx.reflect.store[symbol1] && !entry.ctx.reflect.store[symbol2]) {\n\t\t\tentry.ctx.reflect.store[symbol2] = entry.ctx.reflect.store[symbol1];\n\t\t\tdelete entry.ctx.reflect.store[symbol1];\n\t\t}\n\t\tctx.reflect.notify(Object.keys(diff), (ctx, name) => {\n\t\t\tconst [symbol1, symbol2, flag1, flag2] = diff[name];\n\t\t\tconst symbol3 = ctx[Context.isolate][name];\n\t\t\tconst flag3 = ctx[delims[name]];\n\t\t\treturn (symbol1 === symbol3 || symbol2 === symbol3) && flag1 === flag3 !== (flag1 === flag2);\n\t\t});\n\t\tfor (const name in delims) if (!Reflect.ownKeys(newMap).includes(name)) delete entry.ctx[delims[name]];\n\t});\n\tctx.on(\"loader/partial-dispose\", (entry, legacy, active) => {\n\t\tfor (const [name, label] of Object.entries(legacy.isolate ?? {})) {\n\t\t\tif (label === true) continue;\n\t\t\tif (active && entry.options.isolate?.[name] === label) continue;\n\t\t\tconst realm = realms[label];\n\t\t\tif (!realm) continue;\n\t\t\tfor (const entry of ctx.loader.entries()) if (entry.options.isolate?.[name] === realm.label) return;\n\t\t\trealm.delete(name);\n\t\t\tif (!realm.size) delete realms[realm.label];\n\t\t}\n\t});\n}\n//#endregion\n//#region lib/types/index.js\n/**\n* Service that owns a loader entry tree and imports configured plugins.\n*\n* Subclasses provide persistence by implementing `write()` on `EntryTree`.\n*/\nvar Loader = class extends EntryTree {\n\tconfig;\n\tenvData = process.env.CORDIS_SHARED ? JSON.parse(process.env.CORDIS_SHARED) : { startTime: Date.now() };\n\tname = \"loader\";\n\tinternal = ModuleLoader.fromInternal();\n\tbuiltins = Object.create(null);\n\tconstructor(ctx, config = {}) {\n\t\tsuper(ctx);\n\t\tthis.config = config;\n\t\tif (config.baseUrl) this.ctx.baseUrl = config.baseUrl;\n\t\tconst self = this;\n\t\tdefineProperty(this, Service.tracker, {\n\t\t\tassociate: \"loader\",\n\t\t\tproperty: \"ctx\",\n\t\t\tnoShadow: true\n\t\t});\n\t\tctx.reflect.provide(\"loader\", this, this[Service.check]);\n\t\tctx.on(\"internal/config\", function(_config, next) {\n\t\t\tconst config = next();\n\t\t\tif (!this.entry || this.parent.fiber?.entry === this.entry) return config;\n\t\t\tif ((this.runtime?.callback)?.[EntryGroup.key]) return config;\n\t\t\treturn interpolate(this.ctx, config);\n\t\t}, { global: true });\n\t\tctx.on(\"internal/update\", async function(config, noSave, next) {\n\t\t\tif (!this.entry || noSave || this.parent.fiber?.entry === this.entry) return next();\n\t\t\tawait next();\n\t\t\tconst unparse = this.runtime?.Config?.[\"simplify\"];\n\t\t\tthis.entry.options.config = unparse ? unparse(config) : config;\n\t\t\tthis.entry.parent.tree.write();\n\t\t}, {\n\t\t\tglobal: true,\n\t\t\tprepend: true\n\t\t});\n\t\tctx.on(\"internal/update\", function(config, _, next) {\n\t\t\tif (!this.entry || this.parent.fiber?.entry === this.entry) return next();\n\t\t\tself.showLog(this.entry, \"reload\");\n\t\t\treturn next();\n\t\t}, { global: true });\n\t\tctx.on(\"internal/plugin\", (fiber) => {\n\t\t\tif (fiber.parent[Entry.key] && !fiber.entry) {\n\t\t\t\tfiber.entry = fiber.parent[Entry.key];\n\t\t\t\tInject.resolve(fiber.entry.options.inject, fiber.inject);\n\t\t\t}\n\t\t\tif (fiber.uid) return;\n\t\t\tif (!fiber.entry) return;\n\t\t\tif (fiber.parent.fiber?.entry === fiber.entry) return;\n\t\t\tif (!ctx.registry.has(fiber.runtime.callback)) return;\n\t\t\tconst treeOwner = fiber.entry.parent.tree.ctx.fiber;\n\t\t\tif (!treeOwner.uid || treeOwner.state === 5) return;\n\t\t\tif (fiber.entry._disposing) return;\n\t\t\tthis.showLog(fiber.entry, \"unload\");\n\t\t\tif (fiber.entry.disabled) return;\n\t\t\tfiber.entry.options.disabled = true;\n\t\t\tfiber.entry.parent.tree.write();\n\t\t});\n\t\tctx.plugin(isolate);\n\t}\n\twrite() {}\n\t[Service.check]() {\n\t\tif (Service.prototype[Service.resolveConfig].call(this).await && this.getTasks().length) return false;\n\t\treturn true;\n\t}\n\tshowLog(entry, type) {\n\t\tif (entry.options.group || !entry.parent.tree.enableLogs) return;\n\t\tthis.ctx.root.logger?.(\"loader\").info(\"%s plugin %C\", type, entry.options.name);\n\t}\n\t/** Return the loader entry id that owns `fiber`, if any. */\n\tlocate(fiber = this.ctx.fiber) {\n\t\twhile (1) {\n\t\t\tif (fiber.entry) return fiber.entry.id;\n\t\t\tconst next = fiber.parent.fiber;\n\t\t\tif (fiber === next) return;\n\t\t\tfiber = next;\n\t\t}\n\t}\n\t/** Hook for hosts that can restart the process on full-reload requests. */\n\texit() {}\n\t/** Normalize ESM/CJS/default export shapes before applying a plugin. */\n\tunwrapExports(exports) {\n\t\tif (isNullable(exports)) return exports;\n\t\texports = exports.default ?? exports;\n\t\tif (!exports.__esModule) return exports;\n\t\treturn exports.default ?? exports;\n\t}\n};\n//#endregion\nexport { Entry, EntryGroup, EntryTree, GlobalRealm, Group, Loader, Loader as default, LocalRealm, ModuleLoader, Realm, evaluate, interpolate, isJsExpr };\n", "import { EntryGroup, EntryTree, isJsExpr } from \"@deepseek-ai/cordis-plugin-loader\";\nimport { Service } from \"@deepseek-ai/cordis\";\nimport { extname } from \"node:path\";\nimport { access, constants, readFile, rename, writeFile } from \"node:fs/promises\";\nimport { setTimeout as setTimeout$1 } from \"node:timers/promises\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport * as yaml from \"js-yaml\";\n//#region lib/types/index.js\nvar __rewriteRelativeImportExtension = function(path, preserveJsx) {\n\tif (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {\n\t\treturn tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : d + ext + \".\" + cm.toLowerCase() + \"js\";\n\t});\n\treturn path;\n};\nconst JsExpr = new yaml.Type(\"tag:yaml.org,2002:js\", {\n\tkind: \"scalar\",\n\tresolve: (data) => typeof data === \"string\",\n\tconstruct: (data) => ({ __jsExpr: data }),\n\tpredicate: isJsExpr,\n\trepresent: (data) => data[\"__jsExpr\"]\n});\n/**\n* The entry-list YAML dialect: `!!js` scalars round-trip as expression nodes\n* the Loader evaluates at entry activation. Exported so config tooling\n* (`dsh --dump-config`) parses and prints exactly the dialect this include\n* mounts.\n*/\nconst entryListSchema = yaml.JSON_SCHEMA.extend(JsExpr);\nconst schema = entryListSchema;\nconst writable = {\n\t\".json\": \"application/json\",\n\t\".yaml\": \"application/yaml\",\n\t\".yml\": \"application/yaml\"\n};\nconst supported = new Set(Object.keys(writable));\nconst WRITE_RETRY_LIMIT = 10;\nconst WRITE_RETRY_DELAY_MS = 50;\nfunction retryableWriteError(error) {\n\tconst code = error?.code;\n\treturn code === \"EACCES\" || code === \"EBUSY\" || code === \"EPERM\";\n}\n/**\n* Apply patch lists to an entry list \u2014 THE patch semantics of this include,\n* shared by mounting (`applyPatches`) and offline config tooling\n* (`dsh --dump-config`) so a dump can never drift from what boots. The input\n* is never mutated and the result is always detached from it (even with no\n* patches): patching or mounting shared entry objects would bake earlier\n* values into the cached parse, so repeated application (config hot-reloads)\n* could never revert a removed or changed patch. Inserted entries are indexed\n* as they are added, so a later patch in the same list can target a row an\n* earlier patch inserted. A patch that matches nothing warns and is skipped.\n* @param data - the parsed entry list (JSON-safe plain data).\n* @param patches - the patch list to apply, in order.\n* @param warn - sink for skipped-patch diagnostics (printf-style, `%C` = code).\n* @returns a detached entry list with every applicable patch applied.\n*/\nfunction applyEntryPatches(data, patches, warn) {\n\tdata = structuredClone(data);\n\tif (!patches?.length) return data;\n\tconst entryMap = /* @__PURE__ */ new Map();\n\tconst buildMap = (entries) => {\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.id) entryMap.set(entry.id, entry);\n\t\t\tif (entry.group && Array.isArray(entry.config)) buildMap(entry.config);\n\t\t}\n\t};\n\tbuildMap(data);\n\tfor (const patch of patches) {\n\t\tconst { id, insert, name, ...overrides } = patch;\n\t\tif (insert) {\n\t\t\tif (id) {\n\t\t\t\tconst target = entryMap.get(id);\n\t\t\t\tif (!target) {\n\t\t\t\t\twarn(\"patch insert: entry %C not found\", id);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!target.group) {\n\t\t\t\t\twarn(\"patch insert: entry %C is not a group\", id);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!Array.isArray(target.config)) target.config = [];\n\t\t\t\ttarget.config.push(...insert);\n\t\t\t} else data.push(...insert);\n\t\t\tbuildMap(insert);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!id) {\n\t\t\twarn(\"patch: id is required for non-insert patches\");\n\t\t\tcontinue;\n\t\t}\n\t\tconst target = entryMap.get(id);\n\t\tif (!target) {\n\t\t\twarn(\"patch: entry %C not found\", id);\n\t\t\tcontinue;\n\t\t}\n\t\tif (name && name !== target.name) {\n\t\t\twarn(\"patch: name mismatch for %C (expected %C, got %C), skipping\", id, target.name, name);\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const [key, value] of Object.entries(overrides)) {\n\t\t\tif (key === \"id\") continue;\n\t\t\ttarget[key] = value;\n\t\t}\n\t}\n\treturn data;\n}\nvar ConfigFileError = class extends Error {\n\tstage;\n\tconstructor(stage, path, cause) {\n\t\tsuper(`failed to ${stage} config file ${path}`, { cause });\n\t\tthis.stage = stage;\n\t\tthis.name = \"ConfigFileError\";\n\t}\n};\n/** Loader entry tree backed by a YAML or JSON file. */\nvar Include = class extends EntryTree {\n\tconfig;\n\tstatic inject = [\"loader\"];\n\tstatic [EntryGroup.key] = true;\n\tfilename;\n\ttype;\n\treadonly;\n\tcontent;\n\tdata;\n\twriteTask;\n\tpendingWrite;\n\twriteQueue = Promise.resolve();\n\tapplyQueue = Promise.resolve();\n\tconstructor(ctx, config) {\n\t\tsuper(ctx);\n\t\tthis.config = config;\n\t\tthis.enableLogs = config.enableLogs ?? ctx.fiber.entry?.parent.tree.enableLogs ?? false;\n\t\tthis.filename = fileURLToPath(new URL(this.config.path, this.ctx.baseUrl));\n\t\tconst ext = extname(this.filename);\n\t\tif (!supported.has(ext)) throw new Error(`extension \"${ext}\" not supported`);\n\t\tthis.type = writable[ext];\n\t\tthis.readonly = !this.type;\n\t\tthis.ctx.baseUrl = new URL(\".\", pathToFileURL(this.filename)).href;\n\t\tctx.on(\"internal/update\", async (config, _, next) => {\n\t\t\tif (config.path !== this.config.path) return next();\n\t\t\tawait this.enqueue(async () => {\n\t\t\t\tconst data = this.applyPatches(this.data, config.patches);\n\t\t\t\tawait this.root.update(data);\n\t\t\t\tthis.config = config;\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t* Serialize one child-tree mutation behind every earlier one. The group's\n\t* transactional `update` is not reentrant: two concurrent applies (the init\n\t* apply racing an HMR-triggered refresh from the watcher's initial scan)\n\t* interleave create and rollback on the same entries and strand the include\n\t* fiber without settling, so every apply path funnels through this queue.\n\t* A predecessor's failure is its own caller's outcome and never gates the\n\t* next task.\n\t*/\n\tenqueue(task) {\n\t\tconst run = this.applyQueue.then(task, task);\n\t\tthis.applyQueue = run.then(() => {}, () => {});\n\t\treturn run;\n\t}\n\tasync checkAccess() {\n\t\tif (!this.type) return;\n\t\ttry {\n\t\t\tawait access(this.filename, constants.W_OK);\n\t\t} catch {\n\t\t\tthis.readonly = true;\n\t\t}\n\t}\n\tasync read(forced = false) {\n\t\tlet content;\n\t\ttry {\n\t\t\tcontent = await readFile(this.filename, \"utf8\");\n\t\t} catch (error) {\n\t\t\tthrow new ConfigFileError(\"read\", this.filename, error);\n\t\t}\n\t\tif (!forced && this.content === content) return;\n\t\tlet data;\n\t\ttry {\n\t\t\tif (this.type === \"application/yaml\") data = yaml.load(content, { schema });\n\t\t\telse if (this.type === \"application/json\") data = JSON.parse(content);\n\t\t\telse {\n\t\t\t\tconst module = await import(__rewriteRelativeImportExtension(\n\t\t\t\t\t/* @vite-ignore */\n\t\t\t\t\tthis.filename\n\t\t\t\t));\n\t\t\t\tdata = module.default || module;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow new ConfigFileError(\"parse\", this.filename, error);\n\t\t}\n\t\tif (!Array.isArray(data)) throw new ConfigFileError(\"validate\", this.filename, /* @__PURE__ */ new TypeError(\"config file must be a top-level array\"));\n\t\treturn {\n\t\t\tcontent,\n\t\t\tdata\n\t\t};\n\t}\n\tapplyPatches(data, patches) {\n\t\treturn applyEntryPatches(data, patches, (message, ...args) => {\n\t\t\tthis.ctx.root.logger?.(\"loader\").warn(message, ...args);\n\t\t});\n\t}\n\tasync *[Service.init]() {\n\t\tlet candidate;\n\t\ttry {\n\t\t\tcandidate = await this.read(true);\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof ConfigFileError) || error.stage !== \"read\" || error.cause?.code !== \"ENOENT\") throw error;\n\t\t\tif (this.config.initial) {\n\t\t\t\tawait this._writeFile(this.config.initial);\n\t\t\t\tcandidate = await this.read(true);\n\t\t\t} else throw new Error(`config file not found: ${this.filename}`);\n\t\t}\n\t\tyield () => this.stop();\n\t\tawait this.apply(candidate);\n\t}\n\tasync stop() {\n\t\tawait this.root.stop();\n\t\tawait this.flushWrite();\n\t}\n\t/**\n\t* Re-read the file and transactionally refresh child entries when content changed.\n\t* @returns a promise resolving after the new tree commits, or immediately when unchanged.\n\t* @throws when reading, parsing, validation, application, or rollback fails; the last good tree remains active when rollback succeeds.\n\t*/\n\tasync refresh() {\n\t\tawait this.enqueue(async () => {\n\t\t\tconst candidate = await this.read();\n\t\t\tif (!candidate) return;\n\t\t\tawait this._apply(candidate);\n\t\t});\n\t}\n\tapply(candidate) {\n\t\treturn this.enqueue(() => this._apply(candidate));\n\t}\n\tasync _apply(candidate) {\n\t\tconst data = this.applyPatches(candidate.data, this.config.patches);\n\t\tawait this.root.update(data);\n\t\tthis.content = candidate.content;\n\t\tthis.data = candidate.data;\n\t\tawait this.checkAccess();\n\t}\n\tasync _writeFile(config) {\n\t\tif (this.readonly) throw new Error(`cannot overwrite readonly config`);\n\t\tif (this.type === \"application/yaml\") this.content = yaml.dump(config, { schema });\n\t\telse if (this.type === \"application/json\") this.content = JSON.stringify(config, null, 2);\n\t\tawait writeFile(this.filename + \".tmp\", this.content);\n\t\tfor (let retry = 0;; retry++) try {\n\t\t\tawait rename(this.filename + \".tmp\", this.filename);\n\t\t\treturn;\n\t\t} catch (error) {\n\t\t\tif (!retryableWriteError(error) || retry >= WRITE_RETRY_LIMIT) throw error;\n\t\t\tawait setTimeout$1((retry + 1) * WRITE_RETRY_DELAY_MS);\n\t\t}\n\t}\n\twriteFile(config) {\n\t\tclearTimeout(this.writeTask);\n\t\tthis.pendingWrite = config;\n\t\tthis.writeTask = setTimeout(() => {\n\t\t\tthis.flushWrite();\n\t\t}, 0);\n\t}\n\tflushWrite() {\n\t\tclearTimeout(this.writeTask);\n\t\tthis.writeTask = void 0;\n\t\tconst config = this.pendingWrite;\n\t\tthis.pendingWrite = void 0;\n\t\tif (config === void 0) return this.writeQueue;\n\t\tconst run = this.writeQueue.then(() => this._writeFile(config), () => this._writeFile(config));\n\t\tthis.writeQueue = run;\n\t\trun.catch((error) => {\n\t\t\tthis.ctx.root.logger?.(\"loader\").warn(\"failed to write config file %C\", this.filename);\n\t\t\tthis.ctx.root.logger?.(\"loader\").warn(error);\n\t\t});\n\t\treturn run;\n\t}\n\t/** Schedule a write of the current root entry data. */\n\twrite() {\n\t\tthis.context.emit(\"loader/config-update\");\n\t\treturn this.writeFile(this.root.data);\n\t}\n};\n//#endregion\nexport { Include, Include as default, applyEntryPatches, entryListSchema };\n", "import { randomBytes } from \"node:crypto\";\nimport { mkdir, rename, rm, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\n//#region lib/types/index.js\n/**\n* Zero-dependency atomic file replacement and writer coordination.\n* `writeFileAtomic` writes a random-suffix sibling with exclusive create and\n* the caller's permission bits, then renames it over the target, so readers\n* observe either the old or the new complete content and a replaced file ends\n* up with exactly the stated mode. `withFileLock` serializes cross-process\n* writers of one file through a `wx`-created `<file>.lock` sibling, so a\n* read-modify-write cycle can never resurrect a state another writer just\n* replaced; readers stay lock-free because the rename commit is atomic.\n* @module @deepseek-ai/dsh-atomic-write\n*/\n/**\n* Replace `filename` with `content` in one atomic step, creating parent\n* directories. The content is first written to a random-suffix sibling opened\n* with exclusive create (`wx`): the open refuses to follow a symlink planted\n* at the temp path, and the fresh inode carries `options.mode` through the\n* rename, so replacing a wider-permission file narrows it without a chmod\n* race. The rename also replaces a symlinked target itself instead of writing\n* through to its referent, and the same-directory sibling keeps the rename on\n* one filesystem. On any failure the temp file is removed and the failure\n* rethrown. Crash durability (fsync) is out of scope.\n* @param filename - final path receiving the content.\n* @param content - complete next file content.\n* @param options - permission bits for the replacement inode.\n*/\nasync function writeFileAtomic(filename, content, options) {\n\tawait mkdir(dirname(filename), {\n\t\trecursive: true,\n\t\t...options.dirMode === void 0 ? {} : { mode: options.dirMode }\n\t});\n\tconst temp = `${filename}.${randomBytes(6).toString(\"hex\")}.tmp`;\n\ttry {\n\t\tawait writeFile(temp, content, {\n\t\t\tmode: options.mode,\n\t\t\tflag: \"wx\"\n\t\t});\n\t\tawait rename(temp, filename);\n\t} catch (error) {\n\t\tawait rm(temp, { force: true });\n\t\tthrow error;\n\t}\n}\n/** Whether an exclusive create failed because the path already exists. */\nfunction isEEXIST(error) {\n\treturn error?.code === \"EEXIST\";\n}\n/**\n* Writer-lock protocol constants. These are robustness invariants of the\n* cross-process write protocol, not deployment tunables: contention normally\n* resolves within the retry deadline, while expiry fails the contender without\n* guessing whether the existing lock still has an owner.\n*/\nconst LOCK_RETRY_INITIAL_MS = 20;\nconst LOCK_RETRY_MAX_MS = 200;\nconst LOCK_TIMEOUT_MS = 2e3;\n/**\n* Hold the cross-process writer lock for `filename` around one operation. The\n* lock is a `wx`-created sibling (`<filename>.lock`); paired with the\n* rename-based commit of {@link writeFileAtomic}, readers stay lock-free and\n* only writers contend. Contention backs off exponentially and fails with a\n* timed-out error after the deadline. The contender never removes an existing\n* lock because file age cannot prove that its owner stopped; orphan recovery\n* is an operator action. The parent directory must exist.\n* @param filename - the file whose writers this lock serializes.\n* @param operation - the read-render-commit cycle to run while holding the lock.\n* @returns the operation's result; the lock releases on both outcomes.\n*/\nasync function withFileLock(filename, operation) {\n\tconst lockPath = `${filename}.lock`;\n\tconst deadline = Date.now() + LOCK_TIMEOUT_MS;\n\tlet delay = LOCK_RETRY_INITIAL_MS;\n\tfor (;;) {\n\t\ttry {\n\t\t\tawait writeFile(lockPath, `${process.pid}\\n`, {\n\t\t\t\tmode: 384,\n\t\t\t\tflag: \"wx\"\n\t\t\t});\n\t\t\tbreak;\n\t\t} catch (error) {\n\t\t\tif (!isEEXIST(error)) throw error;\n\t\t}\n\t\tif (Date.now() >= deadline) throw new Error(`atomic-write: timed out waiting for the writer lock at ${lockPath}`);\n\t\tawait new Promise((resolve) => setTimeout(resolve, delay));\n\t\tdelay = Math.min(delay * 2, LOCK_RETRY_MAX_MS);\n\t}\n\ttry {\n\t\treturn await operation();\n\t} finally {\n\t\tawait rm(lockPath, { force: true });\n\t}\n}\n//#endregion\nexport { withFileLock, writeFileAtomic };\n", "/**\n * Skill policy: the durable disable list behind the M2 toggles, plus the\n * shadowing provider logic that enforces it. State lives in a settings\n * namespace; the provider turns disabled entries into rank-0 stub candidates\n * so every consumer of `ctx.skills` (the model catalog, the `/name` injection\n * boundary, and the `skill.list` RPC behind the ui-skill menu) stops seeing\n * them. The settings page reads the same state to render the toggle rows.\n *\n * @module ui-settings-skills/policy\n */\n\nimport { resolve } from 'node:path'\nimport type { Context } from '@deepseek-ai/cordis'\nimport type { SkillCandidate, SkillLookupOptions, SkillProvider, SkillProviderControl } from '@deepseek-ai/dsh-skill'\nimport type { ScopeKey } from '@deepseek-ai/dsh-scope'\nimport z from '@deepseek-ai/schemastery'\n\n/** Settings namespace holding the policy document. */\nexport const POLICY_NS = 'ui-settings-skills.policy'\n\n/** The shadowing provider's registry name (also its wire identity). */\nexport const POLICY_PROVIDER = 'ui-settings-skills-policy'\n\n/** Snapshot of a disabled skill, enough to render its row and rebuild the stub. */\nexport interface DisabledSkillEntry {\n readonly description: string\n readonly source: string\n}\n\n/** The policy document: user-level disables plus per-workspace disables. */\nexport interface SkillPolicy {\n /** User-level disabled skills (`~/.agents/skills`), applied to every workspace. */\n readonly user: Readonly<Record<string, DisabledSkillEntry>>\n /** Per-workspace disabled skills (project skills), keyed by WorkspaceId. */\n readonly workspace: Readonly<Record<string, Readonly<Record<string, DisabledSkillEntry>>>>\n}\n\n/** One toggle write. */\nexport interface PolicyUpdate {\n readonly kind: 'user' | 'workspace'\n /** Required for workspace-kind writes. */\n readonly workspaceId?: string\n readonly name: string\n readonly description: string\n readonly source: string\n readonly enabled: boolean\n}\n\nexport const policySchema = z.object({\n user: z.dict(z.object({\n description: z.string(),\n source: z.string(),\n })),\n workspace: z.dict(z.dict(z.object({\n description: z.string(),\n source: z.string(),\n }))),\n})\n\nconst EMPTY_POLICY: SkillPolicy = { user: {}, workspace: {} }\n\n/** Read the current policy, tolerating an absent settings service. */\nexport function readPolicy(ctx: Context): SkillPolicy {\n const settings = ctx.get('settings') as { get?: (ns: string) => unknown } | undefined\n if (settings?.get === undefined) return EMPTY_POLICY\n const value = settings.get(POLICY_NS) as SkillPolicy | undefined\n if (value === undefined) return EMPTY_POLICY\n return { user: value.user ?? {}, workspace: value.workspace ?? {} }\n}\n\n/**\n * Apply one toggle write to the policy document. Rewrites the whole user\n * section through `replace` (the policy is small, and deep-merge `update`\n * semantics for removals are unspecified), so a disabled entry is deleted\n * outright and an enabled one is written.\n * @param ctx - plugin context with a settings service.\n * @param update - the toggle write.\n */\nexport async function updatePolicy(ctx: Context, update: PolicyUpdate): Promise<void> {\n const settings = ctx.get('settings') as { replace?: (ns: string, section: unknown) => Promise<void> } | undefined\n if (settings?.replace === undefined) throw new Error('settings service unavailable')\n const current = readPolicy(ctx)\n const next: {\n user: Record<string, DisabledSkillEntry>\n workspace: Record<string, Record<string, DisabledSkillEntry>>\n } = { user: { ...current.user }, workspace: {} }\n for (const [id, entries] of Object.entries(current.workspace)) next.workspace[id] = { ...entries }\n if (update.kind === 'user') {\n if (update.enabled) delete next.user[update.name]\n else next.user[update.name] = { description: update.description, source: update.source }\n } else {\n if (update.workspaceId === undefined) throw new Error('workspace-kind policy update requires workspaceId')\n const workspaceEntries = { ...(next.workspace[update.workspaceId] ?? {}) }\n if (update.enabled) delete workspaceEntries[update.name]\n else workspaceEntries[update.name] = { description: update.description, source: update.source }\n if (Object.keys(workspaceEntries).length === 0) delete next.workspace[update.workspaceId]\n else next.workspace[update.workspaceId] = workspaceEntries\n }\n await settings.replace(POLICY_NS, next)\n}\n\n/** Canonical cwd comparison key; Windows paths compare case-insensitively. */\nfunction canonicalCwd(path: string): string {\n const resolved = resolve(path)\n return process.platform === 'win32' ? resolved.toLowerCase() : resolved\n}\n\n/**\n * The workspace owning this cwd (canonical equal-or-descendant match), if any.\n * @param ctx - plugin context carrying the workspace registry.\n * @param cwd - the lookup cwd.\n * @returns the WorkspaceId, or undefined when no workspace owns the path.\n */\nexport function workspaceIdForCwd(ctx: Context, cwd: string | undefined): string | undefined {\n if (cwd === undefined) return undefined\n const key = canonicalCwd(cwd)\n const workspaces = ctx.get('workspaceRegistry') as { list?: () => readonly { id: string; path: string }[] } | undefined\n if (workspaces?.list === undefined) return undefined\n for (const workspace of workspaces.list()) {\n const root = canonicalCwd(workspace.path)\n if (key === root || key.startsWith(`${root}\\\\`) || key.startsWith(`${root}/`)) {\n return workspace.id\n }\n }\n return undefined\n}\n\n/**\n * One shadowing provider instance: returns rank-0 stub candidates for every\n * disabled skill visible at the queried cwd. Registered into the layer of the\n * context it receives (the global layer for the host row, an agent's scope\n * layer when mounted through `agent.ctx`), where the registry's same-layer\n * rank tiebreak makes the stub win; `get()` returns undefined so loading a\n * disabled skill fails everywhere.\n * @param ctx - plugin context.\n * @param policy - thunk reading the current policy (read at list time).\n * @returns the provider.\n */\nexport function createPolicyProvider(\n ctx: Context,\n policy: () => SkillPolicy,\n): {\n name: string\n list(options: SkillLookupOptions): Promise<SkillCandidate[]>\n get(candidate: SkillCandidate): Promise<undefined>\n} {\n return {\n name: POLICY_PROVIDER,\n async list(options) {\n const current = policy()\n const disabled = new Map<string, DisabledSkillEntry>()\n for (const [name, entry] of Object.entries(current.user)) disabled.set(name, entry)\n const workspaceId = workspaceIdForCwd(ctx, options.cwd)\n if (workspaceId !== undefined) {\n const entries = current.workspace[workspaceId]\n if (entries !== undefined) {\n for (const [name, entry] of Object.entries(entries)) disabled.set(name, entry)\n }\n }\n return [...disabled].map(([name]) => stubCandidate(name))\n },\n async get() {\n return undefined\n },\n }\n}\n\n/** The stub candidate replacing a disabled skill in every catalog. */\nexport function stubCandidate(name: string): SkillCandidate {\n return {\n name,\n description: 'disabled by ui-settings-skills policy',\n invocation: { modelInvocable: false, userInvocable: false },\n source: 'custom',\n provider: POLICY_PROVIDER,\n rank: 0,\n locator: { stub: name },\n }\n}\n\n/** Registries the shadowing provider mounts on (the host registry or a preset-owned one). */\nexport interface PolicyRegisterable {\n readonly registerProvider?: (create: (control: SkillProviderControl) => SkillProvider) => () => void\n}\n\n/**\n * Mount the shadowing provider on one registry, holding its invalidation\n * control STRONGLY in `invalidators`.\n *\n * The registry does not retain the `SkillProviderControl` after registration,\n * so a weak-only reference is garbage-collected long before a policy write:\n * the invalidators then dereference nothing, the registry's catalog cache\n * never invalidates, and every `ctx.skills` consumer keeps serving the\n * pre-disable catalog until a profile restart. The returned disposer removes\n * the entry again, so the set never outlives a live registration.\n * @param registry - the registry to mount on.\n * @param invalidators - the strong set of live invalidate closures.\n * @param policyCtx - plugin host context (workspace + settings resolution).\n * @param policy - thunk reading the current policy at list time.\n * @returns the exact disposer that unregisters the provider and drops the invalidator.\n */\nexport function registerPolicyProvider(\n registry: PolicyRegisterable,\n invalidators: Set<() => void>,\n policyCtx: Context,\n policy: () => SkillPolicy,\n): () => void {\n const register = registry.registerProvider\n if (register === undefined) return () => {}\n let invalidate: (() => void) | undefined\n // Method call with the registry as receiver: the real implementation reads\n // `this`, and on a traceable proxy the receiver is what rebinds the\n // registration into the caller's scope layer.\n const disposeProvider = register.call(registry, (control) => {\n invalidate = control.invalidate\n invalidators.add(invalidate)\n return createPolicyProvider(policyCtx, policy)\n })\n return () => {\n disposeProvider()\n if (invalidate !== undefined) invalidators.delete(invalidate)\n }\n}\n\n/**\n * Sniff the runtime's scope-tag symbol off a live scoped context.\n *\n * The plugin bundle inlines its own copies of the dsh-* packages while the\n * runtime registry carries its own; `dsh-scope`'s tag is a module-private\n * `Symbol`, so a tag written through an imported copy would be invisible to\n * the runtime's `scopeOf`. The tag is an own property somewhere on the\n * context's prototype chain and the only non-global-registry symbol there\n * (cordis internals all use `Symbol.for`), so it can be recovered and reused\n * through plain object semantics \u2014 no harness changes.\n * @param sample - any context the runtime tagged with a scope (an agent ctx).\n * @returns the runtime's scope-tag symbol, or undefined when `sample` carries none.\n */\nexport function findScopeTag(sample: unknown): symbol | undefined {\n for (let cursor: unknown = sample; cursor !== null && cursor !== undefined && cursor !== Object.prototype; cursor = Object.getPrototypeOf(cursor as object)) {\n for (const sym of Object.getOwnPropertySymbols(cursor as object)) {\n if (Symbol.keyFor(sym) === undefined) return sym\n }\n }\n return undefined\n}\n\n/**\n * Mint a context whose scope tag is `key`, on top of `base`.\n * `base.extend` shares the base's fiber, so registrations through the result\n * are owned by the base's lifecycle while the runtime's `scopeOf` resolves\n * the tag to `key`.\n * @param base - plugin context to derive from.\n * @param tag - the runtime's scope-tag symbol (from {@link findScopeTag}).\n * @param key - the scope key to tag with.\n * @returns the scope-tagged context.\n */\nexport function scopeTaggedContext(base: Context, tag: symbol, key: ScopeKey): Context {\n return base.extend({ [tag]: key } as {})\n}\n", "/**\n * ui-settings-skills host half: serves the skill-management catalog over the\n * plugin's own HTTP route (`ctx.webServer`). The catalog exposes one\n * dimension per registered workspace; every workspace folds in the global\n * layer, the current user's user-level rows (every live agent's scoped view\n * contributes its `user-agents` / `user-dsh` rows), the workspace's per-cwd\n * global view, and the scoped views of its live sessions (the workspace\n * record owns the session mapping). Per-session granularity is never shown.\n *\n * M2 toggles: a settings-namespace policy records disabled skills (user level\n * and per workspace); rank-0 shadowing providers replace them with stubs so\n * every `ctx.skills` consumer (model catalog, `/name` injection, the ui-skill\n * menu RPC) stops seeing them, and the catalog marks them disabled so the\n * page renders the toggle off. The stub mounts on every layer a catalog read\n * can select: the global layer (TUI/headless and rosterless sessions), each\n * preset's STANDING layer (web cold reads \u2014 `skill.list` scopes a session with\n * no live agent to its preset's standing key, whose chain never reaches an\n * agent-layer entry), each live agent's own layer, and the preset's\n * realm-isolated registry when it composes one. Invalidation controls are\n * held STRONGLY: the registry does not retain SkillProviderControl, and a\n * weak-only set was garbage-collected long before a policy write, leaving the\n * registry's collect cache stale so the `/` menu kept serving the pre-disable\n * catalog until a profile restart. After a policy write the plugin invalidates\n * every mounted provider and re-emits `agent-preset/selected` per session,\n * which the api-remotes forward loop relays so the ui-skill client drops its\n * cached `/` catalog and refetches. The browser never submits a raw path.\n *\n * @module ui-settings-skills\n */\n\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport type { Context } from '@deepseek-ai/cordis'\n// Type-only: pulls the ctx.skills Context merge.\nimport type {} from '@deepseek-ai/dsh-skill'\nimport type { SkillSummary } from '@deepseek-ai/dsh-skill'\n// Type-only: pulls the ctx.workspaceRegistry Context merge.\nimport type {} from '@deepseek-ai/dsh-workspace'\n// Type-only: pulls the ctx.webServer Context merge.\nimport type {} from '@deepseek-ai/dsh-host-webserver'\n// Type-only: pulls the ctx.agents Context merge.\nimport type {} from '@deepseek-ai/dsh-agent'\n// Type-only: pulls the ctx.settings Context merge.\nimport type {} from '@deepseek-ai/dsh-settings'\nimport { resolveSessionPreset } from '@deepseek-ai/dsh-agent-presets'\nimport type { SessionId } from '@deepseek-ai/dsh-session'\nimport type { ScopeKey } from '@deepseek-ai/dsh-scope'\nimport {\n findScopeTag, POLICY_NS, POLICY_PROVIDER, policySchema, readPolicy,\n registerPolicyProvider, scopeTaggedContext, updatePolicy, type PolicyRegisterable,\n} from './policy.ts'\nimport type { SkillPolicy } from './policy.ts'\nimport z from '@deepseek-ai/schemastery'\nimport type { CatalogResponse, DimensionView, ErrorResponse, PutPolicyRequest, SkillRow } from './wire.ts'\n\nexport const name = 'ui-settings-skills'\n\n/** Services required by the catalog route. */\nexport const inject = ['skills', 'workspaceRegistry', 'webServer', 'agents']\n\n/** Plugin role: host (routes + namespace + provider) or policy (provider only). */\nexport const Config = z.object({\n role: z.string().default('host'),\n})\n\n/** Route prefix under which the plugin serves its API. */\nexport const API_PREFIX = '/plugin/settings-skills'\n\n/** Skill sources the page manages: the user's own skills and project skills. Preset-loaded skills (`custom`) and built-ins are not managed and never shown. */\nconst VISIBLE_SOURCES = new Set(['user-agents', 'user-dsh', 'project-dsh', 'project-agents'])\n\n/** User-level skill sources (the current user's own skills). */\nconst USER_LEVEL_SOURCES = new Set(['user-agents', 'user-dsh'])\n\n/** The subset of `ctx.skills` the aggregation reads. */\nexport interface SkillsReader {\n snapshot(options?: { readonly cwd?: string; readonly scope?: ScopeKey }): Promise<{ readonly skills: readonly SkillSummary[] }>\n}\n\n/** One workspace row the aggregation resolves. */\nexport interface WorkspaceRow {\n readonly workspaceId: string\n readonly path: string\n readonly title: string\n /** Sessions accounted under this workspace; live ones contribute their scope views. */\n readonly sessionIds: readonly string[]\n}\n\n/** One live agent's scoped view. */\nexport interface LiveAgentRow {\n /** The live agent is its own scope key. */\n readonly scope: ScopeKey\n}\n\n/** Map one registry summary onto the wire row. */\nexport function toSkillRow(skill: SkillSummary): SkillRow {\n return {\n name: skill.name,\n description: skill.description,\n ...(skill.whenToUse !== undefined ? { whenToUse: skill.whenToUse } : {}),\n source: skill.source,\n provider: skill.provider,\n modelInvocable: skill.invocation.modelInvocable,\n userInvocable: skill.invocation.userInvocable,\n ...(skill.resourceBase !== undefined ? { resourceBaseKind: skill.resourceBase.kind } : {}),\n }\n}\n\n/**\n * Merge skill rows by name, first row winning, sorted by name.\n * @param batches - row batches in precedence order.\n * @returns the merged rows.\n */\nfunction mergeRows(...batches: readonly SkillRow[][]): SkillRow[] {\n const merged = new Map<string, SkillRow>()\n for (const batch of batches) {\n for (const row of batch) {\n if (!merged.has(row.name)) merged.set(row.name, row)\n }\n }\n return [...merged.values()].sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0)\n}\n\n/** Filter to the managed sources, dropping policy stub rows and preset/built-in skills. */\nfunction visibleRows(rows: readonly SkillRow[]): SkillRow[] {\n return rows.filter(row => row.provider !== POLICY_PROVIDER && VISIBLE_SOURCES.has(row.source))\n}\n\n/** The disabled rows for one workspace: user-level entries plus the workspace's own. */\nfunction disabledRowsFor(policy: SkillPolicy, workspaceId: string): Map<string, SkillRow> {\n const rows = new Map<string, SkillRow>()\n for (const [name, entry] of Object.entries(policy.user)) {\n rows.set(name, {\n name,\n description: entry.description,\n source: entry.source,\n provider: POLICY_PROVIDER,\n modelInvocable: false,\n userInvocable: false,\n disabled: true,\n disabledScope: 'user',\n })\n }\n const workspaceEntries = policy.workspace[workspaceId]\n if (workspaceEntries !== undefined) {\n for (const [name, entry] of Object.entries(workspaceEntries)) {\n rows.set(name, {\n name,\n description: entry.description,\n source: entry.source,\n provider: POLICY_PROVIDER,\n modelInvocable: false,\n userInvocable: false,\n disabled: true,\n disabledScope: 'workspace',\n })\n }\n }\n return rows\n}\n\n/**\n * Aggregate the catalog. One dimension per workspace in registry order, each\n * folding the global layer, the user-level rows of every live agent, the\n * workspace's per-cwd global view, and the scoped views of its live sessions.\n * Policy-disabled skills are replaced by their policy rows (rendered with the\n * toggle off); a workspace whose collection fails yields an error-bearing\n * view instead of failing the whole response; a failing session is contained\n * inside its workspace.\n * @param skills - the skill registry reader.\n * @param agentsBySession - live agents keyed by session id (read at request time).\n * @param workspaces - workspace rows.\n * @param policy - the current disable policy.\n * @returns the workspace dimension views.\n */\nexport async function buildCatalog(\n skills: SkillsReader,\n agentsBySession: ReadonlyMap<string, LiveAgentRow>,\n workspaces: readonly WorkspaceRow[],\n policy: SkillPolicy = { user: {}, workspace: {} },\n): Promise<DimensionView[]> {\n const globalRows = visibleRows((await skills.snapshot()).skills.map(toSkillRow))\n const userLevelRows: SkillRow[] = []\n for (const row of globalRows) {\n if (USER_LEVEL_SOURCES.has(row.source)) userLevelRows.push(row)\n }\n const agents = [...agentsBySession.values()]\n for (const agent of agents) {\n try {\n for (const row of visibleRows((await skills.snapshot({ scope: agent.scope })).skills.map(toSkillRow))) {\n if (USER_LEVEL_SOURCES.has(row.source)) userLevelRows.push(row)\n }\n } catch {\n // One agent's scope failure must not fail the whole catalog.\n }\n }\n const userRows = mergeRows(userLevelRows)\n const dimensions: DimensionView[] = []\n for (const workspace of workspaces) {\n try {\n const scopedRows: SkillRow[][] = [\n globalRows,\n userRows,\n // The global layer's per-cwd view (host-plane providers; the web-app\n // bundle disables them, so this batch is empty there).\n visibleRows((await skills.snapshot({ cwd: workspace.path })).skills.map(toSkillRow)),\n ]\n for (const sessionId of workspace.sessionIds) {\n const agent = agentsBySession.get(sessionId)\n if (agent === undefined) continue\n try {\n scopedRows.push(visibleRows((await skills.snapshot({ scope: agent.scope, cwd: workspace.path })).skills.map(toSkillRow)))\n } catch {\n // One session's scope failure must not fail the whole workspace.\n }\n }\n const merged = new Map(mergeRows(...scopedRows).map(row => [row.name, row]))\n // Policy rows win: a disabled skill renders off even where a live view\n // still carries it.\n for (const [name, row] of disabledRowsFor(policy, workspace.workspaceId)) merged.set(name, row)\n dimensions.push({\n kind: 'workspace',\n id: workspace.workspaceId,\n title: workspace.title,\n skills: [...merged.values()].sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0),\n })\n } catch (error) {\n dimensions.push({\n kind: 'workspace',\n id: workspace.workspaceId,\n title: workspace.title,\n skills: [],\n error: { code: 'workspace-catalog-failed', message: String(error) },\n })\n }\n }\n return dimensions\n}\n\n/** Write one JSON response with no-store caching. */\nfunction sendJson(res: ServerResponse, status: number, body: unknown): void {\n const text = JSON.stringify(body)\n res.writeHead(status, {\n 'content-type': 'application/json; charset=utf-8',\n 'cache-control': 'no-store',\n })\n res.end(text)\n}\n\n/** Uniform error body. */\nfunction errorBody(code: string, message: string): ErrorResponse {\n return { error: { code, message } }\n}\n\n/** Narrow an unknown JSON value to a policy toggle write, throwing on malformed fields. */\nfunction parsePolicyUpdate(body: unknown): PutPolicyRequest {\n const value = body as Partial<PutPolicyRequest> | null\n if (typeof value !== 'object' || value === null) throw new Error('policy update must be an object')\n const { kind, workspaceId, name, description, source, enabled } = value\n if (kind !== 'user' && kind !== 'workspace') throw new Error('policy update kind must be \"user\" or \"workspace\"')\n if (typeof name !== 'string' || name.length === 0) throw new Error('policy update requires a skill name')\n if (typeof description !== 'string') throw new Error('policy update requires a description')\n if (typeof source !== 'string') throw new Error('policy update requires a source')\n if (typeof enabled !== 'boolean') throw new Error('policy update requires a boolean enabled')\n if (kind === 'workspace' && (typeof workspaceId !== 'string' || workspaceId.length === 0)) {\n throw new Error('workspace policy update requires a workspaceId')\n }\n return {\n kind,\n ...(workspaceId !== undefined ? { workspaceId } : {}),\n name,\n description,\n source,\n enabled,\n }\n}\n\n/**\n * Route handler for the plugin API.\n * @param ctx - the plugin context, for logging and services.\n * @param skills - the skill registry reader.\n * @param agentsBySession - live agent supplier keyed by session id (read at request time).\n * @param workspaces - workspace row supplier (read at request time).\n * @param invalidatePolicy - invalidate the shadowing provider's catalog caches.\n * @param notifyPresetSelected - emit `agent-preset/selected` per session so the\n * ui-skill client drops its cached `/` catalog and refetches.\n * @returns the node:http handler.\n */\nfunction makeHandler(\n ctx: Context,\n skills: SkillsReader,\n agentsBySession: () => ReadonlyMap<string, LiveAgentRow>,\n workspaces: () => readonly WorkspaceRow[],\n invalidatePolicy: () => void,\n notifyPresetSelected: () => void,\n): (req: IncomingMessage, res: ServerResponse) => Promise<void> {\n return async (req, res) => {\n try {\n const pathname = new URL(req.url ?? '/', 'http://ui-settings-skills').pathname\n if (pathname === `${API_PREFIX}/catalog`) {\n if (req.method !== 'GET') {\n sendJson(res, 405, errorBody('method-not-allowed', `method ${req.method} is not allowed`))\n return\n }\n const dimensions = await buildCatalog(skills, agentsBySession(), workspaces(), readPolicy(ctx))\n sendJson(res, 200, { dimensions } satisfies CatalogResponse)\n return\n }\n if (pathname === `${API_PREFIX}/policy`) {\n if (req.method !== 'PUT') {\n sendJson(res, 405, errorBody('method-not-allowed', `method ${req.method} is not allowed`))\n return\n }\n const body = await readJsonBody(req)\n const update = parsePolicyUpdate(body)\n await updatePolicy(ctx, update)\n invalidatePolicy()\n notifyPresetSelected()\n sendJson(res, 200, { ok: true })\n return\n }\n sendJson(res, 404, errorBody('not-found', `unknown route ${pathname}`))\n } catch (error) {\n ctx.logger.warn(`ui-settings-skills: ${String(error)}`)\n sendJson(res, 400, errorBody('bad-request', String(error)))\n }\n }\n}\n\n/** Read a bounded JSON request body. */\nfunction readJsonBody(req: IncomingMessage): Promise<unknown> {\n return new Promise((resolvePromise, reject) => {\n const chunks: Buffer[] = []\n let size = 0\n req.on('data', (chunk: Buffer) => {\n size += chunk.length\n if (size > 64 * 1024) {\n reject(new Error('request body too large'))\n req.destroy()\n return\n }\n chunks.push(chunk)\n })\n req.on('end', () => {\n try {\n resolvePromise(JSON.parse(Buffer.concat(chunks).toString('utf8')))\n } catch (error) {\n reject(error)\n }\n })\n req.on('error', reject)\n })\n}\n\n/**\n * Register the shadowing provider, and \u2014 in the host role \u2014 the settings\n * namespace and the HTTP routes. A policy role (`config.role === 'policy'`)\n * registers only the provider, without the namespace or routes.\n */\nexport function apply(ctx: Context, config: { role?: string } = {}): void {\n const skills = ctx.skills\n const role = config.role ?? 'host'\n\n if (role === 'host') {\n const settings = ctx.get('settings') as { register?: (ns: string, schema: unknown) => { dispose?: () => void } } | undefined\n if (settings?.register !== undefined) {\n ctx.effect(() => {\n // The closure re-checks because property narrowing does not survive\n // into a deferred callback.\n if (settings?.register === undefined) return () => {}\n const scope = settings.register(POLICY_NS, policySchema)\n return () => { scope.dispose?.() }\n }, 'ui-settings-skills: policy namespace')\n }\n }\n\n // Every registration's invalidation control (global layer, each preset's\n // standing layer, each live agent's layer, each realm-isolated preset\n // registry) is held STRONGLY here: the registry itself does not retain\n // SkillProviderControl, so a weak-only set is garbage-collected long before\n // a policy write and the registry's collect cache never invalidates (the\n // disabled skill stays in the `/` catalog until a profile restart). Each\n // registration removes its entry through the disposer it returns, so the\n // set never outlives a live registration.\n const invalidators = new Set<() => void>()\n const invalidatePolicy = (): void => {\n for (const invalidate of [...invalidators]) invalidate()\n }\n const readCurrentPolicy = (): SkillPolicy => readPolicy(ctx)\n // Global layer (TUI/headless; in web compositions it also covers rosterless\n // sessions whose view scope falls back to the global layer).\n ctx.effect(\n () => registerPolicyProvider(skills, invalidators, ctx, readCurrentPolicy),\n 'ui-settings-skills: policy provider (global)',\n )\n\n // A global-layer provider alone cannot shadow web compositions: the ui-skill\n // `/` menu and the model catalog resolve per session, and the preset's real\n // providers live in the preset's STANDING layer. Two more mounts close the\n // gap:\n // - one registration per standing key: a cold read (`skill.list` for a\n // session with no live agent) scopes to the preset's standing key, and\n // that chain never reaches an agent-layer entry \u2014 the stub must sit IN\n // the standing layer, the same layer as the preset's real providers,\n // where rank 0 wins outright;\n // - one registration per live agent: on the agent's own registry view\n // (the agent layer of the host registry \u2014 the nearest overlay, covering\n // per-agent runtime skills) and, when the preset realm-mounts its own\n // registry (isolated, invisible through `agent.ctx`), directly on that\n // registry.\n // A failing mount must not veto agent publication, so every branch is\n // contained.\n const presets = ctx.get('agentPresets') as {\n composedPreset?: (agentCtx: Context) => string | undefined\n standingKeyFor?: (id?: string) => Promise<ScopeKey>\n serviceFor?: (agent: unknown, name: string) => PolicyRegisterable | undefined\n } | undefined\n\n // The plugin bundle inlines its own copies of the dsh-* packages, while the\n // runtime registry carries its own; dsh-scope's scope tag is a\n // module-private Symbol, so createScope()/standingMountFor() imported here\n // would read a DIFFERENT symbol than the runtime's scopeOf and land the\n // registration in the global layer instead. The tag is recovered from a\n // live scoped context once and reused through plain object semantics.\n let scopeTag: symbol | undefined\n\n /** One registration per standing layer, keyed by ScopeKey identity. */\n const standingProviders = new Map<ScopeKey, () => void>()\n const ensureStandingProvider = (key: ScopeKey): void => {\n if (scopeTag === undefined || standingProviders.has(key)) return\n const tagged = scopeTaggedContext(ctx, scopeTag, key)\n // `get` (not a property read) keeps this branch alive when the service is\n // absent, and binds the traceable to `tagged`, whose scopeOf resolves to\n // the standing key \u2014 the registration files beside the real providers.\n const inScope = tagged.get('skills') as PolicyRegisterable | undefined\n if (inScope === undefined) return\n const disposeProvider = registerPolicyProvider(inScope, invalidators, ctx, readCurrentPolicy)\n const remove = (): void => {\n disposeProvider()\n standingProviders.delete(key)\n }\n standingProviders.set(key, remove)\n ctx.effect(() => remove, 'ui-settings-skills: standing policy provider')\n }\n\n /** Ensure the standing-layer stub for one preset id (cold sessions). */\n const ensureStandingForPreset = (presetId: string | undefined): void => {\n if (presetId === undefined) return\n const roster = presets\n if (roster?.standingKeyFor === undefined) return\n void roster.standingKeyFor(presetId).then(\n (key) => ensureStandingProvider(key),\n (error: unknown) => {\n ctx.logger.warn(`ui-settings-skills: standing provider for preset \"${presetId}\" failed: ${String(error)}`)\n },\n )\n }\n\n const mountScopeProvider = (agent: { readonly ctx: Context }): void => {\n // Learn the runtime's scope-tag symbol from this live scoped context, and\n // cover the preset's standing layer: at `agent/created` the preset is\n // already mounted, so `composedPreset` reads the join through the runtime\n // roster and `standingKeyFor` returns the runtime-minted key.\n if (scopeTag === undefined) scopeTag = findScopeTag(agent.ctx)\n const presetId = presets?.composedPreset?.(agent.ctx)\n if (presetId !== undefined) ensureStandingForPreset(presetId)\n agent.ctx.effect(() => {\n const disposers: Array<() => void> = []\n // `ctx.get` (not a property read) so a realm-isolated preset registry\n // cannot abort this branch before the serviceFor fallback runs.\n const agentSkills = agent.ctx.get('skills') as PolicyRegisterable | undefined\n if (agentSkills !== undefined) {\n disposers.push(registerPolicyProvider(agentSkills, invalidators, ctx, readCurrentPolicy))\n }\n const presetRegistry = presets?.serviceFor?.(agent, 'skills')\n if (presetRegistry !== undefined && presetRegistry !== agentSkills) {\n disposers.push(registerPolicyProvider(presetRegistry, invalidators, ctx, readCurrentPolicy))\n }\n return () => {\n for (const dispose of disposers) dispose()\n }\n }, 'ui-settings-skills: scoped policy provider')\n }\n const mountAllScoped = (): void => {\n for (const agent of ctx.agents.list()) {\n try {\n mountScopeProvider(agent)\n } catch (error) {\n ctx.logger.warn(`ui-settings-skills: scoped policy provider for agent \"${agent.id}\" failed: ${String(error)}`)\n }\n }\n }\n mountAllScoped()\n ctx.on('agent/created', ({ agent }) => {\n try {\n mountScopeProvider(agent)\n } catch (error) {\n ctx.logger.warn(`ui-settings-skills: scoped policy provider for agent \"${agent.id}\" failed: ${String(error)}`)\n }\n })\n // Cold-session coverage: whenever a session records its preset (creation or\n // a blank-session switch), make sure that preset's standing layer carries\n // the stub \u2014 the `/` menu for a session with no live agent reads exactly\n // that layer.\n ctx.on('agent-preset/selected', (_sessionId, presetId) => {\n ensureStandingForPreset(presetId)\n })\n // Sessions that predate this plugin's apply (or whose preset event was\n // never replayed) get the same coverage from the durable log; the first\n // `agent/created` has already taught the plugin the runtime's scope tag\n // when this hot-mounts into a running instance.\n const sessionList = ctx.get('sessions') as\n | { list?: () => readonly { readonly id: unknown; readonly header: unknown; readonly events: readonly unknown[] }[] }\n | undefined\n if (sessionList?.list !== undefined) {\n for (const session of sessionList.list()) {\n try {\n ensureStandingForPreset(resolveSessionPreset({\n header: session.header,\n events: session.events,\n } as Parameters<typeof resolveSessionPreset>[0]))\n } catch (error) {\n ctx.logger.warn(`ui-settings-skills: standing provider for session \"${String(session.id)}\" failed: ${String(error)}`)\n }\n }\n }\n\n if (role !== 'host') return\n\n const agentsBySession = () => new Map(\n ctx.agents.list().map(agent => [String(agent.id), { scope: agent } satisfies LiveAgentRow]),\n )\n const workspaces = () => ctx.workspaceRegistry.list().map(workspace => ({\n workspaceId: workspace.id,\n path: workspace.path,\n title: workspace.title,\n sessionIds: workspace.sessionIds.map(String),\n }))\n // The ui-skill `/` menu caches its catalog per session on the client and\n // only refetches when the forwarded `agent-preset/selected` event arrives.\n // Emit it with each session's real preset so the client drops the stale\n // catalog right after a policy write; the event is in the api-remotes\n // forwarded allowlist, and the preset label update is a no-op with the\n // real id.\n const sessions = sessionList\n const notifyPresetSelected = (): void => {\n if (sessions?.list === undefined) return\n for (const session of sessions.list()) {\n try {\n const presetId = resolveSessionPreset({\n header: session.header,\n events: session.events,\n } as Parameters<typeof resolveSessionPreset>[0])\n if (presetId === undefined) continue\n ctx.emit('agent-preset/selected', session.id as SessionId, presetId)\n } catch (error) {\n ctx.logger.warn(`ui-settings-skills: preset notification failed: ${String(error)}`)\n }\n }\n }\n ctx.effect(\n () => ctx.webServer.register({\n kind: 'prefix',\n path: API_PREFIX,\n handler: makeHandler(ctx, skills, agentsBySession, workspaces, invalidatePolicy, notifyPresetSelected),\n }),\n 'ui-settings-skills: catalog route',\n )\n}\n"],
5
+ "mappings": ";AAAA,SAAS,OAAO,IAAI,YAAAA,WAAU,SAAS,MAAAC,KAAI,YAAY;;;ACIvD,SAAS,WAAW,OAAO;AAC1B,SAAO,UAAU,QAAQ,UAAU;AACpC;AAEA,SAAS,cAAc,OAAO;AAC7B,SAAO,CAAC,WAAW,KAAK;AACzB;AAEA,SAAS,cAA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AI,aAAa,OAAW;AAC5B,YAAI,KAAK,yBAAyB,QAAQ,IAAiB,QAAQ;AAAA,MACrE,SAAS,OAAO;AACd,YAAI,OAAO,KAAK,mDAAmD,OAAO,KAAK,CAAC,EAAE;AAAA,MACpF;AAAA,IACF;AAAA,EACF;AACA,MAAI;AAAA,IACF,MAAM,IAAI,UAAU,SAAS;AAAA,MAC3B,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS,YAAY,KAAK,QAAQ,iBAAiB,YAAY,kBAAkB,oBAAoB;AAAA,IACvG,CAAC;AAAA,IACD;AAAA,EACF;AACF;",
6
+ "names": ["readFile", "rm", "type", "value", "Binary", "binary", "result", "a", "b", "Time", "date", "template", "target", "property", "value", "name", "lines", "type", "LoggerService", "CordisError", "inject", "config", "task", "dispose", "resolve", "Inject", "Context", "Service", "kValidationError", "ValidationError", "schema", "options", "pattern", "value", "extra", "type", "resolve", "toJSON", "date", "str", "toString", "name", "key", "schema", "isPlainObject", "name", "clone", "resolve", "resolve", "dirname", "join", "resolve", "isObject", "extend", "exception", "YAMLException", "toString", "common", "require$$0", "line", "map", "Type", "name", "require$$1", "schema", "type", "Schema", "require$$2", "require$$3", "require$$4", "date", "merge", "set", "require$$5", "require$$6", "DEFAULT_SCHEMA", "loadAll", "load", "str", "string", "dump", "loader", "dumper", "from", "require$$7", "require$$8", "require$$9", "require$$10", "require$$11", "require$$12", "require$$13", "require$$14", "require$$15", "require$$16", "require$$17", "require$$18", "require$$19", "require$$20", "require$$21", "ModuleLoader", "require", "config", "EntryTree", "name", "Entry", "loader", "access", "ctx", "entry", "type", "__rewriteRelativeImportExtension", "schema", "name", "target", "config", "rename", "writeFile", "dirname", "pathToFileURL", "readFile", "join", "name", "resolve", "dirname", "rm", "from", "mounted", "scope", "resolve", "resolve", "name", "name", "text", "role", "scope"]
7
+ }