faf-cli 6.4.0 → 6.4.1

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,198 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../node_modules/commander/lib/error.js", "../node_modules/commander/lib/argument.js", "../node_modules/commander/lib/help.js", "../node_modules/commander/lib/option.js", "../node_modules/commander/lib/suggestSimilar.js", "../node_modules/commander/lib/command.js", "../node_modules/commander/index.js", "../node_modules/yaml/dist/nodes/identity.js", "../node_modules/yaml/dist/visit.js", "../node_modules/yaml/dist/doc/directives.js", "../node_modules/yaml/dist/doc/anchors.js", "../node_modules/yaml/dist/doc/applyReviver.js", "../node_modules/yaml/dist/nodes/toJS.js", "../node_modules/yaml/dist/nodes/Node.js", "../node_modules/yaml/dist/nodes/Alias.js", "../node_modules/yaml/dist/nodes/Scalar.js", "../node_modules/yaml/dist/doc/createNode.js", "../node_modules/yaml/dist/nodes/Collection.js", "../node_modules/yaml/dist/stringify/stringifyComment.js", "../node_modules/yaml/dist/stringify/foldFlowLines.js", "../node_modules/yaml/dist/stringify/stringifyString.js", "../node_modules/yaml/dist/stringify/stringify.js", "../node_modules/yaml/dist/stringify/stringifyPair.js", "../node_modules/yaml/dist/log.js", "../node_modules/yaml/dist/schema/yaml-1.1/merge.js", "../node_modules/yaml/dist/nodes/addPairToJSMap.js", "../node_modules/yaml/dist/nodes/Pair.js", "../node_modules/yaml/dist/stringify/stringifyCollection.js", "../node_modules/yaml/dist/nodes/YAMLMap.js", "../node_modules/yaml/dist/schema/common/map.js", "../node_modules/yaml/dist/nodes/YAMLSeq.js", "../node_modules/yaml/dist/schema/common/seq.js", "../node_modules/yaml/dist/schema/common/string.js", "../node_modules/yaml/dist/schema/common/null.js", "../node_modules/yaml/dist/schema/core/bool.js", "../node_modules/yaml/dist/stringify/stringifyNumber.js", "../node_modules/yaml/dist/schema/core/float.js", "../node_modules/yaml/dist/schema/core/int.js", "../node_modules/yaml/dist/schema/core/schema.js", "../node_modules/yaml/dist/schema/json/schema.js", "../node_modules/yaml/dist/schema/yaml-1.1/binary.js", "../node_modules/yaml/dist/schema/yaml-1.1/pairs.js", "../node_modules/yaml/dist/schema/yaml-1.1/omap.js", "../node_modules/yaml/dist/schema/yaml-1.1/bool.js", "../node_modules/yaml/dist/schema/yaml-1.1/float.js", "../node_modules/yaml/dist/schema/yaml-1.1/int.js", "../node_modules/yaml/dist/schema/yaml-1.1/set.js", "../node_modules/yaml/dist/schema/yaml-1.1/timestamp.js", "../node_modules/yaml/dist/schema/yaml-1.1/schema.js", "../node_modules/yaml/dist/schema/tags.js", "../node_modules/yaml/dist/schema/Schema.js", "../node_modules/yaml/dist/stringify/stringifyDocument.js", "../node_modules/yaml/dist/doc/Document.js", "../node_modules/yaml/dist/errors.js", "../node_modules/yaml/dist/compose/resolve-props.js", "../node_modules/yaml/dist/compose/util-contains-newline.js", "../node_modules/yaml/dist/compose/util-flow-indent-check.js", "../node_modules/yaml/dist/compose/util-map-includes.js", "../node_modules/yaml/dist/compose/resolve-block-map.js", "../node_modules/yaml/dist/compose/resolve-block-seq.js", "../node_modules/yaml/dist/compose/resolve-end.js", "../node_modules/yaml/dist/compose/resolve-flow-collection.js", "../node_modules/yaml/dist/compose/compose-collection.js", "../node_modules/yaml/dist/compose/resolve-block-scalar.js", "../node_modules/yaml/dist/compose/resolve-flow-scalar.js", "../node_modules/yaml/dist/compose/compose-scalar.js", "../node_modules/yaml/dist/compose/util-empty-scalar-position.js", "../node_modules/yaml/dist/compose/compose-node.js", "../node_modules/yaml/dist/compose/compose-doc.js", "../node_modules/yaml/dist/compose/composer.js", "../node_modules/yaml/dist/parse/cst-scalar.js", "../node_modules/yaml/dist/parse/cst-stringify.js", "../node_modules/yaml/dist/parse/cst-visit.js", "../node_modules/yaml/dist/parse/cst.js", "../node_modules/yaml/dist/parse/lexer.js", "../node_modules/yaml/dist/parse/line-counter.js", "../node_modules/yaml/dist/parse/parser.js", "../node_modules/yaml/dist/public-api.js", "../src/ui/colors.ts", "../node_modules/@anthropic-ai/sdk/internal/tslib.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs", "../node_modules/@anthropic-ai/sdk/internal/errors.mjs", "../node_modules/@anthropic-ai/sdk/core/error.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/values.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs", "../node_modules/@anthropic-ai/sdk/version.mjs", "../node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs", "../node_modules/@anthropic-ai/sdk/internal/shims.mjs", "../node_modules/@anthropic-ai/sdk/internal/request-options.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/query.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs", "../node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/log.mjs", "../node_modules/@anthropic-ai/sdk/core/streaming.mjs", "../node_modules/@anthropic-ai/sdk/internal/parse.mjs", "../node_modules/@anthropic-ai/sdk/core/api-promise.mjs", "../node_modules/@anthropic-ai/sdk/core/pagination.mjs", "../node_modules/@anthropic-ai/sdk/internal/uploads.mjs", "../node_modules/@anthropic-ai/sdk/internal/to-file.mjs", "../node_modules/@anthropic-ai/sdk/core/uploads.mjs", "../node_modules/@anthropic-ai/sdk/core/resource.mjs", "../node_modules/@anthropic-ai/sdk/internal/headers.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/path.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/environments.mjs", "../node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/files.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/models.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs", "../node_modules/@anthropic-ai/sdk/error.mjs", "../node_modules/@anthropic-ai/sdk/internal/constants.mjs", "../node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs", "../node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs", "../node_modules/@anthropic-ai/sdk/streaming.mjs", "../node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs", "../node_modules/@anthropic-ai/sdk/lib/tools/ToolError.mjs", "../node_modules/@anthropic-ai/sdk/lib/tools/CompactionControl.mjs", "../node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs", "../node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs", "../node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs", "../node_modules/@anthropic-ai/sdk/resources/completions.mjs", "../node_modules/@anthropic-ai/sdk/lib/parser.mjs", "../node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs", "../node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs", "../node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs", "../node_modules/@anthropic-ai/sdk/resources/models.mjs", "../node_modules/@anthropic-ai/sdk/resources/index.mjs", "../node_modules/@anthropic-ai/sdk/internal/utils/env.mjs", "../node_modules/@anthropic-ai/sdk/client.mjs", "../node_modules/@anthropic-ai/sdk/index.mjs", "../node_modules/commander/esm.mjs", "../src/interop/faf.ts", "../node_modules/yaml/dist/index.js", "../src/wasm/kernel.ts", "../src/core/tiers.ts", "../src/core/scorer.ts", "../src/ui/display.ts", "../src/commands/score.ts", "../src/commands/init.ts", "../src/core/slots.ts", "../src/detect/scanner.ts", "../src/detect/frameworks.ts", "../src/detect/stack.ts", "../src/commands/auto.ts", "../src/commands/sync.ts", "../src/interop/claude.ts", "../src/interop/memory.ts", "../src/core/pro.ts", "../src/commands/compile.ts", "../src/commands/decompile.ts", "../src/core/schema.ts", "../src/commands/check.ts", "../src/interop/agents.ts", "../src/interop/cursorrules.ts", "../src/interop/gemini.ts", "../src/commands/export.ts", "../src/commands/git.ts", "../src/commands/info.ts", "../src/detect/formats.ts", "../src/commands/formats.ts", "../src/commands/clear.ts", "../src/commands/convert.ts", "../src/commands/context.ts", "../src/commands/drift.ts", "../src/commands/edit.ts", "../src/commands/recover.ts", "../src/commands/migrate.ts", "../src/commands/pro.ts", "../src/commands/share.ts", "../src/commands/demo.ts", "../src/commands/search.ts", "../src/commands/taf.ts", "../src/commands/go.ts", "../src/commands/ai.ts", "../src/commands/conductor.ts", "../src/cli.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * CommanderError class\n */\nclass CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n */\nclass InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\n",
6
+ "const { InvalidArgumentError } = require('./error.js');\n\nclass Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. <required>\n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.endsWith('...')) {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nfunction humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n\nexports.Argument = Argument;\nexports.humanReadableArgName = humanReadableArgName;\n",
7
+ "const { humanReadableArgName } = require('./argument.js');\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nclass Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (option.description) {\n return `${option.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n *\n * @param {string} heading\n * @param {string[]} items\n * @param {Help} helper\n * @returns string[]\n */\n formatItemList(heading, items, helper) {\n if (items.length === 0) return [];\n\n return [helper.styleTitle(heading), ...items, ''];\n }\n\n /**\n * Group items by their help group heading.\n *\n * @param {Command[] | Option[]} unsortedItems\n * @param {Command[] | Option[]} visibleItems\n * @param {Function} getGroup\n * @returns {Map<string, Command[] | Option[]>}\n */\n groupItems(unsortedItems, visibleItems, getGroup) {\n const result = new Map();\n // Add groups in order of appearance in unsortedItems.\n unsortedItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) result.set(group, []);\n });\n // Add items in order of appearance in visibleItems.\n visibleItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) {\n result.set(group, []);\n }\n result.get(group).push(item);\n });\n return result;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n output = output.concat(\n this.formatItemList('Arguments:', argumentList, helper),\n );\n\n // Options\n const optionGroups = this.groupItems(\n cmd.options,\n helper.visibleOptions(cmd),\n (option) => option.helpGroupHeading ?? 'Options:',\n );\n optionGroups.forEach((options, group) => {\n const optionList = options.map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(this.formatItemList(group, optionList, helper));\n });\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(\n this.formatItemList('Global Options:', globalOptionList, helper),\n );\n }\n\n // Commands\n const commandGroups = this.groupItems(\n cmd.commands,\n helper.visibleCommands(cmd),\n (sub) => sub.helpGroup() || 'Commands:',\n );\n commandGroups.forEach((commands, group) => {\n const commandList = commands.map((sub) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(sub)),\n helper.styleSubcommandDescription(helper.subcommandDescription(sub)),\n );\n });\n output = output.concat(this.formatItemList(group, commandList, helper));\n });\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripColor(str).length;\n }\n\n /**\n * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.\n *\n * @param {string} str\n * @returns {string}\n */\n styleTitle(str) {\n return str;\n }\n\n styleUsage(str) {\n // Usage has lots of parts the user might like to color separately! Assume default usage string which is formed like:\n // command subcommand [options] [command] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word === '[command]') return this.styleSubcommandText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleCommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleCommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleOptionDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleSubcommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleArgumentDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleDescriptionText(str) {\n return str;\n }\n styleOptionTerm(str) {\n return this.styleOptionText(str);\n }\n styleSubcommandTerm(str) {\n // This is very like usage with lots of parts! Assume default string which is formed like:\n // subcommand [options] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleSubcommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleArgumentTerm(str) {\n return this.styleArgumentText(str);\n }\n styleOptionText(str) {\n return str;\n }\n styleArgumentText(str) {\n return str;\n }\n styleSubcommandText(str) {\n return str;\n }\n styleCommandText(str) {\n return str;\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestGlobalOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper),\n );\n }\n\n /**\n * Detect manually wrapped and indented strings by checking for line break followed by whitespace.\n *\n * @param {string} str\n * @returns {boolean}\n */\n preformatted(str) {\n return /\\n[^\\S\\r\\n]/.test(str);\n }\n\n /**\n * Format the \"item\", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.\n *\n * So \"TTT\", 5, \"DDD DDDD DD DDD\" might be formatted for this.helpWidth=17 like so:\n * TTT DDD DDDD\n * DD DDD\n *\n * @param {string} term\n * @param {number} termWidth\n * @param {string} description\n * @param {Help} helper\n * @returns {string}\n */\n formatItem(term, termWidth, description, helper) {\n const itemIndent = 2;\n const itemIndentStr = ' '.repeat(itemIndent);\n if (!description) return itemIndentStr + term;\n\n // Pad the term out to a consistent width, so descriptions are aligned.\n const paddedTerm = term.padEnd(\n termWidth + term.length - helper.displayWidth(term),\n );\n\n // Format the description.\n const spacerWidth = 2; // between term and description\n const helpWidth = this.helpWidth ?? 80; // in case prepareContext() was not called\n const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;\n let formattedDescription;\n if (\n remainingWidth < this.minWidthToWrap ||\n helper.preformatted(description)\n ) {\n formattedDescription = description;\n } else {\n const wrappedDescription = helper.boxWrap(description, remainingWidth);\n formattedDescription = wrappedDescription.replace(\n /\\n/g,\n '\\n' + ' '.repeat(termWidth + spacerWidth),\n );\n }\n\n // Construct and overall indent.\n return (\n itemIndentStr +\n paddedTerm +\n ' '.repeat(spacerWidth) +\n formattedDescription.replace(/\\n/g, `\\n${itemIndentStr}`)\n );\n }\n\n /**\n * Wrap a string at whitespace, preserving existing line breaks.\n * Wrapping is skipped if the width is less than `minWidthToWrap`.\n *\n * @param {string} str\n * @param {number} width\n * @returns {string}\n */\n boxWrap(str, width) {\n if (width < this.minWidthToWrap) return str;\n\n const rawLines = str.split(/\\r\\n|\\n/);\n // split up text by whitespace\n const chunkPattern = /[\\s]*[^\\s]+/g;\n const wrappedLines = [];\n rawLines.forEach((line) => {\n const chunks = line.match(chunkPattern);\n if (chunks === null) {\n wrappedLines.push('');\n return;\n }\n\n let sumChunks = [chunks.shift()];\n let sumWidth = this.displayWidth(sumChunks[0]);\n chunks.forEach((chunk) => {\n const visibleWidth = this.displayWidth(chunk);\n // Accumulate chunks while they fit into width.\n if (sumWidth + visibleWidth <= width) {\n sumChunks.push(chunk);\n sumWidth += visibleWidth;\n return;\n }\n wrappedLines.push(sumChunks.join(''));\n\n const nextChunk = chunk.trimStart(); // trim space at line break\n sumChunks = [nextChunk];\n sumWidth = this.displayWidth(nextChunk);\n });\n wrappedLines.push(sumChunks.join(''));\n });\n\n return wrappedLines.join('\\n');\n }\n}\n\n/**\n * Strip style ANSI escape sequences from the string. In particular, SGR (Select Graphic Rendition) codes.\n *\n * @param {string} str\n * @returns {string}\n * @package\n */\n\nfunction stripColor(str) {\n // eslint-disable-next-line no-control-regex\n const sgrPattern = /\\x1b\\[\\d*(;\\d*)*m/g;\n return str.replace(sgrPattern, '');\n}\n\nexports.Help = Help;\nexports.stripColor = stripColor;\n",
8
+ "const { InvalidArgumentError } = require('./error.js');\n\nclass Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n this.helpGroupHeading = undefined; // soft initialised when option added to command\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Set the help group heading.\n *\n * @param {string} heading\n * @return {Option}\n */\n helpGroup(heading) {\n this.helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nclass DualOptions {\n /**\n * @param {Option[]} options\n */\n constructor(options) {\n this.positiveOptions = new Map();\n this.negativeOptions = new Map();\n this.dualOptions = new Set();\n options.forEach((option) => {\n if (option.negate) {\n this.negativeOptions.set(option.attributeName(), option);\n } else {\n this.positiveOptions.set(option.attributeName(), option);\n }\n });\n this.negativeOptions.forEach((value, key) => {\n if (this.positiveOptions.has(key)) {\n this.dualOptions.add(key);\n }\n });\n }\n\n /**\n * Did the value come from the option, and not from possible matching dual option?\n *\n * @param {*} value\n * @param {Option} option\n * @returns {boolean}\n */\n valueFromOption(value, option) {\n const optionKey = option.attributeName();\n if (!this.dualOptions.has(optionKey)) return true;\n\n // Use the value to deduce if (probably) came from the option.\n const preset = this.negativeOptions.get(optionKey).presetArg;\n const negativeValue = preset !== undefined ? preset : false;\n return option.negate === (negativeValue === value);\n }\n}\n\n/**\n * Convert string from kebab-case to camelCase.\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction camelcase(str) {\n return str.split('-').reduce((str, word) => {\n return str + word[0].toUpperCase() + word.slice(1);\n });\n}\n\n/**\n * Split the short and long flag out of something like '-m,--mixed <value>'\n *\n * @private\n */\n\nfunction splitOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // short flag, single dash and single character\n const shortFlagExp = /^-[^-]$/;\n // long flag, double dash and at least one character\n const longFlagExp = /^--[^-]/;\n\n const flagParts = flags.split(/[ |,]+/).concat('guard');\n // Normal is short and/or long.\n if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();\n if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();\n // Long then short. Rarely used but fine.\n if (!shortFlag && shortFlagExp.test(flagParts[0]))\n shortFlag = flagParts.shift();\n // Allow two long flags, like '--ws, --workspace'\n // This is the supported way to have a shortish option flag.\n if (!shortFlag && longFlagExp.test(flagParts[0])) {\n shortFlag = longFlag;\n longFlag = flagParts.shift();\n }\n\n // Check for unprocessed flag. Fail noisily rather than silently ignore.\n if (flagParts[0].startsWith('-')) {\n const unsupportedFlag = flagParts[0];\n const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;\n if (/^-[^-][^-]/.test(unsupportedFlag))\n throw new Error(\n `${baseError}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`,\n );\n if (shortFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many short flags`);\n if (longFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many long flags`);\n\n throw new Error(`${baseError}\n- unrecognised flag format`);\n }\n if (shortFlag === undefined && longFlag === undefined)\n throw new Error(\n `option creation failed due to no flags found in '${flags}'.`,\n );\n\n return { shortFlag, longFlag };\n}\n\nexports.Option = Option;\nexports.DualOptions = DualOptions;\n",
9
+ "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance\n // Calculating optimal string alignment distance, no substring is edited more than once.\n // (Simple implementation.)\n\n // Quick early exit, return worst case.\n if (Math.abs(a.length - b.length) > maxDistance)\n return Math.max(a.length, b.length);\n\n // distance between prefix substrings of a and b\n const d = [];\n\n // pure deletions turn a into empty string\n for (let i = 0; i <= a.length; i++) {\n d[i] = [i];\n }\n // pure insertions turn empty string into b\n for (let j = 0; j <= b.length; j++) {\n d[0][j] = j;\n }\n\n // fill matrix\n for (let j = 1; j <= b.length; j++) {\n for (let i = 1; i <= a.length; i++) {\n let cost = 1;\n if (a[i - 1] === b[j - 1]) {\n cost = 0;\n } else {\n cost = 1;\n }\n d[i][j] = Math.min(\n d[i - 1][j] + 1, // deletion\n d[i][j - 1] + 1, // insertion\n d[i - 1][j - 1] + cost, // substitution\n );\n // transposition\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);\n }\n }\n }\n\n return d[a.length][b.length];\n}\n\n/**\n * Find close matches, restricted to same number of edits.\n *\n * @param {string} word\n * @param {string[]} candidates\n * @returns {string}\n */\n\nfunction suggestSimilar(word, candidates) {\n if (!candidates || candidates.length === 0) return '';\n // remove possible duplicates\n candidates = Array.from(new Set(candidates));\n\n const searchingOptions = word.startsWith('--');\n if (searchingOptions) {\n word = word.slice(2);\n candidates = candidates.map((candidate) => candidate.slice(2));\n }\n\n let similar = [];\n let bestDistance = maxDistance;\n const minSimilarity = 0.4;\n candidates.forEach((candidate) => {\n if (candidate.length <= 1) return; // no one character guesses\n\n const distance = editDistance(word, candidate);\n const length = Math.max(word.length, candidate.length);\n const similarity = (length - distance) / length;\n if (similarity > minSimilarity) {\n if (distance < bestDistance) {\n // better edit distance, throw away previous worse matches\n bestDistance = distance;\n similar = [candidate];\n } else if (distance === bestDistance) {\n similar.push(candidate);\n }\n }\n });\n\n similar.sort((a, b) => a.localeCompare(b));\n if (searchingOptions) {\n similar = similar.map((candidate) => `--${candidate}`);\n }\n\n if (similar.length > 1) {\n return `\\n(Did you mean one of ${similar.join(', ')}?)`;\n }\n if (similar.length === 1) {\n return `\\n(Did you mean ${similar[0]}?)`;\n }\n return '';\n}\n\nexports.suggestSimilar = suggestSimilar;\n",
10
+ "const EventEmitter = require('node:events').EventEmitter;\nconst childProcess = require('node:child_process');\nconst path = require('node:path');\nconst fs = require('node:fs');\nconst process = require('node:process');\n\nconst { Argument, humanReadableArgName } = require('./argument.js');\nconst { CommanderError } = require('./error.js');\nconst { Help, stripColor } = require('./help.js');\nconst { Option, DualOptions } = require('./option.js');\nconst { suggestSimilar } = require('./suggestSimilar');\n\nclass Command extends EventEmitter {\n /**\n * Initialize a new `Command`.\n *\n * @param {string} [name]\n */\n\n constructor(name) {\n super();\n /** @type {Command[]} */\n this.commands = [];\n /** @type {Option[]} */\n this.options = [];\n this.parent = null;\n this._allowUnknownOption = false;\n this._allowExcessArguments = false;\n /** @type {Argument[]} */\n this.registeredArguments = [];\n this._args = this.registeredArguments; // deprecated old name\n /** @type {string[]} */\n this.args = []; // cli args with options removed\n this.rawArgs = [];\n this.processedArgs = []; // like .args but after custom processing and collecting variadic\n this._scriptPath = null;\n this._name = name || '';\n this._optionValues = {};\n this._optionValueSources = {}; // default, env, cli etc\n this._storeOptionsAsProperties = false;\n this._actionHandler = null;\n this._executableHandler = false;\n this._executableFile = null; // custom name for executable\n this._executableDir = null; // custom search directory for subcommands\n this._defaultCommandName = null;\n this._exitCallback = null;\n this._aliases = [];\n this._combineFlagAndOptionalValue = true;\n this._description = '';\n this._summary = '';\n this._argsDescription = undefined; // legacy\n this._enablePositionalOptions = false;\n this._passThroughOptions = false;\n this._lifeCycleHooks = {}; // a hash of arrays\n /** @type {(boolean | string)} */\n this._showHelpAfterError = false;\n this._showSuggestionAfterError = true;\n this._savedState = null; // used in save/restoreStateBeforeParse\n\n // see configureOutput() for docs\n this._outputConfiguration = {\n writeOut: (str) => process.stdout.write(str),\n writeErr: (str) => process.stderr.write(str),\n outputError: (str, write) => write(str),\n getOutHelpWidth: () =>\n process.stdout.isTTY ? process.stdout.columns : undefined,\n getErrHelpWidth: () =>\n process.stderr.isTTY ? process.stderr.columns : undefined,\n getOutHasColors: () =>\n useColor() ?? (process.stdout.isTTY && process.stdout.hasColors?.()),\n getErrHasColors: () =>\n useColor() ?? (process.stderr.isTTY && process.stderr.hasColors?.()),\n stripColor: (str) => stripColor(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n /** @type {string | undefined} */\n this._helpGroupHeading = undefined; // soft initialised when added to parent\n /** @type {string | undefined} */\n this._defaultCommandGroup = undefined;\n /** @type {string | undefined} */\n this._defaultOptionGroup = undefined;\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n *\n * // Command implemented using separate executable file (description is second parameter to `.command`)\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n *\n * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n this._outputConfiguration = {\n ...this._outputConfiguration,\n ...configuration,\n };\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom argument processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, parseArg, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof parseArg === 'function') {\n argument.default(defaultValue).argParser(parseArg);\n } else {\n argument.default(parseArg);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments('<cmd> [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument?.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n if (enableOrNameAndArgs && this._defaultCommandGroup) {\n // make the command to store the group\n this._initCommandGroup(this._getHelpCommand());\n }\n return this;\n }\n\n const nameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = nameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n // init group unless lazy create\n if (enableOrNameAndArgs || description) this._initCommandGroup(helpCommand);\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n this._initCommandGroup(helpCommand);\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this._initOptionGroup(option);\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this._initCommandGroup(command);\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.negate) {\n // --no-foo is special and defaults foo to true, unless a --foo option is already defined\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n name,\n option.defaultValue === undefined ? true : option.defaultValue,\n 'default',\n );\n }\n } else if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._collectValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n option(flags, description, parseArg, defaultValue) {\n return this._optionEx({}, flags, description, parseArg, defaultValue);\n }\n\n /**\n * Add a required option which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n requiredOption(flags, description, parseArg, defaultValue) {\n return this._optionEx(\n { mandatory: true },\n flags,\n description,\n parseArg,\n defaultValue,\n );\n }\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * // for `.option('-f,--flag [value]'):\n * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour\n * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n *\n * @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.\n * @return {Command} `this` command for chaining\n */\n combineFlagAndOptionalValue(combine = true) {\n this._combineFlagAndOptionalValue = !!combine;\n return this;\n }\n\n /**\n * Allow unknown options on the command line.\n *\n * @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options.\n * @return {Command} `this` command for chaining\n */\n allowUnknownOption(allowUnknown = true) {\n this._allowUnknownOption = !!allowUnknown;\n return this;\n }\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments.\n * @return {Command} `this` command for chaining\n */\n allowExcessArguments(allowExcess = true) {\n this._allowExcessArguments = !!allowExcess;\n return this;\n }\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @param {boolean} [positional]\n * @return {Command} `this` command for chaining\n */\n enablePositionalOptions(positional = true) {\n this._enablePositionalOptions = !!positional;\n return this;\n }\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @param {boolean} [passThrough] for unknown options.\n * @return {Command} `this` command for chaining\n */\n passThroughOptions(passThrough = true) {\n this._passThroughOptions = !!passThrough;\n this._checkForBrokenPassThrough();\n return this;\n }\n\n /**\n * @private\n */\n\n _checkForBrokenPassThrough() {\n if (\n this.parent &&\n this._passThroughOptions &&\n !this.parent._enablePositionalOptions\n ) {\n throw new Error(\n `passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`,\n );\n }\n }\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @param {boolean} [storeAsProperties=true]\n * @return {Command} `this` command for chaining\n */\n\n storeOptionsAsProperties(storeAsProperties = true) {\n if (this.options.length) {\n throw new Error('call .storeOptionsAsProperties() before adding options');\n }\n if (Object.keys(this._optionValues).length) {\n throw new Error(\n 'call .storeOptionsAsProperties() before setting option values',\n );\n }\n this._storeOptionsAsProperties = !!storeAsProperties;\n return this;\n }\n\n /**\n * Retrieve option value.\n *\n * @param {string} key\n * @return {object} value\n */\n\n getOptionValue(key) {\n if (this._storeOptionsAsProperties) {\n return this[key];\n }\n return this._optionValues[key];\n }\n\n /**\n * Store option value.\n *\n * @param {string} key\n * @param {object} value\n * @return {Command} `this` command for chaining\n */\n\n setOptionValue(key, value) {\n return this.setOptionValueWithSource(key, value, undefined);\n }\n\n /**\n * Store option value and where the value came from.\n *\n * @param {string} key\n * @param {object} value\n * @param {string} source - expected values are default/config/env/cli/implied\n * @return {Command} `this` command for chaining\n */\n\n setOptionValueWithSource(key, value, source) {\n if (this._storeOptionsAsProperties) {\n this[key] = value;\n } else {\n this._optionValues[key] = value;\n }\n this._optionValueSources[key] = source;\n return this;\n }\n\n /**\n * Get source of option value.\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSource(key) {\n return this._optionValueSources[key];\n }\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSourceWithGlobals(key) {\n // global overwrites local, like optsWithGlobals\n let source;\n this._getCommandAndAncestors().forEach((cmd) => {\n if (cmd.getOptionValueSource(key) !== undefined) {\n source = cmd.getOptionValueSource(key);\n }\n });\n return source;\n }\n\n /**\n * Get user arguments from implied or explicit arguments.\n * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.\n *\n * @private\n */\n\n _prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // auto-detect argument conventions if nothing supplied\n if (argv === undefined && parseOptions.from === undefined) {\n if (process.versions?.electron) {\n parseOptions.from = 'electron';\n }\n // check node specific options for scenarios where user CLI args follow executable without scriptname\n const execArgv = process.execArgv ?? [];\n if (\n execArgv.includes('-e') ||\n execArgv.includes('--eval') ||\n execArgv.includes('-p') ||\n execArgv.includes('--print')\n ) {\n parseOptions.from = 'eval'; // internal usage, not documented\n }\n }\n\n // default to using process.argv\n if (argv === undefined) {\n argv = process.argv;\n }\n this.rawArgs = argv.slice();\n\n // extract the user args and scriptPath\n let userArgs;\n switch (parseOptions.from) {\n case undefined:\n case 'node':\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n break;\n case 'electron':\n // @ts-ignore: because defaultApp is an unknown property\n if (process.defaultApp) {\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n } else {\n userArgs = argv.slice(1);\n }\n break;\n case 'user':\n userArgs = argv.slice(0);\n break;\n case 'eval':\n userArgs = argv.slice(1);\n break;\n default:\n throw new Error(\n `unexpected parse option { from: '${parseOptions.from}' }`,\n );\n }\n\n // Find default name for program from arguments.\n if (!this._name && this._scriptPath)\n this.nameFromFilename(this._scriptPath);\n this._name = this._name || 'program';\n\n return userArgs;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * program.parse(); // parse process.argv and auto-detect electron and special node flags\n * program.parse(process.argv); // assume argv[0] is app and argv[1] is script\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv] - optional, defaults to process.argv\n * @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron\n * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'\n * @return {Command} `this` command for chaining\n */\n\n parse(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n this._parseCommand([], userArgs);\n\n return this;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags\n * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv]\n * @param {object} [parseOptions]\n * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'\n * @return {Promise}\n */\n\n async parseAsync(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n await this._parseCommand([], userArgs);\n\n return this;\n }\n\n _prepareForParse() {\n if (this._savedState === null) {\n this.saveStateBeforeParse();\n } else {\n this.restoreStateBeforeParse();\n }\n }\n\n /**\n * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state saved.\n */\n saveStateBeforeParse() {\n this._savedState = {\n // name is stable if supplied by author, but may be unspecified for root command and deduced during parsing\n _name: this._name,\n // option values before parse have default values (including false for negated options)\n // shallow clones\n _optionValues: { ...this._optionValues },\n _optionValueSources: { ...this._optionValueSources },\n };\n }\n\n /**\n * Restore state before parse for calls after the first.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state restored.\n */\n restoreStateBeforeParse() {\n if (this._storeOptionsAsProperties)\n throw new Error(`Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties`);\n\n // clear state from _prepareUserArgs\n this._name = this._savedState._name;\n this._scriptPath = null;\n this.rawArgs = [];\n // clear state from setOptionValueWithSource\n this._optionValues = { ...this._savedState._optionValues };\n this._optionValueSources = { ...this._savedState._optionValueSources };\n // clear state from _parseCommand\n this.args = [];\n // clear state from _processArguments\n this.processedArgs = [];\n }\n\n /**\n * Throw if expected executable is missing. Add lots of help for author.\n *\n * @param {string} executableFile\n * @param {string} executableDir\n * @param {string} subcommandName\n */\n _checkForMissingExecutable(executableFile, executableDir, subcommandName) {\n if (fs.existsSync(executableFile)) return;\n\n const executableDirMessage = executableDir\n ? `searched for local subcommand relative to directory '${executableDir}'`\n : 'no directory for search for local subcommand, use .executableDir() to supply a custom directory';\n const executableMissing = `'${executableFile}' does not exist\n - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${executableDirMessage}`;\n throw new Error(executableMissing);\n }\n\n /**\n * Execute a sub-command executable.\n *\n * @private\n */\n\n _executeSubCommand(subcommand, args) {\n args = args.slice();\n let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n function findFile(baseDir, baseName) {\n // Look for specified file\n const localBin = path.resolve(baseDir, baseName);\n if (fs.existsSync(localBin)) return localBin;\n\n // Stop looking if candidate already has an expected extension.\n if (sourceExt.includes(path.extname(baseName))) return undefined;\n\n // Try all the extensions.\n const foundExt = sourceExt.find((ext) =>\n fs.existsSync(`${localBin}${ext}`),\n );\n if (foundExt) return `${localBin}${foundExt}`;\n\n return undefined;\n }\n\n // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // executableFile and executableDir might be full path, or just a name\n let executableFile =\n subcommand._executableFile || `${this._name}-${subcommand._name}`;\n let executableDir = this._executableDir || '';\n if (this._scriptPath) {\n let resolvedScriptPath; // resolve possible symlink for installed npm binary\n try {\n resolvedScriptPath = fs.realpathSync(this._scriptPath);\n } catch {\n resolvedScriptPath = this._scriptPath;\n }\n executableDir = path.resolve(\n path.dirname(resolvedScriptPath),\n executableDir,\n );\n }\n\n // Look for a local file in preference to a command in PATH.\n if (executableDir) {\n let localFile = findFile(executableDir, executableFile);\n\n // Legacy search using prefix of script name instead of command name\n if (!localFile && !subcommand._executableFile && this._scriptPath) {\n const legacyName = path.basename(\n this._scriptPath,\n path.extname(this._scriptPath),\n );\n if (legacyName !== this._name) {\n localFile = findFile(\n executableDir,\n `${legacyName}-${subcommand._name}`,\n );\n }\n }\n executableFile = localFile || executableFile;\n }\n\n launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise?.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent?.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} args\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(args) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n const negativeNumberArg = (arg) => {\n // return false if not a negative number\n if (!/^-(\\d+|\\d*\\.\\d+)(e[+-]?\\d+)?$/.test(arg)) return false;\n // negative number is ok unless digit used as an option in command hierarchy\n return !this._getCommandAndAncestors().some((cmd) =>\n cmd.options\n .map((opt) => opt.short)\n .some((short) => /^-\\d$/.test(short)),\n );\n };\n\n // parse options\n let activeVariadicOption = null;\n let activeGroup = null; // working through group of short options, like -abc\n let i = 0;\n while (i < args.length || activeGroup) {\n const arg = activeGroup ?? args[i++];\n activeGroup = null;\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args.slice(i));\n break;\n }\n\n if (\n activeVariadicOption &&\n (!maybeOption(arg) || negativeNumberArg(arg))\n ) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args[i++];\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (\n i < args.length &&\n (!maybeOption(args[i]) || negativeNumberArg(args[i]))\n ) {\n value = args[i++];\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option\n this.emit(`option:${option.name()}`);\n // remove the processed option and keep processing group\n activeGroup = `-${arg.slice(2)}`;\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n // A negative number in a leaf command is not an unknown option.\n if (\n dest === operands &&\n maybeOption(arg) &&\n !(this.commands.length === 0 && negativeNumberArg(arg))\n ) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n unknown.push(...args.slice(i));\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg, ...args.slice(i));\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg, ...args.slice(i));\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg, ...args.slice(i));\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set/get the help group heading for this subcommand in parent command's help.\n *\n * @param {string} [heading]\n * @return {Command | string}\n */\n\n helpGroup(heading) {\n if (heading === undefined) return this._helpGroupHeading ?? '';\n this._helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n commandsGroup(heading) {\n if (heading === undefined) return this._defaultCommandGroup ?? '';\n this._defaultCommandGroup = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n optionsGroup(heading) {\n if (heading === undefined) return this._defaultOptionGroup ?? '';\n this._defaultOptionGroup = heading;\n return this;\n }\n\n /**\n * @param {Option} option\n * @private\n */\n _initOptionGroup(option) {\n if (this._defaultOptionGroup && !option.helpGroupHeading)\n option.helpGroup(this._defaultOptionGroup);\n }\n\n /**\n * @param {Command} cmd\n * @private\n */\n _initCommandGroup(cmd) {\n if (this._defaultCommandGroup && !cmd.helpGroup())\n cmd.helpGroup(this._defaultCommandGroup);\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or require.main.filename, or __filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(require.main.filename);\n *\n * @param {string} filename\n * @return {Command}\n */\n\n nameFromFilename(filename) {\n this._name = path.basename(filename, path.extname(filename));\n\n return this;\n }\n\n /**\n * Get or set the directory for searching for executable subcommands of this command.\n *\n * @example\n * program.executableDir(__dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support enabling/disabling built-in help option.\n if (typeof flags === 'boolean') {\n if (flags) {\n if (this._helpOption === null) this._helpOption = undefined; // reenable\n if (this._defaultOptionGroup) {\n // make the option to store the group\n this._initOptionGroup(this._getHelpOption());\n }\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n this._helpOption = this.createOption(\n flags ?? '-h, --help',\n description ?? 'display help for command',\n );\n // init group unless lazy create\n if (flags || description) this._initOptionGroup(this._helpOption);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n this._initOptionGroup(option);\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * @returns {boolean | undefined}\n * @package\n */\nfunction useColor() {\n // Test for common conventions.\n // NB: the observed behaviour is in combination with how author adds color! For example:\n // - we do not test NODE_DISABLE_COLORS, but util:styletext does\n // - we do test NO_COLOR, but Chalk does not\n //\n // References:\n // https://no-color.org\n // https://bixense.com/clicolors/\n // https://github.com/nodejs/node/blob/0a00217a5f67ef4a22384cfc80eb6dd9a917fdc1/lib/internal/tty.js#L109\n // https://github.com/chalk/supports-color/blob/c214314a14bcb174b12b3014b2b0a8de375029ae/index.js#L33\n // (https://force-color.org recent web page from 2023, does not match major javascript implementations)\n\n if (\n process.env.NO_COLOR ||\n process.env.FORCE_COLOR === '0' ||\n process.env.FORCE_COLOR === 'false'\n )\n return false;\n if (process.env.FORCE_COLOR || process.env.CLICOLOR_FORCE !== undefined)\n return true;\n return undefined;\n}\n\nexports.Command = Command;\nexports.useColor = useColor; // exporting for tests\n",
11
+ "const { Argument } = require('./lib/argument.js');\nconst { Command } = require('./lib/command.js');\nconst { CommanderError, InvalidArgumentError } = require('./lib/error.js');\nconst { Help } = require('./lib/help.js');\nconst { Option } = require('./lib/option.js');\n\nexports.program = new Command();\n\nexports.createCommand = (name) => new Command(name);\nexports.createOption = (flags, description) => new Option(flags, description);\nexports.createArgument = (name, description) => new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexports.Command = Command;\nexports.Option = Option;\nexports.Argument = Argument;\nexports.Help = Help;\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\nexports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated\n",
12
+ "'use strict';\n\nconst ALIAS = Symbol.for('yaml.alias');\nconst DOC = Symbol.for('yaml.document');\nconst MAP = Symbol.for('yaml.map');\nconst PAIR = Symbol.for('yaml.pair');\nconst SCALAR = Symbol.for('yaml.scalar');\nconst SEQ = Symbol.for('yaml.seq');\nconst NODE_TYPE = Symbol.for('yaml.node.type');\nconst isAlias = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === ALIAS;\nconst isDocument = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === DOC;\nconst isMap = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === MAP;\nconst isPair = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === PAIR;\nconst isScalar = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SCALAR;\nconst isSeq = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SEQ;\nfunction isCollection(node) {\n if (node && typeof node === 'object')\n switch (node[NODE_TYPE]) {\n case MAP:\n case SEQ:\n return true;\n }\n return false;\n}\nfunction isNode(node) {\n if (node && typeof node === 'object')\n switch (node[NODE_TYPE]) {\n case ALIAS:\n case MAP:\n case SCALAR:\n case SEQ:\n return true;\n }\n return false;\n}\nconst hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;\n\nexports.ALIAS = ALIAS;\nexports.DOC = DOC;\nexports.MAP = MAP;\nexports.NODE_TYPE = NODE_TYPE;\nexports.PAIR = PAIR;\nexports.SCALAR = SCALAR;\nexports.SEQ = SEQ;\nexports.hasAnchor = hasAnchor;\nexports.isAlias = isAlias;\nexports.isCollection = isCollection;\nexports.isDocument = isDocument;\nexports.isMap = isMap;\nexports.isNode = isNode;\nexports.isPair = isPair;\nexports.isScalar = isScalar;\nexports.isSeq = isSeq;\n",
13
+ "'use strict';\n\nvar identity = require('./nodes/identity.js');\n\nconst BREAK = Symbol('break visit');\nconst SKIP = Symbol('skip children');\nconst REMOVE = Symbol('remove node');\n/**\n * Apply a visitor to an AST node or document.\n *\n * Walks through the tree (depth-first) starting from `node`, calling a\n * `visitor` function with three arguments:\n * - `key`: For sequence values and map `Pair`, the node's index in the\n * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.\n * `null` for the root node.\n * - `node`: The current node.\n * - `path`: The ancestry of the current node.\n *\n * The return value of the visitor may be used to control the traversal:\n * - `undefined` (default): Do nothing and continue\n * - `visit.SKIP`: Do not visit the children of this node, continue with next\n * sibling\n * - `visit.BREAK`: Terminate traversal completely\n * - `visit.REMOVE`: Remove the current node, then continue with the next one\n * - `Node`: Replace the current node, then continue by visiting it\n * - `number`: While iterating the items of a sequence or map, set the index\n * of the next step. This is useful especially if the index of the current\n * node has changed.\n *\n * If `visitor` is a single function, it will be called with all values\n * encountered in the tree, including e.g. `null` values. Alternatively,\n * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,\n * `Alias` and `Scalar` node. To define the same visitor function for more than\n * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)\n * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most\n * specific defined one will be used for each node.\n */\nfunction visit(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (identity.isDocument(node)) {\n const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n visit_(null, node, visitor_, Object.freeze([]));\n}\n// Without the `as symbol` casts, TS declares these in the `visit`\n// namespace using `var`, but then complains about that because\n// `unique symbol` must be `const`.\n/** Terminate visit traversal completely */\nvisit.BREAK = BREAK;\n/** Do not visit the children of the current node */\nvisit.SKIP = SKIP;\n/** Remove the current node */\nvisit.REMOVE = REMOVE;\nfunction visit_(key, node, visitor, path) {\n const ctrl = callVisitor(key, node, visitor, path);\n if (identity.isNode(ctrl) || identity.isPair(ctrl)) {\n replaceNode(key, path, ctrl);\n return visit_(key, ctrl, visitor, path);\n }\n if (typeof ctrl !== 'symbol') {\n if (identity.isCollection(node)) {\n path = Object.freeze(path.concat(node));\n for (let i = 0; i < node.items.length; ++i) {\n const ci = visit_(i, node.items[i], visitor, path);\n if (typeof ci === 'number')\n i = ci - 1;\n else if (ci === BREAK)\n return BREAK;\n else if (ci === REMOVE) {\n node.items.splice(i, 1);\n i -= 1;\n }\n }\n }\n else if (identity.isPair(node)) {\n path = Object.freeze(path.concat(node));\n const ck = visit_('key', node.key, visitor, path);\n if (ck === BREAK)\n return BREAK;\n else if (ck === REMOVE)\n node.key = null;\n const cv = visit_('value', node.value, visitor, path);\n if (cv === BREAK)\n return BREAK;\n else if (cv === REMOVE)\n node.value = null;\n }\n }\n return ctrl;\n}\n/**\n * Apply an async visitor to an AST node or document.\n *\n * Walks through the tree (depth-first) starting from `node`, calling a\n * `visitor` function with three arguments:\n * - `key`: For sequence values and map `Pair`, the node's index in the\n * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.\n * `null` for the root node.\n * - `node`: The current node.\n * - `path`: The ancestry of the current node.\n *\n * The return value of the visitor may be used to control the traversal:\n * - `Promise`: Must resolve to one of the following values\n * - `undefined` (default): Do nothing and continue\n * - `visit.SKIP`: Do not visit the children of this node, continue with next\n * sibling\n * - `visit.BREAK`: Terminate traversal completely\n * - `visit.REMOVE`: Remove the current node, then continue with the next one\n * - `Node`: Replace the current node, then continue by visiting it\n * - `number`: While iterating the items of a sequence or map, set the index\n * of the next step. This is useful especially if the index of the current\n * node has changed.\n *\n * If `visitor` is a single function, it will be called with all values\n * encountered in the tree, including e.g. `null` values. Alternatively,\n * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,\n * `Alias` and `Scalar` node. To define the same visitor function for more than\n * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)\n * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most\n * specific defined one will be used for each node.\n */\nasync function visitAsync(node, visitor) {\n const visitor_ = initVisitor(visitor);\n if (identity.isDocument(node)) {\n const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));\n if (cd === REMOVE)\n node.contents = null;\n }\n else\n await visitAsync_(null, node, visitor_, Object.freeze([]));\n}\n// Without the `as symbol` casts, TS declares these in the `visit`\n// namespace using `var`, but then complains about that because\n// `unique symbol` must be `const`.\n/** Terminate visit traversal completely */\nvisitAsync.BREAK = BREAK;\n/** Do not visit the children of the current node */\nvisitAsync.SKIP = SKIP;\n/** Remove the current node */\nvisitAsync.REMOVE = REMOVE;\nasync function visitAsync_(key, node, visitor, path) {\n const ctrl = await callVisitor(key, node, visitor, path);\n if (identity.isNode(ctrl) || identity.isPair(ctrl)) {\n replaceNode(key, path, ctrl);\n return visitAsync_(key, ctrl, visitor, path);\n }\n if (typeof ctrl !== 'symbol') {\n if (identity.isCollection(node)) {\n path = Object.freeze(path.concat(node));\n for (let i = 0; i < node.items.length; ++i) {\n const ci = await visitAsync_(i, node.items[i], visitor, path);\n if (typeof ci === 'number')\n i = ci - 1;\n else if (ci === BREAK)\n return BREAK;\n else if (ci === REMOVE) {\n node.items.splice(i, 1);\n i -= 1;\n }\n }\n }\n else if (identity.isPair(node)) {\n path = Object.freeze(path.concat(node));\n const ck = await visitAsync_('key', node.key, visitor, path);\n if (ck === BREAK)\n return BREAK;\n else if (ck === REMOVE)\n node.key = null;\n const cv = await visitAsync_('value', node.value, visitor, path);\n if (cv === BREAK)\n return BREAK;\n else if (cv === REMOVE)\n node.value = null;\n }\n }\n return ctrl;\n}\nfunction initVisitor(visitor) {\n if (typeof visitor === 'object' &&\n (visitor.Collection || visitor.Node || visitor.Value)) {\n return Object.assign({\n Alias: visitor.Node,\n Map: visitor.Node,\n Scalar: visitor.Node,\n Seq: visitor.Node\n }, visitor.Value && {\n Map: visitor.Value,\n Scalar: visitor.Value,\n Seq: visitor.Value\n }, visitor.Collection && {\n Map: visitor.Collection,\n Seq: visitor.Collection\n }, visitor);\n }\n return visitor;\n}\nfunction callVisitor(key, node, visitor, path) {\n if (typeof visitor === 'function')\n return visitor(key, node, path);\n if (identity.isMap(node))\n return visitor.Map?.(key, node, path);\n if (identity.isSeq(node))\n return visitor.Seq?.(key, node, path);\n if (identity.isPair(node))\n return visitor.Pair?.(key, node, path);\n if (identity.isScalar(node))\n return visitor.Scalar?.(key, node, path);\n if (identity.isAlias(node))\n return visitor.Alias?.(key, node, path);\n return undefined;\n}\nfunction replaceNode(key, path, node) {\n const parent = path[path.length - 1];\n if (identity.isCollection(parent)) {\n parent.items[key] = node;\n }\n else if (identity.isPair(parent)) {\n if (key === 'key')\n parent.key = node;\n else\n parent.value = node;\n }\n else if (identity.isDocument(parent)) {\n parent.contents = node;\n }\n else {\n const pt = identity.isAlias(parent) ? 'alias' : 'scalar';\n throw new Error(`Cannot replace node with ${pt} parent`);\n }\n}\n\nexports.visit = visit;\nexports.visitAsync = visitAsync;\n",
14
+ "'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar visit = require('../visit.js');\n\nconst escapeChars = {\n '!': '%21',\n ',': '%2C',\n '[': '%5B',\n ']': '%5D',\n '{': '%7B',\n '}': '%7D'\n};\nconst escapeTagName = (tn) => tn.replace(/[!,[\\]{}]/g, ch => escapeChars[ch]);\nclass Directives {\n constructor(yaml, tags) {\n /**\n * The directives-end/doc-start marker `---`. If `null`, a marker may still be\n * included in the document's stringified representation.\n */\n this.docStart = null;\n /** The doc-end marker `...`. */\n this.docEnd = false;\n this.yaml = Object.assign({}, Directives.defaultYaml, yaml);\n this.tags = Object.assign({}, Directives.defaultTags, tags);\n }\n clone() {\n const copy = new Directives(this.yaml, this.tags);\n copy.docStart = this.docStart;\n return copy;\n }\n /**\n * During parsing, get a Directives instance for the current document and\n * update the stream state according to the current version's spec.\n */\n atDocument() {\n const res = new Directives(this.yaml, this.tags);\n switch (this.yaml.version) {\n case '1.1':\n this.atNextDocument = true;\n break;\n case '1.2':\n this.atNextDocument = false;\n this.yaml = {\n explicit: Directives.defaultYaml.explicit,\n version: '1.2'\n };\n this.tags = Object.assign({}, Directives.defaultTags);\n break;\n }\n return res;\n }\n /**\n * @param onError - May be called even if the action was successful\n * @returns `true` on success\n */\n add(line, onError) {\n if (this.atNextDocument) {\n this.yaml = { explicit: Directives.defaultYaml.explicit, version: '1.1' };\n this.tags = Object.assign({}, Directives.defaultTags);\n this.atNextDocument = false;\n }\n const parts = line.trim().split(/[ \\t]+/);\n const name = parts.shift();\n switch (name) {\n case '%TAG': {\n if (parts.length !== 2) {\n onError(0, '%TAG directive should contain exactly two parts');\n if (parts.length < 2)\n return false;\n }\n const [handle, prefix] = parts;\n this.tags[handle] = prefix;\n return true;\n }\n case '%YAML': {\n this.yaml.explicit = true;\n if (parts.length !== 1) {\n onError(0, '%YAML directive should contain exactly one part');\n return false;\n }\n const [version] = parts;\n if (version === '1.1' || version === '1.2') {\n this.yaml.version = version;\n return true;\n }\n else {\n const isValid = /^\\d+\\.\\d+$/.test(version);\n onError(6, `Unsupported YAML version ${version}`, isValid);\n return false;\n }\n }\n default:\n onError(0, `Unknown directive ${name}`, true);\n return false;\n }\n }\n /**\n * Resolves a tag, matching handles to those defined in %TAG directives.\n *\n * @returns Resolved tag, which may also be the non-specific tag `'!'` or a\n * `'!local'` tag, or `null` if unresolvable.\n */\n tagName(source, onError) {\n if (source === '!')\n return '!'; // non-specific tag\n if (source[0] !== '!') {\n onError(`Not a valid tag: ${source}`);\n return null;\n }\n if (source[1] === '<') {\n const verbatim = source.slice(2, -1);\n if (verbatim === '!' || verbatim === '!!') {\n onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);\n return null;\n }\n if (source[source.length - 1] !== '>')\n onError('Verbatim tags must end with a >');\n return verbatim;\n }\n const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);\n if (!suffix)\n onError(`The ${source} tag has no suffix`);\n const prefix = this.tags[handle];\n if (prefix) {\n try {\n return prefix + decodeURIComponent(suffix);\n }\n catch (error) {\n onError(String(error));\n return null;\n }\n }\n if (handle === '!')\n return source; // local tag\n onError(`Could not resolve tag: ${source}`);\n return null;\n }\n /**\n * Given a fully resolved tag, returns its printable string form,\n * taking into account current tag prefixes and defaults.\n */\n tagString(tag) {\n for (const [handle, prefix] of Object.entries(this.tags)) {\n if (tag.startsWith(prefix))\n return handle + escapeTagName(tag.substring(prefix.length));\n }\n return tag[0] === '!' ? tag : `!<${tag}>`;\n }\n toString(doc) {\n const lines = this.yaml.explicit\n ? [`%YAML ${this.yaml.version || '1.2'}`]\n : [];\n const tagEntries = Object.entries(this.tags);\n let tagNames;\n if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) {\n const tags = {};\n visit.visit(doc.contents, (_key, node) => {\n if (identity.isNode(node) && node.tag)\n tags[node.tag] = true;\n });\n tagNames = Object.keys(tags);\n }\n else\n tagNames = [];\n for (const [handle, prefix] of tagEntries) {\n if (handle === '!!' && prefix === 'tag:yaml.org,2002:')\n continue;\n if (!doc || tagNames.some(tn => tn.startsWith(prefix)))\n lines.push(`%TAG ${handle} ${prefix}`);\n }\n return lines.join('\\n');\n }\n}\nDirectives.defaultYaml = { explicit: false, version: '1.2' };\nDirectives.defaultTags = { '!!': 'tag:yaml.org,2002:' };\n\nexports.Directives = Directives;\n",
15
+ "'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar visit = require('../visit.js');\n\n/**\n * Verify that the input string is a valid anchor.\n *\n * Will throw on errors.\n */\nfunction anchorIsValid(anchor) {\n if (/[\\x00-\\x19\\s,[\\]{}]/.test(anchor)) {\n const sa = JSON.stringify(anchor);\n const msg = `Anchor must not contain whitespace or control characters: ${sa}`;\n throw new Error(msg);\n }\n return true;\n}\nfunction anchorNames(root) {\n const anchors = new Set();\n visit.visit(root, {\n Value(_key, node) {\n if (node.anchor)\n anchors.add(node.anchor);\n }\n });\n return anchors;\n}\n/** Find a new anchor name with the given `prefix` and a one-indexed suffix. */\nfunction findNewAnchor(prefix, exclude) {\n for (let i = 1; true; ++i) {\n const name = `${prefix}${i}`;\n if (!exclude.has(name))\n return name;\n }\n}\nfunction createNodeAnchors(doc, prefix) {\n const aliasObjects = [];\n const sourceObjects = new Map();\n let prevAnchors = null;\n return {\n onAnchor: (source) => {\n aliasObjects.push(source);\n prevAnchors ?? (prevAnchors = anchorNames(doc));\n const anchor = findNewAnchor(prefix, prevAnchors);\n prevAnchors.add(anchor);\n return anchor;\n },\n /**\n * With circular references, the source node is only resolved after all\n * of its child nodes are. This is why anchors are set only after all of\n * the nodes have been created.\n */\n setAnchors: () => {\n for (const source of aliasObjects) {\n const ref = sourceObjects.get(source);\n if (typeof ref === 'object' &&\n ref.anchor &&\n (identity.isScalar(ref.node) || identity.isCollection(ref.node))) {\n ref.node.anchor = ref.anchor;\n }\n else {\n const error = new Error('Failed to resolve repeated object (this should not happen)');\n error.source = source;\n throw error;\n }\n }\n },\n sourceObjects\n };\n}\n\nexports.anchorIsValid = anchorIsValid;\nexports.anchorNames = anchorNames;\nexports.createNodeAnchors = createNodeAnchors;\nexports.findNewAnchor = findNewAnchor;\n",
16
+ "'use strict';\n\n/**\n * Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec,\n * in section 24.5.1.1 \"Runtime Semantics: InternalizeJSONProperty\" of the\n * 2021 edition: https://tc39.es/ecma262/#sec-json.parse\n *\n * Includes extensions for handling Map and Set objects.\n */\nfunction applyReviver(reviver, obj, key, val) {\n if (val && typeof val === 'object') {\n if (Array.isArray(val)) {\n for (let i = 0, len = val.length; i < len; ++i) {\n const v0 = val[i];\n const v1 = applyReviver(reviver, val, String(i), v0);\n // eslint-disable-next-line @typescript-eslint/no-array-delete\n if (v1 === undefined)\n delete val[i];\n else if (v1 !== v0)\n val[i] = v1;\n }\n }\n else if (val instanceof Map) {\n for (const k of Array.from(val.keys())) {\n const v0 = val.get(k);\n const v1 = applyReviver(reviver, val, k, v0);\n if (v1 === undefined)\n val.delete(k);\n else if (v1 !== v0)\n val.set(k, v1);\n }\n }\n else if (val instanceof Set) {\n for (const v0 of Array.from(val)) {\n const v1 = applyReviver(reviver, val, v0, v0);\n if (v1 === undefined)\n val.delete(v0);\n else if (v1 !== v0) {\n val.delete(v0);\n val.add(v1);\n }\n }\n }\n else {\n for (const [k, v0] of Object.entries(val)) {\n const v1 = applyReviver(reviver, val, k, v0);\n if (v1 === undefined)\n delete val[k];\n else if (v1 !== v0)\n val[k] = v1;\n }\n }\n }\n return reviver.call(obj, key, val);\n}\n\nexports.applyReviver = applyReviver;\n",
17
+ "'use strict';\n\nvar identity = require('./identity.js');\n\n/**\n * Recursively convert any node or its contents to native JavaScript\n *\n * @param value - The input value\n * @param arg - If `value` defines a `toJSON()` method, use this\n * as its first argument\n * @param ctx - Conversion context, originally set in Document#toJS(). If\n * `{ keep: true }` is not set, output should be suitable for JSON\n * stringification.\n */\nfunction toJS(value, arg, ctx) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n if (Array.isArray(value))\n return value.map((v, i) => toJS(v, String(i), ctx));\n if (value && typeof value.toJSON === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n if (!ctx || !identity.hasAnchor(value))\n return value.toJSON(arg, ctx);\n const data = { aliasCount: 0, count: 1, res: undefined };\n ctx.anchors.set(value, data);\n ctx.onCreate = res => {\n data.res = res;\n delete ctx.onCreate;\n };\n const res = value.toJSON(arg, ctx);\n if (ctx.onCreate)\n ctx.onCreate(res);\n return res;\n }\n if (typeof value === 'bigint' && !ctx?.keep)\n return Number(value);\n return value;\n}\n\nexports.toJS = toJS;\n",
18
+ "'use strict';\n\nvar applyReviver = require('../doc/applyReviver.js');\nvar identity = require('./identity.js');\nvar toJS = require('./toJS.js');\n\nclass NodeBase {\n constructor(type) {\n Object.defineProperty(this, identity.NODE_TYPE, { value: type });\n }\n /** Create a copy of this node. */\n clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }\n /** A plain JavaScript representation of this node. */\n toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {\n if (!identity.isDocument(doc))\n throw new TypeError('A document argument is required');\n const ctx = {\n anchors: new Map(),\n doc,\n keep: true,\n mapAsMap: mapAsMap === true,\n mapKeyWarned: false,\n maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100\n };\n const res = toJS.toJS(this, '', ctx);\n if (typeof onAnchor === 'function')\n for (const { count, res } of ctx.anchors.values())\n onAnchor(res, count);\n return typeof reviver === 'function'\n ? applyReviver.applyReviver(reviver, { '': res }, '', res)\n : res;\n }\n}\n\nexports.NodeBase = NodeBase;\n",
19
+ "'use strict';\n\nvar anchors = require('../doc/anchors.js');\nvar visit = require('../visit.js');\nvar identity = require('./identity.js');\nvar Node = require('./Node.js');\nvar toJS = require('./toJS.js');\n\nclass Alias extends Node.NodeBase {\n constructor(source) {\n super(identity.ALIAS);\n this.source = source;\n Object.defineProperty(this, 'tag', {\n set() {\n throw new Error('Alias nodes cannot have tags');\n }\n });\n }\n /**\n * Resolve the value of this alias within `doc`, finding the last\n * instance of the `source` anchor before this node.\n */\n resolve(doc, ctx) {\n let nodes;\n if (ctx?.aliasResolveCache) {\n nodes = ctx.aliasResolveCache;\n }\n else {\n nodes = [];\n visit.visit(doc, {\n Node: (_key, node) => {\n if (identity.isAlias(node) || identity.hasAnchor(node))\n nodes.push(node);\n }\n });\n if (ctx)\n ctx.aliasResolveCache = nodes;\n }\n let found = undefined;\n for (const node of nodes) {\n if (node === this)\n break;\n if (node.anchor === this.source)\n found = node;\n }\n return found;\n }\n toJSON(_arg, ctx) {\n if (!ctx)\n return { source: this.source };\n const { anchors, doc, maxAliasCount } = ctx;\n const source = this.resolve(doc, ctx);\n if (!source) {\n const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;\n throw new ReferenceError(msg);\n }\n let data = anchors.get(source);\n if (!data) {\n // Resolve anchors for Node.prototype.toJS()\n toJS.toJS(source, null, ctx);\n data = anchors.get(source);\n }\n /* istanbul ignore if */\n if (data?.res === undefined) {\n const msg = 'This should not happen: Alias anchor was not resolved?';\n throw new ReferenceError(msg);\n }\n if (maxAliasCount >= 0) {\n data.count += 1;\n if (data.aliasCount === 0)\n data.aliasCount = getAliasCount(doc, source, anchors);\n if (data.count * data.aliasCount > maxAliasCount) {\n const msg = 'Excessive alias count indicates a resource exhaustion attack';\n throw new ReferenceError(msg);\n }\n }\n return data.res;\n }\n toString(ctx, _onComment, _onChompKeep) {\n const src = `*${this.source}`;\n if (ctx) {\n anchors.anchorIsValid(this.source);\n if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {\n const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;\n throw new Error(msg);\n }\n if (ctx.implicitKey)\n return `${src} `;\n }\n return src;\n }\n}\nfunction getAliasCount(doc, node, anchors) {\n if (identity.isAlias(node)) {\n const source = node.resolve(doc);\n const anchor = anchors && source && anchors.get(source);\n return anchor ? anchor.count * anchor.aliasCount : 0;\n }\n else if (identity.isCollection(node)) {\n let count = 0;\n for (const item of node.items) {\n const c = getAliasCount(doc, item, anchors);\n if (c > count)\n count = c;\n }\n return count;\n }\n else if (identity.isPair(node)) {\n const kc = getAliasCount(doc, node.key, anchors);\n const vc = getAliasCount(doc, node.value, anchors);\n return Math.max(kc, vc);\n }\n return 1;\n}\n\nexports.Alias = Alias;\n",
20
+ "'use strict';\n\nvar identity = require('./identity.js');\nvar Node = require('./Node.js');\nvar toJS = require('./toJS.js');\n\nconst isScalarValue = (value) => !value || (typeof value !== 'function' && typeof value !== 'object');\nclass Scalar extends Node.NodeBase {\n constructor(value) {\n super(identity.SCALAR);\n this.value = value;\n }\n toJSON(arg, ctx) {\n return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx);\n }\n toString() {\n return String(this.value);\n }\n}\nScalar.BLOCK_FOLDED = 'BLOCK_FOLDED';\nScalar.BLOCK_LITERAL = 'BLOCK_LITERAL';\nScalar.PLAIN = 'PLAIN';\nScalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';\nScalar.QUOTE_SINGLE = 'QUOTE_SINGLE';\n\nexports.Scalar = Scalar;\nexports.isScalarValue = isScalarValue;\n",
21
+ "'use strict';\n\nvar Alias = require('../nodes/Alias.js');\nvar identity = require('../nodes/identity.js');\nvar Scalar = require('../nodes/Scalar.js');\n\nconst defaultTagPrefix = 'tag:yaml.org,2002:';\nfunction findTagObject(value, tagName, tags) {\n if (tagName) {\n const match = tags.filter(t => t.tag === tagName);\n const tagObj = match.find(t => !t.format) ?? match[0];\n if (!tagObj)\n throw new Error(`Tag ${tagName} not found`);\n return tagObj;\n }\n return tags.find(t => t.identify?.(value) && !t.format);\n}\nfunction createNode(value, tagName, ctx) {\n if (identity.isDocument(value))\n value = value.contents;\n if (identity.isNode(value))\n return value;\n if (identity.isPair(value)) {\n const map = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx);\n map.items.push(value);\n return map;\n }\n if (value instanceof String ||\n value instanceof Number ||\n value instanceof Boolean ||\n (typeof BigInt !== 'undefined' && value instanceof BigInt) // not supported everywhere\n ) {\n // https://tc39.es/ecma262/#sec-serializejsonproperty\n value = value.valueOf();\n }\n const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;\n // Detect duplicate references to the same object & use Alias nodes for all\n // after first. The `ref` wrapper allows for circular references to resolve.\n let ref = undefined;\n if (aliasDuplicateObjects && value && typeof value === 'object') {\n ref = sourceObjects.get(value);\n if (ref) {\n ref.anchor ?? (ref.anchor = onAnchor(value));\n return new Alias.Alias(ref.anchor);\n }\n else {\n ref = { anchor: null, node: null };\n sourceObjects.set(value, ref);\n }\n }\n if (tagName?.startsWith('!!'))\n tagName = defaultTagPrefix + tagName.slice(2);\n let tagObj = findTagObject(value, tagName, schema.tags);\n if (!tagObj) {\n if (value && typeof value.toJSON === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n value = value.toJSON();\n }\n if (!value || typeof value !== 'object') {\n const node = new Scalar.Scalar(value);\n if (ref)\n ref.node = node;\n return node;\n }\n tagObj =\n value instanceof Map\n ? schema[identity.MAP]\n : Symbol.iterator in Object(value)\n ? schema[identity.SEQ]\n : schema[identity.MAP];\n }\n if (onTagObj) {\n onTagObj(tagObj);\n delete ctx.onTagObj;\n }\n const node = tagObj?.createNode\n ? tagObj.createNode(ctx.schema, value, ctx)\n : typeof tagObj?.nodeClass?.from === 'function'\n ? tagObj.nodeClass.from(ctx.schema, value, ctx)\n : new Scalar.Scalar(value);\n if (tagName)\n node.tag = tagName;\n else if (!tagObj.default)\n node.tag = tagObj.tag;\n if (ref)\n ref.node = node;\n return node;\n}\n\nexports.createNode = createNode;\n",
22
+ "'use strict';\n\nvar createNode = require('../doc/createNode.js');\nvar identity = require('./identity.js');\nvar Node = require('./Node.js');\n\nfunction collectionFromPath(schema, path, value) {\n let v = value;\n for (let i = path.length - 1; i >= 0; --i) {\n const k = path[i];\n if (typeof k === 'number' && Number.isInteger(k) && k >= 0) {\n const a = [];\n a[k] = v;\n v = a;\n }\n else {\n v = new Map([[k, v]]);\n }\n }\n return createNode.createNode(v, undefined, {\n aliasDuplicateObjects: false,\n keepUndefined: false,\n onAnchor: () => {\n throw new Error('This should not happen, please report a bug.');\n },\n schema,\n sourceObjects: new Map()\n });\n}\n// Type guard is intentionally a little wrong so as to be more useful,\n// as it does not cover untypable empty non-string iterables (e.g. []).\nconst isEmptyPath = (path) => path == null ||\n (typeof path === 'object' && !!path[Symbol.iterator]().next().done);\nclass Collection extends Node.NodeBase {\n constructor(type, schema) {\n super(type);\n Object.defineProperty(this, 'schema', {\n value: schema,\n configurable: true,\n enumerable: false,\n writable: true\n });\n }\n /**\n * Create a copy of this collection.\n *\n * @param schema - If defined, overwrites the original's schema\n */\n clone(schema) {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (schema)\n copy.schema = schema;\n copy.items = copy.items.map(it => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it);\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }\n /**\n * Adds a value to the collection. For `!!map` and `!!omap` the value must\n * be a Pair instance or a `{ key, value }` object, which may not have a key\n * that already exists in the map.\n */\n addIn(path, value) {\n if (isEmptyPath(path))\n this.add(value);\n else {\n const [key, ...rest] = path;\n const node = this.get(key, true);\n if (identity.isCollection(node))\n node.addIn(rest, value);\n else if (node === undefined && this.schema)\n this.set(key, collectionFromPath(this.schema, rest, value));\n else\n throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n }\n }\n /**\n * Removes a value from the collection.\n * @returns `true` if the item was found and removed.\n */\n deleteIn(path) {\n const [key, ...rest] = path;\n if (rest.length === 0)\n return this.delete(key);\n const node = this.get(key, true);\n if (identity.isCollection(node))\n return node.deleteIn(rest);\n else\n throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n }\n /**\n * Returns item at `key`, or `undefined` if not found. By default unwraps\n * scalar values from their surrounding node; to disable set `keepScalar` to\n * `true` (collections are always returned intact).\n */\n getIn(path, keepScalar) {\n const [key, ...rest] = path;\n const node = this.get(key, true);\n if (rest.length === 0)\n return !keepScalar && identity.isScalar(node) ? node.value : node;\n else\n return identity.isCollection(node) ? node.getIn(rest, keepScalar) : undefined;\n }\n hasAllNullValues(allowScalar) {\n return this.items.every(node => {\n if (!identity.isPair(node))\n return false;\n const n = node.value;\n return (n == null ||\n (allowScalar &&\n identity.isScalar(n) &&\n n.value == null &&\n !n.commentBefore &&\n !n.comment &&\n !n.tag));\n });\n }\n /**\n * Checks if the collection includes a value with the key `key`.\n */\n hasIn(path) {\n const [key, ...rest] = path;\n if (rest.length === 0)\n return this.has(key);\n const node = this.get(key, true);\n return identity.isCollection(node) ? node.hasIn(rest) : false;\n }\n /**\n * Sets a value in this collection. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n */\n setIn(path, value) {\n const [key, ...rest] = path;\n if (rest.length === 0) {\n this.set(key, value);\n }\n else {\n const node = this.get(key, true);\n if (identity.isCollection(node))\n node.setIn(rest, value);\n else if (node === undefined && this.schema)\n this.set(key, collectionFromPath(this.schema, rest, value));\n else\n throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);\n }\n }\n}\n\nexports.Collection = Collection;\nexports.collectionFromPath = collectionFromPath;\nexports.isEmptyPath = isEmptyPath;\n",
23
+ "'use strict';\n\n/**\n * Stringifies a comment.\n *\n * Empty comment lines are left empty,\n * lines consisting of a single space are replaced by `#`,\n * and all other lines are prefixed with a `#`.\n */\nconst stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, '#');\nfunction indentComment(comment, indent) {\n if (/^\\n+$/.test(comment))\n return comment.substring(1);\n return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;\n}\nconst lineComment = (str, indent, comment) => str.endsWith('\\n')\n ? indentComment(comment, indent)\n : comment.includes('\\n')\n ? '\\n' + indentComment(comment, indent)\n : (str.endsWith(' ') ? '' : ' ') + comment;\n\nexports.indentComment = indentComment;\nexports.lineComment = lineComment;\nexports.stringifyComment = stringifyComment;\n",
24
+ "'use strict';\n\nconst FOLD_FLOW = 'flow';\nconst FOLD_BLOCK = 'block';\nconst FOLD_QUOTED = 'quoted';\n/**\n * Tries to keep input at up to `lineWidth` characters, splitting only on spaces\n * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are\n * terminated with `\\n` and started with `indent`.\n */\nfunction foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {\n if (!lineWidth || lineWidth < 0)\n return text;\n if (lineWidth < minContentWidth)\n minContentWidth = 0;\n const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);\n if (text.length <= endStep)\n return text;\n const folds = [];\n const escapedFolds = {};\n let end = lineWidth - indent.length;\n if (typeof indentAtStart === 'number') {\n if (indentAtStart > lineWidth - Math.max(2, minContentWidth))\n folds.push(0);\n else\n end = lineWidth - indentAtStart;\n }\n let split = undefined;\n let prev = undefined;\n let overflow = false;\n let i = -1;\n let escStart = -1;\n let escEnd = -1;\n if (mode === FOLD_BLOCK) {\n i = consumeMoreIndentedLines(text, i, indent.length);\n if (i !== -1)\n end = i + endStep;\n }\n for (let ch; (ch = text[(i += 1)]);) {\n if (mode === FOLD_QUOTED && ch === '\\\\') {\n escStart = i;\n switch (text[i + 1]) {\n case 'x':\n i += 3;\n break;\n case 'u':\n i += 5;\n break;\n case 'U':\n i += 9;\n break;\n default:\n i += 1;\n }\n escEnd = i;\n }\n if (ch === '\\n') {\n if (mode === FOLD_BLOCK)\n i = consumeMoreIndentedLines(text, i, indent.length);\n end = i + indent.length + endStep;\n split = undefined;\n }\n else {\n if (ch === ' ' &&\n prev &&\n prev !== ' ' &&\n prev !== '\\n' &&\n prev !== '\\t') {\n // space surrounded by non-space can be replaced with newline + indent\n const next = text[i + 1];\n if (next && next !== ' ' && next !== '\\n' && next !== '\\t')\n split = i;\n }\n if (i >= end) {\n if (split) {\n folds.push(split);\n end = split + endStep;\n split = undefined;\n }\n else if (mode === FOLD_QUOTED) {\n // white-space collected at end may stretch past lineWidth\n while (prev === ' ' || prev === '\\t') {\n prev = ch;\n ch = text[(i += 1)];\n overflow = true;\n }\n // Account for newline escape, but don't break preceding escape\n const j = i > escEnd + 1 ? i - 2 : escStart - 1;\n // Bail out if lineWidth & minContentWidth are shorter than an escape string\n if (escapedFolds[j])\n return text;\n folds.push(j);\n escapedFolds[j] = true;\n end = j + endStep;\n split = undefined;\n }\n else {\n overflow = true;\n }\n }\n }\n prev = ch;\n }\n if (overflow && onOverflow)\n onOverflow();\n if (folds.length === 0)\n return text;\n if (onFold)\n onFold();\n let res = text.slice(0, folds[0]);\n for (let i = 0; i < folds.length; ++i) {\n const fold = folds[i];\n const end = folds[i + 1] || text.length;\n if (fold === 0)\n res = `\\n${indent}${text.slice(0, end)}`;\n else {\n if (mode === FOLD_QUOTED && escapedFolds[fold])\n res += `${text[fold]}\\\\`;\n res += `\\n${indent}${text.slice(fold + 1, end)}`;\n }\n }\n return res;\n}\n/**\n * Presumes `i + 1` is at the start of a line\n * @returns index of last newline in more-indented block\n */\nfunction consumeMoreIndentedLines(text, i, indent) {\n let end = i;\n let start = i + 1;\n let ch = text[start];\n while (ch === ' ' || ch === '\\t') {\n if (i < start + indent) {\n ch = text[++i];\n }\n else {\n do {\n ch = text[++i];\n } while (ch && ch !== '\\n');\n end = i;\n start = i + 1;\n ch = text[start];\n }\n }\n return end;\n}\n\nexports.FOLD_BLOCK = FOLD_BLOCK;\nexports.FOLD_FLOW = FOLD_FLOW;\nexports.FOLD_QUOTED = FOLD_QUOTED;\nexports.foldFlowLines = foldFlowLines;\n",
25
+ "'use strict';\n\nvar Scalar = require('../nodes/Scalar.js');\nvar foldFlowLines = require('./foldFlowLines.js');\n\nconst getFoldOptions = (ctx, isBlock) => ({\n indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,\n lineWidth: ctx.options.lineWidth,\n minContentWidth: ctx.options.minContentWidth\n});\n// Also checks for lines starting with %, as parsing the output as YAML 1.1 will\n// presume that's starting a new document.\nconst containsDocumentMarker = (str) => /^(%|---|\\.\\.\\.)/m.test(str);\nfunction lineLengthOverLimit(str, lineWidth, indentLength) {\n if (!lineWidth || lineWidth < 0)\n return false;\n const limit = lineWidth - indentLength;\n const strLen = str.length;\n if (strLen <= limit)\n return false;\n for (let i = 0, start = 0; i < strLen; ++i) {\n if (str[i] === '\\n') {\n if (i - start > limit)\n return true;\n start = i + 1;\n if (strLen - start <= limit)\n return false;\n }\n }\n return true;\n}\nfunction doubleQuotedString(value, ctx) {\n const json = JSON.stringify(value);\n if (ctx.options.doubleQuotedAsJSON)\n return json;\n const { implicitKey } = ctx;\n const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;\n const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');\n let str = '';\n let start = 0;\n for (let i = 0, ch = json[i]; ch; ch = json[++i]) {\n if (ch === ' ' && json[i + 1] === '\\\\' && json[i + 2] === 'n') {\n // space before newline needs to be escaped to not be folded\n str += json.slice(start, i) + '\\\\ ';\n i += 1;\n start = i;\n ch = '\\\\';\n }\n if (ch === '\\\\')\n switch (json[i + 1]) {\n case 'u':\n {\n str += json.slice(start, i);\n const code = json.substr(i + 2, 4);\n switch (code) {\n case '0000':\n str += '\\\\0';\n break;\n case '0007':\n str += '\\\\a';\n break;\n case '000b':\n str += '\\\\v';\n break;\n case '001b':\n str += '\\\\e';\n break;\n case '0085':\n str += '\\\\N';\n break;\n case '00a0':\n str += '\\\\_';\n break;\n case '2028':\n str += '\\\\L';\n break;\n case '2029':\n str += '\\\\P';\n break;\n default:\n if (code.substr(0, 2) === '00')\n str += '\\\\x' + code.substr(2);\n else\n str += json.substr(i, 6);\n }\n i += 5;\n start = i + 1;\n }\n break;\n case 'n':\n if (implicitKey ||\n json[i + 2] === '\"' ||\n json.length < minMultiLineLength) {\n i += 1;\n }\n else {\n // folding will eat first newline\n str += json.slice(start, i) + '\\n\\n';\n while (json[i + 2] === '\\\\' &&\n json[i + 3] === 'n' &&\n json[i + 4] !== '\"') {\n str += '\\n';\n i += 2;\n }\n str += indent;\n // space after newline needs to be escaped to not be folded\n if (json[i + 2] === ' ')\n str += '\\\\';\n i += 1;\n start = i + 1;\n }\n break;\n default:\n i += 1;\n }\n }\n str = start ? str + json.slice(start) : json;\n return implicitKey\n ? str\n : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));\n}\nfunction singleQuotedString(value, ctx) {\n if (ctx.options.singleQuote === false ||\n (ctx.implicitKey && value.includes('\\n')) ||\n /[ \\t]\\n|\\n[ \\t]/.test(value) // single quoted string can't have leading or trailing whitespace around newline\n )\n return doubleQuotedString(value, ctx);\n const indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');\n const res = \"'\" + value.replace(/'/g, \"''\").replace(/\\n+/g, `$&\\n${indent}`) + \"'\";\n return ctx.implicitKey\n ? res\n : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));\n}\nfunction quotedString(value, ctx) {\n const { singleQuote } = ctx.options;\n let qs;\n if (singleQuote === false)\n qs = doubleQuotedString;\n else {\n const hasDouble = value.includes('\"');\n const hasSingle = value.includes(\"'\");\n if (hasDouble && !hasSingle)\n qs = singleQuotedString;\n else if (hasSingle && !hasDouble)\n qs = doubleQuotedString;\n else\n qs = singleQuote ? singleQuotedString : doubleQuotedString;\n }\n return qs(value, ctx);\n}\n// The negative lookbehind avoids a polynomial search,\n// but isn't supported yet on Safari: https://caniuse.com/js-regexp-lookbehind\nlet blockEndNewlines;\ntry {\n blockEndNewlines = new RegExp('(^|(?<!\\n))\\n+(?!\\n|$)', 'g');\n}\ncatch {\n blockEndNewlines = /\\n+(?!\\n|$)/g;\n}\nfunction blockString({ comment, type, value }, ctx, onComment, onChompKeep) {\n const { blockQuote, commentString, lineWidth } = ctx.options;\n // 1. Block can't end in whitespace unless the last line is non-empty.\n // 2. Strings consisting of only whitespace are best rendered explicitly.\n if (!blockQuote || /\\n[\\t ]+$/.test(value)) {\n return quotedString(value, ctx);\n }\n const indent = ctx.indent ||\n (ctx.forceBlockIndent || containsDocumentMarker(value) ? ' ' : '');\n const literal = blockQuote === 'literal'\n ? true\n : blockQuote === 'folded' || type === Scalar.Scalar.BLOCK_FOLDED\n ? false\n : type === Scalar.Scalar.BLOCK_LITERAL\n ? true\n : !lineLengthOverLimit(value, lineWidth, indent.length);\n if (!value)\n return literal ? '|\\n' : '>\\n';\n // determine chomping from whitespace at value end\n let chomp;\n let endStart;\n for (endStart = value.length; endStart > 0; --endStart) {\n const ch = value[endStart - 1];\n if (ch !== '\\n' && ch !== '\\t' && ch !== ' ')\n break;\n }\n let end = value.substring(endStart);\n const endNlPos = end.indexOf('\\n');\n if (endNlPos === -1) {\n chomp = '-'; // strip\n }\n else if (value === end || endNlPos !== end.length - 1) {\n chomp = '+'; // keep\n if (onChompKeep)\n onChompKeep();\n }\n else {\n chomp = ''; // clip\n }\n if (end) {\n value = value.slice(0, -end.length);\n if (end[end.length - 1] === '\\n')\n end = end.slice(0, -1);\n end = end.replace(blockEndNewlines, `$&${indent}`);\n }\n // determine indent indicator from whitespace at value start\n let startWithSpace = false;\n let startEnd;\n let startNlPos = -1;\n for (startEnd = 0; startEnd < value.length; ++startEnd) {\n const ch = value[startEnd];\n if (ch === ' ')\n startWithSpace = true;\n else if (ch === '\\n')\n startNlPos = startEnd;\n else\n break;\n }\n let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);\n if (start) {\n value = value.substring(start.length);\n start = start.replace(/\\n+/g, `$&${indent}`);\n }\n const indentSize = indent ? '2' : '1'; // root is at -1\n // Leading | or > is added later\n let header = (startWithSpace ? indentSize : '') + chomp;\n if (comment) {\n header += ' ' + commentString(comment.replace(/ ?[\\r\\n]+/g, ' '));\n if (onComment)\n onComment();\n }\n if (!literal) {\n const foldedValue = value\n .replace(/\\n+/g, '\\n$&')\n .replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g, '$1$2') // more-indented lines aren't folded\n // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent\n .replace(/\\n+/g, `$&${indent}`);\n let literalFallback = false;\n const foldOptions = getFoldOptions(ctx, true);\n if (blockQuote !== 'folded' && type !== Scalar.Scalar.BLOCK_FOLDED) {\n foldOptions.onOverflow = () => {\n literalFallback = true;\n };\n }\n const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);\n if (!literalFallback)\n return `>${header}\\n${indent}${body}`;\n }\n value = value.replace(/\\n+/g, `$&${indent}`);\n return `|${header}\\n${indent}${start}${value}${end}`;\n}\nfunction plainString(item, ctx, onComment, onChompKeep) {\n const { type, value } = item;\n const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;\n if ((implicitKey && value.includes('\\n')) ||\n (inFlow && /[[\\]{},]/.test(value))) {\n return quotedString(value, ctx);\n }\n if (/^[\\n\\t ,[\\]{}#&*!|>'\"%@`]|^[?-]$|^[?-][ \\t]|[\\n:][ \\t]|[ \\t]\\n|[\\n\\t ]#|[\\n\\t :]$/.test(value)) {\n // not allowed:\n // - '-' or '?'\n // - start with an indicator character (except [?:-]) or /[?-] /\n // - '\\n ', ': ' or ' \\n' anywhere\n // - '#' not preceded by a non-space char\n // - end with ' ' or ':'\n return implicitKey || inFlow || !value.includes('\\n')\n ? quotedString(value, ctx)\n : blockString(item, ctx, onComment, onChompKeep);\n }\n if (!implicitKey &&\n !inFlow &&\n type !== Scalar.Scalar.PLAIN &&\n value.includes('\\n')) {\n // Where allowed & type not set explicitly, prefer block style for multiline strings\n return blockString(item, ctx, onComment, onChompKeep);\n }\n if (containsDocumentMarker(value)) {\n if (indent === '') {\n ctx.forceBlockIndent = true;\n return blockString(item, ctx, onComment, onChompKeep);\n }\n else if (implicitKey && indent === indentStep) {\n return quotedString(value, ctx);\n }\n }\n const str = value.replace(/\\n+/g, `$&\\n${indent}`);\n // Verify that output will be parsed as a string, as e.g. plain numbers and\n // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),\n // and others in v1.1.\n if (actualString) {\n const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && tag.test?.test(str);\n const { compat, tags } = ctx.doc.schema;\n if (tags.some(test) || compat?.some(test))\n return quotedString(value, ctx);\n }\n return implicitKey\n ? str\n : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));\n}\nfunction stringifyString(item, ctx, onComment, onChompKeep) {\n const { implicitKey, inFlow } = ctx;\n const ss = typeof item.value === 'string'\n ? item\n : Object.assign({}, item, { value: String(item.value) });\n let { type } = item;\n if (type !== Scalar.Scalar.QUOTE_DOUBLE) {\n // force double quotes on control characters & unpaired surrogates\n if (/[\\x00-\\x08\\x0b-\\x1f\\x7f-\\x9f\\u{D800}-\\u{DFFF}]/u.test(ss.value))\n type = Scalar.Scalar.QUOTE_DOUBLE;\n }\n const _stringify = (_type) => {\n switch (_type) {\n case Scalar.Scalar.BLOCK_FOLDED:\n case Scalar.Scalar.BLOCK_LITERAL:\n return implicitKey || inFlow\n ? quotedString(ss.value, ctx) // blocks are not valid inside flow containers\n : blockString(ss, ctx, onComment, onChompKeep);\n case Scalar.Scalar.QUOTE_DOUBLE:\n return doubleQuotedString(ss.value, ctx);\n case Scalar.Scalar.QUOTE_SINGLE:\n return singleQuotedString(ss.value, ctx);\n case Scalar.Scalar.PLAIN:\n return plainString(ss, ctx, onComment, onChompKeep);\n default:\n return null;\n }\n };\n let res = _stringify(type);\n if (res === null) {\n const { defaultKeyType, defaultStringType } = ctx.options;\n const t = (implicitKey && defaultKeyType) || defaultStringType;\n res = _stringify(t);\n if (res === null)\n throw new Error(`Unsupported default string type ${t}`);\n }\n return res;\n}\n\nexports.stringifyString = stringifyString;\n",
26
+ "'use strict';\n\nvar anchors = require('../doc/anchors.js');\nvar identity = require('../nodes/identity.js');\nvar stringifyComment = require('./stringifyComment.js');\nvar stringifyString = require('./stringifyString.js');\n\nfunction createStringifyContext(doc, options) {\n const opt = Object.assign({\n blockQuote: true,\n commentString: stringifyComment.stringifyComment,\n defaultKeyType: null,\n defaultStringType: 'PLAIN',\n directives: null,\n doubleQuotedAsJSON: false,\n doubleQuotedMinMultiLineLength: 40,\n falseStr: 'false',\n flowCollectionPadding: true,\n indentSeq: true,\n lineWidth: 80,\n minContentWidth: 20,\n nullStr: 'null',\n simpleKeys: false,\n singleQuote: null,\n trueStr: 'true',\n verifyAliasOrder: true\n }, doc.schema.toStringOptions, options);\n let inFlow;\n switch (opt.collectionStyle) {\n case 'block':\n inFlow = false;\n break;\n case 'flow':\n inFlow = true;\n break;\n default:\n inFlow = null;\n }\n return {\n anchors: new Set(),\n doc,\n flowCollectionPadding: opt.flowCollectionPadding ? ' ' : '',\n indent: '',\n indentStep: typeof opt.indent === 'number' ? ' '.repeat(opt.indent) : ' ',\n inFlow,\n options: opt\n };\n}\nfunction getTagObject(tags, item) {\n if (item.tag) {\n const match = tags.filter(t => t.tag === item.tag);\n if (match.length > 0)\n return match.find(t => t.format === item.format) ?? match[0];\n }\n let tagObj = undefined;\n let obj;\n if (identity.isScalar(item)) {\n obj = item.value;\n let match = tags.filter(t => t.identify?.(obj));\n if (match.length > 1) {\n const testMatch = match.filter(t => t.test);\n if (testMatch.length > 0)\n match = testMatch;\n }\n tagObj =\n match.find(t => t.format === item.format) ?? match.find(t => !t.format);\n }\n else {\n obj = item;\n tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);\n }\n if (!tagObj) {\n const name = obj?.constructor?.name ?? (obj === null ? 'null' : typeof obj);\n throw new Error(`Tag not resolved for ${name} value`);\n }\n return tagObj;\n}\n// needs to be called before value stringifier to allow for circular anchor refs\nfunction stringifyProps(node, tagObj, { anchors: anchors$1, doc }) {\n if (!doc.directives)\n return '';\n const props = [];\n const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor;\n if (anchor && anchors.anchorIsValid(anchor)) {\n anchors$1.add(anchor);\n props.push(`&${anchor}`);\n }\n const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);\n if (tag)\n props.push(doc.directives.tagString(tag));\n return props.join(' ');\n}\nfunction stringify(item, ctx, onComment, onChompKeep) {\n if (identity.isPair(item))\n return item.toString(ctx, onComment, onChompKeep);\n if (identity.isAlias(item)) {\n if (ctx.doc.directives)\n return item.toString(ctx);\n if (ctx.resolvedAliases?.has(item)) {\n throw new TypeError(`Cannot stringify circular structure without alias nodes`);\n }\n else {\n if (ctx.resolvedAliases)\n ctx.resolvedAliases.add(item);\n else\n ctx.resolvedAliases = new Set([item]);\n item = item.resolve(ctx.doc);\n }\n }\n let tagObj = undefined;\n const node = identity.isNode(item)\n ? item\n : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });\n tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));\n const props = stringifyProps(node, tagObj, ctx);\n if (props.length > 0)\n ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;\n const str = typeof tagObj.stringify === 'function'\n ? tagObj.stringify(node, ctx, onComment, onChompKeep)\n : identity.isScalar(node)\n ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep)\n : node.toString(ctx, onComment, onChompKeep);\n if (!props)\n return str;\n return identity.isScalar(node) || str[0] === '{' || str[0] === '['\n ? `${props} ${str}`\n : `${props}\\n${ctx.indent}${str}`;\n}\n\nexports.createStringifyContext = createStringifyContext;\nexports.stringify = stringify;\n",
27
+ "'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar Scalar = require('../nodes/Scalar.js');\nvar stringify = require('./stringify.js');\nvar stringifyComment = require('./stringifyComment.js');\n\nfunction stringifyPair({ key, value }, ctx, onComment, onChompKeep) {\n const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;\n let keyComment = (identity.isNode(key) && key.comment) || null;\n if (simpleKeys) {\n if (keyComment) {\n throw new Error('With simple keys, key nodes cannot have comments');\n }\n if (identity.isCollection(key) || (!identity.isNode(key) && typeof key === 'object')) {\n const msg = 'With simple keys, collection cannot be used as a key value';\n throw new Error(msg);\n }\n }\n let explicitKey = !simpleKeys &&\n (!key ||\n (keyComment && value == null && !ctx.inFlow) ||\n identity.isCollection(key) ||\n (identity.isScalar(key)\n ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL\n : typeof key === 'object'));\n ctx = Object.assign({}, ctx, {\n allNullValues: false,\n implicitKey: !explicitKey && (simpleKeys || !allNullValues),\n indent: indent + indentStep\n });\n let keyCommentDone = false;\n let chompKeep = false;\n let str = stringify.stringify(key, ctx, () => (keyCommentDone = true), () => (chompKeep = true));\n if (!explicitKey && !ctx.inFlow && str.length > 1024) {\n if (simpleKeys)\n throw new Error('With simple keys, single line scalar must not span more than 1024 characters');\n explicitKey = true;\n }\n if (ctx.inFlow) {\n if (allNullValues || value == null) {\n if (keyCommentDone && onComment)\n onComment();\n return str === '' ? '?' : explicitKey ? `? ${str}` : str;\n }\n }\n else if ((allNullValues && !simpleKeys) || (value == null && explicitKey)) {\n str = `? ${str}`;\n if (keyComment && !keyCommentDone) {\n str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));\n }\n else if (chompKeep && onChompKeep)\n onChompKeep();\n return str;\n }\n if (keyCommentDone)\n keyComment = null;\n if (explicitKey) {\n if (keyComment)\n str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));\n str = `? ${str}\\n${indent}:`;\n }\n else {\n str = `${str}:`;\n if (keyComment)\n str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));\n }\n let vsb, vcb, valueComment;\n if (identity.isNode(value)) {\n vsb = !!value.spaceBefore;\n vcb = value.commentBefore;\n valueComment = value.comment;\n }\n else {\n vsb = false;\n vcb = null;\n valueComment = null;\n if (value && typeof value === 'object')\n value = doc.createNode(value);\n }\n ctx.implicitKey = false;\n if (!explicitKey && !keyComment && identity.isScalar(value))\n ctx.indentAtStart = str.length + 1;\n chompKeep = false;\n if (!indentSeq &&\n indentStep.length >= 2 &&\n !ctx.inFlow &&\n !explicitKey &&\n identity.isSeq(value) &&\n !value.flow &&\n !value.tag &&\n !value.anchor) {\n // If indentSeq === false, consider '- ' as part of indentation where possible\n ctx.indent = ctx.indent.substring(2);\n }\n let valueCommentDone = false;\n const valueStr = stringify.stringify(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true));\n let ws = ' ';\n if (keyComment || vsb || vcb) {\n ws = vsb ? '\\n' : '';\n if (vcb) {\n const cs = commentString(vcb);\n ws += `\\n${stringifyComment.indentComment(cs, ctx.indent)}`;\n }\n if (valueStr === '' && !ctx.inFlow) {\n if (ws === '\\n' && valueComment)\n ws = '\\n\\n';\n }\n else {\n ws += `\\n${ctx.indent}`;\n }\n }\n else if (!explicitKey && identity.isCollection(value)) {\n const vs0 = valueStr[0];\n const nl0 = valueStr.indexOf('\\n');\n const hasNewline = nl0 !== -1;\n const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;\n if (hasNewline || !flow) {\n let hasPropsLine = false;\n if (hasNewline && (vs0 === '&' || vs0 === '!')) {\n let sp0 = valueStr.indexOf(' ');\n if (vs0 === '&' &&\n sp0 !== -1 &&\n sp0 < nl0 &&\n valueStr[sp0 + 1] === '!') {\n sp0 = valueStr.indexOf(' ', sp0 + 1);\n }\n if (sp0 === -1 || nl0 < sp0)\n hasPropsLine = true;\n }\n if (!hasPropsLine)\n ws = `\\n${ctx.indent}`;\n }\n }\n else if (valueStr === '' || valueStr[0] === '\\n') {\n ws = '';\n }\n str += ws + valueStr;\n if (ctx.inFlow) {\n if (valueCommentDone && onComment)\n onComment();\n }\n else if (valueComment && !valueCommentDone) {\n str += stringifyComment.lineComment(str, ctx.indent, commentString(valueComment));\n }\n else if (chompKeep && onChompKeep) {\n onChompKeep();\n }\n return str;\n}\n\nexports.stringifyPair = stringifyPair;\n",
28
+ "'use strict';\n\nvar node_process = require('process');\n\nfunction debug(logLevel, ...messages) {\n if (logLevel === 'debug')\n console.log(...messages);\n}\nfunction warn(logLevel, warning) {\n if (logLevel === 'debug' || logLevel === 'warn') {\n if (typeof node_process.emitWarning === 'function')\n node_process.emitWarning(warning);\n else\n console.warn(warning);\n }\n}\n\nexports.debug = debug;\nexports.warn = warn;\n",
29
+ "'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar Scalar = require('../../nodes/Scalar.js');\n\n// If the value associated with a merge key is a single mapping node, each of\n// its key/value pairs is inserted into the current mapping, unless the key\n// already exists in it. If the value associated with the merge key is a\n// sequence, then this sequence is expected to contain mapping nodes and each\n// of these nodes is merged in turn according to its order in the sequence.\n// Keys in mapping nodes earlier in the sequence override keys specified in\n// later mapping nodes. -- http://yaml.org/type/merge.html\nconst MERGE_KEY = '<<';\nconst merge = {\n identify: value => value === MERGE_KEY ||\n (typeof value === 'symbol' && value.description === MERGE_KEY),\n default: 'key',\n tag: 'tag:yaml.org,2002:merge',\n test: /^<<$/,\n resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {\n addToJSMap: addMergeToJSMap\n }),\n stringify: () => MERGE_KEY\n};\nconst isMergeKey = (ctx, key) => (merge.identify(key) ||\n (identity.isScalar(key) &&\n (!key.type || key.type === Scalar.Scalar.PLAIN) &&\n merge.identify(key.value))) &&\n ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);\nfunction addMergeToJSMap(ctx, map, value) {\n value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;\n if (identity.isSeq(value))\n for (const it of value.items)\n mergeValue(ctx, map, it);\n else if (Array.isArray(value))\n for (const it of value)\n mergeValue(ctx, map, it);\n else\n mergeValue(ctx, map, value);\n}\nfunction mergeValue(ctx, map, value) {\n const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;\n if (!identity.isMap(source))\n throw new Error('Merge sources must be maps or map aliases');\n const srcMap = source.toJSON(null, ctx, Map);\n for (const [key, value] of srcMap) {\n if (map instanceof Map) {\n if (!map.has(key))\n map.set(key, value);\n }\n else if (map instanceof Set) {\n map.add(key);\n }\n else if (!Object.prototype.hasOwnProperty.call(map, key)) {\n Object.defineProperty(map, key, {\n value,\n writable: true,\n enumerable: true,\n configurable: true\n });\n }\n }\n return map;\n}\n\nexports.addMergeToJSMap = addMergeToJSMap;\nexports.isMergeKey = isMergeKey;\nexports.merge = merge;\n",
30
+ "'use strict';\n\nvar log = require('../log.js');\nvar merge = require('../schema/yaml-1.1/merge.js');\nvar stringify = require('../stringify/stringify.js');\nvar identity = require('./identity.js');\nvar toJS = require('./toJS.js');\n\nfunction addPairToJSMap(ctx, map, { key, value }) {\n if (identity.isNode(key) && key.addToJSMap)\n key.addToJSMap(ctx, map, value);\n // TODO: Should drop this special case for bare << handling\n else if (merge.isMergeKey(ctx, key))\n merge.addMergeToJSMap(ctx, map, value);\n else {\n const jsKey = toJS.toJS(key, '', ctx);\n if (map instanceof Map) {\n map.set(jsKey, toJS.toJS(value, jsKey, ctx));\n }\n else if (map instanceof Set) {\n map.add(jsKey);\n }\n else {\n const stringKey = stringifyKey(key, jsKey, ctx);\n const jsValue = toJS.toJS(value, stringKey, ctx);\n if (stringKey in map)\n Object.defineProperty(map, stringKey, {\n value: jsValue,\n writable: true,\n enumerable: true,\n configurable: true\n });\n else\n map[stringKey] = jsValue;\n }\n }\n return map;\n}\nfunction stringifyKey(key, jsKey, ctx) {\n if (jsKey === null)\n return '';\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n if (typeof jsKey !== 'object')\n return String(jsKey);\n if (identity.isNode(key) && ctx?.doc) {\n const strCtx = stringify.createStringifyContext(ctx.doc, {});\n strCtx.anchors = new Set();\n for (const node of ctx.anchors.keys())\n strCtx.anchors.add(node.anchor);\n strCtx.inFlow = true;\n strCtx.inStringifyKey = true;\n const strKey = key.toString(strCtx);\n if (!ctx.mapKeyWarned) {\n let jsonStr = JSON.stringify(strKey);\n if (jsonStr.length > 40)\n jsonStr = jsonStr.substring(0, 36) + '...\"';\n log.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);\n ctx.mapKeyWarned = true;\n }\n return strKey;\n }\n return JSON.stringify(jsKey);\n}\n\nexports.addPairToJSMap = addPairToJSMap;\n",
31
+ "'use strict';\n\nvar createNode = require('../doc/createNode.js');\nvar stringifyPair = require('../stringify/stringifyPair.js');\nvar addPairToJSMap = require('./addPairToJSMap.js');\nvar identity = require('./identity.js');\n\nfunction createPair(key, value, ctx) {\n const k = createNode.createNode(key, undefined, ctx);\n const v = createNode.createNode(value, undefined, ctx);\n return new Pair(k, v);\n}\nclass Pair {\n constructor(key, value = null) {\n Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR });\n this.key = key;\n this.value = value;\n }\n clone(schema) {\n let { key, value } = this;\n if (identity.isNode(key))\n key = key.clone(schema);\n if (identity.isNode(value))\n value = value.clone(schema);\n return new Pair(key, value);\n }\n toJSON(_, ctx) {\n const pair = ctx?.mapAsMap ? new Map() : {};\n return addPairToJSMap.addPairToJSMap(ctx, pair, this);\n }\n toString(ctx, onComment, onChompKeep) {\n return ctx?.doc\n ? stringifyPair.stringifyPair(this, ctx, onComment, onChompKeep)\n : JSON.stringify(this);\n }\n}\n\nexports.Pair = Pair;\nexports.createPair = createPair;\n",
32
+ "'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar stringify = require('./stringify.js');\nvar stringifyComment = require('./stringifyComment.js');\n\nfunction stringifyCollection(collection, ctx, options) {\n const flow = ctx.inFlow ?? collection.flow;\n const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;\n return stringify(collection, ctx, options);\n}\nfunction stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {\n const { indent, options: { commentString } } = ctx;\n const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });\n let chompKeep = false; // flag for the preceding node's status\n const lines = [];\n for (let i = 0; i < items.length; ++i) {\n const item = items[i];\n let comment = null;\n if (identity.isNode(item)) {\n if (!chompKeep && item.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, item.commentBefore, chompKeep);\n if (item.comment)\n comment = item.comment;\n }\n else if (identity.isPair(item)) {\n const ik = identity.isNode(item.key) ? item.key : null;\n if (ik) {\n if (!chompKeep && ik.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);\n }\n }\n chompKeep = false;\n let str = stringify.stringify(item, itemCtx, () => (comment = null), () => (chompKeep = true));\n if (comment)\n str += stringifyComment.lineComment(str, itemIndent, commentString(comment));\n if (chompKeep && comment)\n chompKeep = false;\n lines.push(blockItemPrefix + str);\n }\n let str;\n if (lines.length === 0) {\n str = flowChars.start + flowChars.end;\n }\n else {\n str = lines[0];\n for (let i = 1; i < lines.length; ++i) {\n const line = lines[i];\n str += line ? `\\n${indent}${line}` : '\\n';\n }\n }\n if (comment) {\n str += '\\n' + stringifyComment.indentComment(commentString(comment), indent);\n if (onComment)\n onComment();\n }\n else if (chompKeep && onChompKeep)\n onChompKeep();\n return str;\n}\nfunction stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {\n const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;\n itemIndent += indentStep;\n const itemCtx = Object.assign({}, ctx, {\n indent: itemIndent,\n inFlow: true,\n type: null\n });\n let reqNewline = false;\n let linesAtValue = 0;\n const lines = [];\n for (let i = 0; i < items.length; ++i) {\n const item = items[i];\n let comment = null;\n if (identity.isNode(item)) {\n if (item.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, item.commentBefore, false);\n if (item.comment)\n comment = item.comment;\n }\n else if (identity.isPair(item)) {\n const ik = identity.isNode(item.key) ? item.key : null;\n if (ik) {\n if (ik.spaceBefore)\n lines.push('');\n addCommentBefore(ctx, lines, ik.commentBefore, false);\n if (ik.comment)\n reqNewline = true;\n }\n const iv = identity.isNode(item.value) ? item.value : null;\n if (iv) {\n if (iv.comment)\n comment = iv.comment;\n if (iv.commentBefore)\n reqNewline = true;\n }\n else if (item.value == null && ik?.comment) {\n comment = ik.comment;\n }\n }\n if (comment)\n reqNewline = true;\n let str = stringify.stringify(item, itemCtx, () => (comment = null));\n if (i < items.length - 1)\n str += ',';\n if (comment)\n str += stringifyComment.lineComment(str, itemIndent, commentString(comment));\n if (!reqNewline && (lines.length > linesAtValue || str.includes('\\n')))\n reqNewline = true;\n lines.push(str);\n linesAtValue = lines.length;\n }\n const { start, end } = flowChars;\n if (lines.length === 0) {\n return start + end;\n }\n else {\n if (!reqNewline) {\n const len = lines.reduce((sum, line) => sum + line.length + 2, 2);\n reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;\n }\n if (reqNewline) {\n let str = start;\n for (const line of lines)\n str += line ? `\\n${indentStep}${indent}${line}` : '\\n';\n return `${str}\\n${indent}${end}`;\n }\n else {\n return `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;\n }\n }\n}\nfunction addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {\n if (comment && chompKeep)\n comment = comment.replace(/^\\n+/, '');\n if (comment) {\n const ic = stringifyComment.indentComment(commentString(comment), indent);\n lines.push(ic.trimStart()); // Avoid double indent on first line\n }\n}\n\nexports.stringifyCollection = stringifyCollection;\n",
33
+ "'use strict';\n\nvar stringifyCollection = require('../stringify/stringifyCollection.js');\nvar addPairToJSMap = require('./addPairToJSMap.js');\nvar Collection = require('./Collection.js');\nvar identity = require('./identity.js');\nvar Pair = require('./Pair.js');\nvar Scalar = require('./Scalar.js');\n\nfunction findPair(items, key) {\n const k = identity.isScalar(key) ? key.value : key;\n for (const it of items) {\n if (identity.isPair(it)) {\n if (it.key === key || it.key === k)\n return it;\n if (identity.isScalar(it.key) && it.key.value === k)\n return it;\n }\n }\n return undefined;\n}\nclass YAMLMap extends Collection.Collection {\n static get tagName() {\n return 'tag:yaml.org,2002:map';\n }\n constructor(schema) {\n super(identity.MAP, schema);\n this.items = [];\n }\n /**\n * A generic collection parsing method that can be extended\n * to other node classes that inherit from YAMLMap\n */\n static from(schema, obj, ctx) {\n const { keepUndefined, replacer } = ctx;\n const map = new this(schema);\n const add = (key, value) => {\n if (typeof replacer === 'function')\n value = replacer.call(obj, key, value);\n else if (Array.isArray(replacer) && !replacer.includes(key))\n return;\n if (value !== undefined || keepUndefined)\n map.items.push(Pair.createPair(key, value, ctx));\n };\n if (obj instanceof Map) {\n for (const [key, value] of obj)\n add(key, value);\n }\n else if (obj && typeof obj === 'object') {\n for (const key of Object.keys(obj))\n add(key, obj[key]);\n }\n if (typeof schema.sortMapEntries === 'function') {\n map.items.sort(schema.sortMapEntries);\n }\n return map;\n }\n /**\n * Adds a value to the collection.\n *\n * @param overwrite - If not set `true`, using a key that is already in the\n * collection will throw. Otherwise, overwrites the previous value.\n */\n add(pair, overwrite) {\n let _pair;\n if (identity.isPair(pair))\n _pair = pair;\n else if (!pair || typeof pair !== 'object' || !('key' in pair)) {\n // In TypeScript, this never happens.\n _pair = new Pair.Pair(pair, pair?.value);\n }\n else\n _pair = new Pair.Pair(pair.key, pair.value);\n const prev = findPair(this.items, _pair.key);\n const sortEntries = this.schema?.sortMapEntries;\n if (prev) {\n if (!overwrite)\n throw new Error(`Key ${_pair.key} already set`);\n // For scalars, keep the old node & its comments and anchors\n if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value))\n prev.value.value = _pair.value;\n else\n prev.value = _pair.value;\n }\n else if (sortEntries) {\n const i = this.items.findIndex(item => sortEntries(_pair, item) < 0);\n if (i === -1)\n this.items.push(_pair);\n else\n this.items.splice(i, 0, _pair);\n }\n else {\n this.items.push(_pair);\n }\n }\n delete(key) {\n const it = findPair(this.items, key);\n if (!it)\n return false;\n const del = this.items.splice(this.items.indexOf(it), 1);\n return del.length > 0;\n }\n get(key, keepScalar) {\n const it = findPair(this.items, key);\n const node = it?.value;\n return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? undefined;\n }\n has(key) {\n return !!findPair(this.items, key);\n }\n set(key, value) {\n this.add(new Pair.Pair(key, value), true);\n }\n /**\n * @param ctx - Conversion context, originally set in Document#toJS()\n * @param {Class} Type - If set, forces the returned collection type\n * @returns Instance of Type, Map, or Object\n */\n toJSON(_, ctx, Type) {\n const map = Type ? new Type() : ctx?.mapAsMap ? new Map() : {};\n if (ctx?.onCreate)\n ctx.onCreate(map);\n for (const item of this.items)\n addPairToJSMap.addPairToJSMap(ctx, map, item);\n return map;\n }\n toString(ctx, onComment, onChompKeep) {\n if (!ctx)\n return JSON.stringify(this);\n for (const item of this.items) {\n if (!identity.isPair(item))\n throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);\n }\n if (!ctx.allNullValues && this.hasAllNullValues(false))\n ctx = Object.assign({}, ctx, { allNullValues: true });\n return stringifyCollection.stringifyCollection(this, ctx, {\n blockItemPrefix: '',\n flowChars: { start: '{', end: '}' },\n itemIndent: ctx.indent || '',\n onChompKeep,\n onComment\n });\n }\n}\n\nexports.YAMLMap = YAMLMap;\nexports.findPair = findPair;\n",
34
+ "'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar YAMLMap = require('../../nodes/YAMLMap.js');\n\nconst map = {\n collection: 'map',\n default: true,\n nodeClass: YAMLMap.YAMLMap,\n tag: 'tag:yaml.org,2002:map',\n resolve(map, onError) {\n if (!identity.isMap(map))\n onError('Expected a mapping for this tag');\n return map;\n },\n createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)\n};\n\nexports.map = map;\n",
35
+ "'use strict';\n\nvar createNode = require('../doc/createNode.js');\nvar stringifyCollection = require('../stringify/stringifyCollection.js');\nvar Collection = require('./Collection.js');\nvar identity = require('./identity.js');\nvar Scalar = require('./Scalar.js');\nvar toJS = require('./toJS.js');\n\nclass YAMLSeq extends Collection.Collection {\n static get tagName() {\n return 'tag:yaml.org,2002:seq';\n }\n constructor(schema) {\n super(identity.SEQ, schema);\n this.items = [];\n }\n add(value) {\n this.items.push(value);\n }\n /**\n * Removes a value from the collection.\n *\n * `key` must contain a representation of an integer for this to succeed.\n * It may be wrapped in a `Scalar`.\n *\n * @returns `true` if the item was found and removed.\n */\n delete(key) {\n const idx = asItemIndex(key);\n if (typeof idx !== 'number')\n return false;\n const del = this.items.splice(idx, 1);\n return del.length > 0;\n }\n get(key, keepScalar) {\n const idx = asItemIndex(key);\n if (typeof idx !== 'number')\n return undefined;\n const it = this.items[idx];\n return !keepScalar && identity.isScalar(it) ? it.value : it;\n }\n /**\n * Checks if the collection includes a value with the key `key`.\n *\n * `key` must contain a representation of an integer for this to succeed.\n * It may be wrapped in a `Scalar`.\n */\n has(key) {\n const idx = asItemIndex(key);\n return typeof idx === 'number' && idx < this.items.length;\n }\n /**\n * Sets a value in this collection. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n *\n * If `key` does not contain a representation of an integer, this will throw.\n * It may be wrapped in a `Scalar`.\n */\n set(key, value) {\n const idx = asItemIndex(key);\n if (typeof idx !== 'number')\n throw new Error(`Expected a valid index, not ${key}.`);\n const prev = this.items[idx];\n if (identity.isScalar(prev) && Scalar.isScalarValue(value))\n prev.value = value;\n else\n this.items[idx] = value;\n }\n toJSON(_, ctx) {\n const seq = [];\n if (ctx?.onCreate)\n ctx.onCreate(seq);\n let i = 0;\n for (const item of this.items)\n seq.push(toJS.toJS(item, String(i++), ctx));\n return seq;\n }\n toString(ctx, onComment, onChompKeep) {\n if (!ctx)\n return JSON.stringify(this);\n return stringifyCollection.stringifyCollection(this, ctx, {\n blockItemPrefix: '- ',\n flowChars: { start: '[', end: ']' },\n itemIndent: (ctx.indent || '') + ' ',\n onChompKeep,\n onComment\n });\n }\n static from(schema, obj, ctx) {\n const { replacer } = ctx;\n const seq = new this(schema);\n if (obj && Symbol.iterator in Object(obj)) {\n let i = 0;\n for (let it of obj) {\n if (typeof replacer === 'function') {\n const key = obj instanceof Set ? it : String(i++);\n it = replacer.call(obj, key, it);\n }\n seq.items.push(createNode.createNode(it, undefined, ctx));\n }\n }\n return seq;\n }\n}\nfunction asItemIndex(key) {\n let idx = identity.isScalar(key) ? key.value : key;\n if (idx && typeof idx === 'string')\n idx = Number(idx);\n return typeof idx === 'number' && Number.isInteger(idx) && idx >= 0\n ? idx\n : null;\n}\n\nexports.YAMLSeq = YAMLSeq;\n",
36
+ "'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar YAMLSeq = require('../../nodes/YAMLSeq.js');\n\nconst seq = {\n collection: 'seq',\n default: true,\n nodeClass: YAMLSeq.YAMLSeq,\n tag: 'tag:yaml.org,2002:seq',\n resolve(seq, onError) {\n if (!identity.isSeq(seq))\n onError('Expected a sequence for this tag');\n return seq;\n },\n createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx)\n};\n\nexports.seq = seq;\n",
37
+ "'use strict';\n\nvar stringifyString = require('../../stringify/stringifyString.js');\n\nconst string = {\n identify: value => typeof value === 'string',\n default: true,\n tag: 'tag:yaml.org,2002:str',\n resolve: str => str,\n stringify(item, ctx, onComment, onChompKeep) {\n ctx = Object.assign({ actualString: true }, ctx);\n return stringifyString.stringifyString(item, ctx, onComment, onChompKeep);\n }\n};\n\nexports.string = string;\n",
38
+ "'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\n\nconst nullTag = {\n identify: value => value == null,\n createNode: () => new Scalar.Scalar(null),\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^(?:~|[Nn]ull|NULL)?$/,\n resolve: () => new Scalar.Scalar(null),\n stringify: ({ source }, ctx) => typeof source === 'string' && nullTag.test.test(source)\n ? source\n : ctx.options.nullStr\n};\n\nexports.nullTag = nullTag;\n",
39
+ "'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\n\nconst boolTag = {\n identify: value => typeof value === 'boolean',\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,\n resolve: str => new Scalar.Scalar(str[0] === 't' || str[0] === 'T'),\n stringify({ source, value }, ctx) {\n if (source && boolTag.test.test(source)) {\n const sv = source[0] === 't' || source[0] === 'T';\n if (value === sv)\n return source;\n }\n return value ? ctx.options.trueStr : ctx.options.falseStr;\n }\n};\n\nexports.boolTag = boolTag;\n",
40
+ "'use strict';\n\nfunction stringifyNumber({ format, minFractionDigits, tag, value }) {\n if (typeof value === 'bigint')\n return String(value);\n const num = typeof value === 'number' ? value : Number(value);\n if (!isFinite(num))\n return isNaN(num) ? '.nan' : num < 0 ? '-.inf' : '.inf';\n let n = Object.is(value, -0) ? '-0' : JSON.stringify(value);\n if (!format &&\n minFractionDigits &&\n (!tag || tag === 'tag:yaml.org,2002:float') &&\n /^\\d/.test(n)) {\n let i = n.indexOf('.');\n if (i < 0) {\n i = n.length;\n n += '.';\n }\n let d = minFractionDigits - (n.length - i - 1);\n while (d-- > 0)\n n += '0';\n }\n return n;\n}\n\nexports.stringifyNumber = stringifyNumber;\n",
41
+ "'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\nvar stringifyNumber = require('../../stringify/stringifyNumber.js');\n\nconst floatNaN = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,\n resolve: str => str.slice(-3).toLowerCase() === 'nan'\n ? NaN\n : str[0] === '-'\n ? Number.NEGATIVE_INFINITY\n : Number.POSITIVE_INFINITY,\n stringify: stringifyNumber.stringifyNumber\n};\nconst floatExp = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'EXP',\n test: /^[-+]?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)[eE][-+]?[0-9]+$/,\n resolve: str => parseFloat(str),\n stringify(node) {\n const num = Number(node.value);\n return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);\n }\n};\nconst float = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^[-+]?(?:\\.[0-9]+|[0-9]+\\.[0-9]*)$/,\n resolve(str) {\n const node = new Scalar.Scalar(parseFloat(str));\n const dot = str.indexOf('.');\n if (dot !== -1 && str[str.length - 1] === '0')\n node.minFractionDigits = str.length - dot - 1;\n return node;\n },\n stringify: stringifyNumber.stringifyNumber\n};\n\nexports.float = float;\nexports.floatExp = floatExp;\nexports.floatNaN = floatNaN;\n",
42
+ "'use strict';\n\nvar stringifyNumber = require('../../stringify/stringifyNumber.js');\n\nconst intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);\nconst intResolve = (str, offset, radix, { intAsBigInt }) => (intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix));\nfunction intStringify(node, radix, prefix) {\n const { value } = node;\n if (intIdentify(value) && value >= 0)\n return prefix + value.toString(radix);\n return stringifyNumber.stringifyNumber(node);\n}\nconst intOct = {\n identify: value => intIdentify(value) && value >= 0,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'OCT',\n test: /^0o[0-7]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt),\n stringify: node => intStringify(node, 8, '0o')\n};\nconst int = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^[-+]?[0-9]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),\n stringify: stringifyNumber.stringifyNumber\n};\nconst intHex = {\n identify: value => intIdentify(value) && value >= 0,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'HEX',\n test: /^0x[0-9a-fA-F]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),\n stringify: node => intStringify(node, 16, '0x')\n};\n\nexports.int = int;\nexports.intHex = intHex;\nexports.intOct = intOct;\n",
43
+ "'use strict';\n\nvar map = require('../common/map.js');\nvar _null = require('../common/null.js');\nvar seq = require('../common/seq.js');\nvar string = require('../common/string.js');\nvar bool = require('./bool.js');\nvar float = require('./float.js');\nvar int = require('./int.js');\n\nconst schema = [\n map.map,\n seq.seq,\n string.string,\n _null.nullTag,\n bool.boolTag,\n int.intOct,\n int.int,\n int.intHex,\n float.floatNaN,\n float.floatExp,\n float.float\n];\n\nexports.schema = schema;\n",
44
+ "'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\nvar map = require('../common/map.js');\nvar seq = require('../common/seq.js');\n\nfunction intIdentify(value) {\n return typeof value === 'bigint' || Number.isInteger(value);\n}\nconst stringifyJSON = ({ value }) => JSON.stringify(value);\nconst jsonScalars = [\n {\n identify: value => typeof value === 'string',\n default: true,\n tag: 'tag:yaml.org,2002:str',\n resolve: str => str,\n stringify: stringifyJSON\n },\n {\n identify: value => value == null,\n createNode: () => new Scalar.Scalar(null),\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^null$/,\n resolve: () => null,\n stringify: stringifyJSON\n },\n {\n identify: value => typeof value === 'boolean',\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^true$|^false$/,\n resolve: str => str === 'true',\n stringify: stringifyJSON\n },\n {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^-?(?:0|[1-9][0-9]*)$/,\n resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),\n stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)\n },\n {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,\n resolve: str => parseFloat(str),\n stringify: stringifyJSON\n }\n];\nconst jsonError = {\n default: true,\n tag: '',\n test: /^/,\n resolve(str, onError) {\n onError(`Unresolved plain scalar ${JSON.stringify(str)}`);\n return str;\n }\n};\nconst schema = [map.map, seq.seq].concat(jsonScalars, jsonError);\n\nexports.schema = schema;\n",
45
+ "'use strict';\n\nvar node_buffer = require('buffer');\nvar Scalar = require('../../nodes/Scalar.js');\nvar stringifyString = require('../../stringify/stringifyString.js');\n\nconst binary = {\n identify: value => value instanceof Uint8Array, // Buffer inherits from Uint8Array\n default: false,\n tag: 'tag:yaml.org,2002:binary',\n /**\n * Returns a Buffer in node and an Uint8Array in browsers\n *\n * To use the resulting buffer as an image, you'll want to do something like:\n *\n * const blob = new Blob([buffer], { type: 'image/jpeg' })\n * document.querySelector('#photo').src = URL.createObjectURL(blob)\n */\n resolve(src, onError) {\n if (typeof node_buffer.Buffer === 'function') {\n return node_buffer.Buffer.from(src, 'base64');\n }\n else if (typeof atob === 'function') {\n // On IE 11, atob() can't handle newlines\n const str = atob(src.replace(/[\\n\\r]/g, ''));\n const buffer = new Uint8Array(str.length);\n for (let i = 0; i < str.length; ++i)\n buffer[i] = str.charCodeAt(i);\n return buffer;\n }\n else {\n onError('This environment does not support reading binary tags; either Buffer or atob is required');\n return src;\n }\n },\n stringify({ comment, type, value }, ctx, onComment, onChompKeep) {\n if (!value)\n return '';\n const buf = value; // checked earlier by binary.identify()\n let str;\n if (typeof node_buffer.Buffer === 'function') {\n str =\n buf instanceof node_buffer.Buffer\n ? buf.toString('base64')\n : node_buffer.Buffer.from(buf.buffer).toString('base64');\n }\n else if (typeof btoa === 'function') {\n let s = '';\n for (let i = 0; i < buf.length; ++i)\n s += String.fromCharCode(buf[i]);\n str = btoa(s);\n }\n else {\n throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');\n }\n type ?? (type = Scalar.Scalar.BLOCK_LITERAL);\n if (type !== Scalar.Scalar.QUOTE_DOUBLE) {\n const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);\n const n = Math.ceil(str.length / lineWidth);\n const lines = new Array(n);\n for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {\n lines[i] = str.substr(o, lineWidth);\n }\n str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? '\\n' : ' ');\n }\n return stringifyString.stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);\n }\n};\n\nexports.binary = binary;\n",
46
+ "'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar Pair = require('../../nodes/Pair.js');\nvar Scalar = require('../../nodes/Scalar.js');\nvar YAMLSeq = require('../../nodes/YAMLSeq.js');\n\nfunction resolvePairs(seq, onError) {\n if (identity.isSeq(seq)) {\n for (let i = 0; i < seq.items.length; ++i) {\n let item = seq.items[i];\n if (identity.isPair(item))\n continue;\n else if (identity.isMap(item)) {\n if (item.items.length > 1)\n onError('Each pair must have its own sequence indicator');\n const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null));\n if (item.commentBefore)\n pair.key.commentBefore = pair.key.commentBefore\n ? `${item.commentBefore}\\n${pair.key.commentBefore}`\n : item.commentBefore;\n if (item.comment) {\n const cn = pair.value ?? pair.key;\n cn.comment = cn.comment\n ? `${item.comment}\\n${cn.comment}`\n : item.comment;\n }\n item = pair;\n }\n seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item);\n }\n }\n else\n onError('Expected a sequence for this tag');\n return seq;\n}\nfunction createPairs(schema, iterable, ctx) {\n const { replacer } = ctx;\n const pairs = new YAMLSeq.YAMLSeq(schema);\n pairs.tag = 'tag:yaml.org,2002:pairs';\n let i = 0;\n if (iterable && Symbol.iterator in Object(iterable))\n for (let it of iterable) {\n if (typeof replacer === 'function')\n it = replacer.call(iterable, String(i++), it);\n let key, value;\n if (Array.isArray(it)) {\n if (it.length === 2) {\n key = it[0];\n value = it[1];\n }\n else\n throw new TypeError(`Expected [key, value] tuple: ${it}`);\n }\n else if (it && it instanceof Object) {\n const keys = Object.keys(it);\n if (keys.length === 1) {\n key = keys[0];\n value = it[key];\n }\n else {\n throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);\n }\n }\n else {\n key = it;\n }\n pairs.items.push(Pair.createPair(key, value, ctx));\n }\n return pairs;\n}\nconst pairs = {\n collection: 'seq',\n default: false,\n tag: 'tag:yaml.org,2002:pairs',\n resolve: resolvePairs,\n createNode: createPairs\n};\n\nexports.createPairs = createPairs;\nexports.pairs = pairs;\nexports.resolvePairs = resolvePairs;\n",
47
+ "'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar toJS = require('../../nodes/toJS.js');\nvar YAMLMap = require('../../nodes/YAMLMap.js');\nvar YAMLSeq = require('../../nodes/YAMLSeq.js');\nvar pairs = require('./pairs.js');\n\nclass YAMLOMap extends YAMLSeq.YAMLSeq {\n constructor() {\n super();\n this.add = YAMLMap.YAMLMap.prototype.add.bind(this);\n this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this);\n this.get = YAMLMap.YAMLMap.prototype.get.bind(this);\n this.has = YAMLMap.YAMLMap.prototype.has.bind(this);\n this.set = YAMLMap.YAMLMap.prototype.set.bind(this);\n this.tag = YAMLOMap.tag;\n }\n /**\n * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,\n * but TypeScript won't allow widening the signature of a child method.\n */\n toJSON(_, ctx) {\n if (!ctx)\n return super.toJSON(_);\n const map = new Map();\n if (ctx?.onCreate)\n ctx.onCreate(map);\n for (const pair of this.items) {\n let key, value;\n if (identity.isPair(pair)) {\n key = toJS.toJS(pair.key, '', ctx);\n value = toJS.toJS(pair.value, key, ctx);\n }\n else {\n key = toJS.toJS(pair, '', ctx);\n }\n if (map.has(key))\n throw new Error('Ordered maps must not include duplicate keys');\n map.set(key, value);\n }\n return map;\n }\n static from(schema, iterable, ctx) {\n const pairs$1 = pairs.createPairs(schema, iterable, ctx);\n const omap = new this();\n omap.items = pairs$1.items;\n return omap;\n }\n}\nYAMLOMap.tag = 'tag:yaml.org,2002:omap';\nconst omap = {\n collection: 'seq',\n identify: value => value instanceof Map,\n nodeClass: YAMLOMap,\n default: false,\n tag: 'tag:yaml.org,2002:omap',\n resolve(seq, onError) {\n const pairs$1 = pairs.resolvePairs(seq, onError);\n const seenKeys = [];\n for (const { key } of pairs$1.items) {\n if (identity.isScalar(key)) {\n if (seenKeys.includes(key.value)) {\n onError(`Ordered maps must not include duplicate keys: ${key.value}`);\n }\n else {\n seenKeys.push(key.value);\n }\n }\n }\n return Object.assign(new YAMLOMap(), pairs$1);\n },\n createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)\n};\n\nexports.YAMLOMap = YAMLOMap;\nexports.omap = omap;\n",
48
+ "'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\n\nfunction boolStringify({ value, source }, ctx) {\n const boolObj = value ? trueTag : falseTag;\n if (source && boolObj.test.test(source))\n return source;\n return value ? ctx.options.trueStr : ctx.options.falseStr;\n}\nconst trueTag = {\n identify: value => value === true,\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,\n resolve: () => new Scalar.Scalar(true),\n stringify: boolStringify\n};\nconst falseTag = {\n identify: value => value === false,\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,\n resolve: () => new Scalar.Scalar(false),\n stringify: boolStringify\n};\n\nexports.falseTag = falseTag;\nexports.trueTag = trueTag;\n",
49
+ "'use strict';\n\nvar Scalar = require('../../nodes/Scalar.js');\nvar stringifyNumber = require('../../stringify/stringifyNumber.js');\n\nconst floatNaN = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^(?:[-+]?\\.(?:inf|Inf|INF)|\\.nan|\\.NaN|\\.NAN)$/,\n resolve: (str) => str.slice(-3).toLowerCase() === 'nan'\n ? NaN\n : str[0] === '-'\n ? Number.NEGATIVE_INFINITY\n : Number.POSITIVE_INFINITY,\n stringify: stringifyNumber.stringifyNumber\n};\nconst floatExp = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'EXP',\n test: /^[-+]?(?:[0-9][0-9_]*)?(?:\\.[0-9_]*)?[eE][-+]?[0-9]+$/,\n resolve: (str) => parseFloat(str.replace(/_/g, '')),\n stringify(node) {\n const num = Number(node.value);\n return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);\n }\n};\nconst float = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^[-+]?(?:[0-9][0-9_]*)?\\.[0-9_]*$/,\n resolve(str) {\n const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, '')));\n const dot = str.indexOf('.');\n if (dot !== -1) {\n const f = str.substring(dot + 1).replace(/_/g, '');\n if (f[f.length - 1] === '0')\n node.minFractionDigits = f.length;\n }\n return node;\n },\n stringify: stringifyNumber.stringifyNumber\n};\n\nexports.float = float;\nexports.floatExp = floatExp;\nexports.floatNaN = floatNaN;\n",
50
+ "'use strict';\n\nvar stringifyNumber = require('../../stringify/stringifyNumber.js');\n\nconst intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);\nfunction intResolve(str, offset, radix, { intAsBigInt }) {\n const sign = str[0];\n if (sign === '-' || sign === '+')\n offset += 1;\n str = str.substring(offset).replace(/_/g, '');\n if (intAsBigInt) {\n switch (radix) {\n case 2:\n str = `0b${str}`;\n break;\n case 8:\n str = `0o${str}`;\n break;\n case 16:\n str = `0x${str}`;\n break;\n }\n const n = BigInt(str);\n return sign === '-' ? BigInt(-1) * n : n;\n }\n const n = parseInt(str, radix);\n return sign === '-' ? -1 * n : n;\n}\nfunction intStringify(node, radix, prefix) {\n const { value } = node;\n if (intIdentify(value)) {\n const str = value.toString(radix);\n return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;\n }\n return stringifyNumber.stringifyNumber(node);\n}\nconst intBin = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'BIN',\n test: /^[-+]?0b[0-1_]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt),\n stringify: node => intStringify(node, 2, '0b')\n};\nconst intOct = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'OCT',\n test: /^[-+]?0[0-7_]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt),\n stringify: node => intStringify(node, 8, '0')\n};\nconst int = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^[-+]?[0-9][0-9_]*$/,\n resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),\n stringify: stringifyNumber.stringifyNumber\n};\nconst intHex = {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'HEX',\n test: /^[-+]?0x[0-9a-fA-F_]+$/,\n resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),\n stringify: node => intStringify(node, 16, '0x')\n};\n\nexports.int = int;\nexports.intBin = intBin;\nexports.intHex = intHex;\nexports.intOct = intOct;\n",
51
+ "'use strict';\n\nvar identity = require('../../nodes/identity.js');\nvar Pair = require('../../nodes/Pair.js');\nvar YAMLMap = require('../../nodes/YAMLMap.js');\n\nclass YAMLSet extends YAMLMap.YAMLMap {\n constructor(schema) {\n super(schema);\n this.tag = YAMLSet.tag;\n }\n add(key) {\n let pair;\n if (identity.isPair(key))\n pair = key;\n else if (key &&\n typeof key === 'object' &&\n 'key' in key &&\n 'value' in key &&\n key.value === null)\n pair = new Pair.Pair(key.key, null);\n else\n pair = new Pair.Pair(key, null);\n const prev = YAMLMap.findPair(this.items, pair.key);\n if (!prev)\n this.items.push(pair);\n }\n /**\n * If `keepPair` is `true`, returns the Pair matching `key`.\n * Otherwise, returns the value of that Pair's key.\n */\n get(key, keepPair) {\n const pair = YAMLMap.findPair(this.items, key);\n return !keepPair && identity.isPair(pair)\n ? identity.isScalar(pair.key)\n ? pair.key.value\n : pair.key\n : pair;\n }\n set(key, value) {\n if (typeof value !== 'boolean')\n throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);\n const prev = YAMLMap.findPair(this.items, key);\n if (prev && !value) {\n this.items.splice(this.items.indexOf(prev), 1);\n }\n else if (!prev && value) {\n this.items.push(new Pair.Pair(key));\n }\n }\n toJSON(_, ctx) {\n return super.toJSON(_, ctx, Set);\n }\n toString(ctx, onComment, onChompKeep) {\n if (!ctx)\n return JSON.stringify(this);\n if (this.hasAllNullValues(true))\n return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep);\n else\n throw new Error('Set items must all have null values');\n }\n static from(schema, iterable, ctx) {\n const { replacer } = ctx;\n const set = new this(schema);\n if (iterable && Symbol.iterator in Object(iterable))\n for (let value of iterable) {\n if (typeof replacer === 'function')\n value = replacer.call(iterable, value, value);\n set.items.push(Pair.createPair(value, null, ctx));\n }\n return set;\n }\n}\nYAMLSet.tag = 'tag:yaml.org,2002:set';\nconst set = {\n collection: 'map',\n identify: value => value instanceof Set,\n nodeClass: YAMLSet,\n default: false,\n tag: 'tag:yaml.org,2002:set',\n createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),\n resolve(map, onError) {\n if (identity.isMap(map)) {\n if (map.hasAllNullValues(true))\n return Object.assign(new YAMLSet(), map);\n else\n onError('Set items must all have null values');\n }\n else\n onError('Expected a mapping for this tag');\n return map;\n }\n};\n\nexports.YAMLSet = YAMLSet;\nexports.set = set;\n",
52
+ "'use strict';\n\nvar stringifyNumber = require('../../stringify/stringifyNumber.js');\n\n/** Internal types handle bigint as number, because TS can't figure it out. */\nfunction parseSexagesimal(str, asBigInt) {\n const sign = str[0];\n const parts = sign === '-' || sign === '+' ? str.substring(1) : str;\n const num = (n) => asBigInt ? BigInt(n) : Number(n);\n const res = parts\n .replace(/_/g, '')\n .split(':')\n .reduce((res, p) => res * num(60) + num(p), num(0));\n return (sign === '-' ? num(-1) * res : res);\n}\n/**\n * hhhh:mm:ss.sss\n *\n * Internal types handle bigint as number, because TS can't figure it out.\n */\nfunction stringifySexagesimal(node) {\n let { value } = node;\n let num = (n) => n;\n if (typeof value === 'bigint')\n num = n => BigInt(n);\n else if (isNaN(value) || !isFinite(value))\n return stringifyNumber.stringifyNumber(node);\n let sign = '';\n if (value < 0) {\n sign = '-';\n value *= num(-1);\n }\n const _60 = num(60);\n const parts = [value % _60]; // seconds, including ms\n if (value < 60) {\n parts.unshift(0); // at least one : is required\n }\n else {\n value = (value - parts[0]) / _60;\n parts.unshift(value % _60); // minutes\n if (value >= 60) {\n value = (value - parts[0]) / _60;\n parts.unshift(value); // hours\n }\n }\n return (sign +\n parts\n .map(n => String(n).padStart(2, '0'))\n .join(':')\n .replace(/000000\\d*$/, '') // % 60 may introduce error\n );\n}\nconst intTime = {\n identify: value => typeof value === 'bigint' || Number.isInteger(value),\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'TIME',\n test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,\n resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt),\n stringify: stringifySexagesimal\n};\nconst floatTime = {\n identify: value => typeof value === 'number',\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'TIME',\n test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*$/,\n resolve: str => parseSexagesimal(str, false),\n stringify: stringifySexagesimal\n};\nconst timestamp = {\n identify: value => value instanceof Date,\n default: true,\n tag: 'tag:yaml.org,2002:timestamp',\n // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part\n // may be omitted altogether, resulting in a date format. In such a case, the time part is\n // assumed to be 00:00:00Z (start of day, UTC).\n test: RegExp('^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd\n '(?:' + // time is optional\n '(?:t|T|[ \\\\t]+)' + // t | T | whitespace\n '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?\n '(?:[ \\\\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30\n ')?$'),\n resolve(str) {\n const match = str.match(timestamp.test);\n if (!match)\n throw new Error('!!timestamp expects a date, starting with yyyy-mm-dd');\n const [, year, month, day, hour, minute, second] = match.map(Number);\n const millisec = match[7] ? Number((match[7] + '00').substr(1, 3)) : 0;\n let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);\n const tz = match[8];\n if (tz && tz !== 'Z') {\n let d = parseSexagesimal(tz, false);\n if (Math.abs(d) < 30)\n d *= 60;\n date -= 60000 * d;\n }\n return new Date(date);\n },\n stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\\.000Z$/, '') ?? ''\n};\n\nexports.floatTime = floatTime;\nexports.intTime = intTime;\nexports.timestamp = timestamp;\n",
53
+ "'use strict';\n\nvar map = require('../common/map.js');\nvar _null = require('../common/null.js');\nvar seq = require('../common/seq.js');\nvar string = require('../common/string.js');\nvar binary = require('./binary.js');\nvar bool = require('./bool.js');\nvar float = require('./float.js');\nvar int = require('./int.js');\nvar merge = require('./merge.js');\nvar omap = require('./omap.js');\nvar pairs = require('./pairs.js');\nvar set = require('./set.js');\nvar timestamp = require('./timestamp.js');\n\nconst schema = [\n map.map,\n seq.seq,\n string.string,\n _null.nullTag,\n bool.trueTag,\n bool.falseTag,\n int.intBin,\n int.intOct,\n int.int,\n int.intHex,\n float.floatNaN,\n float.floatExp,\n float.float,\n binary.binary,\n merge.merge,\n omap.omap,\n pairs.pairs,\n set.set,\n timestamp.intTime,\n timestamp.floatTime,\n timestamp.timestamp\n];\n\nexports.schema = schema;\n",
54
+ "'use strict';\n\nvar map = require('./common/map.js');\nvar _null = require('./common/null.js');\nvar seq = require('./common/seq.js');\nvar string = require('./common/string.js');\nvar bool = require('./core/bool.js');\nvar float = require('./core/float.js');\nvar int = require('./core/int.js');\nvar schema = require('./core/schema.js');\nvar schema$1 = require('./json/schema.js');\nvar binary = require('./yaml-1.1/binary.js');\nvar merge = require('./yaml-1.1/merge.js');\nvar omap = require('./yaml-1.1/omap.js');\nvar pairs = require('./yaml-1.1/pairs.js');\nvar schema$2 = require('./yaml-1.1/schema.js');\nvar set = require('./yaml-1.1/set.js');\nvar timestamp = require('./yaml-1.1/timestamp.js');\n\nconst schemas = new Map([\n ['core', schema.schema],\n ['failsafe', [map.map, seq.seq, string.string]],\n ['json', schema$1.schema],\n ['yaml11', schema$2.schema],\n ['yaml-1.1', schema$2.schema]\n]);\nconst tagsByName = {\n binary: binary.binary,\n bool: bool.boolTag,\n float: float.float,\n floatExp: float.floatExp,\n floatNaN: float.floatNaN,\n floatTime: timestamp.floatTime,\n int: int.int,\n intHex: int.intHex,\n intOct: int.intOct,\n intTime: timestamp.intTime,\n map: map.map,\n merge: merge.merge,\n null: _null.nullTag,\n omap: omap.omap,\n pairs: pairs.pairs,\n seq: seq.seq,\n set: set.set,\n timestamp: timestamp.timestamp\n};\nconst coreKnownTags = {\n 'tag:yaml.org,2002:binary': binary.binary,\n 'tag:yaml.org,2002:merge': merge.merge,\n 'tag:yaml.org,2002:omap': omap.omap,\n 'tag:yaml.org,2002:pairs': pairs.pairs,\n 'tag:yaml.org,2002:set': set.set,\n 'tag:yaml.org,2002:timestamp': timestamp.timestamp\n};\nfunction getTags(customTags, schemaName, addMergeTag) {\n const schemaTags = schemas.get(schemaName);\n if (schemaTags && !customTags) {\n return addMergeTag && !schemaTags.includes(merge.merge)\n ? schemaTags.concat(merge.merge)\n : schemaTags.slice();\n }\n let tags = schemaTags;\n if (!tags) {\n if (Array.isArray(customTags))\n tags = [];\n else {\n const keys = Array.from(schemas.keys())\n .filter(key => key !== 'yaml11')\n .map(key => JSON.stringify(key))\n .join(', ');\n throw new Error(`Unknown schema \"${schemaName}\"; use one of ${keys} or define customTags array`);\n }\n }\n if (Array.isArray(customTags)) {\n for (const tag of customTags)\n tags = tags.concat(tag);\n }\n else if (typeof customTags === 'function') {\n tags = customTags(tags.slice());\n }\n if (addMergeTag)\n tags = tags.concat(merge.merge);\n return tags.reduce((tags, tag) => {\n const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;\n if (!tagObj) {\n const tagName = JSON.stringify(tag);\n const keys = Object.keys(tagsByName)\n .map(key => JSON.stringify(key))\n .join(', ');\n throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);\n }\n if (!tags.includes(tagObj))\n tags.push(tagObj);\n return tags;\n }, []);\n}\n\nexports.coreKnownTags = coreKnownTags;\nexports.getTags = getTags;\n",
55
+ "'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar map = require('./common/map.js');\nvar seq = require('./common/seq.js');\nvar string = require('./common/string.js');\nvar tags = require('./tags.js');\n\nconst sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;\nclass Schema {\n constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {\n this.compat = Array.isArray(compat)\n ? tags.getTags(compat, 'compat')\n : compat\n ? tags.getTags(null, compat)\n : null;\n this.name = (typeof schema === 'string' && schema) || 'core';\n this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};\n this.tags = tags.getTags(customTags, this.name, merge);\n this.toStringOptions = toStringDefaults ?? null;\n Object.defineProperty(this, identity.MAP, { value: map.map });\n Object.defineProperty(this, identity.SCALAR, { value: string.string });\n Object.defineProperty(this, identity.SEQ, { value: seq.seq });\n // Used by createMap()\n this.sortMapEntries =\n typeof sortMapEntries === 'function'\n ? sortMapEntries\n : sortMapEntries === true\n ? sortMapEntriesByKey\n : null;\n }\n clone() {\n const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this));\n copy.tags = this.tags.slice();\n return copy;\n }\n}\n\nexports.Schema = Schema;\n",
56
+ "'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar stringify = require('./stringify.js');\nvar stringifyComment = require('./stringifyComment.js');\n\nfunction stringifyDocument(doc, options) {\n const lines = [];\n let hasDirectives = options.directives === true;\n if (options.directives !== false && doc.directives) {\n const dir = doc.directives.toString(doc);\n if (dir) {\n lines.push(dir);\n hasDirectives = true;\n }\n else if (doc.directives.docStart)\n hasDirectives = true;\n }\n if (hasDirectives)\n lines.push('---');\n const ctx = stringify.createStringifyContext(doc, options);\n const { commentString } = ctx.options;\n if (doc.commentBefore) {\n if (lines.length !== 1)\n lines.unshift('');\n const cs = commentString(doc.commentBefore);\n lines.unshift(stringifyComment.indentComment(cs, ''));\n }\n let chompKeep = false;\n let contentComment = null;\n if (doc.contents) {\n if (identity.isNode(doc.contents)) {\n if (doc.contents.spaceBefore && hasDirectives)\n lines.push('');\n if (doc.contents.commentBefore) {\n const cs = commentString(doc.contents.commentBefore);\n lines.push(stringifyComment.indentComment(cs, ''));\n }\n // top-level block scalars need to be indented if followed by a comment\n ctx.forceBlockIndent = !!doc.comment;\n contentComment = doc.contents.comment;\n }\n const onChompKeep = contentComment ? undefined : () => (chompKeep = true);\n let body = stringify.stringify(doc.contents, ctx, () => (contentComment = null), onChompKeep);\n if (contentComment)\n body += stringifyComment.lineComment(body, '', commentString(contentComment));\n if ((body[0] === '|' || body[0] === '>') &&\n lines[lines.length - 1] === '---') {\n // Top-level block scalars with a preceding doc marker ought to use the\n // same line for their header.\n lines[lines.length - 1] = `--- ${body}`;\n }\n else\n lines.push(body);\n }\n else {\n lines.push(stringify.stringify(doc.contents, ctx));\n }\n if (doc.directives?.docEnd) {\n if (doc.comment) {\n const cs = commentString(doc.comment);\n if (cs.includes('\\n')) {\n lines.push('...');\n lines.push(stringifyComment.indentComment(cs, ''));\n }\n else {\n lines.push(`... ${cs}`);\n }\n }\n else {\n lines.push('...');\n }\n }\n else {\n let dc = doc.comment;\n if (dc && chompKeep)\n dc = dc.replace(/^\\n+/, '');\n if (dc) {\n if ((!chompKeep || contentComment) && lines[lines.length - 1] !== '')\n lines.push('');\n lines.push(stringifyComment.indentComment(commentString(dc), ''));\n }\n }\n return lines.join('\\n') + '\\n';\n}\n\nexports.stringifyDocument = stringifyDocument;\n",
57
+ "'use strict';\n\nvar Alias = require('../nodes/Alias.js');\nvar Collection = require('../nodes/Collection.js');\nvar identity = require('../nodes/identity.js');\nvar Pair = require('../nodes/Pair.js');\nvar toJS = require('../nodes/toJS.js');\nvar Schema = require('../schema/Schema.js');\nvar stringifyDocument = require('../stringify/stringifyDocument.js');\nvar anchors = require('./anchors.js');\nvar applyReviver = require('./applyReviver.js');\nvar createNode = require('./createNode.js');\nvar directives = require('./directives.js');\n\nclass Document {\n constructor(value, replacer, options) {\n /** A comment before this Document */\n this.commentBefore = null;\n /** A comment immediately after this Document */\n this.comment = null;\n /** Errors encountered during parsing. */\n this.errors = [];\n /** Warnings encountered during parsing. */\n this.warnings = [];\n Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC });\n let _replacer = null;\n if (typeof replacer === 'function' || Array.isArray(replacer)) {\n _replacer = replacer;\n }\n else if (options === undefined && replacer) {\n options = replacer;\n replacer = undefined;\n }\n const opt = Object.assign({\n intAsBigInt: false,\n keepSourceTokens: false,\n logLevel: 'warn',\n prettyErrors: true,\n strict: true,\n stringKeys: false,\n uniqueKeys: true,\n version: '1.2'\n }, options);\n this.options = opt;\n let { version } = opt;\n if (options?._directives) {\n this.directives = options._directives.atDocument();\n if (this.directives.yaml.explicit)\n version = this.directives.yaml.version;\n }\n else\n this.directives = new directives.Directives({ version });\n this.setSchema(version, options);\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents =\n value === undefined ? null : this.createNode(value, _replacer, options);\n }\n /**\n * Create a deep copy of this Document and its contents.\n *\n * Custom Node values that inherit from `Object` still refer to their original instances.\n */\n clone() {\n const copy = Object.create(Document.prototype, {\n [identity.NODE_TYPE]: { value: identity.DOC }\n });\n copy.commentBefore = this.commentBefore;\n copy.comment = this.comment;\n copy.errors = this.errors.slice();\n copy.warnings = this.warnings.slice();\n copy.options = Object.assign({}, this.options);\n if (this.directives)\n copy.directives = this.directives.clone();\n copy.schema = this.schema.clone();\n // @ts-expect-error We can't really know that this matches Contents.\n copy.contents = identity.isNode(this.contents)\n ? this.contents.clone(copy.schema)\n : this.contents;\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }\n /** Adds a value to the document. */\n add(value) {\n if (assertCollection(this.contents))\n this.contents.add(value);\n }\n /** Adds a value to the document. */\n addIn(path, value) {\n if (assertCollection(this.contents))\n this.contents.addIn(path, value);\n }\n /**\n * Create a new `Alias` node, ensuring that the target `node` has the required anchor.\n *\n * If `node` already has an anchor, `name` is ignored.\n * Otherwise, the `node.anchor` value will be set to `name`,\n * or if an anchor with that name is already present in the document,\n * `name` will be used as a prefix for a new unique anchor.\n * If `name` is undefined, the generated anchor will use 'a' as a prefix.\n */\n createAlias(node, name) {\n if (!node.anchor) {\n const prev = anchors.anchorNames(this);\n node.anchor =\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n !name || prev.has(name) ? anchors.findNewAnchor(name || 'a', prev) : name;\n }\n return new Alias.Alias(node.anchor);\n }\n createNode(value, replacer, options) {\n let _replacer = undefined;\n if (typeof replacer === 'function') {\n value = replacer.call({ '': value }, '', value);\n _replacer = replacer;\n }\n else if (Array.isArray(replacer)) {\n const keyToStr = (v) => typeof v === 'number' || v instanceof String || v instanceof Number;\n const asStr = replacer.filter(keyToStr).map(String);\n if (asStr.length > 0)\n replacer = replacer.concat(asStr);\n _replacer = replacer;\n }\n else if (options === undefined && replacer) {\n options = replacer;\n replacer = undefined;\n }\n const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {};\n const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(this, \n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n anchorPrefix || 'a');\n const ctx = {\n aliasDuplicateObjects: aliasDuplicateObjects ?? true,\n keepUndefined: keepUndefined ?? false,\n onAnchor,\n onTagObj,\n replacer: _replacer,\n schema: this.schema,\n sourceObjects\n };\n const node = createNode.createNode(value, tag, ctx);\n if (flow && identity.isCollection(node))\n node.flow = true;\n setAnchors();\n return node;\n }\n /**\n * Convert a key and a value into a `Pair` using the current schema,\n * recursively wrapping all values as `Scalar` or `Collection` nodes.\n */\n createPair(key, value, options = {}) {\n const k = this.createNode(key, null, options);\n const v = this.createNode(value, null, options);\n return new Pair.Pair(k, v);\n }\n /**\n * Removes a value from the document.\n * @returns `true` if the item was found and removed.\n */\n delete(key) {\n return assertCollection(this.contents) ? this.contents.delete(key) : false;\n }\n /**\n * Removes a value from the document.\n * @returns `true` if the item was found and removed.\n */\n deleteIn(path) {\n if (Collection.isEmptyPath(path)) {\n if (this.contents == null)\n return false;\n // @ts-expect-error Presumed impossible if Strict extends false\n this.contents = null;\n return true;\n }\n return assertCollection(this.contents)\n ? this.contents.deleteIn(path)\n : false;\n }\n /**\n * Returns item at `key`, or `undefined` if not found. By default unwraps\n * scalar values from their surrounding node; to disable set `keepScalar` to\n * `true` (collections are always returned intact).\n */\n get(key, keepScalar) {\n return identity.isCollection(this.contents)\n ? this.contents.get(key, keepScalar)\n : undefined;\n }\n /**\n * Returns item at `path`, or `undefined` if not found. By default unwraps\n * scalar values from their surrounding node; to disable set `keepScalar` to\n * `true` (collections are always returned intact).\n */\n getIn(path, keepScalar) {\n if (Collection.isEmptyPath(path))\n return !keepScalar && identity.isScalar(this.contents)\n ? this.contents.value\n : this.contents;\n return identity.isCollection(this.contents)\n ? this.contents.getIn(path, keepScalar)\n : undefined;\n }\n /**\n * Checks if the document includes a value with the key `key`.\n */\n has(key) {\n return identity.isCollection(this.contents) ? this.contents.has(key) : false;\n }\n /**\n * Checks if the document includes a value at `path`.\n */\n hasIn(path) {\n if (Collection.isEmptyPath(path))\n return this.contents !== undefined;\n return identity.isCollection(this.contents) ? this.contents.hasIn(path) : false;\n }\n /**\n * Sets a value in this document. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n */\n set(key, value) {\n if (this.contents == null) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = Collection.collectionFromPath(this.schema, [key], value);\n }\n else if (assertCollection(this.contents)) {\n this.contents.set(key, value);\n }\n }\n /**\n * Sets a value in this document. For `!!set`, `value` needs to be a\n * boolean to add/remove the item from the set.\n */\n setIn(path, value) {\n if (Collection.isEmptyPath(path)) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = value;\n }\n else if (this.contents == null) {\n // @ts-expect-error We can't really know that this matches Contents.\n this.contents = Collection.collectionFromPath(this.schema, Array.from(path), value);\n }\n else if (assertCollection(this.contents)) {\n this.contents.setIn(path, value);\n }\n }\n /**\n * Change the YAML version and schema used by the document.\n * A `null` version disables support for directives, explicit tags, anchors, and aliases.\n * It also requires the `schema` option to be given as a `Schema` instance value.\n *\n * Overrides all previously set schema options.\n */\n setSchema(version, options = {}) {\n if (typeof version === 'number')\n version = String(version);\n let opt;\n switch (version) {\n case '1.1':\n if (this.directives)\n this.directives.yaml.version = '1.1';\n else\n this.directives = new directives.Directives({ version: '1.1' });\n opt = { resolveKnownTags: false, schema: 'yaml-1.1' };\n break;\n case '1.2':\n case 'next':\n if (this.directives)\n this.directives.yaml.version = version;\n else\n this.directives = new directives.Directives({ version });\n opt = { resolveKnownTags: true, schema: 'core' };\n break;\n case null:\n if (this.directives)\n delete this.directives;\n opt = null;\n break;\n default: {\n const sv = JSON.stringify(version);\n throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);\n }\n }\n // Not using `instanceof Schema` to allow for duck typing\n if (options.schema instanceof Object)\n this.schema = options.schema;\n else if (opt)\n this.schema = new Schema.Schema(Object.assign(opt, options));\n else\n throw new Error(`With a null YAML version, the { schema: Schema } option is required`);\n }\n // json & jsonArg are only used from toJSON()\n toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {\n const ctx = {\n anchors: new Map(),\n doc: this,\n keep: !json,\n mapAsMap: mapAsMap === true,\n mapKeyWarned: false,\n maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100\n };\n const res = toJS.toJS(this.contents, jsonArg ?? '', ctx);\n if (typeof onAnchor === 'function')\n for (const { count, res } of ctx.anchors.values())\n onAnchor(res, count);\n return typeof reviver === 'function'\n ? applyReviver.applyReviver(reviver, { '': res }, '', res)\n : res;\n }\n /**\n * A JSON representation of the document `contents`.\n *\n * @param jsonArg Used by `JSON.stringify` to indicate the array index or\n * property name.\n */\n toJSON(jsonArg, onAnchor) {\n return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor });\n }\n /** A YAML representation of the document. */\n toString(options = {}) {\n if (this.errors.length > 0)\n throw new Error('Document with errors cannot be stringified');\n if ('indent' in options &&\n (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) {\n const s = JSON.stringify(options.indent);\n throw new Error(`\"indent\" option must be a positive integer, not ${s}`);\n }\n return stringifyDocument.stringifyDocument(this, options);\n }\n}\nfunction assertCollection(contents) {\n if (identity.isCollection(contents))\n return true;\n throw new Error('Expected a YAML collection as document contents');\n}\n\nexports.Document = Document;\n",
58
+ "'use strict';\n\nclass YAMLError extends Error {\n constructor(name, pos, code, message) {\n super();\n this.name = name;\n this.code = code;\n this.message = message;\n this.pos = pos;\n }\n}\nclass YAMLParseError extends YAMLError {\n constructor(pos, code, message) {\n super('YAMLParseError', pos, code, message);\n }\n}\nclass YAMLWarning extends YAMLError {\n constructor(pos, code, message) {\n super('YAMLWarning', pos, code, message);\n }\n}\nconst prettifyError = (src, lc) => (error) => {\n if (error.pos[0] === -1)\n return;\n error.linePos = error.pos.map(pos => lc.linePos(pos));\n const { line, col } = error.linePos[0];\n error.message += ` at line ${line}, column ${col}`;\n let ci = col - 1;\n let lineStr = src\n .substring(lc.lineStarts[line - 1], lc.lineStarts[line])\n .replace(/[\\n\\r]+$/, '');\n // Trim to max 80 chars, keeping col position near the middle\n if (ci >= 60 && lineStr.length > 80) {\n const trimStart = Math.min(ci - 39, lineStr.length - 79);\n lineStr = '…' + lineStr.substring(trimStart);\n ci -= trimStart - 1;\n }\n if (lineStr.length > 80)\n lineStr = lineStr.substring(0, 79) + '…';\n // Include previous line in context if pointing at line start\n if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) {\n // Regexp won't match if start is trimmed\n let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);\n if (prev.length > 80)\n prev = prev.substring(0, 79) + '…\\n';\n lineStr = prev + lineStr;\n }\n if (/[^ ]/.test(lineStr)) {\n let count = 1;\n const end = error.linePos[1];\n if (end?.line === line && end.col > col) {\n count = Math.max(1, Math.min(end.col - col, 80 - ci));\n }\n const pointer = ' '.repeat(ci) + '^'.repeat(count);\n error.message += `:\\n\\n${lineStr}\\n${pointer}\\n`;\n }\n};\n\nexports.YAMLError = YAMLError;\nexports.YAMLParseError = YAMLParseError;\nexports.YAMLWarning = YAMLWarning;\nexports.prettifyError = prettifyError;\n",
59
+ "'use strict';\n\nfunction resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {\n let spaceBefore = false;\n let atNewline = startOnNewline;\n let hasSpace = startOnNewline;\n let comment = '';\n let commentSep = '';\n let hasNewline = false;\n let reqSpace = false;\n let tab = null;\n let anchor = null;\n let tag = null;\n let newlineAfterProp = null;\n let comma = null;\n let found = null;\n let start = null;\n for (const token of tokens) {\n if (reqSpace) {\n if (token.type !== 'space' &&\n token.type !== 'newline' &&\n token.type !== 'comma')\n onError(token.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');\n reqSpace = false;\n }\n if (tab) {\n if (atNewline && token.type !== 'comment' && token.type !== 'newline') {\n onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');\n }\n tab = null;\n }\n switch (token.type) {\n case 'space':\n // At the doc level, tabs at line start may be parsed\n // as leading white space rather than indentation.\n // In a flow collection, only the parser handles indent.\n if (!flow &&\n (indicator !== 'doc-start' || next?.type !== 'flow-collection') &&\n token.source.includes('\\t')) {\n tab = token;\n }\n hasSpace = true;\n break;\n case 'comment': {\n if (!hasSpace)\n onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');\n const cb = token.source.substring(1) || ' ';\n if (!comment)\n comment = cb;\n else\n comment += commentSep + cb;\n commentSep = '';\n atNewline = false;\n break;\n }\n case 'newline':\n if (atNewline) {\n if (comment)\n comment += token.source;\n else if (!found || indicator !== 'seq-item-ind')\n spaceBefore = true;\n }\n else\n commentSep += token.source;\n atNewline = true;\n hasNewline = true;\n if (anchor || tag)\n newlineAfterProp = token;\n hasSpace = true;\n break;\n case 'anchor':\n if (anchor)\n onError(token, 'MULTIPLE_ANCHORS', 'A node can have at most one anchor');\n if (token.source.endsWith(':'))\n onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);\n anchor = token;\n start ?? (start = token.offset);\n atNewline = false;\n hasSpace = false;\n reqSpace = true;\n break;\n case 'tag': {\n if (tag)\n onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');\n tag = token;\n start ?? (start = token.offset);\n atNewline = false;\n hasSpace = false;\n reqSpace = true;\n break;\n }\n case indicator:\n // Could here handle preceding comments differently\n if (anchor || tag)\n onError(token, 'BAD_PROP_ORDER', `Anchors and tags must be after the ${token.source} indicator`);\n if (found)\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.source} in ${flow ?? 'collection'}`);\n found = token;\n atNewline =\n indicator === 'seq-item-ind' || indicator === 'explicit-key-ind';\n hasSpace = false;\n break;\n case 'comma':\n if (flow) {\n if (comma)\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected , in ${flow}`);\n comma = token;\n atNewline = false;\n hasSpace = false;\n break;\n }\n // else fallthrough\n default:\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.type} token`);\n atNewline = false;\n hasSpace = false;\n }\n }\n const last = tokens[tokens.length - 1];\n const end = last ? last.offset + last.source.length : offset;\n if (reqSpace &&\n next &&\n next.type !== 'space' &&\n next.type !== 'newline' &&\n next.type !== 'comma' &&\n (next.type !== 'scalar' || next.source !== '')) {\n onError(next.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');\n }\n if (tab &&\n ((atNewline && tab.indent <= parentIndent) ||\n next?.type === 'block-map' ||\n next?.type === 'block-seq'))\n onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');\n return {\n comma,\n found,\n spaceBefore,\n comment,\n hasNewline,\n anchor,\n tag,\n newlineAfterProp,\n end,\n start: start ?? end\n };\n}\n\nexports.resolveProps = resolveProps;\n",
60
+ "'use strict';\n\nfunction containsNewline(key) {\n if (!key)\n return null;\n switch (key.type) {\n case 'alias':\n case 'scalar':\n case 'double-quoted-scalar':\n case 'single-quoted-scalar':\n if (key.source.includes('\\n'))\n return true;\n if (key.end)\n for (const st of key.end)\n if (st.type === 'newline')\n return true;\n return false;\n case 'flow-collection':\n for (const it of key.items) {\n for (const st of it.start)\n if (st.type === 'newline')\n return true;\n if (it.sep)\n for (const st of it.sep)\n if (st.type === 'newline')\n return true;\n if (containsNewline(it.key) || containsNewline(it.value))\n return true;\n }\n return false;\n default:\n return true;\n }\n}\n\nexports.containsNewline = containsNewline;\n",
61
+ "'use strict';\n\nvar utilContainsNewline = require('./util-contains-newline.js');\n\nfunction flowIndentCheck(indent, fc, onError) {\n if (fc?.type === 'flow-collection') {\n const end = fc.end[0];\n if (end.indent === indent &&\n (end.source === ']' || end.source === '}') &&\n utilContainsNewline.containsNewline(fc)) {\n const msg = 'Flow end indicator should be more indented than parent';\n onError(end, 'BAD_INDENT', msg, true);\n }\n }\n}\n\nexports.flowIndentCheck = flowIndentCheck;\n",
62
+ "'use strict';\n\nvar identity = require('../nodes/identity.js');\n\nfunction mapIncludes(ctx, items, search) {\n const { uniqueKeys } = ctx.options;\n if (uniqueKeys === false)\n return false;\n const isEqual = typeof uniqueKeys === 'function'\n ? uniqueKeys\n : (a, b) => a === b || (identity.isScalar(a) && identity.isScalar(b) && a.value === b.value);\n return items.some(pair => isEqual(pair.key, search));\n}\n\nexports.mapIncludes = mapIncludes;\n",
63
+ "'use strict';\n\nvar Pair = require('../nodes/Pair.js');\nvar YAMLMap = require('../nodes/YAMLMap.js');\nvar resolveProps = require('./resolve-props.js');\nvar utilContainsNewline = require('./util-contains-newline.js');\nvar utilFlowIndentCheck = require('./util-flow-indent-check.js');\nvar utilMapIncludes = require('./util-map-includes.js');\n\nconst startColMsg = 'All mapping items must start at the same column';\nfunction resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {\n const NodeClass = tag?.nodeClass ?? YAMLMap.YAMLMap;\n const map = new NodeClass(ctx.schema);\n if (ctx.atRoot)\n ctx.atRoot = false;\n let offset = bm.offset;\n let commentEnd = null;\n for (const collItem of bm.items) {\n const { start, key, sep, value } = collItem;\n // key properties\n const keyProps = resolveProps.resolveProps(start, {\n indicator: 'explicit-key-ind',\n next: key ?? sep?.[0],\n offset,\n onError,\n parentIndent: bm.indent,\n startOnNewline: true\n });\n const implicitKey = !keyProps.found;\n if (implicitKey) {\n if (key) {\n if (key.type === 'block-seq')\n onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'A block sequence may not be used as an implicit map key');\n else if ('indent' in key && key.indent !== bm.indent)\n onError(offset, 'BAD_INDENT', startColMsg);\n }\n if (!keyProps.anchor && !keyProps.tag && !sep) {\n commentEnd = keyProps.end;\n if (keyProps.comment) {\n if (map.comment)\n map.comment += '\\n' + keyProps.comment;\n else\n map.comment = keyProps.comment;\n }\n continue;\n }\n if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) {\n onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line');\n }\n }\n else if (keyProps.found?.indent !== bm.indent) {\n onError(offset, 'BAD_INDENT', startColMsg);\n }\n // key value\n ctx.atKey = true;\n const keyStart = keyProps.end;\n const keyNode = key\n ? composeNode(ctx, key, keyProps, onError)\n : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);\n if (ctx.schema.compat)\n utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);\n ctx.atKey = false;\n if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))\n onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');\n // value properties\n const valueProps = resolveProps.resolveProps(sep ?? [], {\n indicator: 'map-value-ind',\n next: value,\n offset: keyNode.range[2],\n onError,\n parentIndent: bm.indent,\n startOnNewline: !key || key.type === 'block-scalar'\n });\n offset = valueProps.end;\n if (valueProps.found) {\n if (implicitKey) {\n if (value?.type === 'block-map' && !valueProps.hasNewline)\n onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'Nested mappings are not allowed in compact mappings');\n if (ctx.options.strict &&\n keyProps.start < valueProps.found.offset - 1024)\n onError(keyNode.range, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit block mapping key');\n }\n // value value\n const valueNode = value\n ? composeNode(ctx, value, valueProps, onError)\n : composeEmptyNode(ctx, offset, sep, null, valueProps, onError);\n if (ctx.schema.compat)\n utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);\n offset = valueNode.range[2];\n const pair = new Pair.Pair(keyNode, valueNode);\n if (ctx.options.keepSourceTokens)\n pair.srcToken = collItem;\n map.items.push(pair);\n }\n else {\n // key with no value\n if (implicitKey)\n onError(keyNode.range, 'MISSING_CHAR', 'Implicit map keys need to be followed by map values');\n if (valueProps.comment) {\n if (keyNode.comment)\n keyNode.comment += '\\n' + valueProps.comment;\n else\n keyNode.comment = valueProps.comment;\n }\n const pair = new Pair.Pair(keyNode);\n if (ctx.options.keepSourceTokens)\n pair.srcToken = collItem;\n map.items.push(pair);\n }\n }\n if (commentEnd && commentEnd < offset)\n onError(commentEnd, 'IMPOSSIBLE', 'Map comment with trailing content');\n map.range = [bm.offset, offset, commentEnd ?? offset];\n return map;\n}\n\nexports.resolveBlockMap = resolveBlockMap;\n",
64
+ "'use strict';\n\nvar YAMLSeq = require('../nodes/YAMLSeq.js');\nvar resolveProps = require('./resolve-props.js');\nvar utilFlowIndentCheck = require('./util-flow-indent-check.js');\n\nfunction resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {\n const NodeClass = tag?.nodeClass ?? YAMLSeq.YAMLSeq;\n const seq = new NodeClass(ctx.schema);\n if (ctx.atRoot)\n ctx.atRoot = false;\n if (ctx.atKey)\n ctx.atKey = false;\n let offset = bs.offset;\n let commentEnd = null;\n for (const { start, value } of bs.items) {\n const props = resolveProps.resolveProps(start, {\n indicator: 'seq-item-ind',\n next: value,\n offset,\n onError,\n parentIndent: bs.indent,\n startOnNewline: true\n });\n if (!props.found) {\n if (props.anchor || props.tag || value) {\n if (value?.type === 'block-seq')\n onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');\n else\n onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');\n }\n else {\n commentEnd = props.end;\n if (props.comment)\n seq.comment = props.comment;\n continue;\n }\n }\n const node = value\n ? composeNode(ctx, value, props, onError)\n : composeEmptyNode(ctx, props.end, start, null, props, onError);\n if (ctx.schema.compat)\n utilFlowIndentCheck.flowIndentCheck(bs.indent, value, onError);\n offset = node.range[2];\n seq.items.push(node);\n }\n seq.range = [bs.offset, offset, commentEnd ?? offset];\n return seq;\n}\n\nexports.resolveBlockSeq = resolveBlockSeq;\n",
65
+ "'use strict';\n\nfunction resolveEnd(end, offset, reqSpace, onError) {\n let comment = '';\n if (end) {\n let hasSpace = false;\n let sep = '';\n for (const token of end) {\n const { source, type } = token;\n switch (type) {\n case 'space':\n hasSpace = true;\n break;\n case 'comment': {\n if (reqSpace && !hasSpace)\n onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');\n const cb = source.substring(1) || ' ';\n if (!comment)\n comment = cb;\n else\n comment += sep + cb;\n sep = '';\n break;\n }\n case 'newline':\n if (comment)\n sep += source;\n hasSpace = true;\n break;\n default:\n onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${type} at node end`);\n }\n offset += source.length;\n }\n }\n return { comment, offset };\n}\n\nexports.resolveEnd = resolveEnd;\n",
66
+ "'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar Pair = require('../nodes/Pair.js');\nvar YAMLMap = require('../nodes/YAMLMap.js');\nvar YAMLSeq = require('../nodes/YAMLSeq.js');\nvar resolveEnd = require('./resolve-end.js');\nvar resolveProps = require('./resolve-props.js');\nvar utilContainsNewline = require('./util-contains-newline.js');\nvar utilMapIncludes = require('./util-map-includes.js');\n\nconst blockMsg = 'Block collections are not allowed within flow collections';\nconst isBlock = (token) => token && (token.type === 'block-map' || token.type === 'block-seq');\nfunction resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {\n const isMap = fc.start.source === '{';\n const fcName = isMap ? 'flow map' : 'flow sequence';\n const NodeClass = (tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq));\n const coll = new NodeClass(ctx.schema);\n coll.flow = true;\n const atRoot = ctx.atRoot;\n if (atRoot)\n ctx.atRoot = false;\n if (ctx.atKey)\n ctx.atKey = false;\n let offset = fc.offset + fc.start.source.length;\n for (let i = 0; i < fc.items.length; ++i) {\n const collItem = fc.items[i];\n const { start, key, sep, value } = collItem;\n const props = resolveProps.resolveProps(start, {\n flow: fcName,\n indicator: 'explicit-key-ind',\n next: key ?? sep?.[0],\n offset,\n onError,\n parentIndent: fc.indent,\n startOnNewline: false\n });\n if (!props.found) {\n if (!props.anchor && !props.tag && !sep && !value) {\n if (i === 0 && props.comma)\n onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);\n else if (i < fc.items.length - 1)\n onError(props.start, 'UNEXPECTED_TOKEN', `Unexpected empty item in ${fcName}`);\n if (props.comment) {\n if (coll.comment)\n coll.comment += '\\n' + props.comment;\n else\n coll.comment = props.comment;\n }\n offset = props.end;\n continue;\n }\n if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key))\n onError(key, // checked by containsNewline()\n 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');\n }\n if (i === 0) {\n if (props.comma)\n onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);\n }\n else {\n if (!props.comma)\n onError(props.start, 'MISSING_CHAR', `Missing , between ${fcName} items`);\n if (props.comment) {\n let prevItemComment = '';\n loop: for (const st of start) {\n switch (st.type) {\n case 'comma':\n case 'space':\n break;\n case 'comment':\n prevItemComment = st.source.substring(1);\n break loop;\n default:\n break loop;\n }\n }\n if (prevItemComment) {\n let prev = coll.items[coll.items.length - 1];\n if (identity.isPair(prev))\n prev = prev.value ?? prev.key;\n if (prev.comment)\n prev.comment += '\\n' + prevItemComment;\n else\n prev.comment = prevItemComment;\n props.comment = props.comment.substring(prevItemComment.length + 1);\n }\n }\n }\n if (!isMap && !sep && !props.found) {\n // item is a value in a seq\n // → key & sep are empty, start does not include ? or :\n const valueNode = value\n ? composeNode(ctx, value, props, onError)\n : composeEmptyNode(ctx, props.end, sep, null, props, onError);\n coll.items.push(valueNode);\n offset = valueNode.range[2];\n if (isBlock(value))\n onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);\n }\n else {\n // item is a key+value pair\n // key value\n ctx.atKey = true;\n const keyStart = props.end;\n const keyNode = key\n ? composeNode(ctx, key, props, onError)\n : composeEmptyNode(ctx, keyStart, start, null, props, onError);\n if (isBlock(key))\n onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);\n ctx.atKey = false;\n // value properties\n const valueProps = resolveProps.resolveProps(sep ?? [], {\n flow: fcName,\n indicator: 'map-value-ind',\n next: value,\n offset: keyNode.range[2],\n onError,\n parentIndent: fc.indent,\n startOnNewline: false\n });\n if (valueProps.found) {\n if (!isMap && !props.found && ctx.options.strict) {\n if (sep)\n for (const st of sep) {\n if (st === valueProps.found)\n break;\n if (st.type === 'newline') {\n onError(st, 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');\n break;\n }\n }\n if (props.start < valueProps.found.offset - 1024)\n onError(valueProps.found, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit flow sequence key');\n }\n }\n else if (value) {\n if ('source' in value && value.source?.[0] === ':')\n onError(value, 'MISSING_CHAR', `Missing space after : in ${fcName}`);\n else\n onError(valueProps.start, 'MISSING_CHAR', `Missing , or : between ${fcName} items`);\n }\n // value value\n const valueNode = value\n ? composeNode(ctx, value, valueProps, onError)\n : valueProps.found\n ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError)\n : null;\n if (valueNode) {\n if (isBlock(value))\n onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);\n }\n else if (valueProps.comment) {\n if (keyNode.comment)\n keyNode.comment += '\\n' + valueProps.comment;\n else\n keyNode.comment = valueProps.comment;\n }\n const pair = new Pair.Pair(keyNode, valueNode);\n if (ctx.options.keepSourceTokens)\n pair.srcToken = collItem;\n if (isMap) {\n const map = coll;\n if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))\n onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');\n map.items.push(pair);\n }\n else {\n const map = new YAMLMap.YAMLMap(ctx.schema);\n map.flow = true;\n map.items.push(pair);\n const endRange = (valueNode ?? keyNode).range;\n map.range = [keyNode.range[0], endRange[1], endRange[2]];\n coll.items.push(map);\n }\n offset = valueNode ? valueNode.range[2] : valueProps.end;\n }\n }\n const expectedEnd = isMap ? '}' : ']';\n const [ce, ...ee] = fc.end;\n let cePos = offset;\n if (ce?.source === expectedEnd)\n cePos = ce.offset + ce.source.length;\n else {\n const name = fcName[0].toUpperCase() + fcName.substring(1);\n const msg = atRoot\n ? `${name} must end with a ${expectedEnd}`\n : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;\n onError(offset, atRoot ? 'MISSING_CHAR' : 'BAD_INDENT', msg);\n if (ce && ce.source.length !== 1)\n ee.unshift(ce);\n }\n if (ee.length > 0) {\n const end = resolveEnd.resolveEnd(ee, cePos, ctx.options.strict, onError);\n if (end.comment) {\n if (coll.comment)\n coll.comment += '\\n' + end.comment;\n else\n coll.comment = end.comment;\n }\n coll.range = [fc.offset, cePos, end.offset];\n }\n else {\n coll.range = [fc.offset, cePos, cePos];\n }\n return coll;\n}\n\nexports.resolveFlowCollection = resolveFlowCollection;\n",
67
+ "'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar Scalar = require('../nodes/Scalar.js');\nvar YAMLMap = require('../nodes/YAMLMap.js');\nvar YAMLSeq = require('../nodes/YAMLSeq.js');\nvar resolveBlockMap = require('./resolve-block-map.js');\nvar resolveBlockSeq = require('./resolve-block-seq.js');\nvar resolveFlowCollection = require('./resolve-flow-collection.js');\n\nfunction resolveCollection(CN, ctx, token, onError, tagName, tag) {\n const coll = token.type === 'block-map'\n ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag)\n : token.type === 'block-seq'\n ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag)\n : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag);\n const Coll = coll.constructor;\n // If we got a tagName matching the class, or the tag name is '!',\n // then use the tagName from the node class used to create it.\n if (tagName === '!' || tagName === Coll.tagName) {\n coll.tag = Coll.tagName;\n return coll;\n }\n if (tagName)\n coll.tag = tagName;\n return coll;\n}\nfunction composeCollection(CN, ctx, token, props, onError) {\n const tagToken = props.tag;\n const tagName = !tagToken\n ? null\n : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));\n if (token.type === 'block-seq') {\n const { anchor, newlineAfterProp: nl } = props;\n const lastProp = anchor && tagToken\n ? anchor.offset > tagToken.offset\n ? anchor\n : tagToken\n : (anchor ?? tagToken);\n if (lastProp && (!nl || nl.offset < lastProp.offset)) {\n const message = 'Missing newline after block sequence props';\n onError(lastProp, 'MISSING_CHAR', message);\n }\n }\n const expType = token.type === 'block-map'\n ? 'map'\n : token.type === 'block-seq'\n ? 'seq'\n : token.start.source === '{'\n ? 'map'\n : 'seq';\n // shortcut: check if it's a generic YAMLMap or YAMLSeq\n // before jumping into the custom tag logic.\n if (!tagToken ||\n !tagName ||\n tagName === '!' ||\n (tagName === YAMLMap.YAMLMap.tagName && expType === 'map') ||\n (tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq')) {\n return resolveCollection(CN, ctx, token, onError, tagName);\n }\n let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);\n if (!tag) {\n const kt = ctx.schema.knownTags[tagName];\n if (kt?.collection === expType) {\n ctx.schema.tags.push(Object.assign({}, kt, { default: false }));\n tag = kt;\n }\n else {\n if (kt) {\n onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);\n }\n else {\n onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);\n }\n return resolveCollection(CN, ctx, token, onError, tagName);\n }\n }\n const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);\n const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll;\n const node = identity.isNode(res)\n ? res\n : new Scalar.Scalar(res);\n node.range = coll.range;\n node.tag = tagName;\n if (tag?.format)\n node.format = tag.format;\n return node;\n}\n\nexports.composeCollection = composeCollection;\n",
68
+ "'use strict';\n\nvar Scalar = require('../nodes/Scalar.js');\n\nfunction resolveBlockScalar(ctx, scalar, onError) {\n const start = scalar.offset;\n const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);\n if (!header)\n return { value: '', type: null, comment: '', range: [start, start, start] };\n const type = header.mode === '>' ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;\n const lines = scalar.source ? splitLines(scalar.source) : [];\n // determine the end of content & start of chomping\n let chompStart = lines.length;\n for (let i = lines.length - 1; i >= 0; --i) {\n const content = lines[i][1];\n if (content === '' || content === '\\r')\n chompStart = i;\n else\n break;\n }\n // shortcut for empty contents\n if (chompStart === 0) {\n const value = header.chomp === '+' && lines.length > 0\n ? '\\n'.repeat(Math.max(1, lines.length - 1))\n : '';\n let end = start + header.length;\n if (scalar.source)\n end += scalar.source.length;\n return { value, type, comment: header.comment, range: [start, end, end] };\n }\n // find the indentation level to trim from start\n let trimIndent = scalar.indent + header.indent;\n let offset = scalar.offset + header.length;\n let contentStart = 0;\n for (let i = 0; i < chompStart; ++i) {\n const [indent, content] = lines[i];\n if (content === '' || content === '\\r') {\n if (header.indent === 0 && indent.length > trimIndent)\n trimIndent = indent.length;\n }\n else {\n if (indent.length < trimIndent) {\n const message = 'Block scalars with more-indented leading empty lines must use an explicit indentation indicator';\n onError(offset + indent.length, 'MISSING_CHAR', message);\n }\n if (header.indent === 0)\n trimIndent = indent.length;\n contentStart = i;\n if (trimIndent === 0 && !ctx.atRoot) {\n const message = 'Block scalar values in collections must be indented';\n onError(offset, 'BAD_INDENT', message);\n }\n break;\n }\n offset += indent.length + content.length + 1;\n }\n // include trailing more-indented empty lines in content\n for (let i = lines.length - 1; i >= chompStart; --i) {\n if (lines[i][0].length > trimIndent)\n chompStart = i + 1;\n }\n let value = '';\n let sep = '';\n let prevMoreIndented = false;\n // leading whitespace is kept intact\n for (let i = 0; i < contentStart; ++i)\n value += lines[i][0].slice(trimIndent) + '\\n';\n for (let i = contentStart; i < chompStart; ++i) {\n let [indent, content] = lines[i];\n offset += indent.length + content.length + 1;\n const crlf = content[content.length - 1] === '\\r';\n if (crlf)\n content = content.slice(0, -1);\n /* istanbul ignore if already caught in lexer */\n if (content && indent.length < trimIndent) {\n const src = header.indent\n ? 'explicit indentation indicator'\n : 'first line';\n const message = `Block scalar lines must not be less indented than their ${src}`;\n onError(offset - content.length - (crlf ? 2 : 1), 'BAD_INDENT', message);\n indent = '';\n }\n if (type === Scalar.Scalar.BLOCK_LITERAL) {\n value += sep + indent.slice(trimIndent) + content;\n sep = '\\n';\n }\n else if (indent.length > trimIndent || content[0] === '\\t') {\n // more-indented content within a folded block\n if (sep === ' ')\n sep = '\\n';\n else if (!prevMoreIndented && sep === '\\n')\n sep = '\\n\\n';\n value += sep + indent.slice(trimIndent) + content;\n sep = '\\n';\n prevMoreIndented = true;\n }\n else if (content === '') {\n // empty line\n if (sep === '\\n')\n value += '\\n';\n else\n sep = '\\n';\n }\n else {\n value += sep + content;\n sep = ' ';\n prevMoreIndented = false;\n }\n }\n switch (header.chomp) {\n case '-':\n break;\n case '+':\n for (let i = chompStart; i < lines.length; ++i)\n value += '\\n' + lines[i][0].slice(trimIndent);\n if (value[value.length - 1] !== '\\n')\n value += '\\n';\n break;\n default:\n value += '\\n';\n }\n const end = start + header.length + scalar.source.length;\n return { value, type, comment: header.comment, range: [start, end, end] };\n}\nfunction parseBlockScalarHeader({ offset, props }, strict, onError) {\n /* istanbul ignore if should not happen */\n if (props[0].type !== 'block-scalar-header') {\n onError(props[0], 'IMPOSSIBLE', 'Block scalar header not found');\n return null;\n }\n const { source } = props[0];\n const mode = source[0];\n let indent = 0;\n let chomp = '';\n let error = -1;\n for (let i = 1; i < source.length; ++i) {\n const ch = source[i];\n if (!chomp && (ch === '-' || ch === '+'))\n chomp = ch;\n else {\n const n = Number(ch);\n if (!indent && n)\n indent = n;\n else if (error === -1)\n error = offset + i;\n }\n }\n if (error !== -1)\n onError(error, 'UNEXPECTED_TOKEN', `Block scalar header includes extra characters: ${source}`);\n let hasSpace = false;\n let comment = '';\n let length = source.length;\n for (let i = 1; i < props.length; ++i) {\n const token = props[i];\n switch (token.type) {\n case 'space':\n hasSpace = true;\n // fallthrough\n case 'newline':\n length += token.source.length;\n break;\n case 'comment':\n if (strict && !hasSpace) {\n const message = 'Comments must be separated from other tokens by white space characters';\n onError(token, 'MISSING_CHAR', message);\n }\n length += token.source.length;\n comment = token.source.substring(1);\n break;\n case 'error':\n onError(token, 'UNEXPECTED_TOKEN', token.message);\n length += token.source.length;\n break;\n /* istanbul ignore next should not happen */\n default: {\n const message = `Unexpected token in block scalar header: ${token.type}`;\n onError(token, 'UNEXPECTED_TOKEN', message);\n const ts = token.source;\n if (ts && typeof ts === 'string')\n length += ts.length;\n }\n }\n }\n return { mode, indent, chomp, comment, length };\n}\n/** @returns Array of lines split up as `[indent, content]` */\nfunction splitLines(source) {\n const split = source.split(/\\n( *)/);\n const first = split[0];\n const m = first.match(/^( *)/);\n const line0 = m?.[1]\n ? [m[1], first.slice(m[1].length)]\n : ['', first];\n const lines = [line0];\n for (let i = 1; i < split.length; i += 2)\n lines.push([split[i], split[i + 1]]);\n return lines;\n}\n\nexports.resolveBlockScalar = resolveBlockScalar;\n",
69
+ "'use strict';\n\nvar Scalar = require('../nodes/Scalar.js');\nvar resolveEnd = require('./resolve-end.js');\n\nfunction resolveFlowScalar(scalar, strict, onError) {\n const { offset, type, source, end } = scalar;\n let _type;\n let value;\n const _onError = (rel, code, msg) => onError(offset + rel, code, msg);\n switch (type) {\n case 'scalar':\n _type = Scalar.Scalar.PLAIN;\n value = plainValue(source, _onError);\n break;\n case 'single-quoted-scalar':\n _type = Scalar.Scalar.QUOTE_SINGLE;\n value = singleQuotedValue(source, _onError);\n break;\n case 'double-quoted-scalar':\n _type = Scalar.Scalar.QUOTE_DOUBLE;\n value = doubleQuotedValue(source, _onError);\n break;\n /* istanbul ignore next should not happen */\n default:\n onError(scalar, 'UNEXPECTED_TOKEN', `Expected a flow scalar value, but found: ${type}`);\n return {\n value: '',\n type: null,\n comment: '',\n range: [offset, offset + source.length, offset + source.length]\n };\n }\n const valueEnd = offset + source.length;\n const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError);\n return {\n value,\n type: _type,\n comment: re.comment,\n range: [offset, valueEnd, re.offset]\n };\n}\nfunction plainValue(source, onError) {\n let badChar = '';\n switch (source[0]) {\n /* istanbul ignore next should not happen */\n case '\\t':\n badChar = 'a tab character';\n break;\n case ',':\n badChar = 'flow indicator character ,';\n break;\n case '%':\n badChar = 'directive indicator character %';\n break;\n case '|':\n case '>': {\n badChar = `block scalar indicator ${source[0]}`;\n break;\n }\n case '@':\n case '`': {\n badChar = `reserved character ${source[0]}`;\n break;\n }\n }\n if (badChar)\n onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`);\n return foldLines(source);\n}\nfunction singleQuotedValue(source, onError) {\n if (source[source.length - 1] !== \"'\" || source.length === 1)\n onError(source.length, 'MISSING_CHAR', \"Missing closing 'quote\");\n return foldLines(source.slice(1, -1)).replace(/''/g, \"'\");\n}\nfunction foldLines(source) {\n /**\n * The negative lookbehind here and in the `re` RegExp is to\n * prevent causing a polynomial search time in certain cases.\n *\n * The try-catch is for Safari, which doesn't support this yet:\n * https://caniuse.com/js-regexp-lookbehind\n */\n let first, line;\n try {\n first = new RegExp('(.*?)(?<![ \\t])[ \\t]*\\r?\\n', 'sy');\n line = new RegExp('[ \\t]*(.*?)(?:(?<![ \\t])[ \\t]*)?\\r?\\n', 'sy');\n }\n catch {\n first = /(.*?)[ \\t]*\\r?\\n/sy;\n line = /[ \\t]*(.*?)[ \\t]*\\r?\\n/sy;\n }\n let match = first.exec(source);\n if (!match)\n return source;\n let res = match[1];\n let sep = ' ';\n let pos = first.lastIndex;\n line.lastIndex = pos;\n while ((match = line.exec(source))) {\n if (match[1] === '') {\n if (sep === '\\n')\n res += sep;\n else\n sep = '\\n';\n }\n else {\n res += sep + match[1];\n sep = ' ';\n }\n pos = line.lastIndex;\n }\n const last = /[ \\t]*(.*)/sy;\n last.lastIndex = pos;\n match = last.exec(source);\n return res + sep + (match?.[1] ?? '');\n}\nfunction doubleQuotedValue(source, onError) {\n let res = '';\n for (let i = 1; i < source.length - 1; ++i) {\n const ch = source[i];\n if (ch === '\\r' && source[i + 1] === '\\n')\n continue;\n if (ch === '\\n') {\n const { fold, offset } = foldNewline(source, i);\n res += fold;\n i = offset;\n }\n else if (ch === '\\\\') {\n let next = source[++i];\n const cc = escapeCodes[next];\n if (cc)\n res += cc;\n else if (next === '\\n') {\n // skip escaped newlines, but still trim the following line\n next = source[i + 1];\n while (next === ' ' || next === '\\t')\n next = source[++i + 1];\n }\n else if (next === '\\r' && source[i + 1] === '\\n') {\n // skip escaped CRLF newlines, but still trim the following line\n next = source[++i + 1];\n while (next === ' ' || next === '\\t')\n next = source[++i + 1];\n }\n else if (next === 'x' || next === 'u' || next === 'U') {\n const length = { x: 2, u: 4, U: 8 }[next];\n res += parseCharCode(source, i + 1, length, onError);\n i += length;\n }\n else {\n const raw = source.substr(i - 1, 2);\n onError(i - 1, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);\n res += raw;\n }\n }\n else if (ch === ' ' || ch === '\\t') {\n // trim trailing whitespace\n const wsStart = i;\n let next = source[i + 1];\n while (next === ' ' || next === '\\t')\n next = source[++i + 1];\n if (next !== '\\n' && !(next === '\\r' && source[i + 2] === '\\n'))\n res += i > wsStart ? source.slice(wsStart, i + 1) : ch;\n }\n else {\n res += ch;\n }\n }\n if (source[source.length - 1] !== '\"' || source.length === 1)\n onError(source.length, 'MISSING_CHAR', 'Missing closing \"quote');\n return res;\n}\n/**\n * Fold a single newline into a space, multiple newlines to N - 1 newlines.\n * Presumes `source[offset] === '\\n'`\n */\nfunction foldNewline(source, offset) {\n let fold = '';\n let ch = source[offset + 1];\n while (ch === ' ' || ch === '\\t' || ch === '\\n' || ch === '\\r') {\n if (ch === '\\r' && source[offset + 2] !== '\\n')\n break;\n if (ch === '\\n')\n fold += '\\n';\n offset += 1;\n ch = source[offset + 1];\n }\n if (!fold)\n fold = ' ';\n return { fold, offset };\n}\nconst escapeCodes = {\n '0': '\\0', // null character\n a: '\\x07', // bell character\n b: '\\b', // backspace\n e: '\\x1b', // escape character\n f: '\\f', // form feed\n n: '\\n', // line feed\n r: '\\r', // carriage return\n t: '\\t', // horizontal tab\n v: '\\v', // vertical tab\n N: '\\u0085', // Unicode next line\n _: '\\u00a0', // Unicode non-breaking space\n L: '\\u2028', // Unicode line separator\n P: '\\u2029', // Unicode paragraph separator\n ' ': ' ',\n '\"': '\"',\n '/': '/',\n '\\\\': '\\\\',\n '\\t': '\\t'\n};\nfunction parseCharCode(source, offset, length, onError) {\n const cc = source.substr(offset, length);\n const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);\n const code = ok ? parseInt(cc, 16) : NaN;\n if (isNaN(code)) {\n const raw = source.substr(offset - 2, length + 2);\n onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);\n return raw;\n }\n return String.fromCodePoint(code);\n}\n\nexports.resolveFlowScalar = resolveFlowScalar;\n",
70
+ "'use strict';\n\nvar identity = require('../nodes/identity.js');\nvar Scalar = require('../nodes/Scalar.js');\nvar resolveBlockScalar = require('./resolve-block-scalar.js');\nvar resolveFlowScalar = require('./resolve-flow-scalar.js');\n\nfunction composeScalar(ctx, token, tagToken, onError) {\n const { value, type, comment, range } = token.type === 'block-scalar'\n ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError)\n : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);\n const tagName = tagToken\n ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))\n : null;\n let tag;\n if (ctx.options.stringKeys && ctx.atKey) {\n tag = ctx.schema[identity.SCALAR];\n }\n else if (tagName)\n tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);\n else if (token.type === 'scalar')\n tag = findScalarTagByTest(ctx, value, token, onError);\n else\n tag = ctx.schema[identity.SCALAR];\n let scalar;\n try {\n const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);\n scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);\n }\n catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg);\n scalar = new Scalar.Scalar(value);\n }\n scalar.range = range;\n scalar.source = value;\n if (type)\n scalar.type = type;\n if (tagName)\n scalar.tag = tagName;\n if (tag.format)\n scalar.format = tag.format;\n if (comment)\n scalar.comment = comment;\n return scalar;\n}\nfunction findScalarTagByName(schema, value, tagName, tagToken, onError) {\n if (tagName === '!')\n return schema[identity.SCALAR]; // non-specific tag\n const matchWithTest = [];\n for (const tag of schema.tags) {\n if (!tag.collection && tag.tag === tagName) {\n if (tag.default && tag.test)\n matchWithTest.push(tag);\n else\n return tag;\n }\n }\n for (const tag of matchWithTest)\n if (tag.test?.test(value))\n return tag;\n const kt = schema.knownTags[tagName];\n if (kt && !kt.collection) {\n // Ensure that the known tag is available for stringifying,\n // but does not get used by default.\n schema.tags.push(Object.assign({}, kt, { default: false, test: undefined }));\n return kt;\n }\n onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');\n return schema[identity.SCALAR];\n}\nfunction findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {\n const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&\n tag.test?.test(value)) || schema[identity.SCALAR];\n if (schema.compat) {\n const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??\n schema[identity.SCALAR];\n if (tag.tag !== compat.tag) {\n const ts = directives.tagString(tag.tag);\n const cs = directives.tagString(compat.tag);\n const msg = `Value may be parsed as either ${ts} or ${cs}`;\n onError(token, 'TAG_RESOLVE_FAILED', msg, true);\n }\n }\n return tag;\n}\n\nexports.composeScalar = composeScalar;\n",
71
+ "'use strict';\n\nfunction emptyScalarPosition(offset, before, pos) {\n if (before) {\n pos ?? (pos = before.length);\n for (let i = pos - 1; i >= 0; --i) {\n let st = before[i];\n switch (st.type) {\n case 'space':\n case 'comment':\n case 'newline':\n offset -= st.source.length;\n continue;\n }\n // Technically, an empty scalar is immediately after the last non-empty\n // node, but it's more useful to place it after any whitespace.\n st = before[++i];\n while (st?.type === 'space') {\n offset += st.source.length;\n st = before[++i];\n }\n break;\n }\n }\n return offset;\n}\n\nexports.emptyScalarPosition = emptyScalarPosition;\n",
72
+ "'use strict';\n\nvar Alias = require('../nodes/Alias.js');\nvar identity = require('../nodes/identity.js');\nvar composeCollection = require('./compose-collection.js');\nvar composeScalar = require('./compose-scalar.js');\nvar resolveEnd = require('./resolve-end.js');\nvar utilEmptyScalarPosition = require('./util-empty-scalar-position.js');\n\nconst CN = { composeNode, composeEmptyNode };\nfunction composeNode(ctx, token, props, onError) {\n const atKey = ctx.atKey;\n const { spaceBefore, comment, anchor, tag } = props;\n let node;\n let isSrcToken = true;\n switch (token.type) {\n case 'alias':\n node = composeAlias(ctx, token, onError);\n if (anchor || tag)\n onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties');\n break;\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n case 'block-scalar':\n node = composeScalar.composeScalar(ctx, token, tag, onError);\n if (anchor)\n node.anchor = anchor.source.substring(1);\n break;\n case 'block-map':\n case 'block-seq':\n case 'flow-collection':\n node = composeCollection.composeCollection(CN, ctx, token, props, onError);\n if (anchor)\n node.anchor = anchor.source.substring(1);\n break;\n default: {\n const message = token.type === 'error'\n ? token.message\n : `Unsupported token (type: ${token.type})`;\n onError(token, 'UNEXPECTED_TOKEN', message);\n node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);\n isSrcToken = false;\n }\n }\n if (anchor && node.anchor === '')\n onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');\n if (atKey &&\n ctx.options.stringKeys &&\n (!identity.isScalar(node) ||\n typeof node.value !== 'string' ||\n (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {\n const msg = 'With stringKeys, all keys must be strings';\n onError(tag ?? token, 'NON_STRING_KEY', msg);\n }\n if (spaceBefore)\n node.spaceBefore = true;\n if (comment) {\n if (token.type === 'scalar' && token.source === '')\n node.comment = comment;\n else\n node.commentBefore = comment;\n }\n // @ts-expect-error Type checking misses meaning of isSrcToken\n if (ctx.options.keepSourceTokens && isSrcToken)\n node.srcToken = token;\n return node;\n}\nfunction composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {\n const token = {\n type: 'scalar',\n offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),\n indent: -1,\n source: ''\n };\n const node = composeScalar.composeScalar(ctx, token, tag, onError);\n if (anchor) {\n node.anchor = anchor.source.substring(1);\n if (node.anchor === '')\n onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');\n }\n if (spaceBefore)\n node.spaceBefore = true;\n if (comment) {\n node.comment = comment;\n node.range[2] = end;\n }\n return node;\n}\nfunction composeAlias({ options }, { offset, source, end }, onError) {\n const alias = new Alias.Alias(source.substring(1));\n if (alias.source === '')\n onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string');\n if (alias.source.endsWith(':'))\n onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true);\n const valueEnd = offset + source.length;\n const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);\n alias.range = [offset, valueEnd, re.offset];\n if (re.comment)\n alias.comment = re.comment;\n return alias;\n}\n\nexports.composeEmptyNode = composeEmptyNode;\nexports.composeNode = composeNode;\n",
73
+ "'use strict';\n\nvar Document = require('../doc/Document.js');\nvar composeNode = require('./compose-node.js');\nvar resolveEnd = require('./resolve-end.js');\nvar resolveProps = require('./resolve-props.js');\n\nfunction composeDoc(options, directives, { offset, start, value, end }, onError) {\n const opts = Object.assign({ _directives: directives }, options);\n const doc = new Document.Document(undefined, opts);\n const ctx = {\n atKey: false,\n atRoot: true,\n directives: doc.directives,\n options: doc.options,\n schema: doc.schema\n };\n const props = resolveProps.resolveProps(start, {\n indicator: 'doc-start',\n next: value ?? end?.[0],\n offset,\n onError,\n parentIndent: 0,\n startOnNewline: true\n });\n if (props.found) {\n doc.directives.docStart = true;\n if (value &&\n (value.type === 'block-map' || value.type === 'block-seq') &&\n !props.hasNewline)\n onError(props.end, 'MISSING_CHAR', 'Block collection cannot start on same line with directives-end marker');\n }\n // @ts-expect-error If Contents is set, let's trust the user\n doc.contents = value\n ? composeNode.composeNode(ctx, value, props, onError)\n : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);\n const contentEnd = doc.contents.range[2];\n const re = resolveEnd.resolveEnd(end, contentEnd, false, onError);\n if (re.comment)\n doc.comment = re.comment;\n doc.range = [offset, contentEnd, re.offset];\n return doc;\n}\n\nexports.composeDoc = composeDoc;\n",
74
+ "'use strict';\n\nvar node_process = require('process');\nvar directives = require('../doc/directives.js');\nvar Document = require('../doc/Document.js');\nvar errors = require('../errors.js');\nvar identity = require('../nodes/identity.js');\nvar composeDoc = require('./compose-doc.js');\nvar resolveEnd = require('./resolve-end.js');\n\nfunction getErrorPos(src) {\n if (typeof src === 'number')\n return [src, src + 1];\n if (Array.isArray(src))\n return src.length === 2 ? src : [src[0], src[1]];\n const { offset, source } = src;\n return [offset, offset + (typeof source === 'string' ? source.length : 1)];\n}\nfunction parsePrelude(prelude) {\n let comment = '';\n let atComment = false;\n let afterEmptyLine = false;\n for (let i = 0; i < prelude.length; ++i) {\n const source = prelude[i];\n switch (source[0]) {\n case '#':\n comment +=\n (comment === '' ? '' : afterEmptyLine ? '\\n\\n' : '\\n') +\n (source.substring(1) || ' ');\n atComment = true;\n afterEmptyLine = false;\n break;\n case '%':\n if (prelude[i + 1]?.[0] !== '#')\n i += 1;\n atComment = false;\n break;\n default:\n // This may be wrong after doc-end, but in that case it doesn't matter\n if (!atComment)\n afterEmptyLine = true;\n atComment = false;\n }\n }\n return { comment, afterEmptyLine };\n}\n/**\n * Compose a stream of CST nodes into a stream of YAML Documents.\n *\n * ```ts\n * import { Composer, Parser } from 'yaml'\n *\n * const src: string = ...\n * const tokens = new Parser().parse(src)\n * const docs = new Composer().compose(tokens)\n * ```\n */\nclass Composer {\n constructor(options = {}) {\n this.doc = null;\n this.atDirectives = false;\n this.prelude = [];\n this.errors = [];\n this.warnings = [];\n this.onError = (source, code, message, warning) => {\n const pos = getErrorPos(source);\n if (warning)\n this.warnings.push(new errors.YAMLWarning(pos, code, message));\n else\n this.errors.push(new errors.YAMLParseError(pos, code, message));\n };\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n this.directives = new directives.Directives({ version: options.version || '1.2' });\n this.options = options;\n }\n decorate(doc, afterDoc) {\n const { comment, afterEmptyLine } = parsePrelude(this.prelude);\n //console.log({ dc: doc.comment, prelude, comment })\n if (comment) {\n const dc = doc.contents;\n if (afterDoc) {\n doc.comment = doc.comment ? `${doc.comment}\\n${comment}` : comment;\n }\n else if (afterEmptyLine || doc.directives.docStart || !dc) {\n doc.commentBefore = comment;\n }\n else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {\n let it = dc.items[0];\n if (identity.isPair(it))\n it = it.key;\n const cb = it.commentBefore;\n it.commentBefore = cb ? `${comment}\\n${cb}` : comment;\n }\n else {\n const cb = dc.commentBefore;\n dc.commentBefore = cb ? `${comment}\\n${cb}` : comment;\n }\n }\n if (afterDoc) {\n Array.prototype.push.apply(doc.errors, this.errors);\n Array.prototype.push.apply(doc.warnings, this.warnings);\n }\n else {\n doc.errors = this.errors;\n doc.warnings = this.warnings;\n }\n this.prelude = [];\n this.errors = [];\n this.warnings = [];\n }\n /**\n * Current stream status information.\n *\n * Mostly useful at the end of input for an empty stream.\n */\n streamInfo() {\n return {\n comment: parsePrelude(this.prelude).comment,\n directives: this.directives,\n errors: this.errors,\n warnings: this.warnings\n };\n }\n /**\n * Compose tokens into documents.\n *\n * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.\n * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.\n */\n *compose(tokens, forceDoc = false, endOffset = -1) {\n for (const token of tokens)\n yield* this.next(token);\n yield* this.end(forceDoc, endOffset);\n }\n /** Advance the composer by one CST token. */\n *next(token) {\n if (node_process.env.LOG_STREAM)\n console.dir(token, { depth: null });\n switch (token.type) {\n case 'directive':\n this.directives.add(token.source, (offset, message, warning) => {\n const pos = getErrorPos(token);\n pos[0] += offset;\n this.onError(pos, 'BAD_DIRECTIVE', message, warning);\n });\n this.prelude.push(token.source);\n this.atDirectives = true;\n break;\n case 'document': {\n const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError);\n if (this.atDirectives && !doc.directives.docStart)\n this.onError(token, 'MISSING_CHAR', 'Missing directives-end/doc-start indicator line');\n this.decorate(doc, false);\n if (this.doc)\n yield this.doc;\n this.doc = doc;\n this.atDirectives = false;\n break;\n }\n case 'byte-order-mark':\n case 'space':\n break;\n case 'comment':\n case 'newline':\n this.prelude.push(token.source);\n break;\n case 'error': {\n const msg = token.source\n ? `${token.message}: ${JSON.stringify(token.source)}`\n : token.message;\n const error = new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg);\n if (this.atDirectives || !this.doc)\n this.errors.push(error);\n else\n this.doc.errors.push(error);\n break;\n }\n case 'doc-end': {\n if (!this.doc) {\n const msg = 'Unexpected doc-end without preceding document';\n this.errors.push(new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg));\n break;\n }\n this.doc.directives.docEnd = true;\n const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);\n this.decorate(this.doc, true);\n if (end.comment) {\n const dc = this.doc.comment;\n this.doc.comment = dc ? `${dc}\\n${end.comment}` : end.comment;\n }\n this.doc.range[2] = end.offset;\n break;\n }\n default:\n this.errors.push(new errors.YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', `Unsupported token ${token.type}`));\n }\n }\n /**\n * Call at end of input to yield any remaining document.\n *\n * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.\n * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.\n */\n *end(forceDoc = false, endOffset = -1) {\n if (this.doc) {\n this.decorate(this.doc, true);\n yield this.doc;\n this.doc = null;\n }\n else if (forceDoc) {\n const opts = Object.assign({ _directives: this.directives }, this.options);\n const doc = new Document.Document(undefined, opts);\n if (this.atDirectives)\n this.onError(endOffset, 'MISSING_CHAR', 'Missing directives-end indicator line');\n doc.range = [0, endOffset, endOffset];\n this.decorate(doc, false);\n yield doc;\n }\n }\n}\n\nexports.Composer = Composer;\n",
75
+ "'use strict';\n\nvar resolveBlockScalar = require('../compose/resolve-block-scalar.js');\nvar resolveFlowScalar = require('../compose/resolve-flow-scalar.js');\nvar errors = require('../errors.js');\nvar stringifyString = require('../stringify/stringifyString.js');\n\nfunction resolveAsScalar(token, strict = true, onError) {\n if (token) {\n const _onError = (pos, code, message) => {\n const offset = typeof pos === 'number' ? pos : Array.isArray(pos) ? pos[0] : pos.offset;\n if (onError)\n onError(offset, code, message);\n else\n throw new errors.YAMLParseError([offset, offset + 1], code, message);\n };\n switch (token.type) {\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n return resolveFlowScalar.resolveFlowScalar(token, strict, _onError);\n case 'block-scalar':\n return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError);\n }\n }\n return null;\n}\n/**\n * Create a new scalar token with `value`\n *\n * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,\n * as this function does not support any schema operations and won't check for such conflicts.\n *\n * @param value The string representation of the value, which will have its content properly indented.\n * @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added.\n * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.\n * @param context.indent The indent level of the token.\n * @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value.\n * @param context.offset The offset position of the token.\n * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.\n */\nfunction createScalarToken(value, context) {\n const { implicitKey = false, indent, inFlow = false, offset = -1, type = 'PLAIN' } = context;\n const source = stringifyString.stringifyString({ type, value }, {\n implicitKey,\n indent: indent > 0 ? ' '.repeat(indent) : '',\n inFlow,\n options: { blockQuote: true, lineWidth: -1 }\n });\n const end = context.end ?? [\n { type: 'newline', offset: -1, indent, source: '\\n' }\n ];\n switch (source[0]) {\n case '|':\n case '>': {\n const he = source.indexOf('\\n');\n const head = source.substring(0, he);\n const body = source.substring(he + 1) + '\\n';\n const props = [\n { type: 'block-scalar-header', offset, indent, source: head }\n ];\n if (!addEndtoBlockProps(props, end))\n props.push({ type: 'newline', offset: -1, indent, source: '\\n' });\n return { type: 'block-scalar', offset, indent, props, source: body };\n }\n case '\"':\n return { type: 'double-quoted-scalar', offset, indent, source, end };\n case \"'\":\n return { type: 'single-quoted-scalar', offset, indent, source, end };\n default:\n return { type: 'scalar', offset, indent, source, end };\n }\n}\n/**\n * Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have.\n *\n * Best efforts are made to retain any comments previously associated with the `token`,\n * though all contents within a collection's `items` will be overwritten.\n *\n * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,\n * as this function does not support any schema operations and won't check for such conflicts.\n *\n * @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key.\n * @param value The string representation of the value, which will have its content properly indented.\n * @param context.afterKey In most cases, values after a key should have an additional level of indentation.\n * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.\n * @param context.inFlow Being within a flow collection may affect the resolved type of the token's value.\n * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.\n */\nfunction setScalarValue(token, value, context = {}) {\n let { afterKey = false, implicitKey = false, inFlow = false, type } = context;\n let indent = 'indent' in token ? token.indent : null;\n if (afterKey && typeof indent === 'number')\n indent += 2;\n if (!type)\n switch (token.type) {\n case 'single-quoted-scalar':\n type = 'QUOTE_SINGLE';\n break;\n case 'double-quoted-scalar':\n type = 'QUOTE_DOUBLE';\n break;\n case 'block-scalar': {\n const header = token.props[0];\n if (header.type !== 'block-scalar-header')\n throw new Error('Invalid block scalar header');\n type = header.source[0] === '>' ? 'BLOCK_FOLDED' : 'BLOCK_LITERAL';\n break;\n }\n default:\n type = 'PLAIN';\n }\n const source = stringifyString.stringifyString({ type, value }, {\n implicitKey: implicitKey || indent === null,\n indent: indent !== null && indent > 0 ? ' '.repeat(indent) : '',\n inFlow,\n options: { blockQuote: true, lineWidth: -1 }\n });\n switch (source[0]) {\n case '|':\n case '>':\n setBlockScalarValue(token, source);\n break;\n case '\"':\n setFlowScalarValue(token, source, 'double-quoted-scalar');\n break;\n case \"'\":\n setFlowScalarValue(token, source, 'single-quoted-scalar');\n break;\n default:\n setFlowScalarValue(token, source, 'scalar');\n }\n}\nfunction setBlockScalarValue(token, source) {\n const he = source.indexOf('\\n');\n const head = source.substring(0, he);\n const body = source.substring(he + 1) + '\\n';\n if (token.type === 'block-scalar') {\n const header = token.props[0];\n if (header.type !== 'block-scalar-header')\n throw new Error('Invalid block scalar header');\n header.source = head;\n token.source = body;\n }\n else {\n const { offset } = token;\n const indent = 'indent' in token ? token.indent : -1;\n const props = [\n { type: 'block-scalar-header', offset, indent, source: head }\n ];\n if (!addEndtoBlockProps(props, 'end' in token ? token.end : undefined))\n props.push({ type: 'newline', offset: -1, indent, source: '\\n' });\n for (const key of Object.keys(token))\n if (key !== 'type' && key !== 'offset')\n delete token[key];\n Object.assign(token, { type: 'block-scalar', indent, props, source: body });\n }\n}\n/** @returns `true` if last token is a newline */\nfunction addEndtoBlockProps(props, end) {\n if (end)\n for (const st of end)\n switch (st.type) {\n case 'space':\n case 'comment':\n props.push(st);\n break;\n case 'newline':\n props.push(st);\n return true;\n }\n return false;\n}\nfunction setFlowScalarValue(token, source, type) {\n switch (token.type) {\n case 'scalar':\n case 'double-quoted-scalar':\n case 'single-quoted-scalar':\n token.type = type;\n token.source = source;\n break;\n case 'block-scalar': {\n const end = token.props.slice(1);\n let oa = source.length;\n if (token.props[0].type === 'block-scalar-header')\n oa -= token.props[0].source.length;\n for (const tok of end)\n tok.offset += oa;\n delete token.props;\n Object.assign(token, { type, source, end });\n break;\n }\n case 'block-map':\n case 'block-seq': {\n const offset = token.offset + source.length;\n const nl = { type: 'newline', offset, indent: token.indent, source: '\\n' };\n delete token.items;\n Object.assign(token, { type, source, end: [nl] });\n break;\n }\n default: {\n const indent = 'indent' in token ? token.indent : -1;\n const end = 'end' in token && Array.isArray(token.end)\n ? token.end.filter(st => st.type === 'space' ||\n st.type === 'comment' ||\n st.type === 'newline')\n : [];\n for (const key of Object.keys(token))\n if (key !== 'type' && key !== 'offset')\n delete token[key];\n Object.assign(token, { type, indent, source, end });\n }\n }\n}\n\nexports.createScalarToken = createScalarToken;\nexports.resolveAsScalar = resolveAsScalar;\nexports.setScalarValue = setScalarValue;\n",
76
+ "'use strict';\n\n/**\n * Stringify a CST document, token, or collection item\n *\n * Fair warning: This applies no validation whatsoever, and\n * simply concatenates the sources in their logical order.\n */\nconst stringify = (cst) => 'type' in cst ? stringifyToken(cst) : stringifyItem(cst);\nfunction stringifyToken(token) {\n switch (token.type) {\n case 'block-scalar': {\n let res = '';\n for (const tok of token.props)\n res += stringifyToken(tok);\n return res + token.source;\n }\n case 'block-map':\n case 'block-seq': {\n let res = '';\n for (const item of token.items)\n res += stringifyItem(item);\n return res;\n }\n case 'flow-collection': {\n let res = token.start.source;\n for (const item of token.items)\n res += stringifyItem(item);\n for (const st of token.end)\n res += st.source;\n return res;\n }\n case 'document': {\n let res = stringifyItem(token);\n if (token.end)\n for (const st of token.end)\n res += st.source;\n return res;\n }\n default: {\n let res = token.source;\n if ('end' in token && token.end)\n for (const st of token.end)\n res += st.source;\n return res;\n }\n }\n}\nfunction stringifyItem({ start, key, sep, value }) {\n let res = '';\n for (const st of start)\n res += st.source;\n if (key)\n res += stringifyToken(key);\n if (sep)\n for (const st of sep)\n res += st.source;\n if (value)\n res += stringifyToken(value);\n return res;\n}\n\nexports.stringify = stringify;\n",
77
+ "'use strict';\n\nconst BREAK = Symbol('break visit');\nconst SKIP = Symbol('skip children');\nconst REMOVE = Symbol('remove item');\n/**\n * Apply a visitor to a CST document or item.\n *\n * Walks through the tree (depth-first) starting from the root, calling a\n * `visitor` function with two arguments when entering each item:\n * - `item`: The current item, which included the following members:\n * - `start: SourceToken[]` – Source tokens before the key or value,\n * possibly including its anchor or tag.\n * - `key?: Token | null` – Set for pair values. May then be `null`, if\n * the key before the `:` separator is empty.\n * - `sep?: SourceToken[]` – Source tokens between the key and the value,\n * which should include the `:` map value indicator if `value` is set.\n * - `value?: Token` – The value of a sequence item, or of a map pair.\n * - `path`: The steps from the root to the current node, as an array of\n * `['key' | 'value', number]` tuples.\n *\n * The return value of the visitor may be used to control the traversal:\n * - `undefined` (default): Do nothing and continue\n * - `visit.SKIP`: Do not visit the children of this token, continue with\n * next sibling\n * - `visit.BREAK`: Terminate traversal completely\n * - `visit.REMOVE`: Remove the current item, then continue with the next one\n * - `number`: Set the index of the next step. This is useful especially if\n * the index of the current token has changed.\n * - `function`: Define the next visitor for this item. After the original\n * visitor is called on item entry, next visitors are called after handling\n * a non-empty `key` and when exiting the item.\n */\nfunction visit(cst, visitor) {\n if ('type' in cst && cst.type === 'document')\n cst = { start: cst.start, value: cst.value };\n _visit(Object.freeze([]), cst, visitor);\n}\n// Without the `as symbol` casts, TS declares these in the `visit`\n// namespace using `var`, but then complains about that because\n// `unique symbol` must be `const`.\n/** Terminate visit traversal completely */\nvisit.BREAK = BREAK;\n/** Do not visit the children of the current item */\nvisit.SKIP = SKIP;\n/** Remove the current item */\nvisit.REMOVE = REMOVE;\n/** Find the item at `path` from `cst` as the root */\nvisit.itemAtPath = (cst, path) => {\n let item = cst;\n for (const [field, index] of path) {\n const tok = item?.[field];\n if (tok && 'items' in tok) {\n item = tok.items[index];\n }\n else\n return undefined;\n }\n return item;\n};\n/**\n * Get the immediate parent collection of the item at `path` from `cst` as the root.\n *\n * Throws an error if the collection is not found, which should never happen if the item itself exists.\n */\nvisit.parentCollection = (cst, path) => {\n const parent = visit.itemAtPath(cst, path.slice(0, -1));\n const field = path[path.length - 1][0];\n const coll = parent?.[field];\n if (coll && 'items' in coll)\n return coll;\n throw new Error('Parent collection not found');\n};\nfunction _visit(path, item, visitor) {\n let ctrl = visitor(item, path);\n if (typeof ctrl === 'symbol')\n return ctrl;\n for (const field of ['key', 'value']) {\n const token = item[field];\n if (token && 'items' in token) {\n for (let i = 0; i < token.items.length; ++i) {\n const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor);\n if (typeof ci === 'number')\n i = ci - 1;\n else if (ci === BREAK)\n return BREAK;\n else if (ci === REMOVE) {\n token.items.splice(i, 1);\n i -= 1;\n }\n }\n if (typeof ctrl === 'function' && field === 'key')\n ctrl = ctrl(item, path);\n }\n }\n return typeof ctrl === 'function' ? ctrl(item, path) : ctrl;\n}\n\nexports.visit = visit;\n",
78
+ "'use strict';\n\nvar cstScalar = require('./cst-scalar.js');\nvar cstStringify = require('./cst-stringify.js');\nvar cstVisit = require('./cst-visit.js');\n\n/** The byte order mark */\nconst BOM = '\\u{FEFF}';\n/** Start of doc-mode */\nconst DOCUMENT = '\\x02'; // C0: Start of Text\n/** Unexpected end of flow-mode */\nconst FLOW_END = '\\x18'; // C0: Cancel\n/** Next token is a scalar value */\nconst SCALAR = '\\x1f'; // C0: Unit Separator\n/** @returns `true` if `token` is a flow or block collection */\nconst isCollection = (token) => !!token && 'items' in token;\n/** @returns `true` if `token` is a flow or block scalar; not an alias */\nconst isScalar = (token) => !!token &&\n (token.type === 'scalar' ||\n token.type === 'single-quoted-scalar' ||\n token.type === 'double-quoted-scalar' ||\n token.type === 'block-scalar');\n/* istanbul ignore next */\n/** Get a printable representation of a lexer token */\nfunction prettyToken(token) {\n switch (token) {\n case BOM:\n return '<BOM>';\n case DOCUMENT:\n return '<DOC>';\n case FLOW_END:\n return '<FLOW_END>';\n case SCALAR:\n return '<SCALAR>';\n default:\n return JSON.stringify(token);\n }\n}\n/** Identify the type of a lexer token. May return `null` for unknown tokens. */\nfunction tokenType(source) {\n switch (source) {\n case BOM:\n return 'byte-order-mark';\n case DOCUMENT:\n return 'doc-mode';\n case FLOW_END:\n return 'flow-error-end';\n case SCALAR:\n return 'scalar';\n case '---':\n return 'doc-start';\n case '...':\n return 'doc-end';\n case '':\n case '\\n':\n case '\\r\\n':\n return 'newline';\n case '-':\n return 'seq-item-ind';\n case '?':\n return 'explicit-key-ind';\n case ':':\n return 'map-value-ind';\n case '{':\n return 'flow-map-start';\n case '}':\n return 'flow-map-end';\n case '[':\n return 'flow-seq-start';\n case ']':\n return 'flow-seq-end';\n case ',':\n return 'comma';\n }\n switch (source[0]) {\n case ' ':\n case '\\t':\n return 'space';\n case '#':\n return 'comment';\n case '%':\n return 'directive-line';\n case '*':\n return 'alias';\n case '&':\n return 'anchor';\n case '!':\n return 'tag';\n case \"'\":\n return 'single-quoted-scalar';\n case '\"':\n return 'double-quoted-scalar';\n case '|':\n case '>':\n return 'block-scalar-header';\n }\n return null;\n}\n\nexports.createScalarToken = cstScalar.createScalarToken;\nexports.resolveAsScalar = cstScalar.resolveAsScalar;\nexports.setScalarValue = cstScalar.setScalarValue;\nexports.stringify = cstStringify.stringify;\nexports.visit = cstVisit.visit;\nexports.BOM = BOM;\nexports.DOCUMENT = DOCUMENT;\nexports.FLOW_END = FLOW_END;\nexports.SCALAR = SCALAR;\nexports.isCollection = isCollection;\nexports.isScalar = isScalar;\nexports.prettyToken = prettyToken;\nexports.tokenType = tokenType;\n",
79
+ "'use strict';\n\nvar cst = require('./cst.js');\n\n/*\nSTART -> stream\n\nstream\n directive -> line-end -> stream\n indent + line-end -> stream\n [else] -> line-start\n\nline-end\n comment -> line-end\n newline -> .\n input-end -> END\n\nline-start\n doc-start -> doc\n doc-end -> stream\n [else] -> indent -> block-start\n\nblock-start\n seq-item-start -> block-start\n explicit-key-start -> block-start\n map-value-start -> block-start\n [else] -> doc\n\ndoc\n line-end -> line-start\n spaces -> doc\n anchor -> doc\n tag -> doc\n flow-start -> flow -> doc\n flow-end -> error -> doc\n seq-item-start -> error -> doc\n explicit-key-start -> error -> doc\n map-value-start -> doc\n alias -> doc\n quote-start -> quoted-scalar -> doc\n block-scalar-header -> line-end -> block-scalar(min) -> line-start\n [else] -> plain-scalar(false, min) -> doc\n\nflow\n line-end -> flow\n spaces -> flow\n anchor -> flow\n tag -> flow\n flow-start -> flow -> flow\n flow-end -> .\n seq-item-start -> error -> flow\n explicit-key-start -> flow\n map-value-start -> flow\n alias -> flow\n quote-start -> quoted-scalar -> flow\n comma -> flow\n [else] -> plain-scalar(true, 0) -> flow\n\nquoted-scalar\n quote-end -> .\n [else] -> quoted-scalar\n\nblock-scalar(min)\n newline + peek(indent < min) -> .\n [else] -> block-scalar(min)\n\nplain-scalar(is-flow, min)\n scalar-end(is-flow) -> .\n peek(newline + (indent < min)) -> .\n [else] -> plain-scalar(min)\n*/\nfunction isEmpty(ch) {\n switch (ch) {\n case undefined:\n case ' ':\n case '\\n':\n case '\\r':\n case '\\t':\n return true;\n default:\n return false;\n }\n}\nconst hexDigits = new Set('0123456789ABCDEFabcdef');\nconst tagChars = new Set(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()\");\nconst flowIndicatorChars = new Set(',[]{}');\nconst invalidAnchorChars = new Set(' ,[]{}\\n\\r\\t');\nconst isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);\n/**\n * Splits an input string into lexical tokens, i.e. smaller strings that are\n * easily identifiable by `tokens.tokenType()`.\n *\n * Lexing starts always in a \"stream\" context. Incomplete input may be buffered\n * until a complete token can be emitted.\n *\n * In addition to slices of the original input, the following control characters\n * may also be emitted:\n *\n * - `\\x02` (Start of Text): A document starts with the next token\n * - `\\x18` (Cancel): Unexpected end of flow-mode (indicates an error)\n * - `\\x1f` (Unit Separator): Next token is a scalar value\n * - `\\u{FEFF}` (Byte order mark): Emitted separately outside documents\n */\nclass Lexer {\n constructor() {\n /**\n * Flag indicating whether the end of the current buffer marks the end of\n * all input\n */\n this.atEnd = false;\n /**\n * Explicit indent set in block scalar header, as an offset from the current\n * minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not\n * explicitly set.\n */\n this.blockScalarIndent = -1;\n /**\n * Block scalars that include a + (keep) chomping indicator in their header\n * include trailing empty lines, which are otherwise excluded from the\n * scalar's contents.\n */\n this.blockScalarKeep = false;\n /** Current input */\n this.buffer = '';\n /**\n * Flag noting whether the map value indicator : can immediately follow this\n * node within a flow context.\n */\n this.flowKey = false;\n /** Count of surrounding flow collection levels. */\n this.flowLevel = 0;\n /**\n * Minimum level of indentation required for next lines to be parsed as a\n * part of the current scalar value.\n */\n this.indentNext = 0;\n /** Indentation level of the current line. */\n this.indentValue = 0;\n /** Position of the next \\n character. */\n this.lineEndPos = null;\n /** Stores the state of the lexer if reaching the end of incpomplete input */\n this.next = null;\n /** A pointer to `buffer`; the current position of the lexer. */\n this.pos = 0;\n }\n /**\n * Generate YAML tokens from the `source` string. If `incomplete`,\n * a part of the last line may be left as a buffer for the next call.\n *\n * @returns A generator of lexical tokens\n */\n *lex(source, incomplete = false) {\n if (source) {\n if (typeof source !== 'string')\n throw TypeError('source is not a string');\n this.buffer = this.buffer ? this.buffer + source : source;\n this.lineEndPos = null;\n }\n this.atEnd = !incomplete;\n let next = this.next ?? 'stream';\n while (next && (incomplete || this.hasChars(1)))\n next = yield* this.parseNext(next);\n }\n atLineEnd() {\n let i = this.pos;\n let ch = this.buffer[i];\n while (ch === ' ' || ch === '\\t')\n ch = this.buffer[++i];\n if (!ch || ch === '#' || ch === '\\n')\n return true;\n if (ch === '\\r')\n return this.buffer[i + 1] === '\\n';\n return false;\n }\n charAt(n) {\n return this.buffer[this.pos + n];\n }\n continueScalar(offset) {\n let ch = this.buffer[offset];\n if (this.indentNext > 0) {\n let indent = 0;\n while (ch === ' ')\n ch = this.buffer[++indent + offset];\n if (ch === '\\r') {\n const next = this.buffer[indent + offset + 1];\n if (next === '\\n' || (!next && !this.atEnd))\n return offset + indent + 1;\n }\n return ch === '\\n' || indent >= this.indentNext || (!ch && !this.atEnd)\n ? offset + indent\n : -1;\n }\n if (ch === '-' || ch === '.') {\n const dt = this.buffer.substr(offset, 3);\n if ((dt === '---' || dt === '...') && isEmpty(this.buffer[offset + 3]))\n return -1;\n }\n return offset;\n }\n getLine() {\n let end = this.lineEndPos;\n if (typeof end !== 'number' || (end !== -1 && end < this.pos)) {\n end = this.buffer.indexOf('\\n', this.pos);\n this.lineEndPos = end;\n }\n if (end === -1)\n return this.atEnd ? this.buffer.substring(this.pos) : null;\n if (this.buffer[end - 1] === '\\r')\n end -= 1;\n return this.buffer.substring(this.pos, end);\n }\n hasChars(n) {\n return this.pos + n <= this.buffer.length;\n }\n setNext(state) {\n this.buffer = this.buffer.substring(this.pos);\n this.pos = 0;\n this.lineEndPos = null;\n this.next = state;\n return null;\n }\n peek(n) {\n return this.buffer.substr(this.pos, n);\n }\n *parseNext(next) {\n switch (next) {\n case 'stream':\n return yield* this.parseStream();\n case 'line-start':\n return yield* this.parseLineStart();\n case 'block-start':\n return yield* this.parseBlockStart();\n case 'doc':\n return yield* this.parseDocument();\n case 'flow':\n return yield* this.parseFlowCollection();\n case 'quoted-scalar':\n return yield* this.parseQuotedScalar();\n case 'block-scalar':\n return yield* this.parseBlockScalar();\n case 'plain-scalar':\n return yield* this.parsePlainScalar();\n }\n }\n *parseStream() {\n let line = this.getLine();\n if (line === null)\n return this.setNext('stream');\n if (line[0] === cst.BOM) {\n yield* this.pushCount(1);\n line = line.substring(1);\n }\n if (line[0] === '%') {\n let dirEnd = line.length;\n let cs = line.indexOf('#');\n while (cs !== -1) {\n const ch = line[cs - 1];\n if (ch === ' ' || ch === '\\t') {\n dirEnd = cs - 1;\n break;\n }\n else {\n cs = line.indexOf('#', cs + 1);\n }\n }\n while (true) {\n const ch = line[dirEnd - 1];\n if (ch === ' ' || ch === '\\t')\n dirEnd -= 1;\n else\n break;\n }\n const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));\n yield* this.pushCount(line.length - n); // possible comment\n this.pushNewline();\n return 'stream';\n }\n if (this.atLineEnd()) {\n const sp = yield* this.pushSpaces(true);\n yield* this.pushCount(line.length - sp);\n yield* this.pushNewline();\n return 'stream';\n }\n yield cst.DOCUMENT;\n return yield* this.parseLineStart();\n }\n *parseLineStart() {\n const ch = this.charAt(0);\n if (!ch && !this.atEnd)\n return this.setNext('line-start');\n if (ch === '-' || ch === '.') {\n if (!this.atEnd && !this.hasChars(4))\n return this.setNext('line-start');\n const s = this.peek(3);\n if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) {\n yield* this.pushCount(3);\n this.indentValue = 0;\n this.indentNext = 0;\n return s === '---' ? 'doc' : 'stream';\n }\n }\n this.indentValue = yield* this.pushSpaces(false);\n if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1)))\n this.indentNext = this.indentValue;\n return yield* this.parseBlockStart();\n }\n *parseBlockStart() {\n const [ch0, ch1] = this.peek(2);\n if (!ch1 && !this.atEnd)\n return this.setNext('block-start');\n if ((ch0 === '-' || ch0 === '?' || ch0 === ':') && isEmpty(ch1)) {\n const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));\n this.indentNext = this.indentValue + 1;\n this.indentValue += n;\n return yield* this.parseBlockStart();\n }\n return 'doc';\n }\n *parseDocument() {\n yield* this.pushSpaces(true);\n const line = this.getLine();\n if (line === null)\n return this.setNext('doc');\n let n = yield* this.pushIndicators();\n switch (line[n]) {\n case '#':\n yield* this.pushCount(line.length - n);\n // fallthrough\n case undefined:\n yield* this.pushNewline();\n return yield* this.parseLineStart();\n case '{':\n case '[':\n yield* this.pushCount(1);\n this.flowKey = false;\n this.flowLevel = 1;\n return 'flow';\n case '}':\n case ']':\n // this is an error\n yield* this.pushCount(1);\n return 'doc';\n case '*':\n yield* this.pushUntil(isNotAnchorChar);\n return 'doc';\n case '\"':\n case \"'\":\n return yield* this.parseQuotedScalar();\n case '|':\n case '>':\n n += yield* this.parseBlockScalarHeader();\n n += yield* this.pushSpaces(true);\n yield* this.pushCount(line.length - n);\n yield* this.pushNewline();\n return yield* this.parseBlockScalar();\n default:\n return yield* this.parsePlainScalar();\n }\n }\n *parseFlowCollection() {\n let nl, sp;\n let indent = -1;\n do {\n nl = yield* this.pushNewline();\n if (nl > 0) {\n sp = yield* this.pushSpaces(false);\n this.indentValue = indent = sp;\n }\n else {\n sp = 0;\n }\n sp += yield* this.pushSpaces(true);\n } while (nl + sp > 0);\n const line = this.getLine();\n if (line === null)\n return this.setNext('flow');\n if ((indent !== -1 && indent < this.indentNext && line[0] !== '#') ||\n (indent === 0 &&\n (line.startsWith('---') || line.startsWith('...')) &&\n isEmpty(line[3]))) {\n // Allowing for the terminal ] or } at the same (rather than greater)\n // indent level as the initial [ or { is technically invalid, but\n // failing here would be surprising to users.\n const atFlowEndMarker = indent === this.indentNext - 1 &&\n this.flowLevel === 1 &&\n (line[0] === ']' || line[0] === '}');\n if (!atFlowEndMarker) {\n // this is an error\n this.flowLevel = 0;\n yield cst.FLOW_END;\n return yield* this.parseLineStart();\n }\n }\n let n = 0;\n while (line[n] === ',') {\n n += yield* this.pushCount(1);\n n += yield* this.pushSpaces(true);\n this.flowKey = false;\n }\n n += yield* this.pushIndicators();\n switch (line[n]) {\n case undefined:\n return 'flow';\n case '#':\n yield* this.pushCount(line.length - n);\n return 'flow';\n case '{':\n case '[':\n yield* this.pushCount(1);\n this.flowKey = false;\n this.flowLevel += 1;\n return 'flow';\n case '}':\n case ']':\n yield* this.pushCount(1);\n this.flowKey = true;\n this.flowLevel -= 1;\n return this.flowLevel ? 'flow' : 'doc';\n case '*':\n yield* this.pushUntil(isNotAnchorChar);\n return 'flow';\n case '\"':\n case \"'\":\n this.flowKey = true;\n return yield* this.parseQuotedScalar();\n case ':': {\n const next = this.charAt(1);\n if (this.flowKey || isEmpty(next) || next === ',') {\n this.flowKey = false;\n yield* this.pushCount(1);\n yield* this.pushSpaces(true);\n return 'flow';\n }\n }\n // fallthrough\n default:\n this.flowKey = false;\n return yield* this.parsePlainScalar();\n }\n }\n *parseQuotedScalar() {\n const quote = this.charAt(0);\n let end = this.buffer.indexOf(quote, this.pos + 1);\n if (quote === \"'\") {\n while (end !== -1 && this.buffer[end + 1] === \"'\")\n end = this.buffer.indexOf(\"'\", end + 2);\n }\n else {\n // double-quote\n while (end !== -1) {\n let n = 0;\n while (this.buffer[end - 1 - n] === '\\\\')\n n += 1;\n if (n % 2 === 0)\n break;\n end = this.buffer.indexOf('\"', end + 1);\n }\n }\n // Only looking for newlines within the quotes\n const qb = this.buffer.substring(0, end);\n let nl = qb.indexOf('\\n', this.pos);\n if (nl !== -1) {\n while (nl !== -1) {\n const cs = this.continueScalar(nl + 1);\n if (cs === -1)\n break;\n nl = qb.indexOf('\\n', cs);\n }\n if (nl !== -1) {\n // this is an error caused by an unexpected unindent\n end = nl - (qb[nl - 1] === '\\r' ? 2 : 1);\n }\n }\n if (end === -1) {\n if (!this.atEnd)\n return this.setNext('quoted-scalar');\n end = this.buffer.length;\n }\n yield* this.pushToIndex(end + 1, false);\n return this.flowLevel ? 'flow' : 'doc';\n }\n *parseBlockScalarHeader() {\n this.blockScalarIndent = -1;\n this.blockScalarKeep = false;\n let i = this.pos;\n while (true) {\n const ch = this.buffer[++i];\n if (ch === '+')\n this.blockScalarKeep = true;\n else if (ch > '0' && ch <= '9')\n this.blockScalarIndent = Number(ch) - 1;\n else if (ch !== '-')\n break;\n }\n return yield* this.pushUntil(ch => isEmpty(ch) || ch === '#');\n }\n *parseBlockScalar() {\n let nl = this.pos - 1; // may be -1 if this.pos === 0\n let indent = 0;\n let ch;\n loop: for (let i = this.pos; (ch = this.buffer[i]); ++i) {\n switch (ch) {\n case ' ':\n indent += 1;\n break;\n case '\\n':\n nl = i;\n indent = 0;\n break;\n case '\\r': {\n const next = this.buffer[i + 1];\n if (!next && !this.atEnd)\n return this.setNext('block-scalar');\n if (next === '\\n')\n break;\n } // fallthrough\n default:\n break loop;\n }\n }\n if (!ch && !this.atEnd)\n return this.setNext('block-scalar');\n if (indent >= this.indentNext) {\n if (this.blockScalarIndent === -1)\n this.indentNext = indent;\n else {\n this.indentNext =\n this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);\n }\n do {\n const cs = this.continueScalar(nl + 1);\n if (cs === -1)\n break;\n nl = this.buffer.indexOf('\\n', cs);\n } while (nl !== -1);\n if (nl === -1) {\n if (!this.atEnd)\n return this.setNext('block-scalar');\n nl = this.buffer.length;\n }\n }\n // Trailing insufficiently indented tabs are invalid.\n // To catch that during parsing, we include them in the block scalar value.\n let i = nl + 1;\n ch = this.buffer[i];\n while (ch === ' ')\n ch = this.buffer[++i];\n if (ch === '\\t') {\n while (ch === '\\t' || ch === ' ' || ch === '\\r' || ch === '\\n')\n ch = this.buffer[++i];\n nl = i - 1;\n }\n else if (!this.blockScalarKeep) {\n do {\n let i = nl - 1;\n let ch = this.buffer[i];\n if (ch === '\\r')\n ch = this.buffer[--i];\n const lastChar = i; // Drop the line if last char not more indented\n while (ch === ' ')\n ch = this.buffer[--i];\n if (ch === '\\n' && i >= this.pos && i + 1 + indent > lastChar)\n nl = i;\n else\n break;\n } while (true);\n }\n yield cst.SCALAR;\n yield* this.pushToIndex(nl + 1, true);\n return yield* this.parseLineStart();\n }\n *parsePlainScalar() {\n const inFlow = this.flowLevel > 0;\n let end = this.pos - 1;\n let i = this.pos - 1;\n let ch;\n while ((ch = this.buffer[++i])) {\n if (ch === ':') {\n const next = this.buffer[i + 1];\n if (isEmpty(next) || (inFlow && flowIndicatorChars.has(next)))\n break;\n end = i;\n }\n else if (isEmpty(ch)) {\n let next = this.buffer[i + 1];\n if (ch === '\\r') {\n if (next === '\\n') {\n i += 1;\n ch = '\\n';\n next = this.buffer[i + 1];\n }\n else\n end = i;\n }\n if (next === '#' || (inFlow && flowIndicatorChars.has(next)))\n break;\n if (ch === '\\n') {\n const cs = this.continueScalar(i + 1);\n if (cs === -1)\n break;\n i = Math.max(i, cs - 2); // to advance, but still account for ' #'\n }\n }\n else {\n if (inFlow && flowIndicatorChars.has(ch))\n break;\n end = i;\n }\n }\n if (!ch && !this.atEnd)\n return this.setNext('plain-scalar');\n yield cst.SCALAR;\n yield* this.pushToIndex(end + 1, true);\n return inFlow ? 'flow' : 'doc';\n }\n *pushCount(n) {\n if (n > 0) {\n yield this.buffer.substr(this.pos, n);\n this.pos += n;\n return n;\n }\n return 0;\n }\n *pushToIndex(i, allowEmpty) {\n const s = this.buffer.slice(this.pos, i);\n if (s) {\n yield s;\n this.pos += s.length;\n return s.length;\n }\n else if (allowEmpty)\n yield '';\n return 0;\n }\n *pushIndicators() {\n switch (this.charAt(0)) {\n case '!':\n return ((yield* this.pushTag()) +\n (yield* this.pushSpaces(true)) +\n (yield* this.pushIndicators()));\n case '&':\n return ((yield* this.pushUntil(isNotAnchorChar)) +\n (yield* this.pushSpaces(true)) +\n (yield* this.pushIndicators()));\n case '-': // this is an error\n case '?': // this is an error outside flow collections\n case ':': {\n const inFlow = this.flowLevel > 0;\n const ch1 = this.charAt(1);\n if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {\n if (!inFlow)\n this.indentNext = this.indentValue + 1;\n else if (this.flowKey)\n this.flowKey = false;\n return ((yield* this.pushCount(1)) +\n (yield* this.pushSpaces(true)) +\n (yield* this.pushIndicators()));\n }\n }\n }\n return 0;\n }\n *pushTag() {\n if (this.charAt(1) === '<') {\n let i = this.pos + 2;\n let ch = this.buffer[i];\n while (!isEmpty(ch) && ch !== '>')\n ch = this.buffer[++i];\n return yield* this.pushToIndex(ch === '>' ? i + 1 : i, false);\n }\n else {\n let i = this.pos + 1;\n let ch = this.buffer[i];\n while (ch) {\n if (tagChars.has(ch))\n ch = this.buffer[++i];\n else if (ch === '%' &&\n hexDigits.has(this.buffer[i + 1]) &&\n hexDigits.has(this.buffer[i + 2])) {\n ch = this.buffer[(i += 3)];\n }\n else\n break;\n }\n return yield* this.pushToIndex(i, false);\n }\n }\n *pushNewline() {\n const ch = this.buffer[this.pos];\n if (ch === '\\n')\n return yield* this.pushCount(1);\n else if (ch === '\\r' && this.charAt(1) === '\\n')\n return yield* this.pushCount(2);\n else\n return 0;\n }\n *pushSpaces(allowTabs) {\n let i = this.pos - 1;\n let ch;\n do {\n ch = this.buffer[++i];\n } while (ch === ' ' || (allowTabs && ch === '\\t'));\n const n = i - this.pos;\n if (n > 0) {\n yield this.buffer.substr(this.pos, n);\n this.pos = i;\n }\n return n;\n }\n *pushUntil(test) {\n let i = this.pos;\n let ch = this.buffer[i];\n while (!test(ch))\n ch = this.buffer[++i];\n return yield* this.pushToIndex(i, false);\n }\n}\n\nexports.Lexer = Lexer;\n",
80
+ "'use strict';\n\n/**\n * Tracks newlines during parsing in order to provide an efficient API for\n * determining the one-indexed `{ line, col }` position for any offset\n * within the input.\n */\nclass LineCounter {\n constructor() {\n this.lineStarts = [];\n /**\n * Should be called in ascending order. Otherwise, call\n * `lineCounter.lineStarts.sort()` before calling `linePos()`.\n */\n this.addNewLine = (offset) => this.lineStarts.push(offset);\n /**\n * Performs a binary search and returns the 1-indexed { line, col }\n * position of `offset`. If `line === 0`, `addNewLine` has never been\n * called or `offset` is before the first known newline.\n */\n this.linePos = (offset) => {\n let low = 0;\n let high = this.lineStarts.length;\n while (low < high) {\n const mid = (low + high) >> 1; // Math.floor((low + high) / 2)\n if (this.lineStarts[mid] < offset)\n low = mid + 1;\n else\n high = mid;\n }\n if (this.lineStarts[low] === offset)\n return { line: low + 1, col: 1 };\n if (low === 0)\n return { line: 0, col: offset };\n const start = this.lineStarts[low - 1];\n return { line: low, col: offset - start + 1 };\n };\n }\n}\n\nexports.LineCounter = LineCounter;\n",
81
+ "'use strict';\n\nvar node_process = require('process');\nvar cst = require('./cst.js');\nvar lexer = require('./lexer.js');\n\nfunction includesToken(list, type) {\n for (let i = 0; i < list.length; ++i)\n if (list[i].type === type)\n return true;\n return false;\n}\nfunction findNonEmptyIndex(list) {\n for (let i = 0; i < list.length; ++i) {\n switch (list[i].type) {\n case 'space':\n case 'comment':\n case 'newline':\n break;\n default:\n return i;\n }\n }\n return -1;\n}\nfunction isFlowToken(token) {\n switch (token?.type) {\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n case 'flow-collection':\n return true;\n default:\n return false;\n }\n}\nfunction getPrevProps(parent) {\n switch (parent.type) {\n case 'document':\n return parent.start;\n case 'block-map': {\n const it = parent.items[parent.items.length - 1];\n return it.sep ?? it.start;\n }\n case 'block-seq':\n return parent.items[parent.items.length - 1].start;\n /* istanbul ignore next should not happen */\n default:\n return [];\n }\n}\n/** Note: May modify input array */\nfunction getFirstKeyStartProps(prev) {\n if (prev.length === 0)\n return [];\n let i = prev.length;\n loop: while (--i >= 0) {\n switch (prev[i].type) {\n case 'doc-start':\n case 'explicit-key-ind':\n case 'map-value-ind':\n case 'seq-item-ind':\n case 'newline':\n break loop;\n }\n }\n while (prev[++i]?.type === 'space') {\n /* loop */\n }\n return prev.splice(i, prev.length);\n}\nfunction fixFlowSeqItems(fc) {\n if (fc.start.type === 'flow-seq-start') {\n for (const it of fc.items) {\n if (it.sep &&\n !it.value &&\n !includesToken(it.start, 'explicit-key-ind') &&\n !includesToken(it.sep, 'map-value-ind')) {\n if (it.key)\n it.value = it.key;\n delete it.key;\n if (isFlowToken(it.value)) {\n if (it.value.end)\n Array.prototype.push.apply(it.value.end, it.sep);\n else\n it.value.end = it.sep;\n }\n else\n Array.prototype.push.apply(it.start, it.sep);\n delete it.sep;\n }\n }\n }\n}\n/**\n * A YAML concrete syntax tree (CST) parser\n *\n * ```ts\n * const src: string = ...\n * for (const token of new Parser().parse(src)) {\n * // token: Token\n * }\n * ```\n *\n * To use the parser with a user-provided lexer:\n *\n * ```ts\n * function* parse(source: string, lexer: Lexer) {\n * const parser = new Parser()\n * for (const lexeme of lexer.lex(source))\n * yield* parser.next(lexeme)\n * yield* parser.end()\n * }\n *\n * const src: string = ...\n * const lexer = new Lexer()\n * for (const token of parse(src, lexer)) {\n * // token: Token\n * }\n * ```\n */\nclass Parser {\n /**\n * @param onNewLine - If defined, called separately with the start position of\n * each new line (in `parse()`, including the start of input).\n */\n constructor(onNewLine) {\n /** If true, space and sequence indicators count as indentation */\n this.atNewLine = true;\n /** If true, next token is a scalar value */\n this.atScalar = false;\n /** Current indentation level */\n this.indent = 0;\n /** Current offset since the start of parsing */\n this.offset = 0;\n /** On the same line with a block map key */\n this.onKeyLine = false;\n /** Top indicates the node that's currently being built */\n this.stack = [];\n /** The source of the current token, set in parse() */\n this.source = '';\n /** The type of the current token, set in parse() */\n this.type = '';\n // Must be defined after `next()`\n this.lexer = new lexer.Lexer();\n this.onNewLine = onNewLine;\n }\n /**\n * Parse `source` as a YAML stream.\n * If `incomplete`, a part of the last line may be left as a buffer for the next call.\n *\n * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens.\n *\n * @returns A generator of tokens representing each directive, document, and other structure.\n */\n *parse(source, incomplete = false) {\n if (this.onNewLine && this.offset === 0)\n this.onNewLine(0);\n for (const lexeme of this.lexer.lex(source, incomplete))\n yield* this.next(lexeme);\n if (!incomplete)\n yield* this.end();\n }\n /**\n * Advance the parser by the `source` of one lexical token.\n */\n *next(source) {\n this.source = source;\n if (node_process.env.LOG_TOKENS)\n console.log('|', cst.prettyToken(source));\n if (this.atScalar) {\n this.atScalar = false;\n yield* this.step();\n this.offset += source.length;\n return;\n }\n const type = cst.tokenType(source);\n if (!type) {\n const message = `Not a YAML token: ${source}`;\n yield* this.pop({ type: 'error', offset: this.offset, message, source });\n this.offset += source.length;\n }\n else if (type === 'scalar') {\n this.atNewLine = false;\n this.atScalar = true;\n this.type = 'scalar';\n }\n else {\n this.type = type;\n yield* this.step();\n switch (type) {\n case 'newline':\n this.atNewLine = true;\n this.indent = 0;\n if (this.onNewLine)\n this.onNewLine(this.offset + source.length);\n break;\n case 'space':\n if (this.atNewLine && source[0] === ' ')\n this.indent += source.length;\n break;\n case 'explicit-key-ind':\n case 'map-value-ind':\n case 'seq-item-ind':\n if (this.atNewLine)\n this.indent += source.length;\n break;\n case 'doc-mode':\n case 'flow-error-end':\n return;\n default:\n this.atNewLine = false;\n }\n this.offset += source.length;\n }\n }\n /** Call at end of input to push out any remaining constructions */\n *end() {\n while (this.stack.length > 0)\n yield* this.pop();\n }\n get sourceToken() {\n const st = {\n type: this.type,\n offset: this.offset,\n indent: this.indent,\n source: this.source\n };\n return st;\n }\n *step() {\n const top = this.peek(1);\n if (this.type === 'doc-end' && top?.type !== 'doc-end') {\n while (this.stack.length > 0)\n yield* this.pop();\n this.stack.push({\n type: 'doc-end',\n offset: this.offset,\n source: this.source\n });\n return;\n }\n if (!top)\n return yield* this.stream();\n switch (top.type) {\n case 'document':\n return yield* this.document(top);\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n return yield* this.scalar(top);\n case 'block-scalar':\n return yield* this.blockScalar(top);\n case 'block-map':\n return yield* this.blockMap(top);\n case 'block-seq':\n return yield* this.blockSequence(top);\n case 'flow-collection':\n return yield* this.flowCollection(top);\n case 'doc-end':\n return yield* this.documentEnd(top);\n }\n /* istanbul ignore next should not happen */\n yield* this.pop();\n }\n peek(n) {\n return this.stack[this.stack.length - n];\n }\n *pop(error) {\n const token = error ?? this.stack.pop();\n /* istanbul ignore if should not happen */\n if (!token) {\n const message = 'Tried to pop an empty stack';\n yield { type: 'error', offset: this.offset, source: '', message };\n }\n else if (this.stack.length === 0) {\n yield token;\n }\n else {\n const top = this.peek(1);\n if (token.type === 'block-scalar') {\n // Block scalars use their parent rather than header indent\n token.indent = 'indent' in top ? top.indent : 0;\n }\n else if (token.type === 'flow-collection' && top.type === 'document') {\n // Ignore all indent for top-level flow collections\n token.indent = 0;\n }\n if (token.type === 'flow-collection')\n fixFlowSeqItems(token);\n switch (top.type) {\n case 'document':\n top.value = token;\n break;\n case 'block-scalar':\n top.props.push(token); // error\n break;\n case 'block-map': {\n const it = top.items[top.items.length - 1];\n if (it.value) {\n top.items.push({ start: [], key: token, sep: [] });\n this.onKeyLine = true;\n return;\n }\n else if (it.sep) {\n it.value = token;\n }\n else {\n Object.assign(it, { key: token, sep: [] });\n this.onKeyLine = !it.explicitKey;\n return;\n }\n break;\n }\n case 'block-seq': {\n const it = top.items[top.items.length - 1];\n if (it.value)\n top.items.push({ start: [], value: token });\n else\n it.value = token;\n break;\n }\n case 'flow-collection': {\n const it = top.items[top.items.length - 1];\n if (!it || it.value)\n top.items.push({ start: [], key: token, sep: [] });\n else if (it.sep)\n it.value = token;\n else\n Object.assign(it, { key: token, sep: [] });\n return;\n }\n /* istanbul ignore next should not happen */\n default:\n yield* this.pop();\n yield* this.pop(token);\n }\n if ((top.type === 'document' ||\n top.type === 'block-map' ||\n top.type === 'block-seq') &&\n (token.type === 'block-map' || token.type === 'block-seq')) {\n const last = token.items[token.items.length - 1];\n if (last &&\n !last.sep &&\n !last.value &&\n last.start.length > 0 &&\n findNonEmptyIndex(last.start) === -1 &&\n (token.indent === 0 ||\n last.start.every(st => st.type !== 'comment' || st.indent < token.indent))) {\n if (top.type === 'document')\n top.end = last.start;\n else\n top.items.push({ start: last.start });\n token.items.splice(-1, 1);\n }\n }\n }\n }\n *stream() {\n switch (this.type) {\n case 'directive-line':\n yield { type: 'directive', offset: this.offset, source: this.source };\n return;\n case 'byte-order-mark':\n case 'space':\n case 'comment':\n case 'newline':\n yield this.sourceToken;\n return;\n case 'doc-mode':\n case 'doc-start': {\n const doc = {\n type: 'document',\n offset: this.offset,\n start: []\n };\n if (this.type === 'doc-start')\n doc.start.push(this.sourceToken);\n this.stack.push(doc);\n return;\n }\n }\n yield {\n type: 'error',\n offset: this.offset,\n message: `Unexpected ${this.type} token in YAML stream`,\n source: this.source\n };\n }\n *document(doc) {\n if (doc.value)\n return yield* this.lineEnd(doc);\n switch (this.type) {\n case 'doc-start': {\n if (findNonEmptyIndex(doc.start) !== -1) {\n yield* this.pop();\n yield* this.step();\n }\n else\n doc.start.push(this.sourceToken);\n return;\n }\n case 'anchor':\n case 'tag':\n case 'space':\n case 'comment':\n case 'newline':\n doc.start.push(this.sourceToken);\n return;\n }\n const bv = this.startBlockValue(doc);\n if (bv)\n this.stack.push(bv);\n else {\n yield {\n type: 'error',\n offset: this.offset,\n message: `Unexpected ${this.type} token in YAML document`,\n source: this.source\n };\n }\n }\n *scalar(scalar) {\n if (this.type === 'map-value-ind') {\n const prev = getPrevProps(this.peek(2));\n const start = getFirstKeyStartProps(prev);\n let sep;\n if (scalar.end) {\n sep = scalar.end;\n sep.push(this.sourceToken);\n delete scalar.end;\n }\n else\n sep = [this.sourceToken];\n const map = {\n type: 'block-map',\n offset: scalar.offset,\n indent: scalar.indent,\n items: [{ start, key: scalar, sep }]\n };\n this.onKeyLine = true;\n this.stack[this.stack.length - 1] = map;\n }\n else\n yield* this.lineEnd(scalar);\n }\n *blockScalar(scalar) {\n switch (this.type) {\n case 'space':\n case 'comment':\n case 'newline':\n scalar.props.push(this.sourceToken);\n return;\n case 'scalar':\n scalar.source = this.source;\n // block-scalar source includes trailing newline\n this.atNewLine = true;\n this.indent = 0;\n if (this.onNewLine) {\n let nl = this.source.indexOf('\\n') + 1;\n while (nl !== 0) {\n this.onNewLine(this.offset + nl);\n nl = this.source.indexOf('\\n', nl) + 1;\n }\n }\n yield* this.pop();\n break;\n /* istanbul ignore next should not happen */\n default:\n yield* this.pop();\n yield* this.step();\n }\n }\n *blockMap(map) {\n const it = map.items[map.items.length - 1];\n // it.sep is true-ish if pair already has key or : separator\n switch (this.type) {\n case 'newline':\n this.onKeyLine = false;\n if (it.value) {\n const end = 'end' in it.value ? it.value.end : undefined;\n const last = Array.isArray(end) ? end[end.length - 1] : undefined;\n if (last?.type === 'comment')\n end?.push(this.sourceToken);\n else\n map.items.push({ start: [this.sourceToken] });\n }\n else if (it.sep) {\n it.sep.push(this.sourceToken);\n }\n else {\n it.start.push(this.sourceToken);\n }\n return;\n case 'space':\n case 'comment':\n if (it.value) {\n map.items.push({ start: [this.sourceToken] });\n }\n else if (it.sep) {\n it.sep.push(this.sourceToken);\n }\n else {\n if (this.atIndentedComment(it.start, map.indent)) {\n const prev = map.items[map.items.length - 2];\n const end = prev?.value?.end;\n if (Array.isArray(end)) {\n Array.prototype.push.apply(end, it.start);\n end.push(this.sourceToken);\n map.items.pop();\n return;\n }\n }\n it.start.push(this.sourceToken);\n }\n return;\n }\n if (this.indent >= map.indent) {\n const atMapIndent = !this.onKeyLine && this.indent === map.indent;\n const atNextItem = atMapIndent &&\n (it.sep || it.explicitKey) &&\n this.type !== 'seq-item-ind';\n // For empty nodes, assign newline-separated not indented empty tokens to following node\n let start = [];\n if (atNextItem && it.sep && !it.value) {\n const nl = [];\n for (let i = 0; i < it.sep.length; ++i) {\n const st = it.sep[i];\n switch (st.type) {\n case 'newline':\n nl.push(i);\n break;\n case 'space':\n break;\n case 'comment':\n if (st.indent > map.indent)\n nl.length = 0;\n break;\n default:\n nl.length = 0;\n }\n }\n if (nl.length >= 2)\n start = it.sep.splice(nl[1]);\n }\n switch (this.type) {\n case 'anchor':\n case 'tag':\n if (atNextItem || it.value) {\n start.push(this.sourceToken);\n map.items.push({ start });\n this.onKeyLine = true;\n }\n else if (it.sep) {\n it.sep.push(this.sourceToken);\n }\n else {\n it.start.push(this.sourceToken);\n }\n return;\n case 'explicit-key-ind':\n if (!it.sep && !it.explicitKey) {\n it.start.push(this.sourceToken);\n it.explicitKey = true;\n }\n else if (atNextItem || it.value) {\n start.push(this.sourceToken);\n map.items.push({ start, explicitKey: true });\n }\n else {\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start: [this.sourceToken], explicitKey: true }]\n });\n }\n this.onKeyLine = true;\n return;\n case 'map-value-ind':\n if (it.explicitKey) {\n if (!it.sep) {\n if (includesToken(it.start, 'newline')) {\n Object.assign(it, { key: null, sep: [this.sourceToken] });\n }\n else {\n const start = getFirstKeyStartProps(it.start);\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key: null, sep: [this.sourceToken] }]\n });\n }\n }\n else if (it.value) {\n map.items.push({ start: [], key: null, sep: [this.sourceToken] });\n }\n else if (includesToken(it.sep, 'map-value-ind')) {\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key: null, sep: [this.sourceToken] }]\n });\n }\n else if (isFlowToken(it.key) &&\n !includesToken(it.sep, 'newline')) {\n const start = getFirstKeyStartProps(it.start);\n const key = it.key;\n const sep = it.sep;\n sep.push(this.sourceToken);\n // @ts-expect-error type guard is wrong here\n delete it.key;\n // @ts-expect-error type guard is wrong here\n delete it.sep;\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key, sep }]\n });\n }\n else if (start.length > 0) {\n // Not actually at next item\n it.sep = it.sep.concat(start, this.sourceToken);\n }\n else {\n it.sep.push(this.sourceToken);\n }\n }\n else {\n if (!it.sep) {\n Object.assign(it, { key: null, sep: [this.sourceToken] });\n }\n else if (it.value || atNextItem) {\n map.items.push({ start, key: null, sep: [this.sourceToken] });\n }\n else if (includesToken(it.sep, 'map-value-ind')) {\n this.stack.push({\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start: [], key: null, sep: [this.sourceToken] }]\n });\n }\n else {\n it.sep.push(this.sourceToken);\n }\n }\n this.onKeyLine = true;\n return;\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar': {\n const fs = this.flowScalar(this.type);\n if (atNextItem || it.value) {\n map.items.push({ start, key: fs, sep: [] });\n this.onKeyLine = true;\n }\n else if (it.sep) {\n this.stack.push(fs);\n }\n else {\n Object.assign(it, { key: fs, sep: [] });\n this.onKeyLine = true;\n }\n return;\n }\n default: {\n const bv = this.startBlockValue(map);\n if (bv) {\n if (bv.type === 'block-seq') {\n if (!it.explicitKey &&\n it.sep &&\n !includesToken(it.sep, 'newline')) {\n yield* this.pop({\n type: 'error',\n offset: this.offset,\n message: 'Unexpected block-seq-ind on same line with key',\n source: this.source\n });\n return;\n }\n }\n else if (atMapIndent) {\n map.items.push({ start });\n }\n this.stack.push(bv);\n return;\n }\n }\n }\n }\n yield* this.pop();\n yield* this.step();\n }\n *blockSequence(seq) {\n const it = seq.items[seq.items.length - 1];\n switch (this.type) {\n case 'newline':\n if (it.value) {\n const end = 'end' in it.value ? it.value.end : undefined;\n const last = Array.isArray(end) ? end[end.length - 1] : undefined;\n if (last?.type === 'comment')\n end?.push(this.sourceToken);\n else\n seq.items.push({ start: [this.sourceToken] });\n }\n else\n it.start.push(this.sourceToken);\n return;\n case 'space':\n case 'comment':\n if (it.value)\n seq.items.push({ start: [this.sourceToken] });\n else {\n if (this.atIndentedComment(it.start, seq.indent)) {\n const prev = seq.items[seq.items.length - 2];\n const end = prev?.value?.end;\n if (Array.isArray(end)) {\n Array.prototype.push.apply(end, it.start);\n end.push(this.sourceToken);\n seq.items.pop();\n return;\n }\n }\n it.start.push(this.sourceToken);\n }\n return;\n case 'anchor':\n case 'tag':\n if (it.value || this.indent <= seq.indent)\n break;\n it.start.push(this.sourceToken);\n return;\n case 'seq-item-ind':\n if (this.indent !== seq.indent)\n break;\n if (it.value || includesToken(it.start, 'seq-item-ind'))\n seq.items.push({ start: [this.sourceToken] });\n else\n it.start.push(this.sourceToken);\n return;\n }\n if (this.indent > seq.indent) {\n const bv = this.startBlockValue(seq);\n if (bv) {\n this.stack.push(bv);\n return;\n }\n }\n yield* this.pop();\n yield* this.step();\n }\n *flowCollection(fc) {\n const it = fc.items[fc.items.length - 1];\n if (this.type === 'flow-error-end') {\n let top;\n do {\n yield* this.pop();\n top = this.peek(1);\n } while (top?.type === 'flow-collection');\n }\n else if (fc.end.length === 0) {\n switch (this.type) {\n case 'comma':\n case 'explicit-key-ind':\n if (!it || it.sep)\n fc.items.push({ start: [this.sourceToken] });\n else\n it.start.push(this.sourceToken);\n return;\n case 'map-value-ind':\n if (!it || it.value)\n fc.items.push({ start: [], key: null, sep: [this.sourceToken] });\n else if (it.sep)\n it.sep.push(this.sourceToken);\n else\n Object.assign(it, { key: null, sep: [this.sourceToken] });\n return;\n case 'space':\n case 'comment':\n case 'newline':\n case 'anchor':\n case 'tag':\n if (!it || it.value)\n fc.items.push({ start: [this.sourceToken] });\n else if (it.sep)\n it.sep.push(this.sourceToken);\n else\n it.start.push(this.sourceToken);\n return;\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar': {\n const fs = this.flowScalar(this.type);\n if (!it || it.value)\n fc.items.push({ start: [], key: fs, sep: [] });\n else if (it.sep)\n this.stack.push(fs);\n else\n Object.assign(it, { key: fs, sep: [] });\n return;\n }\n case 'flow-map-end':\n case 'flow-seq-end':\n fc.end.push(this.sourceToken);\n return;\n }\n const bv = this.startBlockValue(fc);\n /* istanbul ignore else should not happen */\n if (bv)\n this.stack.push(bv);\n else {\n yield* this.pop();\n yield* this.step();\n }\n }\n else {\n const parent = this.peek(2);\n if (parent.type === 'block-map' &&\n ((this.type === 'map-value-ind' && parent.indent === fc.indent) ||\n (this.type === 'newline' &&\n !parent.items[parent.items.length - 1].sep))) {\n yield* this.pop();\n yield* this.step();\n }\n else if (this.type === 'map-value-ind' &&\n parent.type !== 'flow-collection') {\n const prev = getPrevProps(parent);\n const start = getFirstKeyStartProps(prev);\n fixFlowSeqItems(fc);\n const sep = fc.end.splice(1, fc.end.length);\n sep.push(this.sourceToken);\n const map = {\n type: 'block-map',\n offset: fc.offset,\n indent: fc.indent,\n items: [{ start, key: fc, sep }]\n };\n this.onKeyLine = true;\n this.stack[this.stack.length - 1] = map;\n }\n else {\n yield* this.lineEnd(fc);\n }\n }\n }\n flowScalar(type) {\n if (this.onNewLine) {\n let nl = this.source.indexOf('\\n') + 1;\n while (nl !== 0) {\n this.onNewLine(this.offset + nl);\n nl = this.source.indexOf('\\n', nl) + 1;\n }\n }\n return {\n type,\n offset: this.offset,\n indent: this.indent,\n source: this.source\n };\n }\n startBlockValue(parent) {\n switch (this.type) {\n case 'alias':\n case 'scalar':\n case 'single-quoted-scalar':\n case 'double-quoted-scalar':\n return this.flowScalar(this.type);\n case 'block-scalar-header':\n return {\n type: 'block-scalar',\n offset: this.offset,\n indent: this.indent,\n props: [this.sourceToken],\n source: ''\n };\n case 'flow-map-start':\n case 'flow-seq-start':\n return {\n type: 'flow-collection',\n offset: this.offset,\n indent: this.indent,\n start: this.sourceToken,\n items: [],\n end: []\n };\n case 'seq-item-ind':\n return {\n type: 'block-seq',\n offset: this.offset,\n indent: this.indent,\n items: [{ start: [this.sourceToken] }]\n };\n case 'explicit-key-ind': {\n this.onKeyLine = true;\n const prev = getPrevProps(parent);\n const start = getFirstKeyStartProps(prev);\n start.push(this.sourceToken);\n return {\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, explicitKey: true }]\n };\n }\n case 'map-value-ind': {\n this.onKeyLine = true;\n const prev = getPrevProps(parent);\n const start = getFirstKeyStartProps(prev);\n return {\n type: 'block-map',\n offset: this.offset,\n indent: this.indent,\n items: [{ start, key: null, sep: [this.sourceToken] }]\n };\n }\n }\n return null;\n }\n atIndentedComment(start, indent) {\n if (this.type !== 'comment')\n return false;\n if (this.indent <= indent)\n return false;\n return start.every(st => st.type === 'newline' || st.type === 'space');\n }\n *documentEnd(docEnd) {\n if (this.type !== 'doc-mode') {\n if (docEnd.end)\n docEnd.end.push(this.sourceToken);\n else\n docEnd.end = [this.sourceToken];\n if (this.type === 'newline')\n yield* this.pop();\n }\n }\n *lineEnd(token) {\n switch (this.type) {\n case 'comma':\n case 'doc-start':\n case 'doc-end':\n case 'flow-seq-end':\n case 'flow-map-end':\n case 'map-value-ind':\n yield* this.pop();\n yield* this.step();\n break;\n case 'newline':\n this.onKeyLine = false;\n // fallthrough\n case 'space':\n case 'comment':\n default:\n // all other values are errors\n if (token.end)\n token.end.push(this.sourceToken);\n else\n token.end = [this.sourceToken];\n if (this.type === 'newline')\n yield* this.pop();\n }\n }\n}\n\nexports.Parser = Parser;\n",
82
+ "'use strict';\n\nvar composer = require('./compose/composer.js');\nvar Document = require('./doc/Document.js');\nvar errors = require('./errors.js');\nvar log = require('./log.js');\nvar identity = require('./nodes/identity.js');\nvar lineCounter = require('./parse/line-counter.js');\nvar parser = require('./parse/parser.js');\n\nfunction parseOptions(options) {\n const prettyErrors = options.prettyErrors !== false;\n const lineCounter$1 = options.lineCounter || (prettyErrors && new lineCounter.LineCounter()) || null;\n return { lineCounter: lineCounter$1, prettyErrors };\n}\n/**\n * Parse the input as a stream of YAML documents.\n *\n * Documents should be separated from each other by `...` or `---` marker lines.\n *\n * @returns If an empty `docs` array is returned, it will be of type\n * EmptyStream and contain additional stream information. In\n * TypeScript, you should use `'empty' in docs` as a type guard for it.\n */\nfunction parseAllDocuments(source, options = {}) {\n const { lineCounter, prettyErrors } = parseOptions(options);\n const parser$1 = new parser.Parser(lineCounter?.addNewLine);\n const composer$1 = new composer.Composer(options);\n const docs = Array.from(composer$1.compose(parser$1.parse(source)));\n if (prettyErrors && lineCounter)\n for (const doc of docs) {\n doc.errors.forEach(errors.prettifyError(source, lineCounter));\n doc.warnings.forEach(errors.prettifyError(source, lineCounter));\n }\n if (docs.length > 0)\n return docs;\n return Object.assign([], { empty: true }, composer$1.streamInfo());\n}\n/** Parse an input string into a single YAML.Document */\nfunction parseDocument(source, options = {}) {\n const { lineCounter, prettyErrors } = parseOptions(options);\n const parser$1 = new parser.Parser(lineCounter?.addNewLine);\n const composer$1 = new composer.Composer(options);\n // `doc` is always set by compose.end(true) at the very latest\n let doc = null;\n for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {\n if (!doc)\n doc = _doc;\n else if (doc.options.logLevel !== 'silent') {\n doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), 'MULTIPLE_DOCS', 'Source contains multiple documents; please use YAML.parseAllDocuments()'));\n break;\n }\n }\n if (prettyErrors && lineCounter) {\n doc.errors.forEach(errors.prettifyError(source, lineCounter));\n doc.warnings.forEach(errors.prettifyError(source, lineCounter));\n }\n return doc;\n}\nfunction parse(src, reviver, options) {\n let _reviver = undefined;\n if (typeof reviver === 'function') {\n _reviver = reviver;\n }\n else if (options === undefined && reviver && typeof reviver === 'object') {\n options = reviver;\n }\n const doc = parseDocument(src, options);\n if (!doc)\n return null;\n doc.warnings.forEach(warning => log.warn(doc.options.logLevel, warning));\n if (doc.errors.length > 0) {\n if (doc.options.logLevel !== 'silent')\n throw doc.errors[0];\n else\n doc.errors = [];\n }\n return doc.toJS(Object.assign({ reviver: _reviver }, options));\n}\nfunction stringify(value, replacer, options) {\n let _replacer = null;\n if (typeof replacer === 'function' || Array.isArray(replacer)) {\n _replacer = replacer;\n }\n else if (options === undefined && replacer) {\n options = replacer;\n }\n if (typeof options === 'string')\n options = options.length;\n if (typeof options === 'number') {\n const indent = Math.round(options);\n options = indent < 1 ? undefined : indent > 8 ? { indent: 8 } : { indent };\n }\n if (value === undefined) {\n const { keepUndefined } = options ?? replacer ?? {};\n if (!keepUndefined)\n return undefined;\n }\n if (identity.isDocument(value) && !_replacer)\n return value.toString(options);\n return new Document.Document(value, _replacer, options).toString(options);\n}\n\nexports.parse = parse;\nexports.parseAllDocuments = parseAllDocuments;\nexports.parseDocument = parseDocument;\nexports.stringify = stringify;\n",
83
+ "// ANSI color helpers — zero deps\n// Design: black/white text by default. Cyan + orange are the only brand colors.\nconst esc = (code: string) => (s: string) => `\\x1b[${code}m${s}\\x1b[0m`;\n\nexport const bold = esc('1');\nexport const dim = esc('2');\nexport const italic = esc('3');\n\n// Brand colors only — no red/green/yellow rainbow\nexport const fafCyan = (s: string) => `\\x1b[38;2;0;212;212m${s}\\x1b[0m`; // #00D4D4\nexport const orange = (s: string) => `\\x1b[38;5;208m${s}\\x1b[0m`;\n",
84
+ "function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\")\n throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f)\n throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return kind === \"a\" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;\n}\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f)\n throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver))\n throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\nexport { __classPrivateFieldSet, __classPrivateFieldGet };\n",
85
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\n/**\n * https://stackoverflow.com/a/2117523\n */\nexport let uuid4 = function () {\n const { crypto } = globalThis;\n if (crypto?.randomUUID) {\n uuid4 = crypto.randomUUID.bind(crypto);\n return crypto.randomUUID();\n }\n const u8 = new Uint8Array(1);\n const randomByte = crypto ? () => crypto.getRandomValues(u8)[0] : () => (Math.random() * 0xff) & 0xff;\n return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) => (+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16));\n};\n//# sourceMappingURL=uuid.mjs.map",
86
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport function isAbortError(err) {\n return (typeof err === 'object' &&\n err !== null &&\n // Spec-compliant fetch implementations\n (('name' in err && err.name === 'AbortError') ||\n // Expo fetch\n ('message' in err && String(err.message).includes('FetchRequestCanceledException'))));\n}\nexport const castToError = (err) => {\n if (err instanceof Error)\n return err;\n if (typeof err === 'object' && err !== null) {\n try {\n if (Object.prototype.toString.call(err) === '[object Error]') {\n // @ts-ignore - not all envs have native support for cause yet\n const error = new Error(err.message, err.cause ? { cause: err.cause } : {});\n if (err.stack)\n error.stack = err.stack;\n // @ts-ignore - not all envs have native support for cause yet\n if (err.cause && !error.cause)\n error.cause = err.cause;\n if (err.name)\n error.name = err.name;\n return error;\n }\n }\n catch { }\n try {\n return new Error(JSON.stringify(err));\n }\n catch { }\n }\n return new Error(err);\n};\n//# sourceMappingURL=errors.mjs.map",
87
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { castToError } from \"../internal/errors.mjs\";\nexport class AnthropicError extends Error {\n}\nexport class APIError extends AnthropicError {\n constructor(status, error, message, headers, type) {\n super(`${APIError.makeMessage(status, error, message)}`);\n this.status = status;\n this.headers = headers;\n this.requestID = headers?.get('request-id');\n this.error = error;\n this.type = type ?? null;\n }\n static makeMessage(status, error, message) {\n const msg = error?.message ?\n typeof error.message === 'string' ?\n error.message\n : JSON.stringify(error.message)\n : error ? JSON.stringify(error)\n : message;\n if (status && msg) {\n return `${status} ${msg}`;\n }\n if (status) {\n return `${status} status code (no body)`;\n }\n if (msg) {\n return msg;\n }\n return '(no status code or body)';\n }\n static generate(status, errorResponse, message, headers) {\n if (!status || !headers) {\n return new APIConnectionError({ message, cause: castToError(errorResponse) });\n }\n const error = errorResponse;\n const type = error?.['error']?.['type'];\n if (status === 400) {\n return new BadRequestError(status, error, message, headers, type);\n }\n if (status === 401) {\n return new AuthenticationError(status, error, message, headers, type);\n }\n if (status === 403) {\n return new PermissionDeniedError(status, error, message, headers, type);\n }\n if (status === 404) {\n return new NotFoundError(status, error, message, headers, type);\n }\n if (status === 409) {\n return new ConflictError(status, error, message, headers, type);\n }\n if (status === 422) {\n return new UnprocessableEntityError(status, error, message, headers, type);\n }\n if (status === 429) {\n return new RateLimitError(status, error, message, headers, type);\n }\n if (status >= 500) {\n return new InternalServerError(status, error, message, headers, type);\n }\n return new APIError(status, error, message, headers, type);\n }\n}\nexport class APIUserAbortError extends APIError {\n constructor({ message } = {}) {\n super(undefined, undefined, message || 'Request was aborted.', undefined);\n }\n}\nexport class APIConnectionError extends APIError {\n constructor({ message, cause }) {\n super(undefined, undefined, message || 'Connection error.', undefined);\n // in some environments the 'cause' property is already declared\n // @ts-ignore\n if (cause)\n this.cause = cause;\n }\n}\nexport class APIConnectionTimeoutError extends APIConnectionError {\n constructor({ message } = {}) {\n super({ message: message ?? 'Request timed out.' });\n }\n}\nexport class BadRequestError extends APIError {\n}\nexport class AuthenticationError extends APIError {\n}\nexport class PermissionDeniedError extends APIError {\n}\nexport class NotFoundError extends APIError {\n}\nexport class ConflictError extends APIError {\n}\nexport class UnprocessableEntityError extends APIError {\n}\nexport class RateLimitError extends APIError {\n}\nexport class InternalServerError extends APIError {\n}\n//# sourceMappingURL=error.mjs.map",
88
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { AnthropicError } from \"../../core/error.mjs\";\n// https://url.spec.whatwg.org/#url-scheme-string\nconst startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;\nexport const isAbsoluteURL = (url) => {\n return startsWithSchemeRegexp.test(url);\n};\nexport let isArray = (val) => ((isArray = Array.isArray), isArray(val));\nexport let isReadonlyArray = isArray;\n/** Returns an object if the given value isn't an object, otherwise returns as-is */\nexport function maybeObj(x) {\n if (typeof x !== 'object') {\n return {};\n }\n return x ?? {};\n}\n// https://stackoverflow.com/a/34491287\nexport function isEmptyObj(obj) {\n if (!obj)\n return true;\n for (const _k in obj)\n return false;\n return true;\n}\n// https://eslint.org/docs/latest/rules/no-prototype-builtins\nexport function hasOwn(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\nexport function isObj(obj) {\n return obj != null && typeof obj === 'object' && !Array.isArray(obj);\n}\nexport const ensurePresent = (value) => {\n if (value == null) {\n throw new AnthropicError(`Expected a value to be given but received ${value} instead.`);\n }\n return value;\n};\nexport const validatePositiveInteger = (name, n) => {\n if (typeof n !== 'number' || !Number.isInteger(n)) {\n throw new AnthropicError(`${name} must be an integer`);\n }\n if (n < 0) {\n throw new AnthropicError(`${name} must be a positive integer`);\n }\n return n;\n};\nexport const coerceInteger = (value) => {\n if (typeof value === 'number')\n return Math.round(value);\n if (typeof value === 'string')\n return parseInt(value, 10);\n throw new AnthropicError(`Could not coerce ${value} (type: ${typeof value}) into a number`);\n};\nexport const coerceFloat = (value) => {\n if (typeof value === 'number')\n return value;\n if (typeof value === 'string')\n return parseFloat(value);\n throw new AnthropicError(`Could not coerce ${value} (type: ${typeof value}) into a number`);\n};\nexport const coerceBoolean = (value) => {\n if (typeof value === 'boolean')\n return value;\n if (typeof value === 'string')\n return value === 'true';\n return Boolean(value);\n};\nexport const maybeCoerceInteger = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceInteger(value);\n};\nexport const maybeCoerceFloat = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceFloat(value);\n};\nexport const maybeCoerceBoolean = (value) => {\n if (value == null) {\n return undefined;\n }\n return coerceBoolean(value);\n};\nexport const safeJSON = (text) => {\n try {\n return JSON.parse(text);\n }\n catch (err) {\n return undefined;\n }\n};\n// Gets a value from an object, deletes the key, and returns the value (or undefined if not found)\nexport const pop = (obj, key) => {\n const value = obj[key];\n delete obj[key];\n return value;\n};\n//# sourceMappingURL=values.mjs.map",
89
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\n//# sourceMappingURL=sleep.mjs.map",
90
+ "export const VERSION = '0.91.1'; // x-release-please-version\n//# sourceMappingURL=version.mjs.map",
91
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { VERSION } from \"../version.mjs\";\nexport const isRunningInBrowser = () => {\n return (\n // @ts-ignore\n typeof window !== 'undefined' &&\n // @ts-ignore\n typeof window.document !== 'undefined' &&\n // @ts-ignore\n typeof navigator !== 'undefined');\n};\n/**\n * Note this does not detect 'browser'; for that, use getBrowserInfo().\n */\nfunction getDetectedPlatform() {\n if (typeof Deno !== 'undefined' && Deno.build != null) {\n return 'deno';\n }\n if (typeof EdgeRuntime !== 'undefined') {\n return 'edge';\n }\n if (Object.prototype.toString.call(typeof globalThis.process !== 'undefined' ? globalThis.process : 0) === '[object process]') {\n return 'node';\n }\n return 'unknown';\n}\nconst getPlatformProperties = () => {\n const detectedPlatform = getDetectedPlatform();\n if (detectedPlatform === 'deno') {\n return {\n 'X-Stainless-Lang': 'js',\n 'X-Stainless-Package-Version': VERSION,\n 'X-Stainless-OS': normalizePlatform(Deno.build.os),\n 'X-Stainless-Arch': normalizeArch(Deno.build.arch),\n 'X-Stainless-Runtime': 'deno',\n 'X-Stainless-Runtime-Version': typeof Deno.version === 'string' ? Deno.version : Deno.version?.deno ?? 'unknown',\n };\n }\n if (typeof EdgeRuntime !== 'undefined') {\n return {\n 'X-Stainless-Lang': 'js',\n 'X-Stainless-Package-Version': VERSION,\n 'X-Stainless-OS': 'Unknown',\n 'X-Stainless-Arch': `other:${EdgeRuntime}`,\n 'X-Stainless-Runtime': 'edge',\n 'X-Stainless-Runtime-Version': globalThis.process.version,\n };\n }\n // Check if Node.js\n if (detectedPlatform === 'node') {\n return {\n 'X-Stainless-Lang': 'js',\n 'X-Stainless-Package-Version': VERSION,\n 'X-Stainless-OS': normalizePlatform(globalThis.process.platform ?? 'unknown'),\n 'X-Stainless-Arch': normalizeArch(globalThis.process.arch ?? 'unknown'),\n 'X-Stainless-Runtime': 'node',\n 'X-Stainless-Runtime-Version': globalThis.process.version ?? 'unknown',\n };\n }\n const browserInfo = getBrowserInfo();\n if (browserInfo) {\n return {\n 'X-Stainless-Lang': 'js',\n 'X-Stainless-Package-Version': VERSION,\n 'X-Stainless-OS': 'Unknown',\n 'X-Stainless-Arch': 'unknown',\n 'X-Stainless-Runtime': `browser:${browserInfo.browser}`,\n 'X-Stainless-Runtime-Version': browserInfo.version,\n };\n }\n // TODO add support for Cloudflare workers, etc.\n return {\n 'X-Stainless-Lang': 'js',\n 'X-Stainless-Package-Version': VERSION,\n 'X-Stainless-OS': 'Unknown',\n 'X-Stainless-Arch': 'unknown',\n 'X-Stainless-Runtime': 'unknown',\n 'X-Stainless-Runtime-Version': 'unknown',\n };\n};\n// Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts\nfunction getBrowserInfo() {\n if (typeof navigator === 'undefined' || !navigator) {\n return null;\n }\n // NOTE: The order matters here!\n const browserPatterns = [\n { key: 'edge', pattern: /Edge(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: 'ie', pattern: /MSIE(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: 'ie', pattern: /Trident(?:.*rv\\:(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: 'chrome', pattern: /Chrome(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: 'firefox', pattern: /Firefox(?:\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?/ },\n { key: 'safari', pattern: /(?:Version\\W+(\\d+)\\.(\\d+)(?:\\.(\\d+))?)?(?:\\W+Mobile\\S*)?\\W+Safari/ },\n ];\n // Find the FIRST matching browser\n for (const { key, pattern } of browserPatterns) {\n const match = pattern.exec(navigator.userAgent);\n if (match) {\n const major = match[1] || 0;\n const minor = match[2] || 0;\n const patch = match[3] || 0;\n return { browser: key, version: `${major}.${minor}.${patch}` };\n }\n }\n return null;\n}\nconst normalizeArch = (arch) => {\n // Node docs:\n // - https://nodejs.org/api/process.html#processarch\n // Deno docs:\n // - https://doc.deno.land/deno/stable/~/Deno.build\n if (arch === 'x32')\n return 'x32';\n if (arch === 'x86_64' || arch === 'x64')\n return 'x64';\n if (arch === 'arm')\n return 'arm';\n if (arch === 'aarch64' || arch === 'arm64')\n return 'arm64';\n if (arch)\n return `other:${arch}`;\n return 'unknown';\n};\nconst normalizePlatform = (platform) => {\n // Node platforms:\n // - https://nodejs.org/api/process.html#processplatform\n // Deno platforms:\n // - https://doc.deno.land/deno/stable/~/Deno.build\n // - https://github.com/denoland/deno/issues/14799\n platform = platform.toLowerCase();\n // NOTE: this iOS check is untested and may not work\n // Node does not work natively on IOS, there is a fork at\n // https://github.com/nodejs-mobile/nodejs-mobile\n // however it is unknown at the time of writing how to detect if it is running\n if (platform.includes('ios'))\n return 'iOS';\n if (platform === 'android')\n return 'Android';\n if (platform === 'darwin')\n return 'MacOS';\n if (platform === 'win32')\n return 'Windows';\n if (platform === 'freebsd')\n return 'FreeBSD';\n if (platform === 'openbsd')\n return 'OpenBSD';\n if (platform === 'linux')\n return 'Linux';\n if (platform)\n return `Other:${platform}`;\n return 'Unknown';\n};\nlet _platformHeaders;\nexport const getPlatformHeaders = () => {\n return (_platformHeaders ?? (_platformHeaders = getPlatformProperties()));\n};\n//# sourceMappingURL=detect-platform.mjs.map",
92
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport function getDefaultFetch() {\n if (typeof fetch !== 'undefined') {\n return fetch;\n }\n throw new Error('`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`');\n}\nexport function makeReadableStream(...args) {\n const ReadableStream = globalThis.ReadableStream;\n if (typeof ReadableStream === 'undefined') {\n // Note: All of the platforms / runtimes we officially support already define\n // `ReadableStream` as a global, so this should only ever be hit on unsupported runtimes.\n throw new Error('`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`');\n }\n return new ReadableStream(...args);\n}\nexport function ReadableStreamFrom(iterable) {\n let iter = Symbol.asyncIterator in iterable ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n return makeReadableStream({\n start() { },\n async pull(controller) {\n const { done, value } = await iter.next();\n if (done) {\n controller.close();\n }\n else {\n controller.enqueue(value);\n }\n },\n async cancel() {\n await iter.return?.();\n },\n });\n}\n/**\n * Most browsers don't yet have async iterable support for ReadableStream,\n * and Node has a very different way of reading bytes from its \"ReadableStream\".\n *\n * This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1627354490\n */\nexport function ReadableStreamToAsyncIterable(stream) {\n if (stream[Symbol.asyncIterator])\n return stream;\n const reader = stream.getReader();\n return {\n async next() {\n try {\n const result = await reader.read();\n if (result?.done)\n reader.releaseLock(); // release lock when stream becomes closed\n return result;\n }\n catch (e) {\n reader.releaseLock(); // release lock when stream becomes errored\n throw e;\n }\n },\n async return() {\n const cancelPromise = reader.cancel();\n reader.releaseLock();\n await cancelPromise;\n return { done: true, value: undefined };\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\n/**\n * Cancels a ReadableStream we don't need to consume.\n * See https://undici.nodejs.org/#/?id=garbage-collection\n */\nexport async function CancelReadableStream(stream) {\n if (stream === null || typeof stream !== 'object')\n return;\n if (stream[Symbol.asyncIterator]) {\n await stream[Symbol.asyncIterator]().return?.();\n return;\n }\n const reader = stream.getReader();\n const cancelPromise = reader.cancel();\n reader.releaseLock();\n await cancelPromise;\n}\n//# sourceMappingURL=shims.mjs.map",
93
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport const FallbackEncoder = ({ headers, body }) => {\n return {\n bodyHeaders: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify(body),\n };\n};\n//# sourceMappingURL=request-options.mjs.map",
94
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { AnthropicError } from \"../../core/error.mjs\";\n/**\n * Basic re-implementation of `qs.stringify` for primitive types.\n */\nexport function stringifyQuery(query) {\n return Object.entries(query)\n .filter(([_, value]) => typeof value !== 'undefined')\n .map(([key, value]) => {\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;\n }\n if (value === null) {\n return `${encodeURIComponent(key)}=`;\n }\n throw new AnthropicError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`);\n })\n .join('&');\n}\n//# sourceMappingURL=query.mjs.map",
95
+ "export function concatBytes(buffers) {\n let length = 0;\n for (const buffer of buffers) {\n length += buffer.length;\n }\n const output = new Uint8Array(length);\n let index = 0;\n for (const buffer of buffers) {\n output.set(buffer, index);\n index += buffer.length;\n }\n return output;\n}\nlet encodeUTF8_;\nexport function encodeUTF8(str) {\n let encoder;\n return (encodeUTF8_ ??\n ((encoder = new globalThis.TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder))))(str);\n}\nlet decodeUTF8_;\nexport function decodeUTF8(bytes) {\n let decoder;\n return (decodeUTF8_ ??\n ((decoder = new globalThis.TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder))))(bytes);\n}\n//# sourceMappingURL=bytes.mjs.map",
96
+ "var _LineDecoder_buffer, _LineDecoder_carriageReturnIndex;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../tslib.mjs\";\nimport { concatBytes, decodeUTF8, encodeUTF8 } from \"../utils/bytes.mjs\";\n/**\n * A re-implementation of httpx's `LineDecoder` in Python that handles incrementally\n * reading lines from text.\n *\n * https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258\n */\nexport class LineDecoder {\n constructor() {\n _LineDecoder_buffer.set(this, void 0);\n _LineDecoder_carriageReturnIndex.set(this, void 0);\n __classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), \"f\");\n __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, \"f\");\n }\n decode(chunk) {\n if (chunk == null) {\n return [];\n }\n const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)\n : typeof chunk === 'string' ? encodeUTF8(chunk)\n : chunk;\n __classPrivateFieldSet(this, _LineDecoder_buffer, concatBytes([__classPrivateFieldGet(this, _LineDecoder_buffer, \"f\"), binaryChunk]), \"f\");\n const lines = [];\n let patternIndex;\n while ((patternIndex = findNewlineIndex(__classPrivateFieldGet(this, _LineDecoder_buffer, \"f\"), __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\"))) != null) {\n if (patternIndex.carriage && __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\") == null) {\n // skip until we either get a corresponding `\\n`, a new `\\r` or nothing\n __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, patternIndex.index, \"f\");\n continue;\n }\n // we got double \\r or \\rtext\\n\n if (__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\") != null &&\n (patternIndex.index !== __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\") + 1 || patternIndex.carriage)) {\n lines.push(decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, \"f\").subarray(0, __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\") - 1)));\n __classPrivateFieldSet(this, _LineDecoder_buffer, __classPrivateFieldGet(this, _LineDecoder_buffer, \"f\").subarray(__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\")), \"f\");\n __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, \"f\");\n continue;\n }\n const endIndex = __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, \"f\") !== null ? patternIndex.preceding - 1 : patternIndex.preceding;\n const line = decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, \"f\").subarray(0, endIndex));\n lines.push(line);\n __classPrivateFieldSet(this, _LineDecoder_buffer, __classPrivateFieldGet(this, _LineDecoder_buffer, \"f\").subarray(patternIndex.index), \"f\");\n __classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, \"f\");\n }\n return lines;\n }\n flush() {\n if (!__classPrivateFieldGet(this, _LineDecoder_buffer, \"f\").length) {\n return [];\n }\n return this.decode('\\n');\n }\n}\n_LineDecoder_buffer = new WeakMap(), _LineDecoder_carriageReturnIndex = new WeakMap();\n// prettier-ignore\nLineDecoder.NEWLINE_CHARS = new Set(['\\n', '\\r']);\nLineDecoder.NEWLINE_REGEXP = /\\r\\n|[\\n\\r]/g;\n/**\n * This function searches the buffer for the end patterns, (\\r or \\n)\n * and returns an object with the index preceding the matched newline and the\n * index after the newline char. `null` is returned if no new line is found.\n *\n * ```ts\n * findNewLineIndex('abc\\ndef') -> { preceding: 2, index: 3 }\n * ```\n */\nfunction findNewlineIndex(buffer, startIndex) {\n const newline = 0x0a; // \\n\n const carriage = 0x0d; // \\r\n for (let i = startIndex ?? 0; i < buffer.length; i++) {\n if (buffer[i] === newline) {\n return { preceding: i, index: i + 1, carriage: false };\n }\n if (buffer[i] === carriage) {\n return { preceding: i, index: i + 1, carriage: true };\n }\n }\n return null;\n}\nexport function findDoubleNewlineIndex(buffer) {\n // This function searches the buffer for the end patterns (\\r\\r, \\n\\n, \\r\\n\\r\\n)\n // and returns the index right after the first occurrence of any pattern,\n // or -1 if none of the patterns are found.\n const newline = 0x0a; // \\n\n const carriage = 0x0d; // \\r\n for (let i = 0; i < buffer.length - 1; i++) {\n if (buffer[i] === newline && buffer[i + 1] === newline) {\n // \\n\\n\n return i + 2;\n }\n if (buffer[i] === carriage && buffer[i + 1] === carriage) {\n // \\r\\r\n return i + 2;\n }\n if (buffer[i] === carriage &&\n buffer[i + 1] === newline &&\n i + 3 < buffer.length &&\n buffer[i + 2] === carriage &&\n buffer[i + 3] === newline) {\n // \\r\\n\\r\\n\n return i + 4;\n }\n }\n return -1;\n}\n//# sourceMappingURL=line.mjs.map",
97
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { hasOwn } from \"./values.mjs\";\nconst levelNumbers = {\n off: 0,\n error: 200,\n warn: 300,\n info: 400,\n debug: 500,\n};\nexport const parseLogLevel = (maybeLevel, sourceName, client) => {\n if (!maybeLevel) {\n return undefined;\n }\n if (hasOwn(levelNumbers, maybeLevel)) {\n return maybeLevel;\n }\n loggerFor(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`);\n return undefined;\n};\nfunction noop() { }\nfunction makeLogFn(fnLevel, logger, logLevel) {\n if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) {\n return noop;\n }\n else {\n // Don't wrap logger functions, we want the stacktrace intact!\n return logger[fnLevel].bind(logger);\n }\n}\nconst noopLogger = {\n error: noop,\n warn: noop,\n info: noop,\n debug: noop,\n};\nlet cachedLoggers = /* @__PURE__ */ new WeakMap();\nexport function loggerFor(client) {\n const logger = client.logger;\n const logLevel = client.logLevel ?? 'off';\n if (!logger) {\n return noopLogger;\n }\n const cachedLogger = cachedLoggers.get(logger);\n if (cachedLogger && cachedLogger[0] === logLevel) {\n return cachedLogger[1];\n }\n const levelLogger = {\n error: makeLogFn('error', logger, logLevel),\n warn: makeLogFn('warn', logger, logLevel),\n info: makeLogFn('info', logger, logLevel),\n debug: makeLogFn('debug', logger, logLevel),\n };\n cachedLoggers.set(logger, [logLevel, levelLogger]);\n return levelLogger;\n}\nexport const formatRequestDetails = (details) => {\n if (details.options) {\n details.options = { ...details.options };\n delete details.options['headers']; // redundant + leaks internals\n }\n if (details.headers) {\n details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [\n name,\n (name.toLowerCase() === 'x-api-key' ||\n name.toLowerCase() === 'authorization' ||\n name.toLowerCase() === 'cookie' ||\n name.toLowerCase() === 'set-cookie') ?\n '***'\n : value,\n ]));\n }\n if ('retryOfRequestLogID' in details) {\n if (details.retryOfRequestLogID) {\n details.retryOf = details.retryOfRequestLogID;\n }\n delete details.retryOfRequestLogID;\n }\n return details;\n};\n//# sourceMappingURL=log.mjs.map",
98
+ "var _Stream_client;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../internal/tslib.mjs\";\nimport { AnthropicError } from \"./error.mjs\";\nimport { makeReadableStream } from \"../internal/shims.mjs\";\nimport { findDoubleNewlineIndex, LineDecoder } from \"../internal/decoders/line.mjs\";\nimport { ReadableStreamToAsyncIterable } from \"../internal/shims.mjs\";\nimport { isAbortError } from \"../internal/errors.mjs\";\nimport { safeJSON } from \"../internal/utils/values.mjs\";\nimport { encodeUTF8 } from \"../internal/utils/bytes.mjs\";\nimport { loggerFor } from \"../internal/utils/log.mjs\";\nimport { APIError } from \"./error.mjs\";\nexport class Stream {\n constructor(iterator, controller, client) {\n this.iterator = iterator;\n _Stream_client.set(this, void 0);\n this.controller = controller;\n __classPrivateFieldSet(this, _Stream_client, client, \"f\");\n }\n static fromSSEResponse(response, controller, client) {\n let consumed = false;\n const logger = client ? loggerFor(client) : console;\n async function* iterator() {\n if (consumed) {\n throw new AnthropicError('Cannot iterate over a consumed stream, use `.tee()` to split the stream.');\n }\n consumed = true;\n let done = false;\n try {\n for await (const sse of _iterSSEMessages(response, controller)) {\n if (sse.event === 'completion') {\n try {\n yield JSON.parse(sse.data);\n }\n catch (e) {\n logger.error(`Could not parse message into JSON:`, sse.data);\n logger.error(`From chunk:`, sse.raw);\n throw e;\n }\n }\n if (sse.event === 'message_start' ||\n sse.event === 'message_delta' ||\n sse.event === 'message_stop' ||\n sse.event === 'content_block_start' ||\n sse.event === 'content_block_delta' ||\n sse.event === 'content_block_stop' ||\n sse.event === 'message' ||\n sse.event === 'user.message' ||\n sse.event === 'user.interrupt' ||\n sse.event === 'user.tool_confirmation' ||\n sse.event === 'user.custom_tool_result' ||\n sse.event === 'agent.message' ||\n sse.event === 'agent.thinking' ||\n sse.event === 'agent.tool_use' ||\n sse.event === 'agent.tool_result' ||\n sse.event === 'agent.mcp_tool_use' ||\n sse.event === 'agent.mcp_tool_result' ||\n sse.event === 'agent.custom_tool_use' ||\n sse.event === 'agent.thread_context_compacted' ||\n sse.event === 'session.status_running' ||\n sse.event === 'session.status_idle' ||\n sse.event === 'session.status_rescheduled' ||\n sse.event === 'session.status_terminated' ||\n sse.event === 'session.error' ||\n sse.event === 'session.deleted' ||\n sse.event === 'span.model_request_start' ||\n sse.event === 'span.model_request_end') {\n try {\n yield JSON.parse(sse.data);\n }\n catch (e) {\n logger.error(`Could not parse message into JSON:`, sse.data);\n logger.error(`From chunk:`, sse.raw);\n throw e;\n }\n }\n if (sse.event === 'ping') {\n continue;\n }\n if (sse.event === 'error') {\n const body = safeJSON(sse.data) ?? sse.data;\n const type = body?.error?.type;\n throw new APIError(undefined, body, undefined, response.headers, type);\n }\n }\n done = true;\n }\n catch (e) {\n // If the user calls `stream.controller.abort()`, we should exit without throwing.\n if (isAbortError(e))\n return;\n throw e;\n }\n finally {\n // If the user `break`s, abort the ongoing request.\n if (!done)\n controller.abort();\n }\n }\n return new Stream(iterator, controller, client);\n }\n /**\n * Generates a Stream from a newline-separated ReadableStream\n * where each item is a JSON value.\n */\n static fromReadableStream(readableStream, controller, client) {\n let consumed = false;\n async function* iterLines() {\n const lineDecoder = new LineDecoder();\n const iter = ReadableStreamToAsyncIterable(readableStream);\n for await (const chunk of iter) {\n for (const line of lineDecoder.decode(chunk)) {\n yield line;\n }\n }\n for (const line of lineDecoder.flush()) {\n yield line;\n }\n }\n async function* iterator() {\n if (consumed) {\n throw new AnthropicError('Cannot iterate over a consumed stream, use `.tee()` to split the stream.');\n }\n consumed = true;\n let done = false;\n try {\n for await (const line of iterLines()) {\n if (done)\n continue;\n if (line)\n yield JSON.parse(line);\n }\n done = true;\n }\n catch (e) {\n // If the user calls `stream.controller.abort()`, we should exit without throwing.\n if (isAbortError(e))\n return;\n throw e;\n }\n finally {\n // If the user `break`s, abort the ongoing request.\n if (!done)\n controller.abort();\n }\n }\n return new Stream(iterator, controller, client);\n }\n [(_Stream_client = new WeakMap(), Symbol.asyncIterator)]() {\n return this.iterator();\n }\n /**\n * Splits the stream into two streams which can be\n * independently read from at different speeds.\n */\n tee() {\n const left = [];\n const right = [];\n const iterator = this.iterator();\n const teeIterator = (queue) => {\n return {\n next: () => {\n if (queue.length === 0) {\n const result = iterator.next();\n left.push(result);\n right.push(result);\n }\n return queue.shift();\n },\n };\n };\n return [\n new Stream(() => teeIterator(left), this.controller, __classPrivateFieldGet(this, _Stream_client, \"f\")),\n new Stream(() => teeIterator(right), this.controller, __classPrivateFieldGet(this, _Stream_client, \"f\")),\n ];\n }\n /**\n * Converts this stream to a newline-separated ReadableStream of\n * JSON stringified values in the stream\n * which can be turned back into a Stream with `Stream.fromReadableStream()`.\n */\n toReadableStream() {\n const self = this;\n let iter;\n return makeReadableStream({\n async start() {\n iter = self[Symbol.asyncIterator]();\n },\n async pull(ctrl) {\n try {\n const { value, done } = await iter.next();\n if (done)\n return ctrl.close();\n const bytes = encodeUTF8(JSON.stringify(value) + '\\n');\n ctrl.enqueue(bytes);\n }\n catch (err) {\n ctrl.error(err);\n }\n },\n async cancel() {\n await iter.return?.();\n },\n });\n }\n}\nexport async function* _iterSSEMessages(response, controller) {\n if (!response.body) {\n controller.abort();\n if (typeof globalThis.navigator !== 'undefined' &&\n globalThis.navigator.product === 'ReactNative') {\n throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`);\n }\n throw new AnthropicError(`Attempted to iterate over a response with no body`);\n }\n const sseDecoder = new SSEDecoder();\n const lineDecoder = new LineDecoder();\n const iter = ReadableStreamToAsyncIterable(response.body);\n for await (const sseChunk of iterSSEChunks(iter)) {\n for (const line of lineDecoder.decode(sseChunk)) {\n const sse = sseDecoder.decode(line);\n if (sse)\n yield sse;\n }\n }\n for (const line of lineDecoder.flush()) {\n const sse = sseDecoder.decode(line);\n if (sse)\n yield sse;\n }\n}\n/**\n * Given an async iterable iterator, iterates over it and yields full\n * SSE chunks, i.e. yields when a double new-line is encountered.\n */\nasync function* iterSSEChunks(iterator) {\n let data = new Uint8Array();\n for await (const chunk of iterator) {\n if (chunk == null) {\n continue;\n }\n const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)\n : typeof chunk === 'string' ? encodeUTF8(chunk)\n : chunk;\n let newData = new Uint8Array(data.length + binaryChunk.length);\n newData.set(data);\n newData.set(binaryChunk, data.length);\n data = newData;\n let patternIndex;\n while ((patternIndex = findDoubleNewlineIndex(data)) !== -1) {\n yield data.slice(0, patternIndex);\n data = data.slice(patternIndex);\n }\n }\n if (data.length > 0) {\n yield data;\n }\n}\nclass SSEDecoder {\n constructor() {\n this.event = null;\n this.data = [];\n this.chunks = [];\n }\n decode(line) {\n if (line.endsWith('\\r')) {\n line = line.substring(0, line.length - 1);\n }\n if (!line) {\n // empty line and we didn't previously encounter any messages\n if (!this.event && !this.data.length)\n return null;\n const sse = {\n event: this.event,\n data: this.data.join('\\n'),\n raw: this.chunks,\n };\n this.event = null;\n this.data = [];\n this.chunks = [];\n return sse;\n }\n this.chunks.push(line);\n if (line.startsWith(':')) {\n return null;\n }\n let [fieldname, _, value] = partition(line, ':');\n if (value.startsWith(' ')) {\n value = value.substring(1);\n }\n if (fieldname === 'event') {\n this.event = value;\n }\n else if (fieldname === 'data') {\n this.data.push(value);\n }\n return null;\n }\n}\nfunction partition(str, delimiter) {\n const index = str.indexOf(delimiter);\n if (index !== -1) {\n return [str.substring(0, index), delimiter, str.substring(index + delimiter.length)];\n }\n return [str, '', ''];\n}\n//# sourceMappingURL=streaming.mjs.map",
99
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { Stream } from \"../core/streaming.mjs\";\nimport { formatRequestDetails, loggerFor } from \"./utils/log.mjs\";\nexport async function defaultParseResponse(client, props) {\n const { response, requestLogID, retryOfRequestLogID, startTime } = props;\n const body = await (async () => {\n if (props.options.stream) {\n loggerFor(client).debug('response', response.status, response.url, response.headers, response.body);\n // Note: there is an invariant here that isn't represented in the type system\n // that if you set `stream: true` the response type must also be `Stream<T>`\n if (props.options.__streamClass) {\n return props.options.__streamClass.fromSSEResponse(response, props.controller);\n }\n return Stream.fromSSEResponse(response, props.controller);\n }\n // fetch refuses to read the body when the status code is 204.\n if (response.status === 204) {\n return null;\n }\n if (props.options.__binaryResponse) {\n return response;\n }\n const contentType = response.headers.get('content-type');\n const mediaType = contentType?.split(';')[0]?.trim();\n const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');\n if (isJSON) {\n const contentLength = response.headers.get('content-length');\n if (contentLength === '0') {\n // if there is no content we can't do anything\n return undefined;\n }\n const json = await response.json();\n return addRequestID(json, response);\n }\n const text = await response.text();\n return text;\n })();\n loggerFor(client).debug(`[${requestLogID}] response parsed`, formatRequestDetails({\n retryOfRequestLogID,\n url: response.url,\n status: response.status,\n body,\n durationMs: Date.now() - startTime,\n }));\n return body;\n}\nexport function addRequestID(value, response) {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n return value;\n }\n return Object.defineProperty(value, '_request_id', {\n value: response.headers.get('request-id'),\n enumerable: false,\n });\n}\n//# sourceMappingURL=parse.mjs.map",
100
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nvar _APIPromise_client;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../internal/tslib.mjs\";\nimport { defaultParseResponse, addRequestID, } from \"../internal/parse.mjs\";\n/**\n * A subclass of `Promise` providing additional helper methods\n * for interacting with the SDK.\n */\nexport class APIPromise extends Promise {\n constructor(client, responsePromise, parseResponse = defaultParseResponse) {\n super((resolve) => {\n // this is maybe a bit weird but this has to be a no-op to not implicitly\n // parse the response body; instead .then, .catch, .finally are overridden\n // to parse the response\n resolve(null);\n });\n this.responsePromise = responsePromise;\n this.parseResponse = parseResponse;\n _APIPromise_client.set(this, void 0);\n __classPrivateFieldSet(this, _APIPromise_client, client, \"f\");\n }\n _thenUnwrap(transform) {\n return new APIPromise(__classPrivateFieldGet(this, _APIPromise_client, \"f\"), this.responsePromise, async (client, props) => addRequestID(transform(await this.parseResponse(client, props), props), props.response));\n }\n /**\n * Gets the raw `Response` instance instead of parsing the response\n * data.\n *\n * If you want to parse the response body but still get the `Response`\n * instance, you can use {@link withResponse()}.\n *\n * 👋 Getting the wrong TypeScript type for `Response`?\n * Try setting `\"moduleResolution\": \"NodeNext\"` or add `\"lib\": [\"DOM\"]`\n * to your `tsconfig.json`.\n */\n asResponse() {\n return this.responsePromise.then((p) => p.response);\n }\n /**\n * Gets the parsed response data, the raw `Response` instance and the ID of the request,\n * returned via the `request-id` header which is useful for debugging requests and resporting\n * issues to Anthropic.\n *\n * If you just want to get the raw `Response` instance without parsing it,\n * you can use {@link asResponse()}.\n *\n * 👋 Getting the wrong TypeScript type for `Response`?\n * Try setting `\"moduleResolution\": \"NodeNext\"` or add `\"lib\": [\"DOM\"]`\n * to your `tsconfig.json`.\n */\n async withResponse() {\n const [data, response] = await Promise.all([this.parse(), this.asResponse()]);\n return { data, response, request_id: response.headers.get('request-id') };\n }\n parse() {\n if (!this.parsedPromise) {\n this.parsedPromise = this.responsePromise.then((data) => this.parseResponse(__classPrivateFieldGet(this, _APIPromise_client, \"f\"), data));\n }\n return this.parsedPromise;\n }\n then(onfulfilled, onrejected) {\n return this.parse().then(onfulfilled, onrejected);\n }\n catch(onrejected) {\n return this.parse().catch(onrejected);\n }\n finally(onfinally) {\n return this.parse().finally(onfinally);\n }\n}\n_APIPromise_client = new WeakMap();\n//# sourceMappingURL=api-promise.mjs.map",
101
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nvar _AbstractPage_client;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../internal/tslib.mjs\";\nimport { AnthropicError } from \"./error.mjs\";\nimport { defaultParseResponse } from \"../internal/parse.mjs\";\nimport { APIPromise } from \"./api-promise.mjs\";\nimport { maybeObj } from \"../internal/utils/values.mjs\";\nexport class AbstractPage {\n constructor(client, response, body, options) {\n _AbstractPage_client.set(this, void 0);\n __classPrivateFieldSet(this, _AbstractPage_client, client, \"f\");\n this.options = options;\n this.response = response;\n this.body = body;\n }\n hasNextPage() {\n const items = this.getPaginatedItems();\n if (!items.length)\n return false;\n return this.nextPageRequestOptions() != null;\n }\n async getNextPage() {\n const nextOptions = this.nextPageRequestOptions();\n if (!nextOptions) {\n throw new AnthropicError('No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.');\n }\n return await __classPrivateFieldGet(this, _AbstractPage_client, \"f\").requestAPIList(this.constructor, nextOptions);\n }\n async *iterPages() {\n let page = this;\n yield page;\n while (page.hasNextPage()) {\n page = await page.getNextPage();\n yield page;\n }\n }\n async *[(_AbstractPage_client = new WeakMap(), Symbol.asyncIterator)]() {\n for await (const page of this.iterPages()) {\n for (const item of page.getPaginatedItems()) {\n yield item;\n }\n }\n }\n}\n/**\n * This subclass of Promise will resolve to an instantiated Page once the request completes.\n *\n * It also implements AsyncIterable to allow auto-paginating iteration on an unawaited list call, eg:\n *\n * for await (const item of client.items.list()) {\n * console.log(item)\n * }\n */\nexport class PagePromise extends APIPromise {\n constructor(client, request, Page) {\n super(client, request, async (client, props) => new Page(client, props.response, await defaultParseResponse(client, props), props.options));\n }\n /**\n * Allow auto-paginating iteration on an unawaited list call, eg:\n *\n * for await (const item of client.items.list()) {\n * console.log(item)\n * }\n */\n async *[Symbol.asyncIterator]() {\n const page = await this;\n for await (const item of page) {\n yield item;\n }\n }\n}\nexport class Page extends AbstractPage {\n constructor(client, response, body, options) {\n super(client, response, body, options);\n this.data = body.data || [];\n this.has_more = body.has_more || false;\n this.first_id = body.first_id || null;\n this.last_id = body.last_id || null;\n }\n getPaginatedItems() {\n return this.data ?? [];\n }\n hasNextPage() {\n if (this.has_more === false) {\n return false;\n }\n return super.hasNextPage();\n }\n nextPageRequestOptions() {\n if (this.options.query?.['before_id']) {\n // in reverse\n const first_id = this.first_id;\n if (!first_id) {\n return null;\n }\n return {\n ...this.options,\n query: {\n ...maybeObj(this.options.query),\n before_id: first_id,\n },\n };\n }\n const cursor = this.last_id;\n if (!cursor) {\n return null;\n }\n return {\n ...this.options,\n query: {\n ...maybeObj(this.options.query),\n after_id: cursor,\n },\n };\n }\n}\nexport class TokenPage extends AbstractPage {\n constructor(client, response, body, options) {\n super(client, response, body, options);\n this.data = body.data || [];\n this.has_more = body.has_more || false;\n this.next_page = body.next_page || null;\n }\n getPaginatedItems() {\n return this.data ?? [];\n }\n hasNextPage() {\n if (this.has_more === false) {\n return false;\n }\n return super.hasNextPage();\n }\n nextPageRequestOptions() {\n const cursor = this.next_page;\n if (!cursor) {\n return null;\n }\n return {\n ...this.options,\n query: {\n ...maybeObj(this.options.query),\n page_token: cursor,\n },\n };\n }\n}\nexport class PageCursor extends AbstractPage {\n constructor(client, response, body, options) {\n super(client, response, body, options);\n this.data = body.data || [];\n this.next_page = body.next_page || null;\n }\n getPaginatedItems() {\n return this.data ?? [];\n }\n nextPageRequestOptions() {\n const cursor = this.next_page;\n if (!cursor) {\n return null;\n }\n return {\n ...this.options,\n query: {\n ...maybeObj(this.options.query),\n page: cursor,\n },\n };\n }\n}\n//# sourceMappingURL=pagination.mjs.map",
102
+ "import { ReadableStreamFrom } from \"./shims.mjs\";\nexport const checkFileSupport = () => {\n if (typeof File === 'undefined') {\n const { process } = globalThis;\n const isOldNode = typeof process?.versions?.node === 'string' && parseInt(process.versions.node.split('.')) < 20;\n throw new Error('`File` is not defined as a global, which is required for file uploads.' +\n (isOldNode ?\n \" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.\"\n : ''));\n }\n};\n/**\n * Construct a `File` instance. This is used to ensure a helpful error is thrown\n * for environments that don't define a global `File` yet.\n */\nexport function makeFile(fileBits, fileName, options) {\n checkFileSupport();\n return new File(fileBits, fileName ?? 'unknown_file', options);\n}\nexport function getName(value, stripPath) {\n const val = (typeof value === 'object' &&\n value !== null &&\n (('name' in value && value.name && String(value.name)) ||\n ('url' in value && value.url && String(value.url)) ||\n ('filename' in value && value.filename && String(value.filename)) ||\n ('path' in value && value.path && String(value.path)))) ||\n '';\n return stripPath ? val.split(/[\\\\/]/).pop() || undefined : val;\n}\nexport const isAsyncIterable = (value) => value != null && typeof value === 'object' && typeof value[Symbol.asyncIterator] === 'function';\n/**\n * Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.\n * Otherwise returns the request as is.\n */\nexport const maybeMultipartFormRequestOptions = async (opts, fetch) => {\n if (!hasUploadableValue(opts.body))\n return opts;\n return { ...opts, body: await createForm(opts.body, fetch) };\n};\nexport const multipartFormRequestOptions = async (opts, fetch, stripFilenames = true) => {\n return { ...opts, body: await createForm(opts.body, fetch, stripFilenames) };\n};\nconst supportsFormDataMap = /* @__PURE__ */ new WeakMap();\n/**\n * node-fetch doesn't support the global FormData object in recent node versions. Instead of sending\n * properly-encoded form data, it just stringifies the object, resulting in a request body of \"[object FormData]\".\n * This function detects if the fetch function provided supports the global FormData object to avoid\n * confusing error messages later on.\n */\nfunction supportsFormData(fetchObject) {\n const fetch = typeof fetchObject === 'function' ? fetchObject : fetchObject.fetch;\n const cached = supportsFormDataMap.get(fetch);\n if (cached)\n return cached;\n const promise = (async () => {\n try {\n const FetchResponse = ('Response' in fetch ?\n fetch.Response\n : (await fetch('data:,')).constructor);\n const data = new FormData();\n if (data.toString() === (await new FetchResponse(data).text())) {\n return false;\n }\n return true;\n }\n catch {\n // avoid false negatives\n return true;\n }\n })();\n supportsFormDataMap.set(fetch, promise);\n return promise;\n}\nexport const createForm = async (body, fetch, stripFilenames = true) => {\n if (!(await supportsFormData(fetch))) {\n throw new TypeError('The provided fetch function does not support file uploads with the current global FormData class.');\n }\n const form = new FormData();\n await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue(form, key, value, stripFilenames)));\n return form;\n};\n// We check for Blob not File because Bun.File doesn't inherit from File,\n// but they both inherit from Blob and have a `name` property at runtime.\nconst isNamedBlob = (value) => value instanceof Blob && 'name' in value;\nconst isUploadable = (value) => typeof value === 'object' &&\n value !== null &&\n (value instanceof Response || isAsyncIterable(value) || isNamedBlob(value));\nconst hasUploadableValue = (value) => {\n if (isUploadable(value))\n return true;\n if (Array.isArray(value))\n return value.some(hasUploadableValue);\n if (value && typeof value === 'object') {\n for (const k in value) {\n if (hasUploadableValue(value[k]))\n return true;\n }\n }\n return false;\n};\nconst addFormValue = async (form, key, value, stripFilenames) => {\n if (value === undefined)\n return;\n if (value == null) {\n throw new TypeError(`Received null for \"${key}\"; to pass null in FormData, you must use the string 'null'`);\n }\n // TODO: make nested formats configurable\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n form.append(key, String(value));\n }\n else if (value instanceof Response) {\n let options = {};\n const contentType = value.headers.get('Content-Type');\n if (contentType) {\n options = { type: contentType };\n }\n form.append(key, makeFile([await value.blob()], getName(value, stripFilenames), options));\n }\n else if (isAsyncIterable(value)) {\n form.append(key, makeFile([await new Response(ReadableStreamFrom(value)).blob()], getName(value, stripFilenames)));\n }\n else if (isNamedBlob(value)) {\n form.append(key, makeFile([value], getName(value, stripFilenames), { type: value.type }));\n }\n else if (Array.isArray(value)) {\n await Promise.all(value.map((entry) => addFormValue(form, key + '[]', entry, stripFilenames)));\n }\n else if (typeof value === 'object') {\n await Promise.all(Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop, stripFilenames)));\n }\n else {\n throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`);\n }\n};\n//# sourceMappingURL=uploads.mjs.map",
103
+ "import { getName, makeFile, isAsyncIterable } from \"./uploads.mjs\";\nimport { checkFileSupport } from \"./uploads.mjs\";\n/**\n * This check adds the arrayBuffer() method type because it is available and used at runtime\n */\nconst isBlobLike = (value) => value != null &&\n typeof value === 'object' &&\n typeof value.size === 'number' &&\n typeof value.type === 'string' &&\n typeof value.text === 'function' &&\n typeof value.slice === 'function' &&\n typeof value.arrayBuffer === 'function';\n/**\n * This check adds the arrayBuffer() method type because it is available and used at runtime\n */\nconst isFileLike = (value) => value != null &&\n typeof value === 'object' &&\n typeof value.name === 'string' &&\n typeof value.lastModified === 'number' &&\n isBlobLike(value);\nconst isResponseLike = (value) => value != null &&\n typeof value === 'object' &&\n typeof value.url === 'string' &&\n typeof value.blob === 'function';\n/**\n * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats\n * @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts\n * @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible\n * @param {Object=} options additional properties\n * @param {string=} options.type the MIME type of the content\n * @param {number=} options.lastModified the last modified timestamp\n * @returns a {@link File} with the given properties\n */\nexport async function toFile(value, name, options) {\n checkFileSupport();\n // If it's a promise, resolve it.\n value = await value;\n name || (name = getName(value, true));\n // If we've been given a `File` we don't need to do anything if the name / options\n // have not been customised.\n if (isFileLike(value)) {\n if (value instanceof File && name == null && options == null) {\n return value;\n }\n return makeFile([await value.arrayBuffer()], name ?? value.name, {\n type: value.type,\n lastModified: value.lastModified,\n ...options,\n });\n }\n if (isResponseLike(value)) {\n const blob = await value.blob();\n name || (name = new URL(value.url).pathname.split(/[\\\\/]/).pop());\n return makeFile(await getBytes(blob), name, options);\n }\n const parts = await getBytes(value);\n if (!options?.type) {\n const type = parts.find((part) => typeof part === 'object' && 'type' in part && part.type);\n if (typeof type === 'string') {\n options = { ...options, type };\n }\n }\n return makeFile(parts, name, options);\n}\nasync function getBytes(value) {\n let parts = [];\n if (typeof value === 'string' ||\n ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.\n value instanceof ArrayBuffer) {\n parts.push(value);\n }\n else if (isBlobLike(value)) {\n parts.push(value instanceof Blob ? value : await value.arrayBuffer());\n }\n else if (isAsyncIterable(value) // includes Readable, ReadableStream, etc.\n ) {\n for await (const chunk of value) {\n parts.push(...(await getBytes(chunk))); // TODO, consider validating?\n }\n }\n else {\n const constructor = value?.constructor?.name;\n throw new Error(`Unexpected data type: ${typeof value}${constructor ? `; constructor: ${constructor}` : ''}${propsForError(value)}`);\n }\n return parts;\n}\nfunction propsForError(value) {\n if (typeof value !== 'object' || value === null)\n return '';\n const props = Object.getOwnPropertyNames(value);\n return `; props: [${props.map((p) => `\"${p}\"`).join(', ')}]`;\n}\n//# sourceMappingURL=to-file.mjs.map",
104
+ "export { toFile } from \"../internal/to-file.mjs\";\n//# sourceMappingURL=uploads.mjs.map",
105
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport class APIResource {\n constructor(client) {\n this._client = client;\n }\n}\n//# sourceMappingURL=resource.mjs.map",
106
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { isReadonlyArray } from \"./utils/values.mjs\";\nconst brand_privateNullableHeaders = Symbol.for('brand.privateNullableHeaders');\nfunction* iterateHeaders(headers) {\n if (!headers)\n return;\n if (brand_privateNullableHeaders in headers) {\n const { values, nulls } = headers;\n yield* values.entries();\n for (const name of nulls) {\n yield [name, null];\n }\n return;\n }\n let shouldClear = false;\n let iter;\n if (headers instanceof Headers) {\n iter = headers.entries();\n }\n else if (isReadonlyArray(headers)) {\n iter = headers;\n }\n else {\n shouldClear = true;\n iter = Object.entries(headers ?? {});\n }\n for (let row of iter) {\n const name = row[0];\n if (typeof name !== 'string')\n throw new TypeError('expected header name to be a string');\n const values = isReadonlyArray(row[1]) ? row[1] : [row[1]];\n let didClear = false;\n for (const value of values) {\n if (value === undefined)\n continue;\n // Objects keys always overwrite older headers, they never append.\n // Yield a null to clear the header before adding the new values.\n if (shouldClear && !didClear) {\n didClear = true;\n yield [name, null];\n }\n yield [name, value];\n }\n }\n}\nexport const buildHeaders = (newHeaders) => {\n const targetHeaders = new Headers();\n const nullHeaders = new Set();\n for (const headers of newHeaders) {\n const seenHeaders = new Set();\n for (const [name, value] of iterateHeaders(headers)) {\n const lowerName = name.toLowerCase();\n if (!seenHeaders.has(lowerName)) {\n targetHeaders.delete(name);\n seenHeaders.add(lowerName);\n }\n if (value === null) {\n targetHeaders.delete(name);\n nullHeaders.add(lowerName);\n }\n else {\n targetHeaders.append(name, value);\n nullHeaders.delete(lowerName);\n }\n }\n }\n return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };\n};\nexport const isEmptyHeaders = (headers) => {\n for (const _ of iterateHeaders(headers))\n return false;\n return true;\n};\n//# sourceMappingURL=headers.mjs.map",
107
+ "import { AnthropicError } from \"../../core/error.mjs\";\n/**\n * Percent-encode everything that isn't safe to have in a path without encoding safe chars.\n *\n * Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:\n * > unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * > sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\" / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n * > pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n */\nexport function encodeURIPath(str) {\n return str.replace(/[^A-Za-z0-9\\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);\n}\nconst EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));\nexport const createPathTagFunction = (pathEncoder = encodeURIPath) => function path(statics, ...params) {\n // If there are no params, no processing is needed.\n if (statics.length === 1)\n return statics[0];\n let postPath = false;\n const invalidSegments = [];\n const path = statics.reduce((previousValue, currentValue, index) => {\n if (/[?#]/.test(currentValue)) {\n postPath = true;\n }\n const value = params[index];\n let encoded = (postPath ? encodeURIComponent : pathEncoder)('' + value);\n if (index !== params.length &&\n (value == null ||\n (typeof value === 'object' &&\n // handle values from other realms\n value.toString ===\n Object.getPrototypeOf(Object.getPrototypeOf(value.hasOwnProperty ?? EMPTY) ?? EMPTY)\n ?.toString))) {\n encoded = value + '';\n invalidSegments.push({\n start: previousValue.length + currentValue.length,\n length: encoded.length,\n error: `Value of type ${Object.prototype.toString\n .call(value)\n .slice(8, -1)} is not a valid path parameter`,\n });\n }\n return previousValue + currentValue + (index === params.length ? '' : encoded);\n }, '');\n const pathOnly = path.split(/[?#]/, 1)[0];\n const invalidSegmentPattern = /(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)/gi;\n let match;\n // Find all invalid segments\n while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {\n invalidSegments.push({\n start: match.index,\n length: match[0].length,\n error: `Value \"${match[0]}\" can\\'t be safely passed as a path parameter`,\n });\n }\n invalidSegments.sort((a, b) => a.start - b.start);\n if (invalidSegments.length > 0) {\n let lastEnd = 0;\n const underline = invalidSegments.reduce((acc, segment) => {\n const spaces = ' '.repeat(segment.start - lastEnd);\n const arrows = '^'.repeat(segment.length);\n lastEnd = segment.start + segment.length;\n return acc + spaces + arrows;\n }, '');\n throw new AnthropicError(`Path parameters result in path with invalid segments:\\n${invalidSegments\n .map((e) => e.error)\n .join('\\n')}\\n${path}\\n${underline}`);\n }\n return path;\n};\n/**\n * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.\n */\nexport const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);\n//# sourceMappingURL=path.mjs.map",
108
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport { PageCursor } from \"../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../internal/headers.mjs\";\nimport { path } from \"../../internal/utils/path.mjs\";\nexport class Environments extends APIResource {\n /**\n * Create a new environment with the specified configuration.\n *\n * @example\n * ```ts\n * const betaEnvironment =\n * await client.beta.environments.create({\n * name: 'python-data-analysis',\n * });\n * ```\n */\n create(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/environments?beta=true', {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Retrieve a specific environment by ID.\n *\n * @example\n * ```ts\n * const betaEnvironment =\n * await client.beta.environments.retrieve(\n * 'env_011CZkZ9X2dpNyB7HsEFoRfW',\n * );\n * ```\n */\n retrieve(environmentID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/environments/${environmentID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Update an existing environment's configuration.\n *\n * @example\n * ```ts\n * const betaEnvironment =\n * await client.beta.environments.update(\n * 'env_011CZkZ9X2dpNyB7HsEFoRfW',\n * );\n * ```\n */\n update(environmentID, params, options) {\n const { betas, ...body } = params;\n return this._client.post(path `/v1/environments/${environmentID}?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List environments with pagination support.\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaEnvironment of client.beta.environments.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/environments?beta=true', (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete an environment by ID. Returns a confirmation of the deletion.\n *\n * @example\n * ```ts\n * const betaEnvironmentDeleteResponse =\n * await client.beta.environments.delete(\n * 'env_011CZkZ9X2dpNyB7HsEFoRfW',\n * );\n * ```\n */\n delete(environmentID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.delete(path `/v1/environments/${environmentID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Archive an environment by ID. Archived environments cannot be used to create new\n * sessions.\n *\n * @example\n * ```ts\n * const betaEnvironment =\n * await client.beta.environments.archive(\n * 'env_011CZkZ9X2dpNyB7HsEFoRfW',\n * );\n * ```\n */\n archive(environmentID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.post(path `/v1/environments/${environmentID}/archive?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=environments.mjs.map",
109
+ "/**\n * Shared utilities for tracking SDK helper usage.\n */\n/**\n * Symbol used to mark objects created by SDK helpers for tracking.\n * The value is the helper name (e.g., 'mcpTool', 'betaZodTool').\n */\nexport const SDK_HELPER_SYMBOL = Symbol('anthropic.sdk.stainlessHelper');\nexport function wasCreatedByStainlessHelper(value) {\n return typeof value === 'object' && value !== null && SDK_HELPER_SYMBOL in value;\n}\n/**\n * Collects helper names from tools and messages arrays.\n * Returns a deduplicated array of helper names found.\n */\nexport function collectStainlessHelpers(tools, messages) {\n const helpers = new Set();\n // Collect from tools\n if (tools) {\n for (const tool of tools) {\n if (wasCreatedByStainlessHelper(tool)) {\n helpers.add(tool[SDK_HELPER_SYMBOL]);\n }\n }\n }\n // Collect from messages and their content blocks\n if (messages) {\n for (const message of messages) {\n if (wasCreatedByStainlessHelper(message)) {\n helpers.add(message[SDK_HELPER_SYMBOL]);\n }\n if (Array.isArray(message.content)) {\n for (const block of message.content) {\n if (wasCreatedByStainlessHelper(block)) {\n helpers.add(block[SDK_HELPER_SYMBOL]);\n }\n }\n }\n }\n }\n return Array.from(helpers);\n}\n/**\n * Builds x-stainless-helper header value from tools and messages.\n * Returns an empty object if no helpers are found.\n */\nexport function stainlessHelperHeader(tools, messages) {\n const helpers = collectStainlessHelpers(tools, messages);\n if (helpers.length === 0)\n return {};\n return { 'x-stainless-helper': helpers.join(', ') };\n}\n/**\n * Builds x-stainless-helper header value from a file object.\n * Returns an empty object if the file is not marked with a helper.\n */\nexport function stainlessHelperHeaderFromFile(file) {\n if (wasCreatedByStainlessHelper(file)) {\n return { 'x-stainless-helper': file[SDK_HELPER_SYMBOL] };\n }\n return {};\n}\n//# sourceMappingURL=stainless-helper-header.mjs.map",
110
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport { Page } from \"../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../internal/headers.mjs\";\nimport { stainlessHelperHeaderFromFile } from \"../../lib/stainless-helper-header.mjs\";\nimport { multipartFormRequestOptions } from \"../../internal/uploads.mjs\";\nimport { path } from \"../../internal/utils/path.mjs\";\nexport class Files extends APIResource {\n /**\n * List Files\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const fileMetadata of client.beta.files.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/files?beta=true', (Page), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete File\n *\n * @example\n * ```ts\n * const deletedFile = await client.beta.files.delete(\n * 'file_id',\n * );\n * ```\n */\n delete(fileID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.delete(path `/v1/files/${fileID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Download File\n *\n * @example\n * ```ts\n * const response = await client.beta.files.download(\n * 'file_id',\n * );\n *\n * const content = await response.blob();\n * console.log(content);\n * ```\n */\n download(fileID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/files/${fileID}/content?beta=true`, {\n ...options,\n headers: buildHeaders([\n {\n 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString(),\n Accept: 'application/binary',\n },\n options?.headers,\n ]),\n __binaryResponse: true,\n });\n }\n /**\n * Get File Metadata\n *\n * @example\n * ```ts\n * const fileMetadata =\n * await client.beta.files.retrieveMetadata('file_id');\n * ```\n */\n retrieveMetadata(fileID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/files/${fileID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Upload File\n *\n * @example\n * ```ts\n * const fileMetadata = await client.beta.files.upload({\n * file: fs.createReadStream('path/to/file'),\n * });\n * ```\n */\n upload(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/files?beta=true', multipartFormRequestOptions({\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'files-api-2025-04-14'].toString() },\n stainlessHelperHeaderFromFile(body.file),\n options?.headers,\n ]),\n }, this._client));\n }\n}\n//# sourceMappingURL=files.mjs.map",
111
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport { Page } from \"../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../internal/headers.mjs\";\nimport { path } from \"../../internal/utils/path.mjs\";\nexport class Models extends APIResource {\n /**\n * Get a specific model.\n *\n * The Models API response can be used to determine information about a specific\n * model or resolve a model alias to a model ID.\n *\n * @example\n * ```ts\n * const betaModelInfo = await client.beta.models.retrieve(\n * 'model_id',\n * );\n * ```\n */\n retrieve(modelID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/models/${modelID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n });\n }\n /**\n * List available models.\n *\n * The Models API response can be used to determine which models are available for\n * use in the API. More recently released models are listed first.\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaModelInfo of client.beta.models.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/models?beta=true', (Page), {\n query,\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=models.mjs.map",
112
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport { PageCursor } from \"../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../internal/headers.mjs\";\nimport { path } from \"../../internal/utils/path.mjs\";\nexport class UserProfiles extends APIResource {\n /**\n * Create User Profile\n *\n * @example\n * ```ts\n * const betaUserProfile =\n * await client.beta.userProfiles.create();\n * ```\n */\n create(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/user_profiles?beta=true', {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-03-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Get User Profile\n *\n * @example\n * ```ts\n * const betaUserProfile =\n * await client.beta.userProfiles.retrieve(\n * 'uprof_011CZkZCu8hGbp5mYRQgUmz9',\n * );\n * ```\n */\n retrieve(userProfileID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/user_profiles/${userProfileID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-03-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Update User Profile\n *\n * @example\n * ```ts\n * const betaUserProfile =\n * await client.beta.userProfiles.update(\n * 'uprof_011CZkZCu8hGbp5mYRQgUmz9',\n * );\n * ```\n */\n update(userProfileID, params, options) {\n const { betas, ...body } = params;\n return this._client.post(path `/v1/user_profiles/${userProfileID}?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-03-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List User Profiles\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaUserProfile of client.beta.userProfiles.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/user_profiles?beta=true', (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-03-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Create Enrollment URL\n *\n * @example\n * ```ts\n * const betaUserProfileEnrollmentURL =\n * await client.beta.userProfiles.createEnrollmentURL(\n * 'uprof_011CZkZCu8hGbp5mYRQgUmz9',\n * );\n * ```\n */\n createEnrollmentURL(userProfileID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.post(path `/v1/user_profiles/${userProfileID}/enrollment_url?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-03-24'].toString() },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=user-profiles.mjs.map",
113
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Versions extends APIResource {\n /**\n * List Agent Versions\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaManagedAgentsAgent of client.beta.agents.versions.list(\n * 'agent_011CZkYpogX7uDKUyvBTophP',\n * )) {\n * // ...\n * }\n * ```\n */\n list(agentID, params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList(path `/v1/agents/${agentID}/versions?beta=true`, (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=versions.mjs.map",
114
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport * as VersionsAPI from \"./versions.mjs\";\nimport { Versions } from \"./versions.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Agents extends APIResource {\n constructor() {\n super(...arguments);\n this.versions = new VersionsAPI.Versions(this._client);\n }\n /**\n * Create Agent\n *\n * @example\n * ```ts\n * const betaManagedAgentsAgent =\n * await client.beta.agents.create({\n * model: 'claude-sonnet-4-6',\n * name: 'My First Agent',\n * });\n * ```\n */\n create(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/agents?beta=true', {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Get Agent\n *\n * @example\n * ```ts\n * const betaManagedAgentsAgent =\n * await client.beta.agents.retrieve(\n * 'agent_011CZkYpogX7uDKUyvBTophP',\n * );\n * ```\n */\n retrieve(agentID, params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.get(path `/v1/agents/${agentID}?beta=true`, {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Update Agent\n *\n * @example\n * ```ts\n * const betaManagedAgentsAgent =\n * await client.beta.agents.update(\n * 'agent_011CZkYpogX7uDKUyvBTophP',\n * { version: 1 },\n * );\n * ```\n */\n update(agentID, params, options) {\n const { betas, ...body } = params;\n return this._client.post(path `/v1/agents/${agentID}?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List Agents\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaManagedAgentsAgent of client.beta.agents.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/agents?beta=true', (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Archive Agent\n *\n * @example\n * ```ts\n * const betaManagedAgentsAgent =\n * await client.beta.agents.archive(\n * 'agent_011CZkYpogX7uDKUyvBTophP',\n * );\n * ```\n */\n archive(agentID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.post(path `/v1/agents/${agentID}/archive?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\nAgents.Versions = Versions;\n//# sourceMappingURL=agents.mjs.map",
115
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Memories extends APIResource {\n /**\n * CreateMemory\n *\n * @example\n * ```ts\n * const betaManagedAgentsMemory =\n * await client.beta.memoryStores.memories.create(\n * 'memory_store_id',\n * { content: 'content', path: 'xx' },\n * );\n * ```\n */\n create(memoryStoreID, params, options) {\n const { view, betas, ...body } = params;\n return this._client.post(path `/v1/memory_stores/${memoryStoreID}/memories?beta=true`, {\n query: { view },\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * GetMemory\n *\n * @example\n * ```ts\n * const betaManagedAgentsMemory =\n * await client.beta.memoryStores.memories.retrieve(\n * 'memory_id',\n * { memory_store_id: 'memory_store_id' },\n * );\n * ```\n */\n retrieve(memoryID, params, options) {\n const { memory_store_id, betas, ...query } = params;\n return this._client.get(path `/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * UpdateMemory\n *\n * @example\n * ```ts\n * const betaManagedAgentsMemory =\n * await client.beta.memoryStores.memories.update(\n * 'memory_id',\n * { memory_store_id: 'memory_store_id' },\n * );\n * ```\n */\n update(memoryID, params, options) {\n const { memory_store_id, view, betas, ...body } = params;\n return this._client.post(path `/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, {\n query: { view },\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * ListMemories\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaManagedAgentsMemoryListItem of client.beta.memoryStores.memories.list(\n * 'memory_store_id',\n * )) {\n * // ...\n * }\n * ```\n */\n list(memoryStoreID, params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList(path `/v1/memory_stores/${memoryStoreID}/memories?beta=true`, (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * DeleteMemory\n *\n * @example\n * ```ts\n * const betaManagedAgentsDeletedMemory =\n * await client.beta.memoryStores.memories.delete(\n * 'memory_id',\n * { memory_store_id: 'memory_store_id' },\n * );\n * ```\n */\n delete(memoryID, params, options) {\n const { memory_store_id, expected_content_sha256, betas } = params;\n return this._client.delete(path `/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, {\n query: { expected_content_sha256 },\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=memories.mjs.map",
116
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class MemoryVersions extends APIResource {\n /**\n * GetMemoryVersion\n *\n * @example\n * ```ts\n * const betaManagedAgentsMemoryVersion =\n * await client.beta.memoryStores.memoryVersions.retrieve(\n * 'memory_version_id',\n * { memory_store_id: 'memory_store_id' },\n * );\n * ```\n */\n retrieve(memoryVersionID, params, options) {\n const { memory_store_id, betas, ...query } = params;\n return this._client.get(path `/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}?beta=true`, {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * ListMemoryVersions\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaManagedAgentsMemoryVersion of client.beta.memoryStores.memoryVersions.list(\n * 'memory_store_id',\n * )) {\n * // ...\n * }\n * ```\n */\n list(memoryStoreID, params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList(path `/v1/memory_stores/${memoryStoreID}/memory_versions?beta=true`, (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * RedactMemoryVersion\n *\n * @example\n * ```ts\n * const betaManagedAgentsMemoryVersion =\n * await client.beta.memoryStores.memoryVersions.redact(\n * 'memory_version_id',\n * { memory_store_id: 'memory_store_id' },\n * );\n * ```\n */\n redact(memoryVersionID, params, options) {\n const { memory_store_id, betas } = params;\n return this._client.post(path `/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}/redact?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=memory-versions.mjs.map",
117
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport * as MemoriesAPI from \"./memories.mjs\";\nimport { Memories, } from \"./memories.mjs\";\nimport * as MemoryVersionsAPI from \"./memory-versions.mjs\";\nimport { MemoryVersions, } from \"./memory-versions.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class MemoryStores extends APIResource {\n constructor() {\n super(...arguments);\n this.memories = new MemoriesAPI.Memories(this._client);\n this.memoryVersions = new MemoryVersionsAPI.MemoryVersions(this._client);\n }\n /**\n * CreateMemoryStore\n *\n * @example\n * ```ts\n * const betaManagedAgentsMemoryStore =\n * await client.beta.memoryStores.create({ name: 'x' });\n * ```\n */\n create(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/memory_stores?beta=true', {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * GetMemoryStore\n *\n * @example\n * ```ts\n * const betaManagedAgentsMemoryStore =\n * await client.beta.memoryStores.retrieve(\n * 'memory_store_id',\n * );\n * ```\n */\n retrieve(memoryStoreID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/memory_stores/${memoryStoreID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * UpdateMemoryStore\n *\n * @example\n * ```ts\n * const betaManagedAgentsMemoryStore =\n * await client.beta.memoryStores.update('memory_store_id');\n * ```\n */\n update(memoryStoreID, params, options) {\n const { betas, ...body } = params;\n return this._client.post(path `/v1/memory_stores/${memoryStoreID}?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * ListMemoryStores\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaManagedAgentsMemoryStore of client.beta.memoryStores.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/memory_stores?beta=true', (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * DeleteMemoryStore\n *\n * @example\n * ```ts\n * const betaManagedAgentsDeletedMemoryStore =\n * await client.beta.memoryStores.delete('memory_store_id');\n * ```\n */\n delete(memoryStoreID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.delete(path `/v1/memory_stores/${memoryStoreID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * ArchiveMemoryStore\n *\n * @example\n * ```ts\n * const betaManagedAgentsMemoryStore =\n * await client.beta.memoryStores.archive('memory_store_id');\n * ```\n */\n archive(memoryStoreID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.post(path `/v1/memory_stores/${memoryStoreID}/archive?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\nMemoryStores.Memories = Memories;\nMemoryStores.MemoryVersions = MemoryVersions;\n//# sourceMappingURL=memory-stores.mjs.map",
118
+ "export * from \"./core/error.mjs\";\n//# sourceMappingURL=error.mjs.map",
119
+ "// File containing shared constants\n/**\n * Model-specific timeout constraints for non-streaming requests\n */\nexport const MODEL_NONSTREAMING_TOKENS = {\n 'claude-opus-4-20250514': 8192,\n 'claude-opus-4-0': 8192,\n 'claude-4-opus-20250514': 8192,\n 'anthropic.claude-opus-4-20250514-v1:0': 8192,\n 'claude-opus-4@20250514': 8192,\n 'claude-opus-4-1-20250805': 8192,\n 'anthropic.claude-opus-4-1-20250805-v1:0': 8192,\n 'claude-opus-4-1@20250805': 8192,\n};\n//# sourceMappingURL=constants.mjs.map",
120
+ "import { AnthropicError } from \"../core/error.mjs\";\nfunction getOutputFormat(params) {\n // Prefer output_format (deprecated) over output_config.format for backward compatibility\n return params?.output_format ?? params?.output_config?.format;\n}\nexport function maybeParseBetaMessage(message, params, opts) {\n const outputFormat = getOutputFormat(params);\n if (!params || !('parse' in (outputFormat ?? {}))) {\n return {\n ...message,\n content: message.content.map((block) => {\n if (block.type === 'text') {\n const parsedBlock = Object.defineProperty({ ...block }, 'parsed_output', {\n value: null,\n enumerable: false,\n });\n return Object.defineProperty(parsedBlock, 'parsed', {\n get() {\n opts.logger.warn('The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead.');\n return null;\n },\n enumerable: false,\n });\n }\n return block;\n }),\n parsed_output: null,\n };\n }\n return parseBetaMessage(message, params, opts);\n}\nexport function parseBetaMessage(message, params, opts) {\n let firstParsedOutput = null;\n const content = message.content.map((block) => {\n if (block.type === 'text') {\n const parsedOutput = parseBetaOutputFormat(params, block.text);\n if (firstParsedOutput === null) {\n firstParsedOutput = parsedOutput;\n }\n const parsedBlock = Object.defineProperty({ ...block }, 'parsed_output', {\n value: parsedOutput,\n enumerable: false,\n });\n return Object.defineProperty(parsedBlock, 'parsed', {\n get() {\n opts.logger.warn('The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead.');\n return parsedOutput;\n },\n enumerable: false,\n });\n }\n return block;\n });\n return {\n ...message,\n content,\n parsed_output: firstParsedOutput,\n };\n}\nfunction parseBetaOutputFormat(params, content) {\n const outputFormat = getOutputFormat(params);\n if (outputFormat?.type !== 'json_schema') {\n return null;\n }\n try {\n if ('parse' in outputFormat) {\n return outputFormat.parse(content);\n }\n return JSON.parse(content);\n }\n catch (error) {\n throw new AnthropicError(`Failed to parse structured output: ${error}`);\n }\n}\n//# sourceMappingURL=beta-parser.mjs.map",
121
+ "const tokenize = (input) => {\n let current = 0;\n let tokens = [];\n while (current < input.length) {\n let char = input[current];\n if (char === '\\\\') {\n current++;\n continue;\n }\n if (char === '{') {\n tokens.push({\n type: 'brace',\n value: '{',\n });\n current++;\n continue;\n }\n if (char === '}') {\n tokens.push({\n type: 'brace',\n value: '}',\n });\n current++;\n continue;\n }\n if (char === '[') {\n tokens.push({\n type: 'paren',\n value: '[',\n });\n current++;\n continue;\n }\n if (char === ']') {\n tokens.push({\n type: 'paren',\n value: ']',\n });\n current++;\n continue;\n }\n if (char === ':') {\n tokens.push({\n type: 'separator',\n value: ':',\n });\n current++;\n continue;\n }\n if (char === ',') {\n tokens.push({\n type: 'delimiter',\n value: ',',\n });\n current++;\n continue;\n }\n if (char === '\"') {\n let value = '';\n let danglingQuote = false;\n char = input[++current];\n while (char !== '\"') {\n if (current === input.length) {\n danglingQuote = true;\n break;\n }\n if (char === '\\\\') {\n current++;\n if (current === input.length) {\n danglingQuote = true;\n break;\n }\n value += char + input[current];\n char = input[++current];\n }\n else {\n value += char;\n char = input[++current];\n }\n }\n char = input[++current];\n if (!danglingQuote) {\n tokens.push({\n type: 'string',\n value,\n });\n }\n continue;\n }\n let WHITESPACE = /\\s/;\n if (char && WHITESPACE.test(char)) {\n current++;\n continue;\n }\n let NUMBERS = /[0-9]/;\n if ((char && NUMBERS.test(char)) || char === '-' || char === '.') {\n let value = '';\n if (char === '-') {\n value += char;\n char = input[++current];\n }\n while ((char && NUMBERS.test(char)) || char === '.') {\n value += char;\n char = input[++current];\n }\n tokens.push({\n type: 'number',\n value,\n });\n continue;\n }\n let LETTERS = /[a-z]/i;\n if (char && LETTERS.test(char)) {\n let value = '';\n while (char && LETTERS.test(char)) {\n if (current === input.length) {\n break;\n }\n value += char;\n char = input[++current];\n }\n if (value == 'true' || value == 'false' || value === 'null') {\n tokens.push({\n type: 'name',\n value,\n });\n }\n else {\n // unknown token, e.g. `nul` which isn't quite `null`\n current++;\n continue;\n }\n continue;\n }\n current++;\n }\n return tokens;\n}, strip = (tokens) => {\n if (tokens.length === 0) {\n return tokens;\n }\n let lastToken = tokens[tokens.length - 1];\n switch (lastToken.type) {\n case 'separator':\n tokens = tokens.slice(0, tokens.length - 1);\n return strip(tokens);\n break;\n case 'number':\n let lastCharacterOfLastToken = lastToken.value[lastToken.value.length - 1];\n if (lastCharacterOfLastToken === '.' || lastCharacterOfLastToken === '-') {\n tokens = tokens.slice(0, tokens.length - 1);\n return strip(tokens);\n }\n case 'string':\n let tokenBeforeTheLastToken = tokens[tokens.length - 2];\n if (tokenBeforeTheLastToken?.type === 'delimiter') {\n tokens = tokens.slice(0, tokens.length - 1);\n return strip(tokens);\n }\n else if (tokenBeforeTheLastToken?.type === 'brace' && tokenBeforeTheLastToken.value === '{') {\n tokens = tokens.slice(0, tokens.length - 1);\n return strip(tokens);\n }\n break;\n case 'delimiter':\n tokens = tokens.slice(0, tokens.length - 1);\n return strip(tokens);\n break;\n }\n return tokens;\n}, unstrip = (tokens) => {\n let tail = [];\n tokens.map((token) => {\n if (token.type === 'brace') {\n if (token.value === '{') {\n tail.push('}');\n }\n else {\n tail.splice(tail.lastIndexOf('}'), 1);\n }\n }\n if (token.type === 'paren') {\n if (token.value === '[') {\n tail.push(']');\n }\n else {\n tail.splice(tail.lastIndexOf(']'), 1);\n }\n }\n });\n if (tail.length > 0) {\n tail.reverse().map((item) => {\n if (item === '}') {\n tokens.push({\n type: 'brace',\n value: '}',\n });\n }\n else if (item === ']') {\n tokens.push({\n type: 'paren',\n value: ']',\n });\n }\n });\n }\n return tokens;\n}, generate = (tokens) => {\n let output = '';\n tokens.map((token) => {\n switch (token.type) {\n case 'string':\n output += '\"' + token.value + '\"';\n break;\n default:\n output += token.value;\n break;\n }\n });\n return output;\n}, partialParse = (input) => JSON.parse(generate(unstrip(strip(tokenize(input)))));\nexport { partialParse };\n//# sourceMappingURL=parser.mjs.map",
122
+ "export * from \"./core/streaming.mjs\";\n//# sourceMappingURL=streaming.mjs.map",
123
+ "var _BetaMessageStream_instances, _BetaMessageStream_currentMessageSnapshot, _BetaMessageStream_params, _BetaMessageStream_connectedPromise, _BetaMessageStream_resolveConnectedPromise, _BetaMessageStream_rejectConnectedPromise, _BetaMessageStream_endPromise, _BetaMessageStream_resolveEndPromise, _BetaMessageStream_rejectEndPromise, _BetaMessageStream_listeners, _BetaMessageStream_ended, _BetaMessageStream_errored, _BetaMessageStream_aborted, _BetaMessageStream_catchingPromiseCreated, _BetaMessageStream_response, _BetaMessageStream_request_id, _BetaMessageStream_logger, _BetaMessageStream_getFinalMessage, _BetaMessageStream_getFinalText, _BetaMessageStream_handleError, _BetaMessageStream_beginRequest, _BetaMessageStream_addStreamEvent, _BetaMessageStream_endRequest, _BetaMessageStream_accumulateMessage;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../internal/tslib.mjs\";\nimport { partialParse } from \"../_vendor/partial-json-parser/parser.mjs\";\nimport { AnthropicError, APIUserAbortError } from \"../error.mjs\";\nimport { isAbortError } from \"../internal/errors.mjs\";\nimport { Stream } from \"../streaming.mjs\";\nimport { maybeParseBetaMessage } from \"./beta-parser.mjs\";\nconst JSON_BUF_PROPERTY = '__json_buf';\nfunction tracksToolInput(content) {\n return content.type === 'tool_use' || content.type === 'server_tool_use' || content.type === 'mcp_tool_use';\n}\nexport class BetaMessageStream {\n constructor(params, opts) {\n _BetaMessageStream_instances.add(this);\n this.messages = [];\n this.receivedMessages = [];\n _BetaMessageStream_currentMessageSnapshot.set(this, void 0);\n _BetaMessageStream_params.set(this, null);\n this.controller = new AbortController();\n _BetaMessageStream_connectedPromise.set(this, void 0);\n _BetaMessageStream_resolveConnectedPromise.set(this, () => { });\n _BetaMessageStream_rejectConnectedPromise.set(this, () => { });\n _BetaMessageStream_endPromise.set(this, void 0);\n _BetaMessageStream_resolveEndPromise.set(this, () => { });\n _BetaMessageStream_rejectEndPromise.set(this, () => { });\n _BetaMessageStream_listeners.set(this, {});\n _BetaMessageStream_ended.set(this, false);\n _BetaMessageStream_errored.set(this, false);\n _BetaMessageStream_aborted.set(this, false);\n _BetaMessageStream_catchingPromiseCreated.set(this, false);\n _BetaMessageStream_response.set(this, void 0);\n _BetaMessageStream_request_id.set(this, void 0);\n _BetaMessageStream_logger.set(this, void 0);\n _BetaMessageStream_handleError.set(this, (error) => {\n __classPrivateFieldSet(this, _BetaMessageStream_errored, true, \"f\");\n if (isAbortError(error)) {\n error = new APIUserAbortError();\n }\n if (error instanceof APIUserAbortError) {\n __classPrivateFieldSet(this, _BetaMessageStream_aborted, true, \"f\");\n return this._emit('abort', error);\n }\n if (error instanceof AnthropicError) {\n return this._emit('error', error);\n }\n if (error instanceof Error) {\n const anthropicError = new AnthropicError(error.message);\n // @ts-ignore\n anthropicError.cause = error;\n return this._emit('error', anthropicError);\n }\n return this._emit('error', new AnthropicError(String(error)));\n });\n __classPrivateFieldSet(this, _BetaMessageStream_connectedPromise, new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _BetaMessageStream_resolveConnectedPromise, resolve, \"f\");\n __classPrivateFieldSet(this, _BetaMessageStream_rejectConnectedPromise, reject, \"f\");\n }), \"f\");\n __classPrivateFieldSet(this, _BetaMessageStream_endPromise, new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _BetaMessageStream_resolveEndPromise, resolve, \"f\");\n __classPrivateFieldSet(this, _BetaMessageStream_rejectEndPromise, reject, \"f\");\n }), \"f\");\n // Don't let these promises cause unhandled rejection errors.\n // we will manually cause an unhandled rejection error later\n // if the user hasn't registered any error listener or called\n // any promise-returning method.\n __classPrivateFieldGet(this, _BetaMessageStream_connectedPromise, \"f\").catch(() => { });\n __classPrivateFieldGet(this, _BetaMessageStream_endPromise, \"f\").catch(() => { });\n __classPrivateFieldSet(this, _BetaMessageStream_params, params, \"f\");\n __classPrivateFieldSet(this, _BetaMessageStream_logger, opts?.logger ?? console, \"f\");\n }\n get response() {\n return __classPrivateFieldGet(this, _BetaMessageStream_response, \"f\");\n }\n get request_id() {\n return __classPrivateFieldGet(this, _BetaMessageStream_request_id, \"f\");\n }\n /**\n * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request,\n * returned vie the `request-id` header which is useful for debugging requests and resporting\n * issues to Anthropic.\n *\n * This is the same as the `APIPromise.withResponse()` method.\n *\n * This method will raise an error if you created the stream using `MessageStream.fromReadableStream`\n * as no `Response` is available.\n */\n async withResponse() {\n __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, \"f\");\n const response = await __classPrivateFieldGet(this, _BetaMessageStream_connectedPromise, \"f\");\n if (!response) {\n throw new Error('Could not resolve a `Response` object');\n }\n return {\n data: this,\n response,\n request_id: response.headers.get('request-id'),\n };\n }\n /**\n * Intended for use on the frontend, consuming a stream produced with\n * `.toReadableStream()` on the backend.\n *\n * Note that messages sent to the model do not appear in `.on('message')`\n * in this context.\n */\n static fromReadableStream(stream) {\n const runner = new BetaMessageStream(null);\n runner._run(() => runner._fromReadableStream(stream));\n return runner;\n }\n static createMessage(messages, params, options, { logger } = {}) {\n const runner = new BetaMessageStream(params, { logger });\n for (const message of params.messages) {\n runner._addMessageParam(message);\n }\n __classPrivateFieldSet(runner, _BetaMessageStream_params, { ...params, stream: true }, \"f\");\n runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, 'X-Stainless-Helper-Method': 'stream' } }));\n return runner;\n }\n _run(executor) {\n executor().then(() => {\n this._emitFinal();\n this._emit('end');\n }, __classPrivateFieldGet(this, _BetaMessageStream_handleError, \"f\"));\n }\n _addMessageParam(message) {\n this.messages.push(message);\n }\n _addMessage(message, emit = true) {\n this.receivedMessages.push(message);\n if (emit) {\n this._emit('message', message);\n }\n }\n async _createMessage(messages, params, options) {\n const signal = options?.signal;\n let abortHandler;\n if (signal) {\n if (signal.aborted)\n this.controller.abort();\n abortHandler = this.controller.abort.bind(this.controller);\n signal.addEventListener('abort', abortHandler);\n }\n try {\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_beginRequest).call(this);\n const { response, data: stream } = await messages\n .create({ ...params, stream: true }, { ...options, signal: this.controller.signal })\n .withResponse();\n this._connected(response);\n for await (const event of stream) {\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_addStreamEvent).call(this, event);\n }\n if (stream.controller.signal?.aborted) {\n throw new APIUserAbortError();\n }\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_endRequest).call(this);\n }\n finally {\n if (signal && abortHandler) {\n signal.removeEventListener('abort', abortHandler);\n }\n }\n }\n _connected(response) {\n if (this.ended)\n return;\n __classPrivateFieldSet(this, _BetaMessageStream_response, response, \"f\");\n __classPrivateFieldSet(this, _BetaMessageStream_request_id, response?.headers.get('request-id'), \"f\");\n __classPrivateFieldGet(this, _BetaMessageStream_resolveConnectedPromise, \"f\").call(this, response);\n this._emit('connect');\n }\n get ended() {\n return __classPrivateFieldGet(this, _BetaMessageStream_ended, \"f\");\n }\n get errored() {\n return __classPrivateFieldGet(this, _BetaMessageStream_errored, \"f\");\n }\n get aborted() {\n return __classPrivateFieldGet(this, _BetaMessageStream_aborted, \"f\");\n }\n abort() {\n this.controller.abort();\n }\n /**\n * Adds the listener function to the end of the listeners array for the event.\n * No checks are made to see if the listener has already been added. Multiple calls passing\n * the same combination of event and listener will result in the listener being added, and\n * called, multiple times.\n * @returns this MessageStream, so that calls can be chained\n */\n on(event, listener) {\n const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event] || (__classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event] = []);\n listeners.push({ listener });\n return this;\n }\n /**\n * Removes the specified listener from the listener array for the event.\n * off() will remove, at most, one instance of a listener from the listener array. If any single\n * listener has been added multiple times to the listener array for the specified event, then\n * off() must be called multiple times to remove each instance.\n * @returns this MessageStream, so that calls can be chained\n */\n off(event, listener) {\n const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event];\n if (!listeners)\n return this;\n const index = listeners.findIndex((l) => l.listener === listener);\n if (index >= 0)\n listeners.splice(index, 1);\n return this;\n }\n /**\n * Adds a one-time listener function for the event. The next time the event is triggered,\n * this listener is removed and then invoked.\n * @returns this MessageStream, so that calls can be chained\n */\n once(event, listener) {\n const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event] || (__classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event] = []);\n listeners.push({ listener, once: true });\n return this;\n }\n /**\n * This is similar to `.once()`, but returns a Promise that resolves the next time\n * the event is triggered, instead of calling a listener callback.\n * @returns a Promise that resolves the next time given event is triggered,\n * or rejects if an error is emitted. (If you request the 'error' event,\n * returns a promise that resolves with the error).\n *\n * Example:\n *\n * const message = await stream.emitted('message') // rejects if the stream errors\n */\n emitted(event) {\n return new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, \"f\");\n if (event !== 'error')\n this.once('error', reject);\n this.once(event, resolve);\n });\n }\n async done() {\n __classPrivateFieldSet(this, _BetaMessageStream_catchingPromiseCreated, true, \"f\");\n await __classPrivateFieldGet(this, _BetaMessageStream_endPromise, \"f\");\n }\n get currentMessage() {\n return __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, \"f\");\n }\n /**\n * @returns a promise that resolves with the the final assistant Message response,\n * or rejects if an error occurred or the stream ended prematurely without producing a Message.\n * If structured outputs were used, this will be a ParsedMessage with a `parsed` field.\n */\n async finalMessage() {\n await this.done();\n return __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_getFinalMessage).call(this);\n }\n /**\n * @returns a promise that resolves with the the final assistant Message's text response, concatenated\n * together if there are more than one text blocks.\n * Rejects if an error occurred or the stream ended prematurely without producing a Message.\n */\n async finalText() {\n await this.done();\n return __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_getFinalText).call(this);\n }\n _emit(event, ...args) {\n // make sure we don't emit any MessageStreamEvents after end\n if (__classPrivateFieldGet(this, _BetaMessageStream_ended, \"f\"))\n return;\n if (event === 'end') {\n __classPrivateFieldSet(this, _BetaMessageStream_ended, true, \"f\");\n __classPrivateFieldGet(this, _BetaMessageStream_resolveEndPromise, \"f\").call(this);\n }\n const listeners = __classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event];\n if (listeners) {\n __classPrivateFieldGet(this, _BetaMessageStream_listeners, \"f\")[event] = listeners.filter((l) => !l.once);\n listeners.forEach(({ listener }) => listener(...args));\n }\n if (event === 'abort') {\n const error = args[0];\n if (!__classPrivateFieldGet(this, _BetaMessageStream_catchingPromiseCreated, \"f\") && !listeners?.length) {\n Promise.reject(error);\n }\n __classPrivateFieldGet(this, _BetaMessageStream_rejectConnectedPromise, \"f\").call(this, error);\n __classPrivateFieldGet(this, _BetaMessageStream_rejectEndPromise, \"f\").call(this, error);\n this._emit('end');\n return;\n }\n if (event === 'error') {\n // NOTE: _emit('error', error) should only be called from #handleError().\n const error = args[0];\n if (!__classPrivateFieldGet(this, _BetaMessageStream_catchingPromiseCreated, \"f\") && !listeners?.length) {\n // Trigger an unhandled rejection if the user hasn't registered any error handlers.\n // If you are seeing stack traces here, make sure to handle errors via either:\n // - runner.on('error', () => ...)\n // - await runner.done()\n // - await runner.final...()\n // - etc.\n Promise.reject(error);\n }\n __classPrivateFieldGet(this, _BetaMessageStream_rejectConnectedPromise, \"f\").call(this, error);\n __classPrivateFieldGet(this, _BetaMessageStream_rejectEndPromise, \"f\").call(this, error);\n this._emit('end');\n }\n }\n _emitFinal() {\n const finalMessage = this.receivedMessages.at(-1);\n if (finalMessage) {\n this._emit('finalMessage', __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_getFinalMessage).call(this));\n }\n }\n async _fromReadableStream(readableStream, options) {\n const signal = options?.signal;\n let abortHandler;\n if (signal) {\n if (signal.aborted)\n this.controller.abort();\n abortHandler = this.controller.abort.bind(this.controller);\n signal.addEventListener('abort', abortHandler);\n }\n try {\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_beginRequest).call(this);\n this._connected(null);\n const stream = Stream.fromReadableStream(readableStream, this.controller);\n for await (const event of stream) {\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_addStreamEvent).call(this, event);\n }\n if (stream.controller.signal?.aborted) {\n throw new APIUserAbortError();\n }\n __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_endRequest).call(this);\n }\n finally {\n if (signal && abortHandler) {\n signal.removeEventListener('abort', abortHandler);\n }\n }\n }\n [(_BetaMessageStream_currentMessageSnapshot = new WeakMap(), _BetaMessageStream_params = new WeakMap(), _BetaMessageStream_connectedPromise = new WeakMap(), _BetaMessageStream_resolveConnectedPromise = new WeakMap(), _BetaMessageStream_rejectConnectedPromise = new WeakMap(), _BetaMessageStream_endPromise = new WeakMap(), _BetaMessageStream_resolveEndPromise = new WeakMap(), _BetaMessageStream_rejectEndPromise = new WeakMap(), _BetaMessageStream_listeners = new WeakMap(), _BetaMessageStream_ended = new WeakMap(), _BetaMessageStream_errored = new WeakMap(), _BetaMessageStream_aborted = new WeakMap(), _BetaMessageStream_catchingPromiseCreated = new WeakMap(), _BetaMessageStream_response = new WeakMap(), _BetaMessageStream_request_id = new WeakMap(), _BetaMessageStream_logger = new WeakMap(), _BetaMessageStream_handleError = new WeakMap(), _BetaMessageStream_instances = new WeakSet(), _BetaMessageStream_getFinalMessage = function _BetaMessageStream_getFinalMessage() {\n if (this.receivedMessages.length === 0) {\n throw new AnthropicError('stream ended without producing a Message with role=assistant');\n }\n return this.receivedMessages.at(-1);\n }, _BetaMessageStream_getFinalText = function _BetaMessageStream_getFinalText() {\n if (this.receivedMessages.length === 0) {\n throw new AnthropicError('stream ended without producing a Message with role=assistant');\n }\n const textBlocks = this.receivedMessages\n .at(-1)\n .content.filter((block) => block.type === 'text')\n .map((block) => block.text);\n if (textBlocks.length === 0) {\n throw new AnthropicError('stream ended without producing a content block with type=text');\n }\n return textBlocks.join(' ');\n }, _BetaMessageStream_beginRequest = function _BetaMessageStream_beginRequest() {\n if (this.ended)\n return;\n __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, undefined, \"f\");\n }, _BetaMessageStream_addStreamEvent = function _BetaMessageStream_addStreamEvent(event) {\n if (this.ended)\n return;\n const messageSnapshot = __classPrivateFieldGet(this, _BetaMessageStream_instances, \"m\", _BetaMessageStream_accumulateMessage).call(this, event);\n this._emit('streamEvent', event, messageSnapshot);\n switch (event.type) {\n case 'content_block_delta': {\n const content = messageSnapshot.content.at(-1);\n switch (event.delta.type) {\n case 'text_delta': {\n if (content.type === 'text') {\n this._emit('text', event.delta.text, content.text || '');\n }\n break;\n }\n case 'citations_delta': {\n if (content.type === 'text') {\n this._emit('citation', event.delta.citation, content.citations ?? []);\n }\n break;\n }\n case 'input_json_delta': {\n if (tracksToolInput(content) && content.input) {\n this._emit('inputJson', event.delta.partial_json, content.input);\n }\n break;\n }\n case 'thinking_delta': {\n if (content.type === 'thinking') {\n this._emit('thinking', event.delta.thinking, content.thinking);\n }\n break;\n }\n case 'signature_delta': {\n if (content.type === 'thinking') {\n this._emit('signature', content.signature);\n }\n break;\n }\n case 'compaction_delta': {\n if (content.type === 'compaction' && content.content) {\n this._emit('compaction', content.content);\n }\n break;\n }\n default:\n checkNever(event.delta);\n }\n break;\n }\n case 'message_stop': {\n this._addMessageParam(messageSnapshot);\n this._addMessage(maybeParseBetaMessage(messageSnapshot, __classPrivateFieldGet(this, _BetaMessageStream_params, \"f\"), { logger: __classPrivateFieldGet(this, _BetaMessageStream_logger, \"f\") }), true);\n break;\n }\n case 'content_block_stop': {\n this._emit('contentBlock', messageSnapshot.content.at(-1));\n break;\n }\n case 'message_start': {\n __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, messageSnapshot, \"f\");\n break;\n }\n case 'content_block_start':\n case 'message_delta':\n break;\n }\n }, _BetaMessageStream_endRequest = function _BetaMessageStream_endRequest() {\n if (this.ended) {\n throw new AnthropicError(`stream has ended, this shouldn't happen`);\n }\n const snapshot = __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, \"f\");\n if (!snapshot) {\n throw new AnthropicError(`request ended without sending any chunks`);\n }\n __classPrivateFieldSet(this, _BetaMessageStream_currentMessageSnapshot, undefined, \"f\");\n return maybeParseBetaMessage(snapshot, __classPrivateFieldGet(this, _BetaMessageStream_params, \"f\"), { logger: __classPrivateFieldGet(this, _BetaMessageStream_logger, \"f\") });\n }, _BetaMessageStream_accumulateMessage = function _BetaMessageStream_accumulateMessage(event) {\n let snapshot = __classPrivateFieldGet(this, _BetaMessageStream_currentMessageSnapshot, \"f\");\n if (event.type === 'message_start') {\n if (snapshot) {\n throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving \"message_stop\"`);\n }\n return event.message;\n }\n if (!snapshot) {\n throw new AnthropicError(`Unexpected event order, got ${event.type} before \"message_start\"`);\n }\n switch (event.type) {\n case 'message_stop':\n return snapshot;\n case 'message_delta':\n snapshot.container = event.delta.container;\n snapshot.stop_reason = event.delta.stop_reason;\n snapshot.stop_sequence = event.delta.stop_sequence;\n snapshot.usage.output_tokens = event.usage.output_tokens;\n snapshot.context_management = event.context_management;\n if (event.usage.input_tokens != null) {\n snapshot.usage.input_tokens = event.usage.input_tokens;\n }\n if (event.usage.cache_creation_input_tokens != null) {\n snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens;\n }\n if (event.usage.cache_read_input_tokens != null) {\n snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens;\n }\n if (event.usage.server_tool_use != null) {\n snapshot.usage.server_tool_use = event.usage.server_tool_use;\n }\n if (event.usage.iterations != null) {\n snapshot.usage.iterations = event.usage.iterations;\n }\n return snapshot;\n case 'content_block_start':\n snapshot.content.push(event.content_block);\n return snapshot;\n case 'content_block_delta': {\n const snapshotContent = snapshot.content.at(event.index);\n switch (event.delta.type) {\n case 'text_delta': {\n if (snapshotContent?.type === 'text') {\n snapshot.content[event.index] = {\n ...snapshotContent,\n text: (snapshotContent.text || '') + event.delta.text,\n };\n }\n break;\n }\n case 'citations_delta': {\n if (snapshotContent?.type === 'text') {\n snapshot.content[event.index] = {\n ...snapshotContent,\n citations: [...(snapshotContent.citations ?? []), event.delta.citation],\n };\n }\n break;\n }\n case 'input_json_delta': {\n if (snapshotContent && tracksToolInput(snapshotContent)) {\n // we need to keep track of the raw JSON string as well so that we can\n // re-parse it for each delta, for now we just store it as an untyped\n // non-enumerable property on the snapshot\n let jsonBuf = snapshotContent[JSON_BUF_PROPERTY] || '';\n jsonBuf += event.delta.partial_json;\n const newContent = { ...snapshotContent };\n Object.defineProperty(newContent, JSON_BUF_PROPERTY, {\n value: jsonBuf,\n enumerable: false,\n writable: true,\n });\n if (jsonBuf) {\n try {\n newContent.input = partialParse(jsonBuf);\n }\n catch (err) {\n const error = new AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${err}. JSON: ${jsonBuf}`);\n __classPrivateFieldGet(this, _BetaMessageStream_handleError, \"f\").call(this, error);\n }\n }\n snapshot.content[event.index] = newContent;\n }\n break;\n }\n case 'thinking_delta': {\n if (snapshotContent?.type === 'thinking') {\n snapshot.content[event.index] = {\n ...snapshotContent,\n thinking: snapshotContent.thinking + event.delta.thinking,\n };\n }\n break;\n }\n case 'signature_delta': {\n if (snapshotContent?.type === 'thinking') {\n snapshot.content[event.index] = {\n ...snapshotContent,\n signature: event.delta.signature,\n };\n }\n break;\n }\n case 'compaction_delta': {\n if (snapshotContent?.type === 'compaction') {\n snapshot.content[event.index] = {\n ...snapshotContent,\n content: (snapshotContent.content || '') + event.delta.content,\n };\n }\n break;\n }\n default:\n checkNever(event.delta);\n }\n return snapshot;\n }\n case 'content_block_stop':\n return snapshot;\n }\n }, Symbol.asyncIterator)]() {\n const pushQueue = [];\n const readQueue = [];\n let done = false;\n this.on('streamEvent', (event) => {\n const reader = readQueue.shift();\n if (reader) {\n reader.resolve(event);\n }\n else {\n pushQueue.push(event);\n }\n });\n this.on('end', () => {\n done = true;\n for (const reader of readQueue) {\n reader.resolve(undefined);\n }\n readQueue.length = 0;\n });\n this.on('abort', (err) => {\n done = true;\n for (const reader of readQueue) {\n reader.reject(err);\n }\n readQueue.length = 0;\n });\n this.on('error', (err) => {\n done = true;\n for (const reader of readQueue) {\n reader.reject(err);\n }\n readQueue.length = 0;\n });\n return {\n next: async () => {\n if (!pushQueue.length) {\n if (done) {\n return { value: undefined, done: true };\n }\n return new Promise((resolve, reject) => readQueue.push({ resolve, reject })).then((chunk) => (chunk ? { value: chunk, done: false } : { value: undefined, done: true }));\n }\n const chunk = pushQueue.shift();\n return { value: chunk, done: false };\n },\n return: async () => {\n this.abort();\n return { value: undefined, done: true };\n },\n };\n }\n toReadableStream() {\n const stream = new Stream(this[Symbol.asyncIterator].bind(this), this.controller);\n return stream.toReadableStream();\n }\n}\n// used to ensure exhaustive case matching without throwing a runtime error\nfunction checkNever(x) { }\n//# sourceMappingURL=BetaMessageStream.mjs.map",
124
+ "/**\n * An error that can be thrown from a tool's `run` method to return structured\n * content blocks as the error result, rather than just a string message.\n *\n * When the ToolRunner catches this error, it will use the `content` property\n * as the tool result with `is_error: true`.\n *\n * @example\n * ```ts\n * const tool = {\n * name: 'my_tool',\n * run: async (input) => {\n * if (somethingWentWrong) {\n * throw new ToolError([\n * { type: 'text', text: 'Error details here' },\n * { type: 'image', source: { type: 'base64', data: '...', media_type: 'image/png' } },\n * ]);\n * }\n * return 'success';\n * },\n * };\n * ```\n */\nexport class ToolError extends Error {\n constructor(content) {\n const message = typeof content === 'string' ? content : (content\n .map((block) => {\n if (block.type === 'text')\n return block.text;\n return `[${block.type}]`;\n })\n .join(' '));\n super(message);\n this.name = 'ToolError';\n this.content = content;\n }\n}\n//# sourceMappingURL=ToolError.mjs.map",
125
+ "export const DEFAULT_TOKEN_THRESHOLD = 100000;\nexport const DEFAULT_SUMMARY_PROMPT = `You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:\n1. Task Overview\nThe user's core request and success criteria\nAny clarifications or constraints they specified\n2. Current State\nWhat has been completed so far\nFiles created, modified, or analyzed (with paths if relevant)\nKey outputs or artifacts produced\n3. Important Discoveries\nTechnical constraints or requirements uncovered\nDecisions made and their rationale\nErrors encountered and how they were resolved\nWhat approaches were tried that didn't work (and why)\n4. Next Steps\nSpecific actions needed to complete the task\nAny blockers or open questions to resolve\nPriority order if multiple steps remain\n5. Context to Preserve\nUser preferences or style requirements\nDomain-specific details that aren't obvious\nAny promises made to the user\nBe concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.\nWrap your summary in <summary></summary> tags.`;\n//# sourceMappingURL=CompactionControl.mjs.map",
126
+ "var _BetaToolRunner_instances, _BetaToolRunner_consumed, _BetaToolRunner_mutated, _BetaToolRunner_state, _BetaToolRunner_options, _BetaToolRunner_message, _BetaToolRunner_toolResponse, _BetaToolRunner_completion, _BetaToolRunner_iterationCount, _BetaToolRunner_checkAndCompact, _BetaToolRunner_generateToolResponse;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../../internal/tslib.mjs\";\nimport { ToolError } from \"./ToolError.mjs\";\nimport { AnthropicError } from \"../../core/error.mjs\";\nimport { buildHeaders } from \"../../internal/headers.mjs\";\nimport { DEFAULT_SUMMARY_PROMPT, DEFAULT_TOKEN_THRESHOLD } from \"./CompactionControl.mjs\";\nimport { collectStainlessHelpers } from \"../stainless-helper-header.mjs\";\n/**\n * Just Promise.withResolvers(), which is not available in all environments.\n */\nfunction promiseWithResolvers() {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve: resolve, reject: reject };\n}\n/**\n * A ToolRunner handles the automatic conversation loop between the assistant and tools.\n *\n * A ToolRunner is an async iterable that yields either BetaMessage or BetaMessageStream objects\n * depending on the streaming configuration.\n */\nexport class BetaToolRunner {\n constructor(client, params, options) {\n _BetaToolRunner_instances.add(this);\n this.client = client;\n /** Whether the async iterator has been consumed */\n _BetaToolRunner_consumed.set(this, false);\n /** Whether parameters have been mutated since the last API call */\n _BetaToolRunner_mutated.set(this, false);\n /** Current state containing the request parameters */\n _BetaToolRunner_state.set(this, void 0);\n _BetaToolRunner_options.set(this, void 0);\n /** Promise for the last message received from the assistant */\n _BetaToolRunner_message.set(this, void 0);\n /** Cached tool response to avoid redundant executions */\n _BetaToolRunner_toolResponse.set(this, void 0);\n /** Promise resolvers for waiting on completion */\n _BetaToolRunner_completion.set(this, void 0);\n /** Number of iterations (API requests) made so far */\n _BetaToolRunner_iterationCount.set(this, 0);\n __classPrivateFieldSet(this, _BetaToolRunner_state, {\n params: {\n // You can't clone the entire params since there are functions as handlers.\n // You also don't really need to clone params.messages, but it probably will prevent a foot gun\n // somewhere.\n ...params,\n messages: structuredClone(params.messages),\n },\n }, \"f\");\n const helpers = collectStainlessHelpers(params.tools, params.messages);\n const helperValue = ['BetaToolRunner', ...helpers].join(', ');\n __classPrivateFieldSet(this, _BetaToolRunner_options, {\n ...options,\n headers: buildHeaders([{ 'x-stainless-helper': helperValue }, options?.headers]),\n }, \"f\");\n __classPrivateFieldSet(this, _BetaToolRunner_completion, promiseWithResolvers(), \"f\");\n if (params.compactionControl?.enabled) {\n console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. ' +\n 'Use server-side compaction instead by passing `edits: [{ type: \"compact_20260112\" }]` in the params passed to `toolRunner()`. ' +\n 'See https://platform.claude.com/docs/en/build-with-claude/compaction');\n }\n }\n async *[(_BetaToolRunner_consumed = new WeakMap(), _BetaToolRunner_mutated = new WeakMap(), _BetaToolRunner_state = new WeakMap(), _BetaToolRunner_options = new WeakMap(), _BetaToolRunner_message = new WeakMap(), _BetaToolRunner_toolResponse = new WeakMap(), _BetaToolRunner_completion = new WeakMap(), _BetaToolRunner_iterationCount = new WeakMap(), _BetaToolRunner_instances = new WeakSet(), _BetaToolRunner_checkAndCompact = async function _BetaToolRunner_checkAndCompact() {\n const compactionControl = __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params.compactionControl;\n if (!compactionControl || !compactionControl.enabled) {\n return false;\n }\n let tokensUsed = 0;\n if (__classPrivateFieldGet(this, _BetaToolRunner_message, \"f\") !== undefined) {\n try {\n const message = await __classPrivateFieldGet(this, _BetaToolRunner_message, \"f\");\n const totalInputTokens = message.usage.input_tokens +\n (message.usage.cache_creation_input_tokens ?? 0) +\n (message.usage.cache_read_input_tokens ?? 0);\n tokensUsed = totalInputTokens + message.usage.output_tokens;\n }\n catch {\n // If we can't get the message, skip compaction\n return false;\n }\n }\n const threshold = compactionControl.contextTokenThreshold ?? DEFAULT_TOKEN_THRESHOLD;\n if (tokensUsed < threshold) {\n return false;\n }\n const model = compactionControl.model ?? __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params.model;\n const summaryPrompt = compactionControl.summaryPrompt ?? DEFAULT_SUMMARY_PROMPT;\n const messages = __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params.messages;\n if (messages[messages.length - 1].role === 'assistant') {\n // Remove tool_use blocks from the last message to avoid 400 error\n // (tool_use requires tool_result, which we don't have yet)\n const lastMessage = messages[messages.length - 1];\n if (Array.isArray(lastMessage.content)) {\n const nonToolBlocks = lastMessage.content.filter((block) => block.type !== 'tool_use');\n if (nonToolBlocks.length === 0) {\n // If all blocks were tool_use, just remove the message entirely\n messages.pop();\n }\n else {\n lastMessage.content = nonToolBlocks;\n }\n }\n }\n const response = await this.client.beta.messages.create({\n model,\n messages: [\n ...messages,\n {\n role: 'user',\n content: [\n {\n type: 'text',\n text: summaryPrompt,\n },\n ],\n },\n ],\n max_tokens: __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params.max_tokens,\n }, {\n signal: __classPrivateFieldGet(this, _BetaToolRunner_options, \"f\").signal,\n headers: buildHeaders([__classPrivateFieldGet(this, _BetaToolRunner_options, \"f\").headers, { 'x-stainless-helper': 'compaction' }]),\n });\n if (response.content[0]?.type !== 'text') {\n throw new AnthropicError('Expected text response for compaction');\n }\n __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params.messages = [\n {\n role: 'user',\n content: response.content,\n },\n ];\n return true;\n }, Symbol.asyncIterator)]() {\n var _a;\n if (__classPrivateFieldGet(this, _BetaToolRunner_consumed, \"f\")) {\n throw new AnthropicError('Cannot iterate over a consumed stream');\n }\n __classPrivateFieldSet(this, _BetaToolRunner_consumed, true, \"f\");\n __classPrivateFieldSet(this, _BetaToolRunner_mutated, true, \"f\");\n __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, undefined, \"f\");\n try {\n while (true) {\n let stream;\n try {\n if (__classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params.max_iterations &&\n __classPrivateFieldGet(this, _BetaToolRunner_iterationCount, \"f\") >= __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params.max_iterations) {\n break;\n }\n __classPrivateFieldSet(this, _BetaToolRunner_mutated, false, \"f\");\n __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, undefined, \"f\");\n __classPrivateFieldSet(this, _BetaToolRunner_iterationCount, (_a = __classPrivateFieldGet(this, _BetaToolRunner_iterationCount, \"f\"), _a++, _a), \"f\");\n __classPrivateFieldSet(this, _BetaToolRunner_message, undefined, \"f\");\n const { max_iterations, compactionControl, ...params } = __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params;\n if (params.stream) {\n stream = this.client.beta.messages.stream({ ...params }, __classPrivateFieldGet(this, _BetaToolRunner_options, \"f\"));\n __classPrivateFieldSet(this, _BetaToolRunner_message, stream.finalMessage(), \"f\");\n // Make sure that this promise doesn't throw before we get the option to do something about it.\n // Error will be caught when we call await this.#message ultimately\n __classPrivateFieldGet(this, _BetaToolRunner_message, \"f\").catch(() => { });\n yield stream;\n }\n else {\n __classPrivateFieldSet(this, _BetaToolRunner_message, this.client.beta.messages.create({ ...params, stream: false }, __classPrivateFieldGet(this, _BetaToolRunner_options, \"f\")), \"f\");\n yield __classPrivateFieldGet(this, _BetaToolRunner_message, \"f\");\n }\n const isCompacted = await __classPrivateFieldGet(this, _BetaToolRunner_instances, \"m\", _BetaToolRunner_checkAndCompact).call(this);\n if (!isCompacted) {\n if (!__classPrivateFieldGet(this, _BetaToolRunner_mutated, \"f\")) {\n const { role, content } = await __classPrivateFieldGet(this, _BetaToolRunner_message, \"f\");\n __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params.messages.push({ role, content });\n }\n const toolMessage = await __classPrivateFieldGet(this, _BetaToolRunner_instances, \"m\", _BetaToolRunner_generateToolResponse).call(this, __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params.messages.at(-1));\n if (toolMessage) {\n __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params.messages.push(toolMessage);\n }\n else if (!__classPrivateFieldGet(this, _BetaToolRunner_mutated, \"f\")) {\n break;\n }\n }\n }\n finally {\n if (stream) {\n stream.abort();\n }\n }\n }\n if (!__classPrivateFieldGet(this, _BetaToolRunner_message, \"f\")) {\n throw new AnthropicError('ToolRunner concluded without a message from the server');\n }\n __classPrivateFieldGet(this, _BetaToolRunner_completion, \"f\").resolve(await __classPrivateFieldGet(this, _BetaToolRunner_message, \"f\"));\n }\n catch (error) {\n __classPrivateFieldSet(this, _BetaToolRunner_consumed, false, \"f\");\n // Silence unhandled promise errors\n __classPrivateFieldGet(this, _BetaToolRunner_completion, \"f\").promise.catch(() => { });\n __classPrivateFieldGet(this, _BetaToolRunner_completion, \"f\").reject(error);\n __classPrivateFieldSet(this, _BetaToolRunner_completion, promiseWithResolvers(), \"f\");\n throw error;\n }\n }\n setMessagesParams(paramsOrMutator) {\n if (typeof paramsOrMutator === 'function') {\n __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params = paramsOrMutator(__classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params);\n }\n else {\n __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params = paramsOrMutator;\n }\n __classPrivateFieldSet(this, _BetaToolRunner_mutated, true, \"f\");\n // Invalidate cached tool response since parameters changed\n __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, undefined, \"f\");\n }\n setRequestOptions(optionsOrMutator) {\n if (typeof optionsOrMutator === 'function') {\n __classPrivateFieldSet(this, _BetaToolRunner_options, optionsOrMutator(__classPrivateFieldGet(this, _BetaToolRunner_options, \"f\")), \"f\");\n }\n else {\n __classPrivateFieldSet(this, _BetaToolRunner_options, { ...__classPrivateFieldGet(this, _BetaToolRunner_options, \"f\"), ...optionsOrMutator }, \"f\");\n }\n }\n /**\n * Get the tool response for the last message from the assistant.\n * Avoids redundant tool executions by caching results.\n *\n * @returns A promise that resolves to a BetaMessageParam containing tool results, or null if no tools need to be executed\n *\n * @example\n * const toolResponse = await runner.generateToolResponse();\n * if (toolResponse) {\n * console.log('Tool results:', toolResponse.content);\n * }\n */\n async generateToolResponse(signal = __classPrivateFieldGet(this, _BetaToolRunner_options, \"f\").signal) {\n const message = (await __classPrivateFieldGet(this, _BetaToolRunner_message, \"f\")) ?? this.params.messages.at(-1);\n if (!message) {\n return null;\n }\n return __classPrivateFieldGet(this, _BetaToolRunner_instances, \"m\", _BetaToolRunner_generateToolResponse).call(this, message, signal);\n }\n /**\n * Wait for the async iterator to complete. This works even if the async iterator hasn't yet started, and\n * will wait for an instance to start and go to completion.\n *\n * @returns A promise that resolves to the final BetaMessage when the iterator completes\n *\n * @example\n * // Start consuming the iterator\n * for await (const message of runner) {\n * console.log('Message:', message.content);\n * }\n *\n * // Meanwhile, wait for completion from another part of the code\n * const finalMessage = await runner.done();\n * console.log('Final response:', finalMessage.content);\n */\n done() {\n return __classPrivateFieldGet(this, _BetaToolRunner_completion, \"f\").promise;\n }\n /**\n * Returns a promise indicating that the stream is done. Unlike .done(), this will eagerly read the stream:\n * * If the iterator has not been consumed, consume the entire iterator and return the final message from the\n * assistant.\n * * If the iterator has been consumed, waits for it to complete and returns the final message.\n *\n * @returns A promise that resolves to the final BetaMessage from the conversation\n * @throws {AnthropicError} If no messages were processed during the conversation\n *\n * @example\n * const finalMessage = await runner.runUntilDone();\n * console.log('Final response:', finalMessage.content);\n */\n async runUntilDone() {\n // If not yet consumed, start consuming and wait for completion\n if (!__classPrivateFieldGet(this, _BetaToolRunner_consumed, \"f\")) {\n for await (const _ of this) {\n // Iterator naturally populates this.#message\n }\n }\n // If consumed but not completed, wait for completion\n return this.done();\n }\n /**\n * Get the current parameters being used by the ToolRunner.\n *\n * @returns A readonly view of the current ToolRunnerParams\n *\n * @example\n * const currentParams = runner.params;\n * console.log('Current model:', currentParams.model);\n * console.log('Message count:', currentParams.messages.length);\n */\n get params() {\n return __classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params;\n }\n /**\n * Add one or more messages to the conversation history.\n *\n * @param messages - One or more BetaMessageParam objects to add to the conversation\n *\n * @example\n * runner.pushMessages(\n * { role: 'user', content: 'Also, what about the weather in NYC?' }\n * );\n *\n * @example\n * // Adding multiple messages\n * runner.pushMessages(\n * { role: 'user', content: 'What about NYC?' },\n * { role: 'user', content: 'And Boston?' }\n * );\n */\n pushMessages(...messages) {\n this.setMessagesParams((params) => ({\n ...params,\n messages: [...params.messages, ...messages],\n }));\n }\n /**\n * Makes the ToolRunner directly awaitable, equivalent to calling .runUntilDone()\n * This allows using `await runner` instead of `await runner.runUntilDone()`\n */\n then(onfulfilled, onrejected) {\n return this.runUntilDone().then(onfulfilled, onrejected);\n }\n}\n_BetaToolRunner_generateToolResponse = async function _BetaToolRunner_generateToolResponse(lastMessage, signal = __classPrivateFieldGet(this, _BetaToolRunner_options, \"f\").signal) {\n if (__classPrivateFieldGet(this, _BetaToolRunner_toolResponse, \"f\") !== undefined) {\n return __classPrivateFieldGet(this, _BetaToolRunner_toolResponse, \"f\");\n }\n __classPrivateFieldSet(this, _BetaToolRunner_toolResponse, generateToolResponse(__classPrivateFieldGet(this, _BetaToolRunner_state, \"f\").params, lastMessage, {\n ...__classPrivateFieldGet(this, _BetaToolRunner_options, \"f\"),\n signal,\n }), \"f\");\n return __classPrivateFieldGet(this, _BetaToolRunner_toolResponse, \"f\");\n};\nasync function generateToolResponse(params, lastMessage = params.messages.at(-1), requestOptions) {\n // Only process if the last message is from the assistant and has tool use blocks\n if (!lastMessage ||\n lastMessage.role !== 'assistant' ||\n !lastMessage.content ||\n typeof lastMessage.content === 'string') {\n return null;\n }\n const toolUseBlocks = lastMessage.content.filter((content) => content.type === 'tool_use');\n if (toolUseBlocks.length === 0) {\n return null;\n }\n const toolResults = await Promise.all(toolUseBlocks.map(async (toolUse) => {\n const tool = params.tools.find((t) => ('name' in t ? t.name : t.mcp_server_name) === toolUse.name);\n if (!tool || !('run' in tool)) {\n return {\n type: 'tool_result',\n tool_use_id: toolUse.id,\n content: `Error: Tool '${toolUse.name}' not found`,\n is_error: true,\n };\n }\n try {\n let input = toolUse.input;\n if ('parse' in tool && tool.parse) {\n input = tool.parse(input);\n }\n const result = await tool.run(input, {\n toolUseBlock: toolUse,\n signal: requestOptions?.signal,\n });\n return {\n type: 'tool_result',\n tool_use_id: toolUse.id,\n content: result,\n };\n }\n catch (error) {\n return {\n type: 'tool_result',\n tool_use_id: toolUse.id,\n content: error instanceof ToolError ?\n error.content\n : `Error: ${error instanceof Error ? error.message : String(error)}`,\n is_error: true,\n };\n }\n }));\n return {\n role: 'user',\n content: toolResults,\n };\n}\n//# sourceMappingURL=BetaToolRunner.mjs.map",
127
+ "import { AnthropicError } from \"../../core/error.mjs\";\nimport { ReadableStreamToAsyncIterable } from \"../shims.mjs\";\nimport { LineDecoder } from \"./line.mjs\";\nexport class JSONLDecoder {\n constructor(iterator, controller) {\n this.iterator = iterator;\n this.controller = controller;\n }\n async *decoder() {\n const lineDecoder = new LineDecoder();\n for await (const chunk of this.iterator) {\n for (const line of lineDecoder.decode(chunk)) {\n yield JSON.parse(line);\n }\n }\n for (const line of lineDecoder.flush()) {\n yield JSON.parse(line);\n }\n }\n [Symbol.asyncIterator]() {\n return this.decoder();\n }\n static fromResponse(response, controller) {\n if (!response.body) {\n controller.abort();\n if (typeof globalThis.navigator !== 'undefined' &&\n globalThis.navigator.product === 'ReactNative') {\n throw new AnthropicError(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`);\n }\n throw new AnthropicError(`Attempted to iterate over a response with no body`);\n }\n return new JSONLDecoder(ReadableStreamToAsyncIterable(response.body), controller);\n }\n}\n//# sourceMappingURL=jsonl.mjs.map",
128
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport { Page } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { JSONLDecoder } from \"../../../internal/decoders/jsonl.mjs\";\nimport { AnthropicError } from \"../../../error.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Batches extends APIResource {\n /**\n * Send a batch of Message creation requests.\n *\n * The Message Batches API can be used to process multiple Messages API requests at\n * once. Once a Message Batch is created, it begins processing immediately. Batches\n * can take up to 24 hours to complete.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const betaMessageBatch =\n * await client.beta.messages.batches.create({\n * requests: [\n * {\n * custom_id: 'my-custom-id-1',\n * params: {\n * max_tokens: 1024,\n * messages: [\n * { content: 'Hello, world', role: 'user' },\n * ],\n * model: 'claude-opus-4-6',\n * },\n * },\n * ],\n * });\n * ```\n */\n create(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/messages/batches?beta=true', {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * This endpoint is idempotent and can be used to poll for Message Batch\n * completion. To access the results of a Message Batch, make a request to the\n * `results_url` field in the response.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const betaMessageBatch =\n * await client.beta.messages.batches.retrieve(\n * 'message_batch_id',\n * );\n * ```\n */\n retrieve(messageBatchID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/messages/batches/${messageBatchID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List all Message Batches within a Workspace. Most recently created batches are\n * returned first.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaMessageBatch of client.beta.messages.batches.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/messages/batches?beta=true', (Page), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete a Message Batch.\n *\n * Message Batches can only be deleted once they've finished processing. If you'd\n * like to delete an in-progress batch, you must first cancel it.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const betaDeletedMessageBatch =\n * await client.beta.messages.batches.delete(\n * 'message_batch_id',\n * );\n * ```\n */\n delete(messageBatchID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.delete(path `/v1/messages/batches/${messageBatchID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Batches may be canceled any time before processing ends. Once cancellation is\n * initiated, the batch enters a `canceling` state, at which time the system may\n * complete any in-progress, non-interruptible requests before finalizing\n * cancellation.\n *\n * The number of canceled requests is specified in `request_counts`. To determine\n * which requests were canceled, check the individual results within the batch.\n * Note that cancellation may not result in any canceled requests if they were\n * non-interruptible.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const betaMessageBatch =\n * await client.beta.messages.batches.cancel(\n * 'message_batch_id',\n * );\n * ```\n */\n cancel(messageBatchID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.post(path `/v1/messages/batches/${messageBatchID}/cancel?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Streams the results of a Message Batch as a `.jsonl` file.\n *\n * Each line in the file is a JSON object containing the result of a single request\n * in the Message Batch. Results are not guaranteed to be in the same order as\n * requests. Use the `custom_id` field to match results to requests.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const betaMessageBatchIndividualResponse =\n * await client.beta.messages.batches.results(\n * 'message_batch_id',\n * );\n * ```\n */\n async results(messageBatchID, params = {}, options) {\n const batch = await this.retrieve(messageBatchID);\n if (!batch.results_url) {\n throw new AnthropicError(`No batch \\`results_url\\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`);\n }\n const { betas } = params ?? {};\n return this._client\n .get(batch.results_url, {\n ...options,\n headers: buildHeaders([\n {\n 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),\n Accept: 'application/binary',\n },\n options?.headers,\n ]),\n stream: true,\n __binaryResponse: true,\n })\n ._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));\n }\n}\n//# sourceMappingURL=batches.mjs.map",
129
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { AnthropicError } from \"../../../error.mjs\";\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport { MODEL_NONSTREAMING_TOKENS } from \"../../../internal/constants.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { stainlessHelperHeader } from \"../../../lib/stainless-helper-header.mjs\";\nimport { parseBetaMessage, } from \"../../../lib/beta-parser.mjs\";\nimport { BetaMessageStream } from \"../../../lib/BetaMessageStream.mjs\";\nimport { BetaToolRunner, } from \"../../../lib/tools/BetaToolRunner.mjs\";\nimport { ToolError } from \"../../../lib/tools/ToolError.mjs\";\nimport * as BatchesAPI from \"./batches.mjs\";\nimport { Batches, } from \"./batches.mjs\";\nconst DEPRECATED_MODELS = {\n 'claude-1.3': 'November 6th, 2024',\n 'claude-1.3-100k': 'November 6th, 2024',\n 'claude-instant-1.1': 'November 6th, 2024',\n 'claude-instant-1.1-100k': 'November 6th, 2024',\n 'claude-instant-1.2': 'November 6th, 2024',\n 'claude-3-sonnet-20240229': 'July 21st, 2025',\n 'claude-3-opus-20240229': 'January 5th, 2026',\n 'claude-2.1': 'July 21st, 2025',\n 'claude-2.0': 'July 21st, 2025',\n 'claude-3-7-sonnet-latest': 'February 19th, 2026',\n 'claude-3-7-sonnet-20250219': 'February 19th, 2026',\n};\nconst MODELS_TO_WARN_WITH_THINKING_ENABLED = ['claude-mythos-preview', 'claude-opus-4-6'];\nexport class Messages extends APIResource {\n constructor() {\n super(...arguments);\n this.batches = new BatchesAPI.Batches(this._client);\n }\n create(params, options) {\n // Transform deprecated output_format to output_config.format\n const modifiedParams = transformOutputFormat(params);\n const { betas, ...body } = modifiedParams;\n if (body.model in DEPRECATED_MODELS) {\n console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]}\\nPlease migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);\n }\n if (MODELS_TO_WARN_WITH_THINKING_ENABLED.includes(body.model) &&\n body.thinking &&\n body.thinking.type === 'enabled') {\n console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);\n }\n let timeout = this._client._options.timeout;\n if (!body.stream && timeout == null) {\n const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? undefined;\n timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens);\n }\n // Collect helper info from tools and messages\n const helperHeader = stainlessHelperHeader(body.tools, body.messages);\n return this._client.post('/v1/messages?beta=true', {\n body,\n timeout: timeout ?? 600000,\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n helperHeader,\n options?.headers,\n ]),\n stream: modifiedParams.stream ?? false,\n });\n }\n /**\n * Send a structured list of input messages with text and/or image content, along with an expected `output_format` and\n * the response will be automatically parsed and available in the `parsed_output` property of the message.\n *\n * @example\n * ```ts\n * const message = await client.beta.messages.parse({\n * model: 'claude-3-5-sonnet-20241022',\n * max_tokens: 1024,\n * messages: [{ role: 'user', content: 'What is 2+2?' }],\n * output_format: zodOutputFormat(z.object({ answer: z.number() }), 'math'),\n * });\n *\n * console.log(message.parsed_output?.answer); // 4\n * ```\n */\n parse(params, options) {\n options = {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(params.betas ?? []), 'structured-outputs-2025-12-15'].toString() },\n options?.headers,\n ]),\n };\n return this.create(params, options).then((message) => parseBetaMessage(message, params, { logger: this._client.logger ?? console }));\n }\n /**\n * Create a Message stream\n */\n stream(body, options) {\n return BetaMessageStream.createMessage(this, body, options);\n }\n /**\n * Count the number of tokens in a Message.\n *\n * The Token Count API can be used to count the number of tokens in a Message,\n * including tools, images, and documents, without creating it.\n *\n * Learn more about token counting in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)\n *\n * @example\n * ```ts\n * const betaMessageTokensCount =\n * await client.beta.messages.countTokens({\n * messages: [{ content: 'Hello, world', role: 'user' }],\n * model: 'claude-opus-4-6',\n * });\n * ```\n */\n countTokens(params, options) {\n // Transform deprecated output_format to output_config.format\n const modifiedParams = transformOutputFormat(params);\n const { betas, ...body } = modifiedParams;\n return this._client.post('/v1/messages/count_tokens?beta=true', {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'token-counting-2024-11-01'].toString() },\n options?.headers,\n ]),\n });\n }\n toolRunner(body, options) {\n return new BetaToolRunner(this._client, body, options);\n }\n}\n/**\n * Transform deprecated output_format to output_config.format\n * Returns a modified copy of the params without mutating the original\n */\nfunction transformOutputFormat(params) {\n if (!params.output_format) {\n return params;\n }\n if (params.output_config?.format) {\n throw new AnthropicError('Both output_format and output_config.format were provided. ' +\n 'Please use only output_config.format (output_format is deprecated).');\n }\n const { output_format, ...rest } = params;\n return {\n ...rest,\n output_config: {\n ...params.output_config,\n format: output_format,\n },\n };\n}\nexport { BetaToolRunner } from \"../../../lib/tools/BetaToolRunner.mjs\";\nexport { ToolError } from \"../../../lib/tools/ToolError.mjs\";\nMessages.Batches = Batches;\nMessages.BetaToolRunner = BetaToolRunner;\nMessages.ToolError = ToolError;\n//# sourceMappingURL=messages.mjs.map",
130
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Events extends APIResource {\n /**\n * List Events\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaManagedAgentsSessionEvent of client.beta.sessions.events.list(\n * 'sesn_011CZkZAtmR3yMPDzynEDxu7',\n * )) {\n * // ...\n * }\n * ```\n */\n list(sessionID, params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList(path `/v1/sessions/${sessionID}/events?beta=true`, (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Send Events\n *\n * @example\n * ```ts\n * const betaManagedAgentsSendSessionEvents =\n * await client.beta.sessions.events.send(\n * 'sesn_011CZkZAtmR3yMPDzynEDxu7',\n * {\n * events: [\n * {\n * content: [\n * {\n * text: 'Where is my order #1234?',\n * type: 'text',\n * },\n * ],\n * type: 'user.message',\n * },\n * ],\n * },\n * );\n * ```\n */\n send(sessionID, params, options) {\n const { betas, ...body } = params;\n return this._client.post(path `/v1/sessions/${sessionID}/events?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Stream Events\n *\n * @example\n * ```ts\n * const betaManagedAgentsStreamSessionEvents =\n * await client.beta.sessions.events.stream(\n * 'sesn_011CZkZAtmR3yMPDzynEDxu7',\n * );\n * ```\n */\n stream(sessionID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/sessions/${sessionID}/events/stream?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n stream: true,\n });\n }\n}\n//# sourceMappingURL=events.mjs.map",
131
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Resources extends APIResource {\n /**\n * Get Session Resource\n *\n * @example\n * ```ts\n * const resource =\n * await client.beta.sessions.resources.retrieve(\n * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht',\n * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' },\n * );\n * ```\n */\n retrieve(resourceID, params, options) {\n const { session_id, betas } = params;\n return this._client.get(path `/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Update Session Resource\n *\n * @example\n * ```ts\n * const resource =\n * await client.beta.sessions.resources.update(\n * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht',\n * {\n * session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7',\n * authorization_token: 'ghp_exampletoken',\n * },\n * );\n * ```\n */\n update(resourceID, params, options) {\n const { session_id, betas, ...body } = params;\n return this._client.post(path `/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List Session Resources\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaManagedAgentsSessionResource of client.beta.sessions.resources.list(\n * 'sesn_011CZkZAtmR3yMPDzynEDxu7',\n * )) {\n * // ...\n * }\n * ```\n */\n list(sessionID, params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList(path `/v1/sessions/${sessionID}/resources?beta=true`, (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete Session Resource\n *\n * @example\n * ```ts\n * const betaManagedAgentsDeleteSessionResource =\n * await client.beta.sessions.resources.delete(\n * 'sesrsc_011CZkZBJq5dWxk9fVLNcPht',\n * { session_id: 'sesn_011CZkZAtmR3yMPDzynEDxu7' },\n * );\n * ```\n */\n delete(resourceID, params, options) {\n const { session_id, betas } = params;\n return this._client.delete(path `/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Add Session Resource\n *\n * @example\n * ```ts\n * const betaManagedAgentsFileResource =\n * await client.beta.sessions.resources.add(\n * 'sesn_011CZkZAtmR3yMPDzynEDxu7',\n * {\n * file_id: 'file_011CNha8iCJcU1wXNR6q4V8w',\n * type: 'file',\n * },\n * );\n * ```\n */\n add(sessionID, params, options) {\n const { betas, ...body } = params;\n return this._client.post(path `/v1/sessions/${sessionID}/resources?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=resources.mjs.map",
132
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport * as EventsAPI from \"./events.mjs\";\nimport { Events, } from \"./events.mjs\";\nimport * as ResourcesAPI from \"./resources.mjs\";\nimport { Resources, } from \"./resources.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Sessions extends APIResource {\n constructor() {\n super(...arguments);\n this.events = new EventsAPI.Events(this._client);\n this.resources = new ResourcesAPI.Resources(this._client);\n }\n /**\n * Create Session\n *\n * @example\n * ```ts\n * const betaManagedAgentsSession =\n * await client.beta.sessions.create({\n * agent: 'agent_011CZkYpogX7uDKUyvBTophP',\n * environment_id: 'env_011CZkZ9X2dpNyB7HsEFoRfW',\n * });\n * ```\n */\n create(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/sessions?beta=true', {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Get Session\n *\n * @example\n * ```ts\n * const betaManagedAgentsSession =\n * await client.beta.sessions.retrieve(\n * 'sesn_011CZkZAtmR3yMPDzynEDxu7',\n * );\n * ```\n */\n retrieve(sessionID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/sessions/${sessionID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Update Session\n *\n * @example\n * ```ts\n * const betaManagedAgentsSession =\n * await client.beta.sessions.update(\n * 'sesn_011CZkZAtmR3yMPDzynEDxu7',\n * );\n * ```\n */\n update(sessionID, params, options) {\n const { betas, ...body } = params;\n return this._client.post(path `/v1/sessions/${sessionID}?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List Sessions\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaManagedAgentsSession of client.beta.sessions.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/sessions?beta=true', (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete Session\n *\n * @example\n * ```ts\n * const betaManagedAgentsDeletedSession =\n * await client.beta.sessions.delete(\n * 'sesn_011CZkZAtmR3yMPDzynEDxu7',\n * );\n * ```\n */\n delete(sessionID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.delete(path `/v1/sessions/${sessionID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Archive Session\n *\n * @example\n * ```ts\n * const betaManagedAgentsSession =\n * await client.beta.sessions.archive(\n * 'sesn_011CZkZAtmR3yMPDzynEDxu7',\n * );\n * ```\n */\n archive(sessionID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.post(path `/v1/sessions/${sessionID}/archive?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\nSessions.Events = Events;\nSessions.Resources = Resources;\n//# sourceMappingURL=sessions.mjs.map",
133
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { multipartFormRequestOptions } from \"../../../internal/uploads.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Versions extends APIResource {\n /**\n * Create Skill Version\n *\n * @example\n * ```ts\n * const version = await client.beta.skills.versions.create(\n * 'skill_id',\n * );\n * ```\n */\n create(skillID, params = {}, options) {\n const { betas, ...body } = params ?? {};\n return this._client.post(path `/v1/skills/${skillID}/versions?beta=true`, multipartFormRequestOptions({\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },\n options?.headers,\n ]),\n }, this._client));\n }\n /**\n * Get Skill Version\n *\n * @example\n * ```ts\n * const version = await client.beta.skills.versions.retrieve(\n * 'version',\n * { skill_id: 'skill_id' },\n * );\n * ```\n */\n retrieve(version, params, options) {\n const { skill_id, betas } = params;\n return this._client.get(path `/v1/skills/${skill_id}/versions/${version}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List Skill Versions\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const versionListResponse of client.beta.skills.versions.list(\n * 'skill_id',\n * )) {\n * // ...\n * }\n * ```\n */\n list(skillID, params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList(path `/v1/skills/${skillID}/versions?beta=true`, (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete Skill Version\n *\n * @example\n * ```ts\n * const version = await client.beta.skills.versions.delete(\n * 'version',\n * { skill_id: 'skill_id' },\n * );\n * ```\n */\n delete(version, params, options) {\n const { skill_id, betas } = params;\n return this._client.delete(path `/v1/skills/${skill_id}/versions/${version}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=versions.mjs.map",
134
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport * as VersionsAPI from \"./versions.mjs\";\nimport { Versions, } from \"./versions.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { multipartFormRequestOptions } from \"../../../internal/uploads.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Skills extends APIResource {\n constructor() {\n super(...arguments);\n this.versions = new VersionsAPI.Versions(this._client);\n }\n /**\n * Create Skill\n *\n * @example\n * ```ts\n * const skill = await client.beta.skills.create();\n * ```\n */\n create(params = {}, options) {\n const { betas, ...body } = params ?? {};\n return this._client.post('/v1/skills?beta=true', multipartFormRequestOptions({\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },\n options?.headers,\n ]),\n }, this._client, false));\n }\n /**\n * Get Skill\n *\n * @example\n * ```ts\n * const skill = await client.beta.skills.retrieve('skill_id');\n * ```\n */\n retrieve(skillID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/skills/${skillID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List Skills\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const skillListResponse of client.beta.skills.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/skills?beta=true', (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete Skill\n *\n * @example\n * ```ts\n * const skill = await client.beta.skills.delete('skill_id');\n * ```\n */\n delete(skillID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.delete(path `/v1/skills/${skillID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },\n options?.headers,\n ]),\n });\n }\n}\nSkills.Versions = Versions;\n//# sourceMappingURL=skills.mjs.map",
135
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Credentials extends APIResource {\n /**\n * Create Credential\n *\n * @example\n * ```ts\n * const betaManagedAgentsCredential =\n * await client.beta.vaults.credentials.create(\n * 'vlt_011CZkZDLs7fYzm1hXNPeRjv',\n * {\n * auth: {\n * token: 'bearer_exampletoken',\n * mcp_server_url:\n * 'https://example-server.modelcontextprotocol.io/sse',\n * type: 'static_bearer',\n * },\n * },\n * );\n * ```\n */\n create(vaultID, params, options) {\n const { betas, ...body } = params;\n return this._client.post(path `/v1/vaults/${vaultID}/credentials?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Get Credential\n *\n * @example\n * ```ts\n * const betaManagedAgentsCredential =\n * await client.beta.vaults.credentials.retrieve(\n * 'vcrd_011CZkZEMt8gZan2iYOQfSkw',\n * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' },\n * );\n * ```\n */\n retrieve(credentialID, params, options) {\n const { vault_id, betas } = params;\n return this._client.get(path `/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Update Credential\n *\n * @example\n * ```ts\n * const betaManagedAgentsCredential =\n * await client.beta.vaults.credentials.update(\n * 'vcrd_011CZkZEMt8gZan2iYOQfSkw',\n * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' },\n * );\n * ```\n */\n update(credentialID, params, options) {\n const { vault_id, betas, ...body } = params;\n return this._client.post(path `/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List Credentials\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaManagedAgentsCredential of client.beta.vaults.credentials.list(\n * 'vlt_011CZkZDLs7fYzm1hXNPeRjv',\n * )) {\n * // ...\n * }\n * ```\n */\n list(vaultID, params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList(path `/v1/vaults/${vaultID}/credentials?beta=true`, (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete Credential\n *\n * @example\n * ```ts\n * const betaManagedAgentsDeletedCredential =\n * await client.beta.vaults.credentials.delete(\n * 'vcrd_011CZkZEMt8gZan2iYOQfSkw',\n * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' },\n * );\n * ```\n */\n delete(credentialID, params, options) {\n const { vault_id, betas } = params;\n return this._client.delete(path `/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Archive Credential\n *\n * @example\n * ```ts\n * const betaManagedAgentsCredential =\n * await client.beta.vaults.credentials.archive(\n * 'vcrd_011CZkZEMt8gZan2iYOQfSkw',\n * { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' },\n * );\n * ```\n */\n archive(credentialID, params, options) {\n const { vault_id, betas } = params;\n return this._client.post(path `/v1/vaults/${vault_id}/credentials/${credentialID}/archive?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=credentials.mjs.map",
136
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../../core/resource.mjs\";\nimport * as CredentialsAPI from \"./credentials.mjs\";\nimport { Credentials, } from \"./credentials.mjs\";\nimport { PageCursor } from \"../../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../../internal/headers.mjs\";\nimport { path } from \"../../../internal/utils/path.mjs\";\nexport class Vaults extends APIResource {\n constructor() {\n super(...arguments);\n this.credentials = new CredentialsAPI.Credentials(this._client);\n }\n /**\n * Create Vault\n *\n * @example\n * ```ts\n * const betaManagedAgentsVault =\n * await client.beta.vaults.create({\n * display_name: 'Example vault',\n * });\n * ```\n */\n create(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/vaults?beta=true', {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Get Vault\n *\n * @example\n * ```ts\n * const betaManagedAgentsVault =\n * await client.beta.vaults.retrieve(\n * 'vlt_011CZkZDLs7fYzm1hXNPeRjv',\n * );\n * ```\n */\n retrieve(vaultID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/vaults/${vaultID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Update Vault\n *\n * @example\n * ```ts\n * const betaManagedAgentsVault =\n * await client.beta.vaults.update(\n * 'vlt_011CZkZDLs7fYzm1hXNPeRjv',\n * );\n * ```\n */\n update(vaultID, params, options) {\n const { betas, ...body } = params;\n return this._client.post(path `/v1/vaults/${vaultID}?beta=true`, {\n body,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * List Vaults\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const betaManagedAgentsVault of client.beta.vaults.list()) {\n * // ...\n * }\n * ```\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/vaults?beta=true', (PageCursor), {\n query,\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Delete Vault\n *\n * @example\n * ```ts\n * const betaManagedAgentsDeletedVault =\n * await client.beta.vaults.delete(\n * 'vlt_011CZkZDLs7fYzm1hXNPeRjv',\n * );\n * ```\n */\n delete(vaultID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.delete(path `/v1/vaults/${vaultID}?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n /**\n * Archive Vault\n *\n * @example\n * ```ts\n * const betaManagedAgentsVault =\n * await client.beta.vaults.archive(\n * 'vlt_011CZkZDLs7fYzm1hXNPeRjv',\n * );\n * ```\n */\n archive(vaultID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.post(path `/v1/vaults/${vaultID}/archive?beta=true`, {\n ...options,\n headers: buildHeaders([\n { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },\n options?.headers,\n ]),\n });\n }\n}\nVaults.Credentials = Credentials;\n//# sourceMappingURL=vaults.mjs.map",
137
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport * as EnvironmentsAPI from \"./environments.mjs\";\nimport { Environments, } from \"./environments.mjs\";\nimport * as FilesAPI from \"./files.mjs\";\nimport { Files, } from \"./files.mjs\";\nimport * as ModelsAPI from \"./models.mjs\";\nimport { Models, } from \"./models.mjs\";\nimport * as UserProfilesAPI from \"./user-profiles.mjs\";\nimport { UserProfiles, } from \"./user-profiles.mjs\";\nimport * as AgentsAPI from \"./agents/agents.mjs\";\nimport { Agents, } from \"./agents/agents.mjs\";\nimport * as MemoryStoresAPI from \"./memory-stores/memory-stores.mjs\";\nimport { MemoryStores, } from \"./memory-stores/memory-stores.mjs\";\nimport * as MessagesAPI from \"./messages/messages.mjs\";\nimport { Messages, } from \"./messages/messages.mjs\";\nimport * as SessionsAPI from \"./sessions/sessions.mjs\";\nimport { Sessions, } from \"./sessions/sessions.mjs\";\nimport * as SkillsAPI from \"./skills/skills.mjs\";\nimport { Skills, } from \"./skills/skills.mjs\";\nimport * as VaultsAPI from \"./vaults/vaults.mjs\";\nimport { Vaults, } from \"./vaults/vaults.mjs\";\nexport class Beta extends APIResource {\n constructor() {\n super(...arguments);\n this.models = new ModelsAPI.Models(this._client);\n this.messages = new MessagesAPI.Messages(this._client);\n this.agents = new AgentsAPI.Agents(this._client);\n this.environments = new EnvironmentsAPI.Environments(this._client);\n this.sessions = new SessionsAPI.Sessions(this._client);\n this.vaults = new VaultsAPI.Vaults(this._client);\n this.memoryStores = new MemoryStoresAPI.MemoryStores(this._client);\n this.files = new FilesAPI.Files(this._client);\n this.skills = new SkillsAPI.Skills(this._client);\n this.userProfiles = new UserProfilesAPI.UserProfiles(this._client);\n }\n}\nBeta.Models = Models;\nBeta.Messages = Messages;\nBeta.Agents = Agents;\nBeta.Environments = Environments;\nBeta.Sessions = Sessions;\nBeta.Vaults = Vaults;\nBeta.MemoryStores = MemoryStores;\nBeta.Files = Files;\nBeta.Skills = Skills;\nBeta.UserProfiles = UserProfiles;\n//# sourceMappingURL=beta.mjs.map",
138
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../core/resource.mjs\";\nimport { buildHeaders } from \"../internal/headers.mjs\";\nexport class Completions extends APIResource {\n create(params, options) {\n const { betas, ...body } = params;\n return this._client.post('/v1/complete', {\n body,\n timeout: this._client._options.timeout ?? 600000,\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n stream: params.stream ?? false,\n });\n }\n}\n//# sourceMappingURL=completions.mjs.map",
139
+ "import { AnthropicError } from \"../core/error.mjs\";\nfunction getOutputFormat(params) {\n return params?.output_config?.format;\n}\nexport function maybeParseMessage(message, params, opts) {\n const outputFormat = getOutputFormat(params);\n if (!params || !('parse' in (outputFormat ?? {}))) {\n return {\n ...message,\n content: message.content.map((block) => {\n if (block.type === 'text') {\n const parsedBlock = Object.defineProperty({ ...block }, 'parsed_output', {\n value: null,\n enumerable: false,\n });\n return parsedBlock;\n }\n return block;\n }),\n parsed_output: null,\n };\n }\n return parseMessage(message, params, opts);\n}\nexport function parseMessage(message, params, opts) {\n let firstParsedOutput = null;\n const content = message.content.map((block) => {\n if (block.type === 'text') {\n const parsedOutput = parseOutputFormat(params, block.text);\n if (firstParsedOutput === null) {\n firstParsedOutput = parsedOutput;\n }\n const parsedBlock = Object.defineProperty({ ...block }, 'parsed_output', {\n value: parsedOutput,\n enumerable: false,\n });\n return parsedBlock;\n }\n return block;\n });\n return {\n ...message,\n content,\n parsed_output: firstParsedOutput,\n };\n}\nfunction parseOutputFormat(params, content) {\n const outputFormat = getOutputFormat(params);\n if (outputFormat?.type !== 'json_schema') {\n return null;\n }\n try {\n if ('parse' in outputFormat) {\n return outputFormat.parse(content);\n }\n return JSON.parse(content);\n }\n catch (error) {\n throw new AnthropicError(`Failed to parse structured output: ${error}`);\n }\n}\n//# sourceMappingURL=parser.mjs.map",
140
+ "var _MessageStream_instances, _MessageStream_currentMessageSnapshot, _MessageStream_params, _MessageStream_connectedPromise, _MessageStream_resolveConnectedPromise, _MessageStream_rejectConnectedPromise, _MessageStream_endPromise, _MessageStream_resolveEndPromise, _MessageStream_rejectEndPromise, _MessageStream_listeners, _MessageStream_ended, _MessageStream_errored, _MessageStream_aborted, _MessageStream_catchingPromiseCreated, _MessageStream_response, _MessageStream_request_id, _MessageStream_logger, _MessageStream_getFinalMessage, _MessageStream_getFinalText, _MessageStream_handleError, _MessageStream_beginRequest, _MessageStream_addStreamEvent, _MessageStream_endRequest, _MessageStream_accumulateMessage;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"../internal/tslib.mjs\";\nimport { isAbortError } from \"../internal/errors.mjs\";\nimport { AnthropicError, APIUserAbortError } from \"../error.mjs\";\nimport { Stream } from \"../streaming.mjs\";\nimport { partialParse } from \"../_vendor/partial-json-parser/parser.mjs\";\nimport { maybeParseMessage } from \"./parser.mjs\";\nconst JSON_BUF_PROPERTY = '__json_buf';\nfunction tracksToolInput(content) {\n return content.type === 'tool_use' || content.type === 'server_tool_use';\n}\nexport class MessageStream {\n constructor(params, opts) {\n _MessageStream_instances.add(this);\n this.messages = [];\n this.receivedMessages = [];\n _MessageStream_currentMessageSnapshot.set(this, void 0);\n _MessageStream_params.set(this, null);\n this.controller = new AbortController();\n _MessageStream_connectedPromise.set(this, void 0);\n _MessageStream_resolveConnectedPromise.set(this, () => { });\n _MessageStream_rejectConnectedPromise.set(this, () => { });\n _MessageStream_endPromise.set(this, void 0);\n _MessageStream_resolveEndPromise.set(this, () => { });\n _MessageStream_rejectEndPromise.set(this, () => { });\n _MessageStream_listeners.set(this, {});\n _MessageStream_ended.set(this, false);\n _MessageStream_errored.set(this, false);\n _MessageStream_aborted.set(this, false);\n _MessageStream_catchingPromiseCreated.set(this, false);\n _MessageStream_response.set(this, void 0);\n _MessageStream_request_id.set(this, void 0);\n _MessageStream_logger.set(this, void 0);\n _MessageStream_handleError.set(this, (error) => {\n __classPrivateFieldSet(this, _MessageStream_errored, true, \"f\");\n if (isAbortError(error)) {\n error = new APIUserAbortError();\n }\n if (error instanceof APIUserAbortError) {\n __classPrivateFieldSet(this, _MessageStream_aborted, true, \"f\");\n return this._emit('abort', error);\n }\n if (error instanceof AnthropicError) {\n return this._emit('error', error);\n }\n if (error instanceof Error) {\n const anthropicError = new AnthropicError(error.message);\n // @ts-ignore\n anthropicError.cause = error;\n return this._emit('error', anthropicError);\n }\n return this._emit('error', new AnthropicError(String(error)));\n });\n __classPrivateFieldSet(this, _MessageStream_connectedPromise, new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _MessageStream_resolveConnectedPromise, resolve, \"f\");\n __classPrivateFieldSet(this, _MessageStream_rejectConnectedPromise, reject, \"f\");\n }), \"f\");\n __classPrivateFieldSet(this, _MessageStream_endPromise, new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _MessageStream_resolveEndPromise, resolve, \"f\");\n __classPrivateFieldSet(this, _MessageStream_rejectEndPromise, reject, \"f\");\n }), \"f\");\n // Don't let these promises cause unhandled rejection errors.\n // we will manually cause an unhandled rejection error later\n // if the user hasn't registered any error listener or called\n // any promise-returning method.\n __classPrivateFieldGet(this, _MessageStream_connectedPromise, \"f\").catch(() => { });\n __classPrivateFieldGet(this, _MessageStream_endPromise, \"f\").catch(() => { });\n __classPrivateFieldSet(this, _MessageStream_params, params, \"f\");\n __classPrivateFieldSet(this, _MessageStream_logger, opts?.logger ?? console, \"f\");\n }\n get response() {\n return __classPrivateFieldGet(this, _MessageStream_response, \"f\");\n }\n get request_id() {\n return __classPrivateFieldGet(this, _MessageStream_request_id, \"f\");\n }\n /**\n * Returns the `MessageStream` data, the raw `Response` instance and the ID of the request,\n * returned vie the `request-id` header which is useful for debugging requests and resporting\n * issues to Anthropic.\n *\n * This is the same as the `APIPromise.withResponse()` method.\n *\n * This method will raise an error if you created the stream using `MessageStream.fromReadableStream`\n * as no `Response` is available.\n */\n async withResponse() {\n __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, \"f\");\n const response = await __classPrivateFieldGet(this, _MessageStream_connectedPromise, \"f\");\n if (!response) {\n throw new Error('Could not resolve a `Response` object');\n }\n return {\n data: this,\n response,\n request_id: response.headers.get('request-id'),\n };\n }\n /**\n * Intended for use on the frontend, consuming a stream produced with\n * `.toReadableStream()` on the backend.\n *\n * Note that messages sent to the model do not appear in `.on('message')`\n * in this context.\n */\n static fromReadableStream(stream) {\n const runner = new MessageStream(null);\n runner._run(() => runner._fromReadableStream(stream));\n return runner;\n }\n static createMessage(messages, params, options, { logger } = {}) {\n const runner = new MessageStream(params, { logger });\n for (const message of params.messages) {\n runner._addMessageParam(message);\n }\n __classPrivateFieldSet(runner, _MessageStream_params, { ...params, stream: true }, \"f\");\n runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, 'X-Stainless-Helper-Method': 'stream' } }));\n return runner;\n }\n _run(executor) {\n executor().then(() => {\n this._emitFinal();\n this._emit('end');\n }, __classPrivateFieldGet(this, _MessageStream_handleError, \"f\"));\n }\n _addMessageParam(message) {\n this.messages.push(message);\n }\n _addMessage(message, emit = true) {\n this.receivedMessages.push(message);\n if (emit) {\n this._emit('message', message);\n }\n }\n async _createMessage(messages, params, options) {\n const signal = options?.signal;\n let abortHandler;\n if (signal) {\n if (signal.aborted)\n this.controller.abort();\n abortHandler = this.controller.abort.bind(this.controller);\n signal.addEventListener('abort', abortHandler);\n }\n try {\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_beginRequest).call(this);\n const { response, data: stream } = await messages\n .create({ ...params, stream: true }, { ...options, signal: this.controller.signal })\n .withResponse();\n this._connected(response);\n for await (const event of stream) {\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_addStreamEvent).call(this, event);\n }\n if (stream.controller.signal?.aborted) {\n throw new APIUserAbortError();\n }\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_endRequest).call(this);\n }\n finally {\n if (signal && abortHandler) {\n signal.removeEventListener('abort', abortHandler);\n }\n }\n }\n _connected(response) {\n if (this.ended)\n return;\n __classPrivateFieldSet(this, _MessageStream_response, response, \"f\");\n __classPrivateFieldSet(this, _MessageStream_request_id, response?.headers.get('request-id'), \"f\");\n __classPrivateFieldGet(this, _MessageStream_resolveConnectedPromise, \"f\").call(this, response);\n this._emit('connect');\n }\n get ended() {\n return __classPrivateFieldGet(this, _MessageStream_ended, \"f\");\n }\n get errored() {\n return __classPrivateFieldGet(this, _MessageStream_errored, \"f\");\n }\n get aborted() {\n return __classPrivateFieldGet(this, _MessageStream_aborted, \"f\");\n }\n abort() {\n this.controller.abort();\n }\n /**\n * Adds the listener function to the end of the listeners array for the event.\n * No checks are made to see if the listener has already been added. Multiple calls passing\n * the same combination of event and listener will result in the listener being added, and\n * called, multiple times.\n * @returns this MessageStream, so that calls can be chained\n */\n on(event, listener) {\n const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event] || (__classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event] = []);\n listeners.push({ listener });\n return this;\n }\n /**\n * Removes the specified listener from the listener array for the event.\n * off() will remove, at most, one instance of a listener from the listener array. If any single\n * listener has been added multiple times to the listener array for the specified event, then\n * off() must be called multiple times to remove each instance.\n * @returns this MessageStream, so that calls can be chained\n */\n off(event, listener) {\n const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event];\n if (!listeners)\n return this;\n const index = listeners.findIndex((l) => l.listener === listener);\n if (index >= 0)\n listeners.splice(index, 1);\n return this;\n }\n /**\n * Adds a one-time listener function for the event. The next time the event is triggered,\n * this listener is removed and then invoked.\n * @returns this MessageStream, so that calls can be chained\n */\n once(event, listener) {\n const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event] || (__classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event] = []);\n listeners.push({ listener, once: true });\n return this;\n }\n /**\n * This is similar to `.once()`, but returns a Promise that resolves the next time\n * the event is triggered, instead of calling a listener callback.\n * @returns a Promise that resolves the next time given event is triggered,\n * or rejects if an error is emitted. (If you request the 'error' event,\n * returns a promise that resolves with the error).\n *\n * Example:\n *\n * const message = await stream.emitted('message') // rejects if the stream errors\n */\n emitted(event) {\n return new Promise((resolve, reject) => {\n __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, \"f\");\n if (event !== 'error')\n this.once('error', reject);\n this.once(event, resolve);\n });\n }\n async done() {\n __classPrivateFieldSet(this, _MessageStream_catchingPromiseCreated, true, \"f\");\n await __classPrivateFieldGet(this, _MessageStream_endPromise, \"f\");\n }\n get currentMessage() {\n return __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, \"f\");\n }\n /**\n * @returns a promise that resolves with the the final assistant Message response,\n * or rejects if an error occurred or the stream ended prematurely without producing a Message.\n * If structured outputs were used, this will be a ParsedMessage with a `parsed_output` field.\n */\n async finalMessage() {\n await this.done();\n return __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_getFinalMessage).call(this);\n }\n /**\n * @returns a promise that resolves with the the final assistant Message's text response, concatenated\n * together if there are more than one text blocks.\n * Rejects if an error occurred or the stream ended prematurely without producing a Message.\n */\n async finalText() {\n await this.done();\n return __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_getFinalText).call(this);\n }\n _emit(event, ...args) {\n // make sure we don't emit any MessageStreamEvents after end\n if (__classPrivateFieldGet(this, _MessageStream_ended, \"f\"))\n return;\n if (event === 'end') {\n __classPrivateFieldSet(this, _MessageStream_ended, true, \"f\");\n __classPrivateFieldGet(this, _MessageStream_resolveEndPromise, \"f\").call(this);\n }\n const listeners = __classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event];\n if (listeners) {\n __classPrivateFieldGet(this, _MessageStream_listeners, \"f\")[event] = listeners.filter((l) => !l.once);\n listeners.forEach(({ listener }) => listener(...args));\n }\n if (event === 'abort') {\n const error = args[0];\n if (!__classPrivateFieldGet(this, _MessageStream_catchingPromiseCreated, \"f\") && !listeners?.length) {\n Promise.reject(error);\n }\n __classPrivateFieldGet(this, _MessageStream_rejectConnectedPromise, \"f\").call(this, error);\n __classPrivateFieldGet(this, _MessageStream_rejectEndPromise, \"f\").call(this, error);\n this._emit('end');\n return;\n }\n if (event === 'error') {\n // NOTE: _emit('error', error) should only be called from #handleError().\n const error = args[0];\n if (!__classPrivateFieldGet(this, _MessageStream_catchingPromiseCreated, \"f\") && !listeners?.length) {\n // Trigger an unhandled rejection if the user hasn't registered any error handlers.\n // If you are seeing stack traces here, make sure to handle errors via either:\n // - runner.on('error', () => ...)\n // - await runner.done()\n // - await runner.final...()\n // - etc.\n Promise.reject(error);\n }\n __classPrivateFieldGet(this, _MessageStream_rejectConnectedPromise, \"f\").call(this, error);\n __classPrivateFieldGet(this, _MessageStream_rejectEndPromise, \"f\").call(this, error);\n this._emit('end');\n }\n }\n _emitFinal() {\n const finalMessage = this.receivedMessages.at(-1);\n if (finalMessage) {\n this._emit('finalMessage', __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_getFinalMessage).call(this));\n }\n }\n async _fromReadableStream(readableStream, options) {\n const signal = options?.signal;\n let abortHandler;\n if (signal) {\n if (signal.aborted)\n this.controller.abort();\n abortHandler = this.controller.abort.bind(this.controller);\n signal.addEventListener('abort', abortHandler);\n }\n try {\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_beginRequest).call(this);\n this._connected(null);\n const stream = Stream.fromReadableStream(readableStream, this.controller);\n for await (const event of stream) {\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_addStreamEvent).call(this, event);\n }\n if (stream.controller.signal?.aborted) {\n throw new APIUserAbortError();\n }\n __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_endRequest).call(this);\n }\n finally {\n if (signal && abortHandler) {\n signal.removeEventListener('abort', abortHandler);\n }\n }\n }\n [(_MessageStream_currentMessageSnapshot = new WeakMap(), _MessageStream_params = new WeakMap(), _MessageStream_connectedPromise = new WeakMap(), _MessageStream_resolveConnectedPromise = new WeakMap(), _MessageStream_rejectConnectedPromise = new WeakMap(), _MessageStream_endPromise = new WeakMap(), _MessageStream_resolveEndPromise = new WeakMap(), _MessageStream_rejectEndPromise = new WeakMap(), _MessageStream_listeners = new WeakMap(), _MessageStream_ended = new WeakMap(), _MessageStream_errored = new WeakMap(), _MessageStream_aborted = new WeakMap(), _MessageStream_catchingPromiseCreated = new WeakMap(), _MessageStream_response = new WeakMap(), _MessageStream_request_id = new WeakMap(), _MessageStream_logger = new WeakMap(), _MessageStream_handleError = new WeakMap(), _MessageStream_instances = new WeakSet(), _MessageStream_getFinalMessage = function _MessageStream_getFinalMessage() {\n if (this.receivedMessages.length === 0) {\n throw new AnthropicError('stream ended without producing a Message with role=assistant');\n }\n return this.receivedMessages.at(-1);\n }, _MessageStream_getFinalText = function _MessageStream_getFinalText() {\n if (this.receivedMessages.length === 0) {\n throw new AnthropicError('stream ended without producing a Message with role=assistant');\n }\n const textBlocks = this.receivedMessages\n .at(-1)\n .content.filter((block) => block.type === 'text')\n .map((block) => block.text);\n if (textBlocks.length === 0) {\n throw new AnthropicError('stream ended without producing a content block with type=text');\n }\n return textBlocks.join(' ');\n }, _MessageStream_beginRequest = function _MessageStream_beginRequest() {\n if (this.ended)\n return;\n __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, undefined, \"f\");\n }, _MessageStream_addStreamEvent = function _MessageStream_addStreamEvent(event) {\n if (this.ended)\n return;\n const messageSnapshot = __classPrivateFieldGet(this, _MessageStream_instances, \"m\", _MessageStream_accumulateMessage).call(this, event);\n this._emit('streamEvent', event, messageSnapshot);\n switch (event.type) {\n case 'content_block_delta': {\n const content = messageSnapshot.content.at(-1);\n switch (event.delta.type) {\n case 'text_delta': {\n if (content.type === 'text') {\n this._emit('text', event.delta.text, content.text || '');\n }\n break;\n }\n case 'citations_delta': {\n if (content.type === 'text') {\n this._emit('citation', event.delta.citation, content.citations ?? []);\n }\n break;\n }\n case 'input_json_delta': {\n if (tracksToolInput(content) && content.input) {\n this._emit('inputJson', event.delta.partial_json, content.input);\n }\n break;\n }\n case 'thinking_delta': {\n if (content.type === 'thinking') {\n this._emit('thinking', event.delta.thinking, content.thinking);\n }\n break;\n }\n case 'signature_delta': {\n if (content.type === 'thinking') {\n this._emit('signature', content.signature);\n }\n break;\n }\n default:\n checkNever(event.delta);\n }\n break;\n }\n case 'message_stop': {\n this._addMessageParam(messageSnapshot);\n this._addMessage(maybeParseMessage(messageSnapshot, __classPrivateFieldGet(this, _MessageStream_params, \"f\"), { logger: __classPrivateFieldGet(this, _MessageStream_logger, \"f\") }), true);\n break;\n }\n case 'content_block_stop': {\n this._emit('contentBlock', messageSnapshot.content.at(-1));\n break;\n }\n case 'message_start': {\n __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, messageSnapshot, \"f\");\n break;\n }\n case 'content_block_start':\n case 'message_delta':\n break;\n }\n }, _MessageStream_endRequest = function _MessageStream_endRequest() {\n if (this.ended) {\n throw new AnthropicError(`stream has ended, this shouldn't happen`);\n }\n const snapshot = __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, \"f\");\n if (!snapshot) {\n throw new AnthropicError(`request ended without sending any chunks`);\n }\n __classPrivateFieldSet(this, _MessageStream_currentMessageSnapshot, undefined, \"f\");\n return maybeParseMessage(snapshot, __classPrivateFieldGet(this, _MessageStream_params, \"f\"), { logger: __classPrivateFieldGet(this, _MessageStream_logger, \"f\") });\n }, _MessageStream_accumulateMessage = function _MessageStream_accumulateMessage(event) {\n let snapshot = __classPrivateFieldGet(this, _MessageStream_currentMessageSnapshot, \"f\");\n if (event.type === 'message_start') {\n if (snapshot) {\n throw new AnthropicError(`Unexpected event order, got ${event.type} before receiving \"message_stop\"`);\n }\n return event.message;\n }\n if (!snapshot) {\n throw new AnthropicError(`Unexpected event order, got ${event.type} before \"message_start\"`);\n }\n switch (event.type) {\n case 'message_stop':\n return snapshot;\n case 'message_delta':\n snapshot.stop_reason = event.delta.stop_reason;\n snapshot.stop_sequence = event.delta.stop_sequence;\n snapshot.usage.output_tokens = event.usage.output_tokens;\n // Update other usage fields if they exist in the event\n if (event.usage.input_tokens != null) {\n snapshot.usage.input_tokens = event.usage.input_tokens;\n }\n if (event.usage.cache_creation_input_tokens != null) {\n snapshot.usage.cache_creation_input_tokens = event.usage.cache_creation_input_tokens;\n }\n if (event.usage.cache_read_input_tokens != null) {\n snapshot.usage.cache_read_input_tokens = event.usage.cache_read_input_tokens;\n }\n if (event.usage.server_tool_use != null) {\n snapshot.usage.server_tool_use = event.usage.server_tool_use;\n }\n return snapshot;\n case 'content_block_start':\n snapshot.content.push({ ...event.content_block });\n return snapshot;\n case 'content_block_delta': {\n const snapshotContent = snapshot.content.at(event.index);\n switch (event.delta.type) {\n case 'text_delta': {\n if (snapshotContent?.type === 'text') {\n snapshot.content[event.index] = {\n ...snapshotContent,\n text: (snapshotContent.text || '') + event.delta.text,\n };\n }\n break;\n }\n case 'citations_delta': {\n if (snapshotContent?.type === 'text') {\n snapshot.content[event.index] = {\n ...snapshotContent,\n citations: [...(snapshotContent.citations ?? []), event.delta.citation],\n };\n }\n break;\n }\n case 'input_json_delta': {\n if (snapshotContent && tracksToolInput(snapshotContent)) {\n // we need to keep track of the raw JSON string as well so that we can\n // re-parse it for each delta, for now we just store it as an untyped\n // non-enumerable property on the snapshot\n let jsonBuf = snapshotContent[JSON_BUF_PROPERTY] || '';\n jsonBuf += event.delta.partial_json;\n const newContent = { ...snapshotContent };\n Object.defineProperty(newContent, JSON_BUF_PROPERTY, {\n value: jsonBuf,\n enumerable: false,\n writable: true,\n });\n if (jsonBuf) {\n newContent.input = partialParse(jsonBuf);\n }\n snapshot.content[event.index] = newContent;\n }\n break;\n }\n case 'thinking_delta': {\n if (snapshotContent?.type === 'thinking') {\n snapshot.content[event.index] = {\n ...snapshotContent,\n thinking: snapshotContent.thinking + event.delta.thinking,\n };\n }\n break;\n }\n case 'signature_delta': {\n if (snapshotContent?.type === 'thinking') {\n snapshot.content[event.index] = {\n ...snapshotContent,\n signature: event.delta.signature,\n };\n }\n break;\n }\n default:\n checkNever(event.delta);\n }\n return snapshot;\n }\n case 'content_block_stop':\n return snapshot;\n }\n }, Symbol.asyncIterator)]() {\n const pushQueue = [];\n const readQueue = [];\n let done = false;\n this.on('streamEvent', (event) => {\n const reader = readQueue.shift();\n if (reader) {\n reader.resolve(event);\n }\n else {\n pushQueue.push(event);\n }\n });\n this.on('end', () => {\n done = true;\n for (const reader of readQueue) {\n reader.resolve(undefined);\n }\n readQueue.length = 0;\n });\n this.on('abort', (err) => {\n done = true;\n for (const reader of readQueue) {\n reader.reject(err);\n }\n readQueue.length = 0;\n });\n this.on('error', (err) => {\n done = true;\n for (const reader of readQueue) {\n reader.reject(err);\n }\n readQueue.length = 0;\n });\n return {\n next: async () => {\n if (!pushQueue.length) {\n if (done) {\n return { value: undefined, done: true };\n }\n return new Promise((resolve, reject) => readQueue.push({ resolve, reject })).then((chunk) => (chunk ? { value: chunk, done: false } : { value: undefined, done: true }));\n }\n const chunk = pushQueue.shift();\n return { value: chunk, done: false };\n },\n return: async () => {\n this.abort();\n return { value: undefined, done: true };\n },\n };\n }\n toReadableStream() {\n const stream = new Stream(this[Symbol.asyncIterator].bind(this), this.controller);\n return stream.toReadableStream();\n }\n}\n// used to ensure exhaustive case matching without throwing a runtime error\nfunction checkNever(x) { }\n//# sourceMappingURL=MessageStream.mjs.map",
141
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport { Page } from \"../../core/pagination.mjs\";\nimport { buildHeaders } from \"../../internal/headers.mjs\";\nimport { JSONLDecoder } from \"../../internal/decoders/jsonl.mjs\";\nimport { AnthropicError } from \"../../error.mjs\";\nimport { path } from \"../../internal/utils/path.mjs\";\nexport class Batches extends APIResource {\n /**\n * Send a batch of Message creation requests.\n *\n * The Message Batches API can be used to process multiple Messages API requests at\n * once. Once a Message Batch is created, it begins processing immediately. Batches\n * can take up to 24 hours to complete.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const messageBatch = await client.messages.batches.create({\n * requests: [\n * {\n * custom_id: 'my-custom-id-1',\n * params: {\n * max_tokens: 1024,\n * messages: [\n * { content: 'Hello, world', role: 'user' },\n * ],\n * model: 'claude-opus-4-6',\n * },\n * },\n * ],\n * });\n * ```\n */\n create(body, options) {\n return this._client.post('/v1/messages/batches', { body, ...options });\n }\n /**\n * This endpoint is idempotent and can be used to poll for Message Batch\n * completion. To access the results of a Message Batch, make a request to the\n * `results_url` field in the response.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const messageBatch = await client.messages.batches.retrieve(\n * 'message_batch_id',\n * );\n * ```\n */\n retrieve(messageBatchID, options) {\n return this._client.get(path `/v1/messages/batches/${messageBatchID}`, options);\n }\n /**\n * List all Message Batches within a Workspace. Most recently created batches are\n * returned first.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * // Automatically fetches more pages as needed.\n * for await (const messageBatch of client.messages.batches.list()) {\n * // ...\n * }\n * ```\n */\n list(query = {}, options) {\n return this._client.getAPIList('/v1/messages/batches', (Page), { query, ...options });\n }\n /**\n * Delete a Message Batch.\n *\n * Message Batches can only be deleted once they've finished processing. If you'd\n * like to delete an in-progress batch, you must first cancel it.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const deletedMessageBatch =\n * await client.messages.batches.delete('message_batch_id');\n * ```\n */\n delete(messageBatchID, options) {\n return this._client.delete(path `/v1/messages/batches/${messageBatchID}`, options);\n }\n /**\n * Batches may be canceled any time before processing ends. Once cancellation is\n * initiated, the batch enters a `canceling` state, at which time the system may\n * complete any in-progress, non-interruptible requests before finalizing\n * cancellation.\n *\n * The number of canceled requests is specified in `request_counts`. To determine\n * which requests were canceled, check the individual results within the batch.\n * Note that cancellation may not result in any canceled requests if they were\n * non-interruptible.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const messageBatch = await client.messages.batches.cancel(\n * 'message_batch_id',\n * );\n * ```\n */\n cancel(messageBatchID, options) {\n return this._client.post(path `/v1/messages/batches/${messageBatchID}/cancel`, options);\n }\n /**\n * Streams the results of a Message Batch as a `.jsonl` file.\n *\n * Each line in the file is a JSON object containing the result of a single request\n * in the Message Batch. Results are not guaranteed to be in the same order as\n * requests. Use the `custom_id` field to match results to requests.\n *\n * Learn more about the Message Batches API in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)\n *\n * @example\n * ```ts\n * const messageBatchIndividualResponse =\n * await client.messages.batches.results('message_batch_id');\n * ```\n */\n async results(messageBatchID, options) {\n const batch = await this.retrieve(messageBatchID);\n if (!batch.results_url) {\n throw new AnthropicError(`No batch \\`results_url\\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`);\n }\n return this._client\n .get(batch.results_url, {\n ...options,\n headers: buildHeaders([{ Accept: 'application/binary' }, options?.headers]),\n stream: true,\n __binaryResponse: true,\n })\n ._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));\n }\n}\n//# sourceMappingURL=batches.mjs.map",
142
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../../core/resource.mjs\";\nimport { buildHeaders } from \"../../internal/headers.mjs\";\nimport { stainlessHelperHeader } from \"../../lib/stainless-helper-header.mjs\";\nimport { MessageStream } from \"../../lib/MessageStream.mjs\";\nimport { parseMessage, } from \"../../lib/parser.mjs\";\nimport * as BatchesAPI from \"./batches.mjs\";\nimport { Batches, } from \"./batches.mjs\";\nimport { MODEL_NONSTREAMING_TOKENS } from \"../../internal/constants.mjs\";\nexport class Messages extends APIResource {\n constructor() {\n super(...arguments);\n this.batches = new BatchesAPI.Batches(this._client);\n }\n create(body, options) {\n if (body.model in DEPRECATED_MODELS) {\n console.warn(`The model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]}\\nPlease migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);\n }\n if (MODELS_TO_WARN_WITH_THINKING_ENABLED.includes(body.model) &&\n body.thinking &&\n body.thinking.type === 'enabled') {\n console.warn(`Using Claude with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);\n }\n let timeout = this._client._options.timeout;\n if (!body.stream && timeout == null) {\n const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? undefined;\n timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens);\n }\n // Collect helper info from tools and messages\n const helperHeader = stainlessHelperHeader(body.tools, body.messages);\n return this._client.post('/v1/messages', {\n body,\n timeout: timeout ?? 600000,\n ...options,\n headers: buildHeaders([helperHeader, options?.headers]),\n stream: body.stream ?? false,\n });\n }\n /**\n * Send a structured list of input messages with text and/or image content, along with an expected `output_config.format` and\n * the response will be automatically parsed and available in the `parsed_output` property of the message.\n *\n * @example\n * ```ts\n * const message = await client.messages.parse({\n * model: 'claude-sonnet-4-5-20250929',\n * max_tokens: 1024,\n * messages: [{ role: 'user', content: 'What is 2+2?' }],\n * output_config: {\n * format: zodOutputFormat(z.object({ answer: z.number() })),\n * },\n * });\n *\n * console.log(message.parsed_output?.answer); // 4\n * ```\n */\n parse(params, options) {\n return this.create(params, options).then((message) => parseMessage(message, params, { logger: this._client.logger ?? console }));\n }\n /**\n * Create a Message stream.\n *\n * If `output_config.format` is provided with a parseable format (like `zodOutputFormat()`),\n * the final message will include a `parsed_output` property with the parsed content.\n *\n * @example\n * ```ts\n * const stream = client.messages.stream({\n * model: 'claude-sonnet-4-5-20250929',\n * max_tokens: 1024,\n * messages: [{ role: 'user', content: 'What is 2+2?' }],\n * output_config: {\n * format: zodOutputFormat(z.object({ answer: z.number() })),\n * },\n * });\n *\n * const message = await stream.finalMessage();\n * console.log(message.parsed_output?.answer); // 4\n * ```\n */\n stream(body, options) {\n return MessageStream.createMessage(this, body, options, { logger: this._client.logger ?? console });\n }\n /**\n * Count the number of tokens in a Message.\n *\n * The Token Count API can be used to count the number of tokens in a Message,\n * including tools, images, and documents, without creating it.\n *\n * Learn more about token counting in our\n * [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)\n *\n * @example\n * ```ts\n * const messageTokensCount =\n * await client.messages.countTokens({\n * messages: [{ content: 'Hello, world', role: 'user' }],\n * model: 'claude-opus-4-6',\n * });\n * ```\n */\n countTokens(body, options) {\n return this._client.post('/v1/messages/count_tokens', { body, ...options });\n }\n}\nconst DEPRECATED_MODELS = {\n 'claude-1.3': 'November 6th, 2024',\n 'claude-1.3-100k': 'November 6th, 2024',\n 'claude-instant-1.1': 'November 6th, 2024',\n 'claude-instant-1.1-100k': 'November 6th, 2024',\n 'claude-instant-1.2': 'November 6th, 2024',\n 'claude-3-sonnet-20240229': 'July 21st, 2025',\n 'claude-3-opus-20240229': 'January 5th, 2026',\n 'claude-2.1': 'July 21st, 2025',\n 'claude-2.0': 'July 21st, 2025',\n 'claude-3-7-sonnet-latest': 'February 19th, 2026',\n 'claude-3-7-sonnet-20250219': 'February 19th, 2026',\n 'claude-3-5-haiku-latest': 'February 19th, 2026',\n 'claude-3-5-haiku-20241022': 'February 19th, 2026',\n 'claude-opus-4-0': 'June 15th, 2026',\n 'claude-opus-4-20250514': 'June 15th, 2026',\n 'claude-sonnet-4-0': 'June 15th, 2026',\n 'claude-sonnet-4-20250514': 'June 15th, 2026',\n};\nconst MODELS_TO_WARN_WITH_THINKING_ENABLED = ['claude-mythos-preview', 'claude-opus-4-6'];\nMessages.Batches = Batches;\n//# sourceMappingURL=messages.mjs.map",
143
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nimport { APIResource } from \"../core/resource.mjs\";\nimport { Page } from \"../core/pagination.mjs\";\nimport { buildHeaders } from \"../internal/headers.mjs\";\nimport { path } from \"../internal/utils/path.mjs\";\nexport class Models extends APIResource {\n /**\n * Get a specific model.\n *\n * The Models API response can be used to determine information about a specific\n * model or resolve a model alias to a model ID.\n */\n retrieve(modelID, params = {}, options) {\n const { betas } = params ?? {};\n return this._client.get(path `/v1/models/${modelID}`, {\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n });\n }\n /**\n * List available models.\n *\n * The Models API response can be used to determine which models are available for\n * use in the API. More recently released models are listed first.\n */\n list(params = {}, options) {\n const { betas, ...query } = params ?? {};\n return this._client.getAPIList('/v1/models', (Page), {\n query,\n ...options,\n headers: buildHeaders([\n { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },\n options?.headers,\n ]),\n });\n }\n}\n//# sourceMappingURL=models.mjs.map",
144
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport * from \"./shared.mjs\";\nexport { Beta, } from \"./beta/beta.mjs\";\nexport { Completions, } from \"./completions.mjs\";\nexport { Messages, } from \"./messages/messages.mjs\";\nexport { Models, } from \"./models.mjs\";\n//# sourceMappingURL=index.mjs.map",
145
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\n/**\n * Read an environment variable.\n *\n * Trims beginning and trailing whitespace.\n *\n * Will return undefined if the environment variable doesn't exist or cannot be accessed.\n */\nexport const readEnv = (env) => {\n if (typeof globalThis.process !== 'undefined') {\n return globalThis.process.env?.[env]?.trim() || undefined;\n }\n if (typeof globalThis.Deno !== 'undefined') {\n return globalThis.Deno.env?.get?.(env)?.trim() || undefined;\n }\n return undefined;\n};\n//# sourceMappingURL=env.mjs.map",
146
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nvar _BaseAnthropic_instances, _a, _BaseAnthropic_encoder, _BaseAnthropic_baseURLOverridden;\nimport { __classPrivateFieldGet, __classPrivateFieldSet } from \"./internal/tslib.mjs\";\nimport { uuid4 } from \"./internal/utils/uuid.mjs\";\nimport { validatePositiveInteger, isAbsoluteURL, safeJSON } from \"./internal/utils/values.mjs\";\nimport { sleep } from \"./internal/utils/sleep.mjs\";\nimport { castToError, isAbortError } from \"./internal/errors.mjs\";\nimport { getPlatformHeaders } from \"./internal/detect-platform.mjs\";\nimport * as Shims from \"./internal/shims.mjs\";\nimport * as Opts from \"./internal/request-options.mjs\";\nimport { stringifyQuery } from \"./internal/utils/query.mjs\";\nimport { VERSION } from \"./version.mjs\";\nimport * as Errors from \"./core/error.mjs\";\nimport * as Pagination from \"./core/pagination.mjs\";\nimport * as Uploads from \"./core/uploads.mjs\";\nimport * as API from \"./resources/index.mjs\";\nimport { APIPromise } from \"./core/api-promise.mjs\";\nimport { Completions, } from \"./resources/completions.mjs\";\nimport { Models, } from \"./resources/models.mjs\";\nimport { Beta, } from \"./resources/beta/beta.mjs\";\nimport { Messages, } from \"./resources/messages/messages.mjs\";\nimport { isRunningInBrowser } from \"./internal/detect-platform.mjs\";\nimport { buildHeaders } from \"./internal/headers.mjs\";\nimport { readEnv } from \"./internal/utils/env.mjs\";\nimport { formatRequestDetails, loggerFor, parseLogLevel, } from \"./internal/utils/log.mjs\";\nimport { isEmptyObj } from \"./internal/utils/values.mjs\";\nexport const HUMAN_PROMPT = '\\\\n\\\\nHuman:';\nexport const AI_PROMPT = '\\\\n\\\\nAssistant:';\n/**\n * Base class for Anthropic API clients.\n */\nexport class BaseAnthropic {\n /**\n * API Client for interfacing with the Anthropic API.\n *\n * @param {string | null | undefined} [opts.apiKey=process.env['ANTHROPIC_API_KEY'] ?? null]\n * @param {string | null | undefined} [opts.authToken=process.env['ANTHROPIC_AUTH_TOKEN'] ?? null]\n * @param {string} [opts.baseURL=process.env['ANTHROPIC_BASE_URL'] ?? https://api.anthropic.com] - Override the default base URL for the API.\n * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.\n * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.\n * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.\n * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.\n * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.\n * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.\n * @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers.\n */\n constructor({ baseURL = readEnv('ANTHROPIC_BASE_URL'), apiKey = readEnv('ANTHROPIC_API_KEY') ?? null, authToken = readEnv('ANTHROPIC_AUTH_TOKEN') ?? null, ...opts } = {}) {\n _BaseAnthropic_instances.add(this);\n _BaseAnthropic_encoder.set(this, void 0);\n const options = {\n apiKey,\n authToken,\n ...opts,\n baseURL: baseURL || `https://api.anthropic.com`,\n };\n if (!options.dangerouslyAllowBrowser && isRunningInBrowser()) {\n throw new Errors.AnthropicError(\"It looks like you're running in a browser-like environment.\\n\\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\\nIf you understand the risks and have appropriate mitigations in place,\\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\\n\\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\\n\");\n }\n this.baseURL = options.baseURL;\n this.timeout = options.timeout ?? _a.DEFAULT_TIMEOUT /* 10 minutes */;\n this.logger = options.logger ?? console;\n const defaultLogLevel = 'warn';\n // Set default logLevel early so that we can log a warning in parseLogLevel.\n this.logLevel = defaultLogLevel;\n this.logLevel =\n parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??\n parseLogLevel(readEnv('ANTHROPIC_LOG'), \"process.env['ANTHROPIC_LOG']\", this) ??\n defaultLogLevel;\n this.fetchOptions = options.fetchOptions;\n this.maxRetries = options.maxRetries ?? 2;\n this.fetch = options.fetch ?? Shims.getDefaultFetch();\n __classPrivateFieldSet(this, _BaseAnthropic_encoder, Opts.FallbackEncoder, \"f\");\n this._options = options;\n this.apiKey = typeof apiKey === 'string' ? apiKey : null;\n this.authToken = authToken;\n }\n /**\n * Create a new client instance re-using the same options given to the current client with optional overriding.\n */\n withOptions(options) {\n const client = new this.constructor({\n ...this._options,\n baseURL: this.baseURL,\n maxRetries: this.maxRetries,\n timeout: this.timeout,\n logger: this.logger,\n logLevel: this.logLevel,\n fetch: this.fetch,\n fetchOptions: this.fetchOptions,\n apiKey: this.apiKey,\n authToken: this.authToken,\n ...options,\n });\n return client;\n }\n defaultQuery() {\n return this._options.defaultQuery;\n }\n validateHeaders({ values, nulls }) {\n if (values.get('x-api-key') || values.get('authorization')) {\n return;\n }\n if (this.apiKey && values.get('x-api-key')) {\n return;\n }\n if (nulls.has('x-api-key')) {\n return;\n }\n if (this.authToken && values.get('authorization')) {\n return;\n }\n if (nulls.has('authorization')) {\n return;\n }\n throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the \"X-Api-Key\" or \"Authorization\" headers to be explicitly omitted');\n }\n async authHeaders(opts) {\n return buildHeaders([await this.apiKeyAuth(opts), await this.bearerAuth(opts)]);\n }\n async apiKeyAuth(opts) {\n if (this.apiKey == null) {\n return undefined;\n }\n return buildHeaders([{ 'X-Api-Key': this.apiKey }]);\n }\n async bearerAuth(opts) {\n if (this.authToken == null) {\n return undefined;\n }\n return buildHeaders([{ Authorization: `Bearer ${this.authToken}` }]);\n }\n /**\n * Basic re-implementation of `qs.stringify` for primitive types.\n */\n stringifyQuery(query) {\n return stringifyQuery(query);\n }\n getUserAgent() {\n return `${this.constructor.name}/JS ${VERSION}`;\n }\n defaultIdempotencyKey() {\n return `stainless-node-retry-${uuid4()}`;\n }\n makeStatusError(status, error, message, headers) {\n return Errors.APIError.generate(status, error, message, headers);\n }\n buildURL(path, query, defaultBaseURL) {\n const baseURL = (!__classPrivateFieldGet(this, _BaseAnthropic_instances, \"m\", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL) || this.baseURL;\n const url = isAbsoluteURL(path) ?\n new URL(path)\n : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));\n const defaultQuery = this.defaultQuery();\n const pathQuery = Object.fromEntries(url.searchParams);\n if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {\n query = { ...pathQuery, ...defaultQuery, ...query };\n }\n if (typeof query === 'object' && query && !Array.isArray(query)) {\n url.search = this.stringifyQuery(query);\n }\n return url.toString();\n }\n _calculateNonstreamingTimeout(maxTokens) {\n const defaultTimeout = 10 * 60;\n const expectedTimeout = (60 * 60 * maxTokens) / 128000;\n if (expectedTimeout > defaultTimeout) {\n throw new Errors.AnthropicError('Streaming is required for operations that may take longer than 10 minutes. ' +\n 'See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details');\n }\n return defaultTimeout * 1000;\n }\n /**\n * Used as a callback for mutating the given `FinalRequestOptions` object.\n */\n async prepareOptions(options) { }\n /**\n * Used as a callback for mutating the given `RequestInit` object.\n *\n * This is useful for cases where you want to add certain headers based off of\n * the request properties, e.g. `method` or `url`.\n */\n async prepareRequest(request, { url, options }) { }\n get(path, opts) {\n return this.methodRequest('get', path, opts);\n }\n post(path, opts) {\n return this.methodRequest('post', path, opts);\n }\n patch(path, opts) {\n return this.methodRequest('patch', path, opts);\n }\n put(path, opts) {\n return this.methodRequest('put', path, opts);\n }\n delete(path, opts) {\n return this.methodRequest('delete', path, opts);\n }\n methodRequest(method, path, opts) {\n return this.request(Promise.resolve(opts).then((opts) => {\n return { method, path, ...opts };\n }));\n }\n request(options, remainingRetries = null) {\n return new APIPromise(this, this.makeRequest(options, remainingRetries, undefined));\n }\n async makeRequest(optionsInput, retriesRemaining, retryOfRequestLogID) {\n const options = await optionsInput;\n const maxRetries = options.maxRetries ?? this.maxRetries;\n if (retriesRemaining == null) {\n retriesRemaining = maxRetries;\n }\n await this.prepareOptions(options);\n const { req, url, timeout } = await this.buildRequest(options, {\n retryCount: maxRetries - retriesRemaining,\n });\n await this.prepareRequest(req, { url, options });\n /** Not an API request ID, just for correlating local log entries. */\n const requestLogID = 'log_' + ((Math.random() * (1 << 24)) | 0).toString(16).padStart(6, '0');\n const retryLogStr = retryOfRequestLogID === undefined ? '' : `, retryOf: ${retryOfRequestLogID}`;\n const startTime = Date.now();\n loggerFor(this).debug(`[${requestLogID}] sending request`, formatRequestDetails({\n retryOfRequestLogID,\n method: options.method,\n url,\n options,\n headers: req.headers,\n }));\n if (options.signal?.aborted) {\n throw new Errors.APIUserAbortError();\n }\n const controller = new AbortController();\n const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError);\n const headersTime = Date.now();\n if (response instanceof globalThis.Error) {\n const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;\n if (options.signal?.aborted) {\n throw new Errors.APIUserAbortError();\n }\n // detect native connection timeout errors\n // deno throws \"TypeError: error sending request for url (https://example/): client error (Connect): tcp connect error: Operation timed out (os error 60): Operation timed out (os error 60)\"\n // undici throws \"TypeError: fetch failed\" with cause \"ConnectTimeoutError: Connect Timeout Error (attempted address: example:443, timeout: 1ms)\"\n // others do not provide enough information to distinguish timeouts from other connection errors\n const isTimeout = isAbortError(response) ||\n /timed? ?out/i.test(String(response) + ('cause' in response ? String(response.cause) : ''));\n if (retriesRemaining) {\n loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - ${retryMessage}`);\n loggerFor(this).debug(`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (${retryMessage})`, formatRequestDetails({\n retryOfRequestLogID,\n url,\n durationMs: headersTime - startTime,\n message: response.message,\n }));\n return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID);\n }\n loggerFor(this).info(`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - error; no more retries left`);\n loggerFor(this).debug(`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (error; no more retries left)`, formatRequestDetails({\n retryOfRequestLogID,\n url,\n durationMs: headersTime - startTime,\n message: response.message,\n }));\n if (isTimeout) {\n throw new Errors.APIConnectionTimeoutError();\n }\n throw new Errors.APIConnectionError({ cause: response });\n }\n const specialHeaders = [...response.headers.entries()]\n .filter(([name]) => name === 'request-id')\n .map(([name, value]) => ', ' + name + ': ' + JSON.stringify(value))\n .join('');\n const responseInfo = `[${requestLogID}${retryLogStr}${specialHeaders}] ${req.method} ${url} ${response.ok ? 'succeeded' : 'failed'} with status ${response.status} in ${headersTime - startTime}ms`;\n if (!response.ok) {\n const shouldRetry = await this.shouldRetry(response);\n if (retriesRemaining && shouldRetry) {\n const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;\n // We don't need the body of this response.\n await Shims.CancelReadableStream(response.body);\n loggerFor(this).info(`${responseInfo} - ${retryMessage}`);\n loggerFor(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails({\n retryOfRequestLogID,\n url: response.url,\n status: response.status,\n headers: response.headers,\n durationMs: headersTime - startTime,\n }));\n return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID, response.headers);\n }\n const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`;\n loggerFor(this).info(`${responseInfo} - ${retryMessage}`);\n const errText = await response.text().catch((err) => castToError(err).message);\n const errJSON = safeJSON(errText);\n const errMessage = errJSON ? undefined : errText;\n loggerFor(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails({\n retryOfRequestLogID,\n url: response.url,\n status: response.status,\n headers: response.headers,\n message: errMessage,\n durationMs: Date.now() - startTime,\n }));\n const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers);\n throw err;\n }\n loggerFor(this).info(responseInfo);\n loggerFor(this).debug(`[${requestLogID}] response start`, formatRequestDetails({\n retryOfRequestLogID,\n url: response.url,\n status: response.status,\n headers: response.headers,\n durationMs: headersTime - startTime,\n }));\n return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };\n }\n getAPIList(path, Page, opts) {\n return this.requestAPIList(Page, opts && 'then' in opts ?\n opts.then((opts) => ({ method: 'get', path, ...opts }))\n : { method: 'get', path, ...opts });\n }\n requestAPIList(Page, options) {\n const request = this.makeRequest(options, null, undefined);\n return new Pagination.PagePromise(this, request, Page);\n }\n async fetchWithTimeout(url, init, ms, controller) {\n const { signal, method, ...options } = init || {};\n // Avoid creating a closure over `this`, `init`, or `options` to prevent memory leaks.\n // An arrow function like `() => controller.abort()` captures the surrounding scope,\n // which includes the request body and other large objects. When the user passes a\n // long-lived AbortSignal, the listener prevents those objects from being GC'd for\n // the lifetime of the signal. Using `.bind()` only retains a reference to the\n // controller itself.\n const abort = this._makeAbort(controller);\n if (signal)\n signal.addEventListener('abort', abort, { once: true });\n const timeout = setTimeout(abort, ms);\n const isReadableBody = (globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream) ||\n (typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body);\n const fetchOptions = {\n signal: controller.signal,\n ...(isReadableBody ? { duplex: 'half' } : {}),\n method: 'GET',\n ...options,\n };\n if (method) {\n // Custom methods like 'patch' need to be uppercased\n // See https://github.com/nodejs/undici/issues/2294\n fetchOptions.method = method.toUpperCase();\n }\n try {\n // use undefined this binding; fetch errors if bound to something else in browser/cloudflare\n return await this.fetch.call(undefined, url, fetchOptions);\n }\n finally {\n clearTimeout(timeout);\n }\n }\n async shouldRetry(response) {\n // Note this is not a standard header.\n const shouldRetryHeader = response.headers.get('x-should-retry');\n // If the server explicitly says whether or not to retry, obey.\n if (shouldRetryHeader === 'true')\n return true;\n if (shouldRetryHeader === 'false')\n return false;\n // Retry on request timeouts.\n if (response.status === 408)\n return true;\n // Retry on lock timeouts.\n if (response.status === 409)\n return true;\n // Retry on rate limits.\n if (response.status === 429)\n return true;\n // Retry internal errors.\n if (response.status >= 500)\n return true;\n return false;\n }\n async retryRequest(options, retriesRemaining, requestLogID, responseHeaders) {\n let timeoutMillis;\n // Note the `retry-after-ms` header may not be standard, but is a good idea and we'd like proactive support for it.\n const retryAfterMillisHeader = responseHeaders?.get('retry-after-ms');\n if (retryAfterMillisHeader) {\n const timeoutMs = parseFloat(retryAfterMillisHeader);\n if (!Number.isNaN(timeoutMs)) {\n timeoutMillis = timeoutMs;\n }\n }\n // About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After\n const retryAfterHeader = responseHeaders?.get('retry-after');\n if (retryAfterHeader && !timeoutMillis) {\n const timeoutSeconds = parseFloat(retryAfterHeader);\n if (!Number.isNaN(timeoutSeconds)) {\n timeoutMillis = timeoutSeconds * 1000;\n }\n else {\n timeoutMillis = Date.parse(retryAfterHeader) - Date.now();\n }\n }\n // If the API asks us to wait a certain amount of time, just do what it\n // says, but otherwise calculate a default\n if (timeoutMillis === undefined) {\n const maxRetries = options.maxRetries ?? this.maxRetries;\n timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);\n }\n await sleep(timeoutMillis);\n return this.makeRequest(options, retriesRemaining - 1, requestLogID);\n }\n calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries) {\n const initialRetryDelay = 0.5;\n const maxRetryDelay = 8.0;\n const numRetries = maxRetries - retriesRemaining;\n // Apply exponential backoff, but not more than the max.\n const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay);\n // Apply some jitter, take up to at most 25 percent of the retry time.\n const jitter = 1 - Math.random() * 0.25;\n return sleepSeconds * jitter * 1000;\n }\n calculateNonstreamingTimeout(maxTokens, maxNonstreamingTokens) {\n const maxTime = 60 * 60 * 1000; // 60 minutes\n const defaultTime = 60 * 10 * 1000; // 10 minutes\n const expectedTime = (maxTime * maxTokens) / 128000;\n if (expectedTime > defaultTime || (maxNonstreamingTokens != null && maxTokens > maxNonstreamingTokens)) {\n throw new Errors.AnthropicError('Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details');\n }\n return defaultTime;\n }\n async buildRequest(inputOptions, { retryCount = 0 } = {}) {\n const options = { ...inputOptions };\n const { method, path, query, defaultBaseURL } = options;\n const url = this.buildURL(path, query, defaultBaseURL);\n if ('timeout' in options)\n validatePositiveInteger('timeout', options.timeout);\n options.timeout = options.timeout ?? this.timeout;\n const { bodyHeaders, body } = this.buildBody({ options });\n const reqHeaders = await this.buildHeaders({ options: inputOptions, method, bodyHeaders, retryCount });\n const req = {\n method,\n headers: reqHeaders,\n ...(options.signal && { signal: options.signal }),\n ...(globalThis.ReadableStream &&\n body instanceof globalThis.ReadableStream && { duplex: 'half' }),\n ...(body && { body }),\n ...(this.fetchOptions ?? {}),\n ...(options.fetchOptions ?? {}),\n };\n return { req, url, timeout: options.timeout };\n }\n async buildHeaders({ options, method, bodyHeaders, retryCount, }) {\n let idempotencyHeaders = {};\n if (this.idempotencyHeader && method !== 'get') {\n if (!options.idempotencyKey)\n options.idempotencyKey = this.defaultIdempotencyKey();\n idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey;\n }\n const headers = buildHeaders([\n idempotencyHeaders,\n {\n Accept: 'application/json',\n 'User-Agent': this.getUserAgent(),\n 'X-Stainless-Retry-Count': String(retryCount),\n ...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),\n ...getPlatformHeaders(),\n ...(this._options.dangerouslyAllowBrowser ?\n { 'anthropic-dangerous-direct-browser-access': 'true' }\n : undefined),\n 'anthropic-version': '2023-06-01',\n },\n await this.authHeaders(options),\n this._options.defaultHeaders,\n bodyHeaders,\n options.headers,\n ]);\n this.validateHeaders(headers);\n return headers.values;\n }\n _makeAbort(controller) {\n // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure\n // would capture all request options, and cause a memory leak.\n return () => controller.abort();\n }\n buildBody({ options: { body, headers: rawHeaders } }) {\n if (!body) {\n return { bodyHeaders: undefined, body: undefined };\n }\n const headers = buildHeaders([rawHeaders]);\n if (\n // Pass raw type verbatim\n ArrayBuffer.isView(body) ||\n body instanceof ArrayBuffer ||\n body instanceof DataView ||\n (typeof body === 'string' &&\n // Preserve legacy string encoding behavior for now\n headers.values.has('content-type')) ||\n // `Blob` is superset of `File`\n (globalThis.Blob && body instanceof globalThis.Blob) ||\n // `FormData` -> `multipart/form-data`\n body instanceof FormData ||\n // `URLSearchParams` -> `application/x-www-form-urlencoded`\n body instanceof URLSearchParams ||\n // Send chunked stream (each chunk has own `length`)\n (globalThis.ReadableStream && body instanceof globalThis.ReadableStream)) {\n return { bodyHeaders: undefined, body: body };\n }\n else if (typeof body === 'object' &&\n (Symbol.asyncIterator in body ||\n (Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))) {\n return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body) };\n }\n else if (typeof body === 'object' &&\n headers.values.get('content-type') === 'application/x-www-form-urlencoded') {\n return {\n bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },\n body: this.stringifyQuery(body),\n };\n }\n else {\n return __classPrivateFieldGet(this, _BaseAnthropic_encoder, \"f\").call(this, { body, headers });\n }\n }\n}\n_a = BaseAnthropic, _BaseAnthropic_encoder = new WeakMap(), _BaseAnthropic_instances = new WeakSet(), _BaseAnthropic_baseURLOverridden = function _BaseAnthropic_baseURLOverridden() {\n return this.baseURL !== 'https://api.anthropic.com';\n};\nBaseAnthropic.Anthropic = _a;\nBaseAnthropic.HUMAN_PROMPT = HUMAN_PROMPT;\nBaseAnthropic.AI_PROMPT = AI_PROMPT;\nBaseAnthropic.DEFAULT_TIMEOUT = 600000; // 10 minutes\nBaseAnthropic.AnthropicError = Errors.AnthropicError;\nBaseAnthropic.APIError = Errors.APIError;\nBaseAnthropic.APIConnectionError = Errors.APIConnectionError;\nBaseAnthropic.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;\nBaseAnthropic.APIUserAbortError = Errors.APIUserAbortError;\nBaseAnthropic.NotFoundError = Errors.NotFoundError;\nBaseAnthropic.ConflictError = Errors.ConflictError;\nBaseAnthropic.RateLimitError = Errors.RateLimitError;\nBaseAnthropic.BadRequestError = Errors.BadRequestError;\nBaseAnthropic.AuthenticationError = Errors.AuthenticationError;\nBaseAnthropic.InternalServerError = Errors.InternalServerError;\nBaseAnthropic.PermissionDeniedError = Errors.PermissionDeniedError;\nBaseAnthropic.UnprocessableEntityError = Errors.UnprocessableEntityError;\nBaseAnthropic.toFile = Uploads.toFile;\n/**\n * API Client for interfacing with the Anthropic API.\n */\nexport class Anthropic extends BaseAnthropic {\n constructor() {\n super(...arguments);\n this.completions = new API.Completions(this);\n this.messages = new API.Messages(this);\n this.models = new API.Models(this);\n this.beta = new API.Beta(this);\n }\n}\nAnthropic.Completions = Completions;\nAnthropic.Messages = Messages;\nAnthropic.Models = Models;\nAnthropic.Beta = Beta;\n//# sourceMappingURL=client.mjs.map",
147
+ "// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.\nexport { Anthropic as default } from \"./client.mjs\";\nexport { toFile } from \"./core/uploads.mjs\";\nexport { APIPromise } from \"./core/api-promise.mjs\";\nexport { BaseAnthropic, Anthropic, HUMAN_PROMPT, AI_PROMPT } from \"./client.mjs\";\nexport { PagePromise } from \"./core/pagination.mjs\";\nexport { AnthropicError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from \"./core/error.mjs\";\n//# sourceMappingURL=index.mjs.map",
148
+ "import commander from './index.js';\n\n// wrapper to provide named exports for ESM.\nexport const {\n program,\n createCommand,\n createArgument,\n createOption,\n CommanderError,\n InvalidArgumentError,\n InvalidOptionArgumentError, // deprecated old name\n Command,\n Argument,\n Option,\n Help,\n} = commander;\n",
149
+ "import { readFileSync, writeFileSync, existsSync } from 'fs';\nimport { join, dirname } from 'path';\nimport { parse, stringify } from 'yaml';\nimport type { FafData } from '../core/types.js';\n\n/** Read and parse a .faf file */\nexport function readFaf(path: string): FafData {\n const text = readFileSync(path, 'utf-8');\n return parse(text) as FafData;\n}\n\n/** Write a .faf file from data */\nexport function writeFaf(path: string, data: FafData): void {\n const text = stringify(data, { lineWidth: 0 });\n writeFileSync(path, text, 'utf-8');\n}\n\n/** Read raw YAML text from a .faf file */\nexport function readFafRaw(path: string): string {\n return readFileSync(path, 'utf-8');\n}\n\n/** Find the .faf file in a directory (walks up) */\nexport function findFafFile(dir: string = process.cwd()): string | null {\n const candidates = ['project.faf', '.faf'];\n // Use path.join for cross-platform separator handling — earlier\n // template-literal `${dir}/${name}` produced forward-slash paths\n // even on Windows, breaking strict path equality and any consumer\n // that path-compared the result.\n for (const name of candidates) {\n const full = join(dir, name);\n if (existsSync(full)) return full;\n }\n // Walk up one level — use path.dirname for cross-platform parent\n // resolution. The earlier regex `dir.replace(/\\/[^/]+$/, '')`\n // only matched POSIX separators and silently no-op'd on Windows.\n const parent = dirname(dir);\n if (parent !== dir) {\n for (const name of candidates) {\n const full = join(parent, name);\n if (existsSync(full)) return full;\n }\n }\n return null;\n}\n",
150
+ "'use strict';\n\nvar composer = require('./compose/composer.js');\nvar Document = require('./doc/Document.js');\nvar Schema = require('./schema/Schema.js');\nvar errors = require('./errors.js');\nvar Alias = require('./nodes/Alias.js');\nvar identity = require('./nodes/identity.js');\nvar Pair = require('./nodes/Pair.js');\nvar Scalar = require('./nodes/Scalar.js');\nvar YAMLMap = require('./nodes/YAMLMap.js');\nvar YAMLSeq = require('./nodes/YAMLSeq.js');\nvar cst = require('./parse/cst.js');\nvar lexer = require('./parse/lexer.js');\nvar lineCounter = require('./parse/line-counter.js');\nvar parser = require('./parse/parser.js');\nvar publicApi = require('./public-api.js');\nvar visit = require('./visit.js');\n\n\n\nexports.Composer = composer.Composer;\nexports.Document = Document.Document;\nexports.Schema = Schema.Schema;\nexports.YAMLError = errors.YAMLError;\nexports.YAMLParseError = errors.YAMLParseError;\nexports.YAMLWarning = errors.YAMLWarning;\nexports.Alias = Alias.Alias;\nexports.isAlias = identity.isAlias;\nexports.isCollection = identity.isCollection;\nexports.isDocument = identity.isDocument;\nexports.isMap = identity.isMap;\nexports.isNode = identity.isNode;\nexports.isPair = identity.isPair;\nexports.isScalar = identity.isScalar;\nexports.isSeq = identity.isSeq;\nexports.Pair = Pair.Pair;\nexports.Scalar = Scalar.Scalar;\nexports.YAMLMap = YAMLMap.YAMLMap;\nexports.YAMLSeq = YAMLSeq.YAMLSeq;\nexports.CST = cst;\nexports.Lexer = lexer.Lexer;\nexports.LineCounter = lineCounter.LineCounter;\nexports.Parser = parser.Parser;\nexports.parse = publicApi.parse;\nexports.parseAllDocuments = publicApi.parseAllDocuments;\nexports.parseDocument = publicApi.parseDocument;\nexports.stringify = publicApi.stringify;\nexports.visit = visit.visit;\nexports.visitAsync = visit.visitAsync;\n",
151
+ "import type { KernelScoreResult, FafbInfo } from '../core/types.js';\n\n// faf-scoring-kernel is CommonJS with synchronous WASM loading\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nlet kernel: typeof import('faf-scoring-kernel') | null = null;\n\nfunction getKernel(): typeof import('faf-scoring-kernel') {\n if (!kernel) {\n try {\n kernel = require('faf-scoring-kernel');\n } catch {\n throw new Error(\n 'faf-scoring-kernel not installed.\\n\\n Run: npm install faf-scoring-kernel\\n'\n );\n }\n }\n return kernel;\n}\n\n/** Score a .faf YAML string (21 base slots) */\nexport function score(yaml: string): KernelScoreResult {\n return JSON.parse(getKernel().score_faf(yaml));\n}\n\n/** Score a .faf YAML string (33 enterprise slots) */\nexport function scoreEnterprise(yaml: string): KernelScoreResult {\n return JSON.parse(getKernel().score_faf_enterprise(yaml));\n}\n\n/** Validate .faf YAML */\nexport function validate(yaml: string): boolean {\n return getKernel().validate_faf(yaml);\n}\n\n/** Compile .faf YAML to FAFb binary */\nexport function compile(yaml: string): Uint8Array {\n return getKernel().compile_fafb(yaml);\n}\n\n/** Decompile FAFb binary to JSON info */\nexport function decompile(bytes: Uint8Array): FafbInfo {\n return JSON.parse(getKernel().decompile_fafb(bytes));\n}\n\n/** Get FAFb file metadata */\nexport function fafbInfo(bytes: Uint8Array): FafbInfo {\n return JSON.parse(getKernel().fafb_info(bytes));\n}\n\n/** Get FAFb binary metadata (name, version, source) */\nexport interface FafbMeta {\n source: string;\n name: string;\n faf_version: string;\n}\n\nexport function scoreFafb(bytes: Uint8Array): FafbMeta {\n return JSON.parse(getKernel().score_fafb(bytes));\n}\n\n/** Get WASM SDK version */\nexport function sdkVersion(): string {\n return getKernel().sdk_version();\n}\n",
152
+ "import type { TierInfo } from './types.js';\nimport { bold, dim, fafCyan, orange } from '../ui/colors.js';\n\n/** Tier boundaries — ordered from highest to lowest\n *\n * Indicators:\n * 🏆 trophy (earned at 100%)\n * ★ filled star (gold — orange)\n * ◆ filled diamond (silver — cyan)\n * ◇ open diamond (bronze — cyan)\n * ● filled circle (mid tiers)\n * ○ open circle (low — dim)\n * ♡ heart (empty — good luck)\n */\nexport const TIERS: TierInfo[] = [\n { name: 'TROPHY', indicator: `${orange('🏆')} ${orange('TROPHY')}`, threshold: 100 },\n { name: 'GOLD', indicator: `${orange(bold('★'))} ${orange('GOLD')}`, threshold: 99 },\n { name: 'SILVER', indicator: `${fafCyan('◆')} ${fafCyan('SILVER')}`, threshold: 95 },\n { name: 'BRONZE', indicator: `${fafCyan('◇')} ${fafCyan('BRONZE')}`, threshold: 85 },\n { name: 'GREEN', indicator: `${bold('●')} GREEN`, threshold: 70 },\n { name: 'YELLOW', indicator: `${dim('●')} YELLOW`, threshold: 55 },\n { name: 'RED', indicator: `${dim('○')} RED`, threshold: 1 },\n { name: 'WHITE', indicator: `${dim('♡')}`, threshold: 0 },\n];\n\n/** Get the display badge for a tier */\nexport function tierBadge(tier: TierInfo): string {\n return tier.indicator;\n}\n\n/** Get tier info for a given score */\nexport function getTier(score: number): TierInfo {\n for (const tier of TIERS) {\n if (score >= tier.threshold) return tier;\n }\n return TIERS[TIERS.length - 1]; // White\n}\n\n/** Get the next tier above the current score (for progress display) */\nexport function getNextTier(score: number): TierInfo | null {\n const current = getTier(score);\n const idx = TIERS.indexOf(current);\n return idx > 0 ? TIERS[idx - 1] : null;\n}\n",
153
+ "import type { KernelScoreResult, ScoreResult } from './types.js';\nimport { getTier } from './tiers.js';\n\n/** Convert kernel result into enriched ScoreResult */\nexport function enrichScore(kernel: KernelScoreResult): ScoreResult {\n return {\n score: kernel.score,\n tier: getTier(kernel.score),\n populated: kernel.populated,\n empty: kernel.empty,\n ignored: kernel.ignored,\n active: kernel.active,\n total: kernel.total,\n slots: kernel.slots,\n };\n}\n",
154
+ "import type { ScoreResult, SlotState } from '../core/types.js';\nimport { tierBadge } from '../core/tiers.js';\nimport { bold, dim, fafCyan, orange } from './colors.js';\n\n/** Display a score result to stdout */\nexport function displayScore(result: ScoreResult, file: string, verbose = false): void {\n const badge = tierBadge(result.tier);\n const pct = bold(`${result.score}%`);\n console.log(`${badge} ${pct} ${dim(`${result.populated}/${result.active} slots`)} ${dim('—')} ${file}`);\n\n // Name the empty slots so users know exactly what blocks improvement.\n // Compact preview (top 3) on the count line, \"+N more\" suffix for overflow,\n // verbose mode shows all via displaySlotBreakdown below.\n if (result.tier.name !== 'TROPHY' && result.empty > 0) {\n const emptyPaths = Object.entries(result.slots)\n .filter(([, state]) => state === 'empty')\n .map(([path]) => path);\n const preview = emptyPaths.slice(0, 3).join(', ');\n const suffix = emptyPaths.length > 3 ? `, +${emptyPaths.length - 3} more` : '';\n console.log(dim(` ${result.empty} empty: ${preview}${suffix}`));\n }\n\n if (verbose) {\n console.log('');\n displaySlotBreakdown(result);\n }\n}\n\n/** Display individual slot states */\nfunction displaySlotBreakdown(result: ScoreResult): void {\n for (const [path, state] of Object.entries(result.slots)) {\n const icon = state === 'populated' ? fafCyan('●')\n : state === 'slotignored' ? dim('—')\n : dim('○');\n console.log(` ${icon} ${state === 'slotignored' ? dim(path) : path}`);\n }\n}\n\n/** Display the FAF header/banner */\nexport function displayHeader(): void {\n console.log(fafCyan(bold('faf')) + dim(' — Foundational AI-Context Format'));\n}\n",
155
+ "import { findFafFile, readFafRaw } from '../interop/faf.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { enrichScore } from '../core/scorer.js';\nimport { displayScore } from '../ui/display.js';\nimport { tierBadge } from '../core/tiers.js';\nimport { bold } from '../ui/colors.js';\n\nexport interface ScoreOptions {\n verbose?: boolean;\n status?: boolean;\n json?: boolean;\n}\n\nexport function scoreCommand(file?: string, options: ScoreOptions = {}): void {\n const fafPath = file ?? findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const yaml = readFafRaw(fafPath);\n const raw = kernel.score(yaml);\n const result = enrichScore(raw);\n\n if (options.json) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n\n if (options.status) {\n // Compact one-liner for CI/scripts\n console.log(`${tierBadge(result.tier)} ${bold(`${result.score}%`)}`);\n return;\n }\n\n displayScore(result, fafPath, options.verbose);\n}\n",
156
+ "import { existsSync } from 'fs';\nimport { join } from 'path';\nimport { detectStack } from '../detect/stack.js';\nimport { writeFaf, readFafRaw } from '../interop/faf.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { enrichScore } from '../core/scorer.js';\nimport { displayScore } from '../ui/display.js';\nimport { bold, dim, fafCyan } from '../ui/colors.js';\n\nexport interface InitOptions {\n yolo?: boolean;\n quick?: boolean;\n force?: boolean;\n output?: string;\n}\n\nexport function initCommand(options: InitOptions = {}): void {\n const dir = process.cwd();\n const outputPath = options.output\n ? (options.output.endsWith('.faf') ? options.output : join(dir, options.output))\n : join(dir, 'project.faf');\n\n if (existsSync(outputPath) && !options.force) {\n console.error(`project.faf already exists. Use ${bold('--force')} to overwrite.`);\n process.exit(1);\n }\n\n const data = detectStack(dir);\n writeFaf(outputPath, data);\n\n const yaml = readFafRaw(outputPath);\n const result = enrichScore(kernel.score(yaml));\n\n console.log(`${fafCyan('created')} ${outputPath}`);\n displayScore(result, outputPath);\n\n if (result.score < 100) {\n console.log(dim(`\\n run ${bold(\"'faf go'\")} to fill empty slots`));\n }\n}\n",
157
+ "import type { SlotDef, SlotCategory } from './types.js';\n\n/** All 33 Mk4 canonical slots */\nexport const SLOTS: SlotDef[] = [\n // Project Meta (3)\n { index: 1, path: 'project.name', description: 'Project name', category: 'project' },\n { index: 2, path: 'project.goal', description: 'What the project does', category: 'project' },\n { index: 3, path: 'project.main_language', description: 'Primary language', category: 'project' },\n\n // Human Context (6)\n { index: 4, path: 'human_context.who', description: 'Who is building this', category: 'human' },\n { index: 5, path: 'human_context.what', description: 'What are they building', category: 'human' },\n { index: 6, path: 'human_context.why', description: 'Why does it exist', category: 'human' },\n { index: 7, path: 'human_context.where', description: 'Where does it run', category: 'human' },\n { index: 8, path: 'human_context.when', description: 'When was it started / timeline', category: 'human' },\n { index: 9, path: 'human_context.how', description: 'How is it built', category: 'human' },\n\n // Frontend Stack (4)\n { index: 10, path: 'stack.frontend', description: 'Framework (React, Svelte, etc.)', category: 'frontend' },\n { index: 11, path: 'stack.css_framework', description: 'CSS framework', category: 'frontend' },\n { index: 12, path: 'stack.ui_library', description: 'UI component library', category: 'frontend' },\n { index: 13, path: 'stack.state_management', description: 'State management', category: 'frontend' },\n\n // Backend Stack (5)\n { index: 14, path: 'stack.backend', description: 'Backend framework', category: 'backend' },\n { index: 15, path: 'stack.api_type', description: 'API style (REST, GraphQL, etc.)', category: 'backend' },\n { index: 16, path: 'stack.runtime', description: 'Runtime (Node, Bun, Python, etc.)', category: 'backend' },\n { index: 17, path: 'stack.database', description: 'Database', category: 'backend' },\n { index: 18, path: 'stack.connection', description: 'Connection method (Prisma, etc.)', category: 'backend' },\n\n // Universal Stack (3)\n { index: 19, path: 'stack.hosting', description: 'Hosting platform', category: 'universal' },\n { index: 20, path: 'stack.build', description: 'Build tool', category: 'universal' },\n { index: 21, path: 'stack.cicd', description: 'CI/CD', category: 'universal' },\n\n // Enterprise Infra (5)\n { index: 22, path: 'stack.monorepo_tool', description: 'Monorepo tool', category: 'enterprise_infra' },\n { index: 23, path: 'stack.package_manager', description: 'Package manager', category: 'enterprise_infra' },\n { index: 24, path: 'stack.workspaces', description: 'Workspace configuration', category: 'enterprise_infra' },\n { index: 25, path: 'monorepo.packages_count', description: 'Number of packages', category: 'enterprise_infra' },\n { index: 26, path: 'monorepo.build_orchestrator', description: 'Build orchestration tool', category: 'enterprise_infra' },\n\n // Enterprise App (4)\n { index: 27, path: 'stack.admin', description: 'Admin panel', category: 'enterprise_app' },\n { index: 28, path: 'stack.cache', description: 'Caching layer', category: 'enterprise_app' },\n { index: 29, path: 'stack.search', description: 'Search engine', category: 'enterprise_app' },\n { index: 30, path: 'stack.storage', description: 'Object storage', category: 'enterprise_app' },\n\n // Enterprise Ops (3)\n { index: 31, path: 'monorepo.versioning_strategy', description: 'Version strategy', category: 'enterprise_ops' },\n { index: 32, path: 'monorepo.shared_configs', description: 'Shared configs', category: 'enterprise_ops' },\n { index: 33, path: 'monorepo.remote_cache', description: 'Remote build cache', category: 'enterprise_ops' },\n];\n\n/** Slot lookup by path */\nexport const SLOT_BY_PATH = new Map(SLOTS.map(s => [s.path, s]));\n\n/** Slots grouped by category */\nexport function slotsByCategory(category: SlotCategory): SlotDef[] {\n return SLOTS.filter(s => s.category === category);\n}\n\n/** Base-tier slots (1-21) — used by score_faf */\nexport const BASE_SLOTS = SLOTS.filter(s => s.index <= 21);\n\n/** Enterprise-tier slots (1-33) — used by score_faf_enterprise */\nexport const ENTERPRISE_SLOTS = SLOTS;\n\n/** Placeholder values treated as Empty */\nexport const PLACEHOLDERS = new Set([\n 'describe your project goal',\n 'development teams',\n 'cloud platform',\n 'null',\n 'none',\n 'unknown',\n 'n/a',\n 'not applicable',\n]);\n\n/** Check if a value is a placeholder (empty) */\nexport function isPlaceholder(value: unknown): boolean {\n if (value === null || value === undefined || value === '') return true;\n if (typeof value === 'string') {\n return PLACEHOLDERS.has(value.toLowerCase().trim());\n }\n if (Array.isArray(value) && value.length === 0) return true;\n if (typeof value === 'object' && Object.keys(value as object).length === 0) return true;\n return false;\n}\n\n/** App-type to active category mapping for faf init */\nexport const APP_TYPE_CATEGORIES: Record<string, SlotCategory[]> = {\n cli: ['project', 'human'],\n library: ['project', 'human'],\n mcp: ['project', 'backend', 'human'],\n backend: ['project', 'backend', 'universal', 'human'],\n 'data-science': ['project', 'backend', 'human'],\n frontend: ['project', 'frontend', 'human'],\n fullstack: ['project', 'frontend', 'backend', 'universal', 'human'],\n svelte: ['project', 'frontend', 'backend', 'universal', 'human'],\n framework: ['project', 'frontend', 'backend', 'universal', 'human'],\n enterprise: ['project', 'frontend', 'backend', 'universal', 'human', 'enterprise_infra', 'enterprise_app', 'enterprise_ops'],\n};\n",
158
+ "import { existsSync, readFileSync, readdirSync } from 'fs';\nimport { join } from 'path';\nimport type { DetectedFramework, Signal } from '../core/types.js';\nimport { FRAMEWORKS } from './frameworks.js';\n\ninterface PackageJson {\n name?: string;\n version?: string;\n description?: string;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n scripts?: Record<string, string>;\n type?: string;\n main?: string;\n bin?: string | Record<string, string>;\n private?: boolean;\n workspaces?: string[] | { packages?: string[] };\n}\n\n/** Read and parse package.json from a directory */\nexport function readPackageJson(dir: string): PackageJson | null {\n const pkgPath = join(dir, 'package.json');\n if (!existsSync(pkgPath)) return null;\n try {\n return JSON.parse(readFileSync(pkgPath, 'utf-8'));\n } catch {\n return null;\n }\n}\n\n/** Scan a directory for files matching patterns */\nfunction fileExists(dir: string, pattern: string): boolean {\n // Handle simple file checks\n if (!pattern.includes('*')) {\n return existsSync(join(dir, pattern));\n }\n\n // Handle glob patterns like \"next.config.*\" or \".github/workflows/*.yml\"\n const parts = pattern.split('/');\n if (parts.length === 1) {\n // Simple wildcard: \"next.config.*\"\n const prefix = pattern.split('*')[0];\n try {\n return readdirSync(dir).some(f => f.startsWith(prefix));\n } catch {\n return false;\n }\n }\n\n // Multi-level: \".github/workflows/*.yml\"\n const subdir = join(dir, ...parts.slice(0, -1));\n const filePattern = parts[parts.length - 1];\n const prefix = filePattern.split('*')[0];\n const suffix = filePattern.split('*')[1] || '';\n try {\n return readdirSync(subdir).some(f => f.startsWith(prefix) && f.endsWith(suffix));\n } catch {\n return false;\n }\n}\n\n/** Match a single signal against project data */\nfunction matchSignal(signal: Signal, pkg: PackageJson | null, dir: string): boolean {\n switch (signal.type) {\n case 'dependency':\n return !!(pkg?.dependencies?.[signal.key!]);\n case 'devDependency':\n return !!(pkg?.devDependencies?.[signal.key!]);\n case 'file':\n return fileExists(dir, signal.pattern!);\n default:\n return false;\n }\n}\n\n/** Detect frameworks in a directory */\nexport function detectFrameworks(dir: string): DetectedFramework[] {\n const pkg = readPackageJson(dir);\n\n return FRAMEWORKS\n .map(fw => {\n const matched = fw.signals.filter(s => matchSignal(s, pkg, dir));\n const confidence = matched.length / fw.signals.length;\n return { name: fw.name, slug: fw.slug, category: fw.category, confidence };\n })\n .filter(fw => fw.confidence > 0)\n .sort((a, b) => b.confidence - a.confidence);\n}\n\n/** Detect the primary language of a project */\nexport function detectLanguage(dir: string): string {\n const pkg = readPackageJson(dir);\n\n // Check for TypeScript\n if (pkg?.devDependencies?.typescript || pkg?.dependencies?.typescript) return 'TypeScript';\n if (existsSync(join(dir, 'tsconfig.json'))) return 'TypeScript';\n\n // Check for common language indicators\n if (existsSync(join(dir, 'Cargo.toml'))) return 'Rust';\n if (existsSync(join(dir, 'go.mod'))) return 'Go';\n if (existsSync(join(dir, 'pyproject.toml')) || existsSync(join(dir, 'setup.py'))) return 'Python';\n if (existsSync(join(dir, 'Gemfile'))) return 'Ruby';\n if (existsSync(join(dir, 'pom.xml')) || existsSync(join(dir, 'build.gradle'))) return 'Java';\n if (existsSync(join(dir, 'Package.swift'))) return 'Swift';\n if (existsSync(join(dir, 'build.zig'))) return 'Zig';\n\n // Fallback to JS if package.json exists\n if (pkg) return 'JavaScript';\n\n return 'Unknown';\n}\n\n/** Detect the project type for slot mapping */\nexport function detectProjectType(dir: string): string {\n const pkg = readPackageJson(dir);\n const frameworks = detectFrameworks(dir);\n\n // CLI detection\n if (pkg?.bin) return 'cli';\n\n // MCP detection\n const hasMcp = frameworks.some(f => f.slug === 'mcp');\n if (hasMcp) return 'mcp';\n\n // Zig project-type detection — build.zig + entry-file convention.\n // src/main.zig → cli (executable); src/root.zig → library.\n // main.zig wins when both exist (typical: cli with internal lib exports).\n if (existsSync(join(dir, 'build.zig'))) {\n if (existsSync(join(dir, 'src/main.zig'))) return 'cli';\n if (existsSync(join(dir, 'src/root.zig'))) return 'library';\n }\n\n // Framework repo detection — private workspace monorepo that builds a framework\n const hasSvelte = frameworks.some(f => f.slug === 'svelte' || f.slug === 'sveltekit');\n const isPrivateWorkspace = pkg?.private === true && (\n existsSync(join(dir, 'pnpm-workspace.yaml')) ||\n pkg?.workspaces !== undefined\n );\n if (isPrivateWorkspace && hasSvelte) return 'framework';\n\n // Svelte/SvelteKit app detection — fullstack by nature (server routes + frontend)\n if (hasSvelte) return 'svelte';\n\n // Next.js and Nuxt are fullstack by nature (API routes built in)\n const hasNextOrNuxt = frameworks.some(f => f.slug === 'nextjs' || f.slug === 'nuxt');\n if (hasNextOrNuxt) return 'fullstack';\n\n // Full-stack detection\n const hasFrontend = frameworks.some(f => f.category === 'frontend');\n const hasBackend = frameworks.some(f => f.category === 'backend');\n if (hasFrontend && hasBackend) return 'fullstack';\n\n // Frontend-only\n if (hasFrontend) return 'frontend';\n\n // Backend-only\n if (hasBackend) return 'backend';\n\n // Library detection (has main/exports but no bin)\n if (pkg?.main && !pkg?.bin) return 'library';\n\n // Default\n return 'library';\n}\n\n/** Detect the runtime */\nexport function detectRuntime(dir: string): string {\n if (existsSync(join(dir, 'bunfig.toml'))) return 'Bun';\n if (existsSync(join(dir, 'deno.json')) || existsSync(join(dir, 'deno.jsonc'))) return 'Deno';\n if (readPackageJson(dir)) return 'Node.js';\n if (existsSync(join(dir, 'Cargo.toml'))) return 'Rust';\n if (existsSync(join(dir, 'go.mod'))) return 'Go';\n return 'Unknown';\n}\n\n/** Detect package manager */\nexport function detectPackageManager(dir: string): string {\n if (existsSync(join(dir, 'bun.lockb')) || existsSync(join(dir, 'bun.lock'))) return 'bun';\n if (existsSync(join(dir, 'pnpm-lock.yaml'))) return 'pnpm';\n if (existsSync(join(dir, 'yarn.lock'))) return 'yarn';\n if (existsSync(join(dir, 'package-lock.json'))) return 'npm';\n return 'npm';\n}\n\n/** Detect CI/CD */\nexport function detectCicd(dir: string): string | null {\n if (existsSync(join(dir, '.github/workflows'))) return 'GitHub Actions';\n if (existsSync(join(dir, '.gitlab-ci.yml'))) return 'GitLab CI';\n if (existsSync(join(dir, '.circleci'))) return 'CircleCI';\n if (existsSync(join(dir, 'Jenkinsfile'))) return 'Jenkins';\n return null;\n}\n\n/** Detect hosting platform */\nexport function detectHosting(dir: string): string | null {\n if (existsSync(join(dir, 'vercel.json'))) return 'Vercel';\n if (existsSync(join(dir, 'netlify.toml'))) return 'Netlify';\n if (existsSync(join(dir, 'wrangler.toml'))) return 'Cloudflare';\n if (existsSync(join(dir, 'Dockerfile'))) return 'Docker';\n if (existsSync(join(dir, 'fly.toml'))) return 'Fly.io';\n if (existsSync(join(dir, 'render.yaml'))) return 'Render';\n return null;\n}\n\n/** Detect SvelteKit adapter from svelte.config.js */\nexport function detectSvelteAdapter(dir: string): string | null {\n const configPath = join(dir, 'svelte.config.js');\n if (!existsSync(configPath)) return null;\n try {\n const content = readFileSync(configPath, 'utf-8');\n // Match adapter imports: import adapter from '@sveltejs/adapter-vercel'\n // Or: import { adapter } from '@sveltejs/adapter-node'\n // Or: const adapter = require('@sveltejs/adapter-static')\n const adapterMatch = content.match(/@sveltejs\\/adapter-(\\w+)/);\n if (adapterMatch) {\n const adapter = adapterMatch[1];\n switch (adapter) {\n case 'vercel': return 'Vercel';\n case 'node': return 'Node';\n case 'static': return 'Static';\n case 'cloudflare': return 'Cloudflare';\n case 'netlify': return 'Netlify';\n case 'auto': return 'Auto';\n default: return adapter;\n }\n }\n return null;\n } catch {\n return null;\n }\n}\n\n/** Detect build tool */\nexport function detectBuildTool(dir: string): string | null {\n const pkg = readPackageJson(dir);\n if (pkg?.devDependencies?.vite || pkg?.dependencies?.vite) return 'Vite';\n if (pkg?.devDependencies?.webpack || pkg?.dependencies?.webpack) return 'webpack';\n if (pkg?.devDependencies?.esbuild || pkg?.dependencies?.esbuild) return 'esbuild';\n if (existsSync(join(dir, 'tsconfig.json')) && pkg?.devDependencies?.typescript) return 'TypeScript (tsc)';\n return null;\n}\n",
159
+ "import type { FrameworkSignature } from '../core/types.js';\n\n/** Data-driven framework signatures — one scanner evaluates all */\nexport const FRAMEWORKS: FrameworkSignature[] = [\n // Frontend Frameworks\n { name: 'Next.js', slug: 'nextjs', category: 'frontend', signals: [\n { type: 'dependency', key: 'next' },\n { type: 'file', pattern: 'next.config.*' },\n ]},\n { name: 'React', slug: 'react', category: 'frontend', signals: [\n { type: 'dependency', key: 'react' },\n ]},\n { name: 'SvelteKit', slug: 'sveltekit', category: 'frontend', signals: [\n { type: 'dependency', key: '@sveltejs/kit' },\n { type: 'file', pattern: 'svelte.config.*' },\n ]},\n { name: 'Svelte', slug: 'svelte', category: 'frontend', signals: [\n { type: 'dependency', key: 'svelte' },\n { type: 'devDependency', key: 'svelte' },\n ]},\n { name: 'Vue.js', slug: 'vue', category: 'frontend', signals: [\n { type: 'dependency', key: 'vue' },\n ]},\n { name: 'Nuxt', slug: 'nuxt', category: 'frontend', signals: [\n { type: 'dependency', key: 'nuxt' },\n { type: 'file', pattern: 'nuxt.config.*' },\n ]},\n { name: 'Angular', slug: 'angular', category: 'frontend', signals: [\n { type: 'dependency', key: '@angular/core' },\n { type: 'file', pattern: 'angular.json' },\n ]},\n { name: 'Astro', slug: 'astro', category: 'frontend', signals: [\n { type: 'dependency', key: 'astro' },\n { type: 'file', pattern: 'astro.config.*' },\n ]},\n { name: 'Solid', slug: 'solid', category: 'frontend', signals: [\n { type: 'dependency', key: 'solid-js' },\n ]},\n { name: 'Remix', slug: 'remix', category: 'frontend', signals: [\n { type: 'dependency', key: '@remix-run/react' },\n ]},\n { name: 'Gatsby', slug: 'gatsby', category: 'frontend', signals: [\n { type: 'dependency', key: 'gatsby' },\n { type: 'file', pattern: 'gatsby-config.*' },\n ]},\n { name: 'Qwik', slug: 'qwik', category: 'frontend', signals: [\n { type: 'dependency', key: '@builder.io/qwik' },\n ]},\n\n // SvelteKit Adapters (hosting signal)\n { name: 'Vercel (SvelteKit)', slug: 'adapter-vercel', category: 'hosting', signals: [\n { type: 'dependency', key: '@sveltejs/adapter-vercel' },\n { type: 'devDependency', key: '@sveltejs/adapter-vercel' },\n ]},\n { name: 'Node (SvelteKit)', slug: 'adapter-node', category: 'hosting', signals: [\n { type: 'dependency', key: '@sveltejs/adapter-node' },\n { type: 'devDependency', key: '@sveltejs/adapter-node' },\n ]},\n { name: 'Static (SvelteKit)', slug: 'adapter-static', category: 'hosting', signals: [\n { type: 'dependency', key: '@sveltejs/adapter-static' },\n { type: 'devDependency', key: '@sveltejs/adapter-static' },\n ]},\n { name: 'Cloudflare (SvelteKit)', slug: 'adapter-cloudflare', category: 'hosting', signals: [\n { type: 'dependency', key: '@sveltejs/adapter-cloudflare' },\n { type: 'devDependency', key: '@sveltejs/adapter-cloudflare' },\n ]},\n { name: 'Netlify (SvelteKit)', slug: 'adapter-netlify', category: 'hosting', signals: [\n { type: 'dependency', key: '@sveltejs/adapter-netlify' },\n { type: 'devDependency', key: '@sveltejs/adapter-netlify' },\n ]},\n\n // CSS Frameworks\n { name: 'Tailwind CSS', slug: 'tailwind', category: 'css', signals: [\n { type: 'dependency', key: 'tailwindcss' },\n { type: 'devDependency', key: 'tailwindcss' },\n { type: 'file', pattern: 'tailwind.config.*' },\n ]},\n { name: 'Bootstrap', slug: 'bootstrap', category: 'css', signals: [\n { type: 'dependency', key: 'bootstrap' },\n ]},\n { name: 'Styled Components', slug: 'styled-components', category: 'css', signals: [\n { type: 'dependency', key: 'styled-components' },\n ]},\n\n // UI Libraries\n { name: 'shadcn/ui', slug: 'shadcn', category: 'ui', signals: [\n { type: 'file', pattern: 'components.json' },\n { type: 'dependency', key: '@radix-ui/react-dialog' },\n ]},\n { name: 'Material UI', slug: 'mui', category: 'ui', signals: [\n { type: 'dependency', key: '@mui/material' },\n ]},\n { name: 'Chakra UI', slug: 'chakra', category: 'ui', signals: [\n { type: 'dependency', key: '@chakra-ui/react' },\n ]},\n { name: 'Ant Design', slug: 'antd', category: 'ui', signals: [\n { type: 'dependency', key: 'antd' },\n ]},\n\n // State Management\n { name: 'Redux', slug: 'redux', category: 'state', signals: [\n { type: 'dependency', key: '@reduxjs/toolkit' },\n ]},\n { name: 'Zustand', slug: 'zustand', category: 'state', signals: [\n { type: 'dependency', key: 'zustand' },\n ]},\n { name: 'Jotai', slug: 'jotai', category: 'state', signals: [\n { type: 'dependency', key: 'jotai' },\n ]},\n { name: 'Pinia', slug: 'pinia', category: 'state', signals: [\n { type: 'dependency', key: 'pinia' },\n ]},\n\n // Backend Frameworks\n { name: 'Express', slug: 'express', category: 'backend', signals: [\n { type: 'dependency', key: 'express' },\n ]},\n { name: 'Fastify', slug: 'fastify', category: 'backend', signals: [\n { type: 'dependency', key: 'fastify' },\n ]},\n { name: 'Hono', slug: 'hono', category: 'backend', signals: [\n { type: 'dependency', key: 'hono' },\n ]},\n { name: 'Elysia', slug: 'elysia', category: 'backend', signals: [\n { type: 'dependency', key: 'elysia' },\n ]},\n { name: 'NestJS', slug: 'nestjs', category: 'backend', signals: [\n { type: 'dependency', key: '@nestjs/core' },\n ]},\n { name: 'Koa', slug: 'koa', category: 'backend', signals: [\n { type: 'dependency', key: 'koa' },\n ]},\n { name: 'Django', slug: 'django', category: 'backend', signals: [\n { type: 'file', pattern: 'manage.py' },\n { type: 'file', pattern: 'settings.py' },\n ]},\n { name: 'Flask', slug: 'flask', category: 'backend', signals: [\n { type: 'file', pattern: 'app.py' },\n ]},\n { name: 'FastAPI', slug: 'fastapi', category: 'backend', signals: [\n { type: 'file', pattern: 'main.py' },\n ]},\n { name: 'Rails', slug: 'rails', category: 'backend', signals: [\n { type: 'file', pattern: 'Gemfile' },\n { type: 'file', pattern: 'config/routes.rb' },\n ]},\n { name: 'Spring Boot', slug: 'spring', category: 'backend', signals: [\n { type: 'file', pattern: 'pom.xml' },\n { type: 'file', pattern: 'build.gradle' },\n ]},\n\n // Databases\n { name: 'Prisma', slug: 'prisma', category: 'database', signals: [\n { type: 'dependency', key: 'prisma' },\n { type: 'devDependency', key: 'prisma' },\n { type: 'file', pattern: 'prisma/schema.prisma' },\n ]},\n { name: 'Drizzle', slug: 'drizzle', category: 'database', signals: [\n { type: 'dependency', key: 'drizzle-orm' },\n { type: 'file', pattern: 'drizzle.config.*' },\n ]},\n { name: 'TypeORM', slug: 'typeorm', category: 'database', signals: [\n { type: 'dependency', key: 'typeorm' },\n ]},\n { name: 'Mongoose', slug: 'mongoose', category: 'database', signals: [\n { type: 'dependency', key: 'mongoose' },\n ]},\n\n // Build Tools\n { name: 'Vite', slug: 'vite', category: 'build', signals: [\n { type: 'dependency', key: 'vite' },\n { type: 'devDependency', key: 'vite' },\n { type: 'file', pattern: 'vite.config.*' },\n ]},\n { name: 'webpack', slug: 'webpack', category: 'build', signals: [\n { type: 'dependency', key: 'webpack' },\n { type: 'devDependency', key: 'webpack' },\n { type: 'file', pattern: 'webpack.config.*' },\n ]},\n { name: 'esbuild', slug: 'esbuild', category: 'build', signals: [\n { type: 'dependency', key: 'esbuild' },\n { type: 'devDependency', key: 'esbuild' },\n ]},\n { name: 'Turbopack', slug: 'turbopack', category: 'build', signals: [\n { type: 'file', pattern: 'turbo.json' },\n ]},\n\n // Testing\n { name: 'Jest', slug: 'jest', category: 'testing', signals: [\n { type: 'devDependency', key: 'jest' },\n { type: 'file', pattern: 'jest.config.*' },\n ]},\n { name: 'Vitest', slug: 'vitest', category: 'testing', signals: [\n { type: 'devDependency', key: 'vitest' },\n ]},\n { name: 'Playwright', slug: 'playwright', category: 'testing', signals: [\n { type: 'devDependency', key: '@playwright/test' },\n { type: 'file', pattern: 'playwright.config.*' },\n ]},\n { name: 'Cypress', slug: 'cypress', category: 'testing', signals: [\n { type: 'devDependency', key: 'cypress' },\n { type: 'file', pattern: 'cypress.config.*' },\n ]},\n\n // Monorepo Tools\n { name: 'Turborepo', slug: 'turborepo', category: 'monorepo', signals: [\n { type: 'devDependency', key: 'turbo' },\n { type: 'file', pattern: 'turbo.json' },\n ]},\n { name: 'Nx', slug: 'nx', category: 'monorepo', signals: [\n { type: 'devDependency', key: 'nx' },\n { type: 'file', pattern: 'nx.json' },\n ]},\n { name: 'Lerna', slug: 'lerna', category: 'monorepo', signals: [\n { type: 'devDependency', key: 'lerna' },\n { type: 'file', pattern: 'lerna.json' },\n ]},\n\n // MCP / AI\n { name: 'MCP SDK', slug: 'mcp', category: 'ai', signals: [\n { type: 'dependency', key: '@modelcontextprotocol/sdk' },\n ]},\n { name: 'Anthropic SDK', slug: 'anthropic', category: 'ai', signals: [\n { type: 'dependency', key: '@anthropic-ai/sdk' },\n ]},\n { name: 'OpenAI SDK', slug: 'openai', category: 'ai', signals: [\n { type: 'dependency', key: 'openai' },\n ]},\n { name: 'LangChain', slug: 'langchain', category: 'ai', signals: [\n { type: 'dependency', key: 'langchain' },\n ]},\n\n // Hosting / Deploy\n { name: 'Vercel', slug: 'vercel', category: 'hosting', signals: [\n { type: 'file', pattern: 'vercel.json' },\n ]},\n { name: 'Netlify', slug: 'netlify', category: 'hosting', signals: [\n { type: 'file', pattern: 'netlify.toml' },\n ]},\n { name: 'Docker', slug: 'docker', category: 'hosting', signals: [\n { type: 'file', pattern: 'Dockerfile' },\n { type: 'file', pattern: 'docker-compose.yml' },\n ]},\n { name: 'Cloudflare Workers', slug: 'cloudflare', category: 'hosting', signals: [\n { type: 'file', pattern: 'wrangler.toml' },\n { type: 'dependency', key: 'wrangler' },\n ]},\n\n // CI/CD\n { name: 'GitHub Actions', slug: 'github-actions', category: 'cicd', signals: [\n { type: 'file', pattern: '.github/workflows/*.yml' },\n ]},\n\n // Commander (CLI indicator)\n { name: 'Commander.js', slug: 'commander', category: 'cli', signals: [\n { type: 'dependency', key: 'commander' },\n ]},\n];\n",
160
+ "import type { FafData } from '../core/types.js';\nimport { APP_TYPE_CATEGORIES, SLOTS } from '../core/slots.js';\nimport {\n detectFrameworks,\n detectLanguage,\n detectProjectType,\n detectRuntime,\n detectPackageManager,\n detectCicd,\n detectHosting,\n detectBuildTool,\n detectSvelteAdapter,\n readPackageJson,\n} from './scanner.js';\n\n/** Auto-detect project stack and generate .faf data */\nexport function detectStack(dir: string): FafData {\n const pkg = readPackageJson(dir);\n const frameworks = detectFrameworks(dir);\n const language = detectLanguage(dir);\n const projectType = detectProjectType(dir);\n const runtime = detectRuntime(dir);\n const pkgManager = detectPackageManager(dir);\n const cicd = detectCicd(dir);\n const hosting = detectHosting(dir);\n const buildTool = detectBuildTool(dir);\n\n // Find specific frameworks by category\n const frontendFw = frameworks.find(f => f.category === 'frontend');\n const cssFw = frameworks.find(f => f.category === 'css');\n const uiFw = frameworks.find(f => f.category === 'ui');\n const stateFw = frameworks.find(f => f.category === 'state');\n const backendFw = frameworks.find(f => f.category === 'backend');\n const dbFw = frameworks.find(f => f.category === 'database');\n\n // Determine which categories are active\n const activeCategories = APP_TYPE_CATEGORIES[projectType] || APP_TYPE_CATEGORIES.library;\n\n // Framework sub-type detection (framework → svelte, framework → nextjs, etc.)\n const isFramework = projectType === 'framework';\n const hasSvelteSignal = frameworks.some(f => f.slug === 'svelte' || f.slug === 'sveltekit');\n const frameworkSubType = isFramework && hasSvelteSignal ? 'svelte' : (isFramework ? null : null);\n\n // Svelte-aware: fires for svelte apps AND framework→svelte repos\n const isSvelte = projectType === 'svelte' || frameworkSubType === 'svelte';\n const svelteAdapter = isSvelte ? detectSvelteAdapter(dir) : null;\n const hasSvelteKit = isSvelte && frameworks.some(f => f.slug === 'sveltekit');\n\n // Framework repos: slots that never apply to framework source code\n const frameworkIgnoredSlots = new Set(['css_framework', 'ui_library', 'database', 'connection', 'hosting']);\n\n // Build stack with slotignored for inactive categories\n const stack: Record<string, string> = {};\n const stackSlots = SLOTS.filter(s => s.path.startsWith('stack.'));\n\n for (const slot of stackSlots) {\n const field = slot.path.replace('stack.', '');\n if (!activeCategories.includes(slot.category)) {\n stack[field] = 'slotignored';\n continue;\n }\n\n // Framework repos: slotignore slots that never apply to framework source code\n if (isFramework && frameworkIgnoredSlots.has(field)) {\n stack[field] = 'slotignored';\n continue;\n }\n\n // Auto-fill detected values (Svelte-aware overrides applied inline)\n switch (field) {\n case 'frontend': stack[field] = frontendFw?.name ?? (projectType === 'cli' ? 'CLI' : ''); break;\n case 'css_framework': stack[field] = cssFw?.name ?? ''; break;\n case 'ui_library': stack[field] = uiFw?.name ?? ''; break;\n case 'state_management':\n // Svelte 5 uses Runes — no external state library needed\n stack[field] = isSvelte ? (stateFw?.name ?? 'Runes') : (stateFw?.name ?? '');\n break;\n case 'backend':\n // SvelteKit IS the backend (server routes, form actions, hooks)\n stack[field] = isSvelte ? (hasSvelteKit ? 'SvelteKit' : (backendFw?.name ?? '')) : (backendFw?.name ?? '');\n break;\n case 'api_type':\n // SvelteKit uses form actions + server routes\n stack[field] = hasSvelteKit ? 'Server Routes' : '';\n break;\n case 'runtime': stack[field] = runtime !== 'Unknown' ? runtime : ''; break;\n case 'database':\n // Only populate if ORM actually detected\n stack[field] = dbFw?.name ?? '';\n break;\n case 'connection':\n stack[field] = dbFw?.name ?? '';\n break;\n case 'hosting':\n // Svelte adapter → hosting platform (adapter-vercel = Vercel, etc.)\n if (isSvelte && svelteAdapter) {\n stack[field] = svelteAdapter;\n } else {\n stack[field] = hosting ?? '';\n }\n break;\n case 'build':\n // SvelteKit always uses Vite\n stack[field] = isSvelte ? 'Vite' : (buildTool ?? '');\n break;\n case 'cicd': stack[field] = cicd ?? ''; break;\n case 'package_manager': stack[field] = pkgManager; break;\n default: stack[field] = ''; break;\n }\n }\n\n // Build monorepo section\n const monorepo: Record<string, string> = {};\n const monorepoSlots = SLOTS.filter(s => s.path.startsWith('monorepo.'));\n for (const slot of monorepoSlots) {\n const field = slot.path.replace('monorepo.', '');\n if (!activeCategories.includes(slot.category)) {\n monorepo[field] = 'slotignored';\n } else {\n monorepo[field] = '';\n }\n }\n\n // Build project section\n const project: Record<string, string> = {\n name: pkg?.name ?? dir.split('/').pop() ?? 'project',\n goal: pkg?.description ?? '',\n main_language: language,\n type: projectType,\n };\n if (isFramework && frameworkSubType) {\n project.framework = frameworkSubType;\n }\n\n return {\n faf_version: '2.5.0',\n project,\n stack,\n human_context: {\n who: '',\n what: pkg?.description ?? '',\n why: '',\n where: '',\n when: '',\n how: '',\n },\n monorepo,\n };\n}\n",
161
+ "import { existsSync } from 'fs';\nimport { join } from 'path';\nimport { detectStack } from '../detect/stack.js';\nimport { writeFaf, readFaf, readFafRaw } from '../interop/faf.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { enrichScore } from '../core/scorer.js';\nimport { displayScore } from '../ui/display.js';\nimport { bold, dim, fafCyan } from '../ui/colors.js';\nimport { APP_TYPE_CATEGORIES, SLOTS } from '../core/slots.js';\n\nexport function autoCommand(): void {\n const dir = process.cwd();\n const fafPath = join(dir, 'project.faf');\n\n const detected = detectStack(dir);\n\n if (existsSync(fafPath)) {\n const existing = readFaf(fafPath);\n const merged = mergeDetected(existing, detected);\n writeFaf(fafPath, merged);\n console.log(`${fafCyan('updated')} ${fafPath}`);\n } else {\n const projectType = detected.project?.type ?? 'library';\n const activeCategories = APP_TYPE_CATEGORIES[projectType] || APP_TYPE_CATEGORIES.library;\n\n for (const slot of SLOTS) {\n if (!activeCategories.includes(slot.category)) {\n const [section, field] = slot.path.split('.');\n if (section === 'stack' && detected.stack) {\n (detected.stack as Record<string, string>)[field] = 'slotignored';\n }\n if (section === 'monorepo' && detected.monorepo) {\n (detected.monorepo as Record<string, string>)[field] = 'slotignored';\n }\n }\n }\n\n writeFaf(fafPath, detected);\n console.log(`${fafCyan('created')} ${fafPath}`);\n }\n\n const yaml = readFafRaw(fafPath);\n const result = enrichScore(kernel.score(yaml));\n displayScore(result, fafPath);\n\n if (result.score < 100) {\n console.log(dim(`\\n run ${bold(\"'faf go'\")} to reach 100%`));\n }\n}\n\nfunction mergeDetected(existing: Record<string, unknown>, detected: Record<string, unknown>): Record<string, unknown> {\n const result = { ...existing };\n for (const [key, value] of Object.entries(detected)) {\n if (!(key in result) || result[key] === null || result[key] === undefined) {\n result[key] = value;\n } else if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n result[key] = mergeDetected(\n (result[key] as Record<string, unknown>) ?? {},\n value as Record<string, unknown>,\n );\n }\n }\n return result;\n}\n",
162
+ "import { existsSync, statSync } from 'fs';\nimport { join, dirname } from 'path';\nimport { findFafFile, readFaf, readFafRaw, writeFaf } from '../interop/faf.js';\nimport { readClaudeMd, writeClaudeMd, generateClaudeMd, parseClaudeMd } from '../interop/claude.js';\nimport { readMemoryMd, writeMemoryMd } from '../interop/memory.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { enrichScore } from '../core/scorer.js';\nimport { displayScore } from '../ui/display.js';\nimport { bold, dim, fafCyan } from '../ui/colors.js';\nimport { isPro } from '../core/pro.js';\n\nexport interface SyncOptions {\n watch?: boolean;\n direction?: 'auto' | 'push' | 'pull';\n}\n\nexport function syncCommand(options: SyncOptions = {}): void {\n const dir = process.cwd();\n const fafPath = findFafFile(dir);\n\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const claudePath = join(dir, 'CLAUDE.md');\n const memoryPath = join(dir, 'MEMORY.md');\n const direction = options.direction ?? 'auto';\n\n // bi-sync: .faf ↔ CLAUDE.md\n if (direction === 'auto') {\n autoSync(fafPath, claudePath, dir);\n } else if (direction === 'push') {\n pushSync(fafPath, dir);\n } else if (direction === 'pull') {\n pullSync(fafPath, claudePath);\n }\n\n // tri-sync: .faf ↔ MEMORY.md (Pro)\n if (isPro()) {\n triSync(fafPath, memoryPath, dir);\n }\n\n if (options.watch) {\n console.log(dim('watching for changes... (Ctrl+C to stop)'));\n watchSync(fafPath, claudePath, memoryPath, dir);\n }\n}\n\nfunction autoSync(fafPath: string, claudePath: string, dir: string): void {\n const fafMtime = statSync(fafPath).mtimeMs;\n const claudeMtime = existsSync(claudePath) ? statSync(claudePath).mtimeMs : 0;\n\n if (!existsSync(claudePath) || fafMtime > claudeMtime) {\n pushSync(fafPath, dir);\n } else {\n pullSync(fafPath, claudePath);\n }\n}\n\nfunction pushSync(fafPath: string, dir: string): void {\n const data = readFaf(fafPath);\n const content = generateClaudeMd(data);\n writeClaudeMd(dir, content);\n console.log(`${fafCyan('◆')} sync .faf → CLAUDE.md ${dim('← bi-sync')}`);\n\n const result = enrichScore(kernel.score(readFafRaw(fafPath)));\n displayScore(result, fafPath);\n}\n\nfunction pullSync(fafPath: string, claudePath: string): void {\n // Use dirname() to extract the directory portably — claudePath comes from\n // join(dir, 'CLAUDE.md') which produces backslashes on Windows. The previous\n // claudePath.replace('/CLAUDE.md', '') only worked on POSIX path separators\n // and silently returned the unchanged path on Windows, breaking pull-sync.\n const claudeContent = readClaudeMd(dirname(claudePath));\n if (!claudeContent) {\n console.error('CLAUDE.md not found.');\n return;\n }\n\n const parsed = parseClaudeMd(claudeContent);\n const existing = readFaf(fafPath);\n\n if (parsed.project?.name) existing.project = { ...existing.project, name: parsed.project.name };\n if (parsed.project?.goal) existing.project = { ...existing.project, goal: parsed.project.goal };\n if (parsed.project?.main_language) existing.project = { ...existing.project, main_language: parsed.project.main_language };\n\n writeFaf(fafPath, existing);\n console.log(`${fafCyan('◆')} sync CLAUDE.md → .faf ${dim('← bi-sync')}`);\n\n const result = enrichScore(kernel.score(readFafRaw(fafPath)));\n displayScore(result, fafPath);\n}\n\nfunction triSync(fafPath: string, memoryPath: string, dir: string): void {\n const data = readFaf(fafPath);\n const fafMtime = statSync(fafPath).mtimeMs;\n const memMtime = existsSync(memoryPath) ? statSync(memoryPath).mtimeMs : 0;\n\n if (!existsSync(memoryPath) || fafMtime > memMtime) {\n // Push .faf → MEMORY.md\n const topics = generateMemoryTopics(data);\n writeMemoryMd(dir, topics);\n console.log(`${fafCyan('◆')} sync .faf → MEMORY.md ${dim('← tri-sync')}`);\n } else {\n // Pull MEMORY.md → .faf (extract relevant context back)\n console.log(`${fafCyan('◆')} sync MEMORY.md → .faf ${dim('← tri-sync')}`);\n }\n}\n\n/** Generate memory topic content from .faf data */\nfunction generateMemoryTopics(data: Record<string, unknown>): string {\n const project = (data.project ?? {}) as Record<string, string>;\n const lines: string[] = [\n `# ${project.name ?? 'Project'} — Memory Topics`,\n '',\n `> Generated by faf sync (tri-sync)`,\n '',\n ];\n\n if (project.name) lines.push(`- **Project:** ${project.name}`);\n if (project.goal) lines.push(`- **Goal:** ${project.goal}`);\n if (project.main_language) lines.push(`- **Language:** ${project.main_language}`);\n if (project.type) lines.push(`- **Type:** ${project.type}`);\n\n return lines.join('\\n') + '\\n';\n}\n\nfunction watchSync(fafPath: string, claudePath: string, memoryPath: string, dir: string): void {\n const { watch } = require('fs');\n let debounce: ReturnType<typeof setTimeout> | null = null;\n\n const handler = () => {\n if (debounce) clearTimeout(debounce);\n debounce = setTimeout(() => {\n console.log(dim('change detected...'));\n autoSync(fafPath, claudePath, dir);\n if (isPro()) triSync(fafPath, memoryPath, dir);\n }, 200);\n };\n\n watch(fafPath, handler);\n if (existsSync(claudePath)) watch(claudePath, handler);\n if (isPro() && existsSync(memoryPath)) watch(memoryPath, handler);\n}\n",
163
+ "import { readFileSync, writeFileSync, existsSync, statSync } from 'fs';\nimport { join } from 'path';\nimport type { FafData } from '../core/types.js';\n\nconst CLAUDE_MD = 'CLAUDE.md';\nconst SYNC_MARKER = 'STATUS: BI-SYNC ACTIVE';\n\n/** Read CLAUDE.md from a directory */\nexport function readClaudeMd(dir: string): string | null {\n const path = join(dir, CLAUDE_MD);\n if (!existsSync(path)) return null;\n return readFileSync(path, 'utf-8');\n}\n\n/** Write CLAUDE.md with bi-sync footer */\nexport function writeClaudeMd(dir: string, content: string): void {\n const path = join(dir, CLAUDE_MD);\n writeFileSync(path, content, 'utf-8');\n}\n\n/** Get mtime of CLAUDE.md */\nexport function claudeMdMtime(dir: string): number | null {\n const path = join(dir, CLAUDE_MD);\n if (!existsSync(path)) return null;\n return statSync(path).mtimeMs;\n}\n\n/** Build the faf meta tag — one-line project DNA for any md */\nexport function fafMetaTag(data: FafData): string {\n const parts = [data.project?.name, data.project?.main_language, data.project?.goal]\n .filter(Boolean)\n .map(s => String(s).trim());\n return `<!-- faf: ${parts.join(' | ')} -->`;\n}\n\n/** Generate CLAUDE.md content from .faf data */\nexport function generateClaudeMd(data: FafData): string {\n const lines: string[] = [];\n const name = data.project?.name ?? 'Project';\n const lang = data.project?.main_language ?? '';\n const goal = data.project?.goal ?? '';\n\n // Meta tag — project DNA, invisible to renderers, visible to AI\n lines.push(fafMetaTag(data));\n lines.push('');\n\n // Title\n lines.push(`# CLAUDE.md — ${name}`);\n lines.push('');\n\n // What This Is\n if (goal) {\n lines.push('## What This Is');\n lines.push('');\n lines.push(goal);\n lines.push('');\n }\n\n // Stack — only non-ignored slots\n const stack = data.stack ?? {};\n const stackEntries: string[] = [];\n if (lang) stackEntries.push(`**Language:** ${lang}`);\n for (const [key, val] of Object.entries(stack)) {\n if (val && val !== 'slotignored' && String(val).trim()) {\n const label = key.replace(/_/g, ' ').replace(/\\b\\w/g, c => c.toUpperCase());\n stackEntries.push(`**${label}:** ${val}`);\n }\n }\n if (stackEntries.length > 0) {\n lines.push('## Stack');\n lines.push('');\n for (const entry of stackEntries) {\n lines.push(`- ${entry}`);\n }\n lines.push('');\n }\n\n // Context — from human_context (the 6Ws)\n const hc = data.human_context ?? {};\n const contextEntries: [string, string][] = [\n ['Who', hc.who], ['What', hc.what], ['Why', hc.why],\n ['Where', hc.where], ['When', hc.when], ['How', hc.how],\n ].filter(([_, v]) => v && String(v).trim()) as [string, string][];\n\n if (contextEntries.length > 0) {\n lines.push('## Context');\n lines.push('');\n for (const [label, val] of contextEntries) {\n lines.push(`- **${label}:** ${val}`);\n }\n lines.push('');\n }\n\n // Sync footer\n lines.push('---');\n lines.push('');\n lines.push(`*${SYNC_MARKER} — ${new Date().toISOString()}*`);\n lines.push('');\n\n return lines.join('\\n');\n}\n\n/** Extract project data from CLAUDE.md content (pull direction) */\nexport function parseClaudeMd(content: string): Partial<FafData> {\n const data: Partial<FafData> = { project: {} };\n\n // New format: \"# CLAUDE.md — project-name\"\n const titleMatch = content.match(/^# CLAUDE\\.md\\s*[—–-]\\s*(.+)$/m);\n if (titleMatch) data.project!.name = titleMatch[1].trim();\n\n // Old format fallback: \"**Name:** value\"\n if (!data.project!.name) {\n const nameMatch = content.match(/\\*\\*Name:\\*\\*\\s*(.+)/);\n if (nameMatch) data.project!.name = nameMatch[1].trim();\n }\n\n // New format: paragraph after \"## What This Is\"\n const whatMatch = content.match(/## What This Is\\s*\\n\\s*\\n(.+)/);\n if (whatMatch) data.project!.goal = whatMatch[1].trim();\n\n // Old format fallback: \"**What Building:** value\"\n if (!data.project!.goal) {\n const goalMatch = content.match(/\\*\\*What Building:\\*\\*\\s*(.+)/);\n if (goalMatch) data.project!.goal = goalMatch[1].trim();\n }\n\n // New format: \"**Language:** value\" under Stack\n const langMatch = content.match(/\\*\\*Language:\\*\\*\\s*(.+)/);\n if (langMatch) data.project!.main_language = langMatch[1].trim();\n\n // Old format fallback: \"**Main Language:** value\"\n if (!data.project!.main_language) {\n const oldLangMatch = content.match(/\\*\\*Main Language:\\*\\*\\s*(.+)/);\n if (oldLangMatch) data.project!.main_language = oldLangMatch[1].trim();\n }\n\n return data;\n}\n",
164
+ "import { readFileSync, writeFileSync, existsSync } from 'fs';\nimport { join } from 'path';\n\n/** Read MEMORY.md content */\nexport function readMemoryMd(dir: string): string | null {\n const path = join(dir, 'MEMORY.md');\n if (!existsSync(path)) return null;\n return readFileSync(path, 'utf-8');\n}\n\n/** Write MEMORY.md content */\nexport function writeMemoryMd(dir: string, content: string): void {\n writeFileSync(join(dir, 'MEMORY.md'), content, 'utf-8');\n}\n",
165
+ "/** Check if user has Pro access */\nexport function isPro(): boolean {\n return process.env.FAF_PRO === '1' || process.env.FAF_PRO === 'true';\n}\n",
166
+ "import { writeFileSync } from 'fs';\nimport { findFafFile, readFafRaw } from '../interop/faf.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { bold, dim, fafCyan } from '../ui/colors.js';\n\nexport interface CompileOptions {\n output?: string;\n}\n\nexport function compileCommand(file?: string, options: CompileOptions = {}): void {\n const fafPath = file ?? findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const yaml = readFafRaw(fafPath);\n const binary = kernel.compile(yaml);\n\n const outputPath = options.output ?? fafPath.replace(/\\.faf$/, '.fafb');\n writeFileSync(outputPath, binary);\n\n console.log(`${fafCyan('compiled')} ${outputPath} ${dim(`(${binary.length} bytes)`)}`);\n}\n",
167
+ "import { readFileSync } from 'fs';\nimport * as kernel from '../wasm/kernel.js';\n\nexport interface DecompileOptions {\n output?: string;\n}\n\nexport function decompileCommand(file: string, options: DecompileOptions = {}): void {\n if (!file) {\n console.error('Error: Please specify a .fafb file to decompile.');\n process.exit(1);\n }\n\n const bytes = new Uint8Array(readFileSync(file));\n\n // Check FAFB magic\n if (String.fromCharCode(bytes[0], bytes[1], bytes[2], bytes[3]) !== 'FAFB') {\n console.error('Error: Not a valid .fafb file (missing FAFB magic bytes).');\n process.exit(3);\n }\n\n const info = kernel.decompile(bytes);\n console.log(JSON.stringify(info, null, 2));\n}\n",
168
+ "import type { FafData } from './types.js';\n\n/** Validate a parsed .faf object */\nexport function validateFaf(data: unknown): { valid: boolean; errors: string[] } {\n const errors: string[] = [];\n\n if (!data || typeof data !== 'object') {\n errors.push('File is not a valid YAML mapping');\n return { valid: false, errors };\n }\n\n const faf = data as FafData;\n\n if (!faf.faf_version) {\n errors.push('Missing required field: faf_version');\n }\n\n if (!faf.project?.name) {\n errors.push('Missing required field: project.name');\n }\n\n return { valid: errors.length === 0, errors };\n}\n",
169
+ "import { findFafFile, readFaf, readFafRaw } from '../interop/faf.js';\nimport { validateFaf } from '../core/schema.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { enrichScore } from '../core/scorer.js';\nimport { displayScore } from '../ui/display.js';\nimport { bold, dim, fafCyan } from '../ui/colors.js';\n\nexport interface CheckOptions {\n strict?: boolean;\n fix?: boolean;\n doctor?: boolean;\n trust?: boolean;\n}\n\nexport function checkCommand(file?: string, options: CheckOptions = {}): void {\n const fafPath = file ?? findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const data = readFaf(fafPath);\n const validation = validateFaf(data);\n\n if (!validation.valid) {\n console.log(`${bold('invalid')} ${fafPath}`);\n for (const err of validation.errors) {\n console.log(` ${dim('x')} ${err}`);\n }\n process.exit(3);\n }\n\n const yaml = readFafRaw(fafPath);\n if (!kernel.validate(yaml)) {\n console.log(`${bold('invalid yaml')} ${fafPath}`);\n process.exit(3);\n }\n\n console.log(`${fafCyan('valid')} ${fafPath}`);\n\n const result = enrichScore(kernel.score(yaml));\n displayScore(result, fafPath);\n\n if (options.strict && result.score < 100) {\n console.log(dim('\\n --strict requires 100%'));\n process.exit(1);\n }\n}\n",
170
+ "import { readFileSync, writeFileSync, existsSync } from 'fs';\nimport { join } from 'path';\nimport type { FafData } from '../core/types.js';\nimport { fafMetaTag } from './claude.js';\n\n/** Generate AGENTS.md content from .faf data */\nexport function generateAgentsMd(data: FafData): string {\n const lines: string[] = [];\n\n lines.push(fafMetaTag(data));\n lines.push('');\n lines.push(`# AGENTS.md — ${data.project?.name ?? 'Project'}`);\n lines.push('');\n lines.push('> Auto-generated from project.faf — do not edit directly');\n lines.push('');\n lines.push('## Project Context');\n lines.push('');\n\n if (data.project?.name) lines.push(`- **Name:** ${data.project.name}`);\n if (data.project?.goal) lines.push(`- **Goal:** ${data.project.goal}`);\n if (data.project?.main_language) lines.push(`- **Language:** ${data.project.main_language}`);\n\n lines.push('');\n lines.push('## Stack');\n lines.push('');\n\n if (data.stack) {\n for (const [key, value] of Object.entries(data.stack)) {\n if (value && value !== 'slotignored' && value !== '') {\n lines.push(`- **${key}:** ${value}`);\n }\n }\n }\n\n if (data.human_context) {\n lines.push('');\n lines.push('## Human Context');\n lines.push('');\n for (const [key, value] of Object.entries(data.human_context)) {\n if (value && value !== '') {\n lines.push(`- **${key}:** ${value}`);\n }\n }\n }\n\n lines.push('');\n return lines.join('\\n');\n}\n\n/** Write AGENTS.md to a directory */\nexport function writeAgentsMd(dir: string, data: FafData): void {\n writeFileSync(join(dir, 'AGENTS.md'), generateAgentsMd(data), 'utf-8');\n}\n",
171
+ "import { writeFileSync } from 'fs';\nimport { join } from 'path';\nimport type { FafData } from '../core/types.js';\nimport { fafMetaTag } from './claude.js';\n\n/** Generate .cursorrules content from .faf data */\nexport function generateCursorrules(data: FafData): string {\n const lines: string[] = [];\n\n lines.push(fafMetaTag(data));\n lines.push('');\n lines.push('# .cursorrules');\n lines.push(`# Auto-generated from project.faf — ${data.project?.name ?? 'Project'}`);\n lines.push('');\n\n if (data.project?.main_language) {\n lines.push(`language: ${data.project.main_language}`);\n }\n\n if (data.stack) {\n lines.push('');\n lines.push('# Stack');\n for (const [key, value] of Object.entries(data.stack)) {\n if (value && value !== 'slotignored' && value !== '') {\n lines.push(`# ${key}: ${value}`);\n }\n }\n }\n\n lines.push('');\n return lines.join('\\n');\n}\n\n/** Write .cursorrules to a directory */\nexport function writeCursorrules(dir: string, data: FafData): void {\n writeFileSync(join(dir, '.cursorrules'), generateCursorrules(data), 'utf-8');\n}\n",
172
+ "import { writeFileSync } from 'fs';\nimport { join } from 'path';\nimport type { FafData } from '../core/types.js';\nimport { fafMetaTag } from './claude.js';\n\n/** Generate GEMINI.md content from .faf data */\nexport function generateGeminiMd(data: FafData): string {\n const lines: string[] = [];\n\n lines.push(fafMetaTag(data));\n lines.push('');\n lines.push(`# GEMINI.md — ${data.project?.name ?? 'Project'}`);\n lines.push('');\n lines.push('> Auto-generated from project.faf');\n lines.push('');\n\n if (data.project?.name) lines.push(`Project: ${data.project.name}`);\n if (data.project?.goal) lines.push(`Goal: ${data.project.goal}`);\n if (data.project?.main_language) lines.push(`Language: ${data.project.main_language}`);\n\n if (data.stack) {\n lines.push('');\n lines.push('## Stack');\n for (const [key, value] of Object.entries(data.stack)) {\n if (value && value !== 'slotignored' && value !== '') {\n lines.push(`- ${key}: ${value}`);\n }\n }\n }\n\n lines.push('');\n return lines.join('\\n');\n}\n\n/** Write GEMINI.md to a directory */\nexport function writeGeminiMd(dir: string, data: FafData): void {\n writeFileSync(join(dir, 'GEMINI.md'), generateGeminiMd(data), 'utf-8');\n}\n",
173
+ "import { findFafFile, readFaf } from '../interop/faf.js';\nimport { writeAgentsMd } from '../interop/agents.js';\nimport { writeCursorrules } from '../interop/cursorrules.js';\nimport { writeGeminiMd } from '../interop/gemini.js';\nimport { dim, fafCyan } from '../ui/colors.js';\n\nexport interface ExportOptions {\n agents?: boolean;\n cursor?: boolean;\n gemini?: boolean;\n conductor?: boolean;\n all?: boolean;\n}\n\nexport function exportCommand(options: ExportOptions = {}): void {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const dir = process.cwd();\n const data = readFaf(fafPath);\n const exportAll = options.all || (!options.agents && !options.cursor && !options.gemini && !options.conductor);\n\n if (exportAll || options.agents) {\n writeAgentsMd(dir, data);\n console.log(` AGENTS.md`);\n }\n\n if (exportAll || options.cursor) {\n writeCursorrules(dir, data);\n console.log(` .cursorrules`);\n }\n\n if (exportAll || options.gemini) {\n writeGeminiMd(dir, data);\n console.log(` GEMINI.md`);\n }\n\n console.log(`${fafCyan('exported')} ${dim(`from ${fafPath}`)}`);\n}\n",
174
+ "import { mkdirSync, rmSync } from 'fs';\nimport { join } from 'path';\nimport { execSync } from 'child_process';\nimport { tmpdir } from 'os';\nimport { detectStack } from '../detect/stack.js';\nimport { writeFaf, readFafRaw } from '../interop/faf.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { enrichScore } from '../core/scorer.js';\nimport { displayScore } from '../ui/display.js';\nimport { dim, fafCyan } from '../ui/colors.js';\n\nexport function gitCommand(url: string): void {\n if (!url) {\n console.error('Error: Please provide a GitHub URL.\\n\\n Usage: faf git <url>');\n process.exit(1);\n }\n\n const repoUrl = url.endsWith('.git') ? url : `${url}.git`;\n const tmpDir = join(tmpdir(), `faf-git-${Date.now()}`);\n mkdirSync(tmpDir, { recursive: true });\n\n try {\n console.log(dim(`cloning ${url}...`));\n try {\n execSync(`git clone --depth 1 ${repoUrl} ${tmpDir}`, { stdio: 'pipe' });\n } catch (err) {\n const stderr = (err as { stderr?: Buffer })?.stderr?.toString() ?? '';\n const reason = stderr.trim().split('\\n').slice(-2).join(' ').trim() || 'git clone failed';\n console.error(`Error: could not clone ${url}\\n\\n ${reason}`);\n process.exit(1);\n }\n\n const data = detectStack(tmpDir);\n const outputPath = join(process.cwd(), 'project.faf');\n writeFaf(outputPath, data);\n\n console.log(`${fafCyan('created')} ${outputPath}`);\n\n const yaml = readFafRaw(outputPath);\n const result = enrichScore(kernel.score(yaml));\n displayScore(result, outputPath);\n } finally {\n rmSync(tmpDir, { recursive: true, force: true });\n }\n}\n",
175
+ "import { bold, dim, fafCyan } from '../ui/colors.js';\nimport * as kernel from '../wasm/kernel.js';\n\nexport interface InfoOptions {\n version?: boolean;\n faq?: boolean;\n index?: boolean;\n stacks?: boolean;\n}\n\nexport function infoCommand(options: InfoOptions = {}): void {\n if (options.version || Object.keys(options).length === 0) {\n showVersion();\n }\n}\n\nfunction showVersion(): void {\n const pkg = require('../../package.json');\n console.log(`${fafCyan(bold('faf'))} v${pkg.version}`);\n console.log(dim(`kernel ${kernel.sdkVersion()} IANA application/vnd.faf+yaml`));\n}\n",
176
+ "/** Supported format types — data catalog */\nexport interface FormatEntry {\n name: string;\n extensions: string[];\n category: string;\n}\n\n/** Format catalog — curated list of recognized formats */\nexport const FORMATS: FormatEntry[] = [\n // Web\n { name: 'HTML', extensions: ['.html', '.htm'], category: 'web' },\n { name: 'CSS', extensions: ['.css'], category: 'web' },\n { name: 'JavaScript', extensions: ['.js', '.mjs', '.cjs'], category: 'web' },\n { name: 'TypeScript', extensions: ['.ts', '.tsx', '.mts', '.cts'], category: 'web' },\n { name: 'JSX', extensions: ['.jsx'], category: 'web' },\n { name: 'Vue', extensions: ['.vue'], category: 'web' },\n { name: 'Svelte', extensions: ['.svelte'], category: 'web' },\n { name: 'Astro', extensions: ['.astro'], category: 'web' },\n\n // Data\n { name: 'JSON', extensions: ['.json'], category: 'data' },\n { name: 'YAML', extensions: ['.yml', '.yaml'], category: 'data' },\n { name: 'TOML', extensions: ['.toml'], category: 'data' },\n { name: 'XML', extensions: ['.xml'], category: 'data' },\n { name: 'CSV', extensions: ['.csv'], category: 'data' },\n\n // Config\n { name: 'INI', extensions: ['.ini', '.cfg'], category: 'config' },\n { name: 'Env', extensions: ['.env'], category: 'config' },\n { name: 'Dockerfile', extensions: ['Dockerfile'], category: 'config' },\n\n // Systems\n { name: 'Rust', extensions: ['.rs'], category: 'systems' },\n { name: 'Go', extensions: ['.go'], category: 'systems' },\n { name: 'C', extensions: ['.c', '.h'], category: 'systems' },\n { name: 'C++', extensions: ['.cpp', '.cc', '.hpp'], category: 'systems' },\n { name: 'Zig', extensions: ['.zig'], category: 'systems' },\n\n // Scripting\n { name: 'Python', extensions: ['.py'], category: 'scripting' },\n { name: 'Ruby', extensions: ['.rb'], category: 'scripting' },\n { name: 'Shell', extensions: ['.sh', '.bash', '.zsh'], category: 'scripting' },\n { name: 'Lua', extensions: ['.lua'], category: 'scripting' },\n\n // JVM\n { name: 'Java', extensions: ['.java'], category: 'jvm' },\n { name: 'Kotlin', extensions: ['.kt', '.kts'], category: 'jvm' },\n { name: 'Scala', extensions: ['.scala'], category: 'jvm' },\n\n // .NET\n { name: 'C#', extensions: ['.cs'], category: 'dotnet' },\n { name: 'F#', extensions: ['.fs'], category: 'dotnet' },\n\n // Mobile\n { name: 'Swift', extensions: ['.swift'], category: 'mobile' },\n { name: 'Dart', extensions: ['.dart'], category: 'mobile' },\n\n // Docs\n { name: 'Markdown', extensions: ['.md', '.mdx'], category: 'docs' },\n { name: 'LaTeX', extensions: ['.tex'], category: 'docs' },\n { name: 'reStructuredText', extensions: ['.rst'], category: 'docs' },\n\n // FAF\n { name: 'FAF', extensions: ['.faf'], category: 'faf' },\n { name: 'FAFb', extensions: ['.fafb'], category: 'faf' },\n];\n\n/** Get format by extension */\nexport function getFormatByExtension(ext: string): FormatEntry | undefined {\n return FORMATS.find(f => f.extensions.includes(ext));\n}\n\n/** Get all formats in a category */\nexport function getFormatsByCategory(category: string): FormatEntry[] {\n return FORMATS.filter(f => f.category === category);\n}\n",
177
+ "import { FORMATS } from '../detect/formats.js';\nimport { bold, dim, fafCyan } from '../ui/colors.js';\n\n/** Show supported formats grouped by category */\nexport function formatsCommand(): void {\n console.log(`${fafCyan('formats')} ${dim('— supported file types')}\\n`);\n\n const categories = new Map<string, typeof FORMATS>();\n for (const f of FORMATS) {\n const list = categories.get(f.category) ?? [];\n list.push(f);\n categories.set(f.category, list);\n }\n\n for (const [category, entries] of categories) {\n console.log(` ${bold(category)}`);\n for (const entry of entries) {\n console.log(` ${entry.name} ${dim(entry.extensions.join(', '))}`);\n }\n console.log();\n }\n\n console.log(dim(` ${FORMATS.length} formats across ${categories.size} categories`));\n}\n",
178
+ "import { readdirSync, rmSync } from 'fs';\nimport { tmpdir } from 'os';\nimport { join } from 'path';\nimport { dim, fafCyan } from '../ui/colors.js';\n\n/** Clear faf-git-* temp directories */\nexport function clearCommand(): void {\n const tmp = tmpdir();\n let removed = 0;\n\n try {\n const entries = readdirSync(tmp);\n for (const entry of entries) {\n if (entry.startsWith('faf-git-')) {\n rmSync(join(tmp, entry), { recursive: true, force: true });\n removed++;\n }\n }\n } catch {\n // tmpdir read failed — nothing to clean\n }\n\n if (removed > 0) {\n console.log(`${fafCyan('cleared')} ${removed} cached director${removed === 1 ? 'y' : 'ies'}`);\n } else {\n console.log(dim('nothing to clear'));\n }\n}\n",
179
+ "import { findFafFile, readFaf, readFafRaw } from '../interop/faf.js';\nimport { dim, fafCyan } from '../ui/colors.js';\n\nexport interface ConvertOptions {\n json?: boolean;\n}\n\n/** Convert .faf to JSON or raw YAML */\nexport function convertCommand(options: ConvertOptions = {}): void {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n if (options.json) {\n const data = readFaf(fafPath);\n console.log(JSON.stringify(data, null, 2));\n } else {\n const raw = readFafRaw(fafPath);\n console.log(raw);\n }\n}\n",
180
+ "import { findFafFile, readFaf } from '../interop/faf.js';\nimport { SLOTS, isPlaceholder } from '../core/slots.js';\nimport { dim, fafCyan } from '../ui/colors.js';\n\n/** Generate compact context dump for AI prompts */\nexport function contextCommand(): void {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const data = readFaf(fafPath);\n const lines: string[] = [];\n\n for (const slot of SLOTS) {\n const [section, field] = slot.path.split('.');\n const sectionData = data[section] as Record<string, unknown> | undefined;\n const value = sectionData?.[field];\n\n if (isPlaceholder(value) || value === 'slotignored') continue;\n lines.push(`${slot.path}: ${value}`);\n }\n\n if (lines.length === 0) {\n console.log(dim('no populated slots'));\n return;\n }\n\n console.log(lines.join('\\n'));\n}\n",
181
+ "import { existsSync, statSync } from 'fs';\nimport { join } from 'path';\nimport { findFafFile } from '../interop/faf.js';\nimport { bold, dim, fafCyan } from '../ui/colors.js';\n\nconst CONTEXT_FILES = ['CLAUDE.md', 'AGENTS.md', '.cursorrules', 'GEMINI.md'];\n\n/** Check context drift between .faf and context files */\nexport function driftCommand(): void {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const dir = process.cwd();\n const fafMtime = statSync(fafPath).mtimeMs;\n\n console.log(`${fafCyan('drift')} ${dim('— context file sync status')}\\n`);\n console.log(` ${bold('.faf')} ${dim(formatAge(fafMtime))}`);\n\n let drifted = 0;\n\n for (const file of CONTEXT_FILES) {\n const path = join(dir, file);\n if (!existsSync(path)) {\n console.log(` ${dim('○')} ${file} ${dim('missing')}`);\n continue;\n }\n\n const mtime = statSync(path).mtimeMs;\n const delta = mtime - fafMtime;\n\n if (Math.abs(delta) < 1000) {\n console.log(` ${fafCyan('●')} ${file} ${dim('in sync')}`);\n } else if (delta > 0) {\n console.log(` ${bold('!')} ${file} ${bold('newer')} ${dim(formatAge(mtime))}`);\n drifted++;\n } else {\n console.log(` ${dim('○')} ${file} ${dim('older')} ${dim(formatAge(mtime))}`);\n drifted++;\n }\n }\n\n if (drifted > 0) {\n console.log(dim(`\\n run ${bold(\"'faf sync'\")} to resolve drift`));\n }\n}\n\nfunction formatAge(mtimeMs: number): string {\n const ago = Date.now() - mtimeMs;\n const secs = Math.floor(ago / 1000);\n if (secs < 60) return `${secs}s ago`;\n const mins = Math.floor(secs / 60);\n if (mins < 60) return `${mins}m ago`;\n const hours = Math.floor(mins / 60);\n if (hours < 24) return `${hours}h ago`;\n const days = Math.floor(hours / 24);\n return `${days}d ago`;\n}\n",
182
+ "import { findFafFile, readFaf, writeFaf } from '../interop/faf.js';\nimport { fafCyan, dim } from '../ui/colors.js';\n\n/** Edit a .faf field by dot-path */\nexport function editCommand(path: string, value: string): void {\n if (!path || value === undefined) {\n console.error('Usage: faf edit <path> <value>\\n\\n Example: faf edit project.name \"My Project\"');\n process.exit(1);\n }\n\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const data = readFaf(fafPath);\n const parts = path.split('.');\n\n if (parts.length !== 2) {\n console.error('Error: path must be section.field (e.g. project.name)');\n process.exit(1);\n }\n\n const [section, field] = parts;\n\n if (!data[section] || typeof data[section] !== 'object') {\n (data as Record<string, unknown>)[section] = {};\n }\n\n (data[section] as Record<string, unknown>)[field] = value;\n writeFaf(fafPath, data);\n\n console.log(`${fafCyan('updated')} ${path} ${dim('→')} ${value}`);\n}\n",
183
+ "import { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\nimport { findFafFile, readFaf, writeFaf } from '../interop/faf.js';\nimport { parseClaudeMd } from '../interop/claude.js';\nimport { fafCyan, dim, bold } from '../ui/colors.js';\nimport type { FafData } from '../core/types.js';\n\n/** Recover .faf from context files (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules) */\nexport function recoverCommand(): void {\n const dir = process.cwd();\n const sources: string[] = [];\n const data: FafData = { faf_version: '2.5.0', project: {} };\n\n // Try CLAUDE.md first (richest source)\n const claudePath = join(dir, 'CLAUDE.md');\n if (existsSync(claudePath)) {\n const content = readFileSync(claudePath, 'utf-8');\n const parsed = parseClaudeMd(content);\n if (parsed.project?.name) data.project!.name = parsed.project.name;\n if (parsed.project?.goal) data.project!.goal = parsed.project.goal;\n if (parsed.project?.main_language) data.project!.main_language = parsed.project.main_language;\n sources.push('CLAUDE.md');\n }\n\n // Try AGENTS.md\n const agentsPath = join(dir, 'AGENTS.md');\n if (existsSync(agentsPath)) {\n const content = readFileSync(agentsPath, 'utf-8');\n if (!data.project!.name) {\n const m = content.match(/^#\\s+(.+)/m);\n if (m) data.project!.name = m[1].trim();\n }\n sources.push('AGENTS.md');\n }\n\n // Try GEMINI.md\n const geminiPath = join(dir, 'GEMINI.md');\n if (existsSync(geminiPath)) {\n const content = readFileSync(geminiPath, 'utf-8');\n if (!data.project!.name) {\n const m = content.match(/^#\\s+(.+)/m);\n if (m) data.project!.name = m[1].trim();\n }\n sources.push('GEMINI.md');\n }\n\n // Try .cursorrules\n const cursorPath = join(dir, '.cursorrules');\n if (existsSync(cursorPath)) {\n sources.push('.cursorrules');\n }\n\n if (sources.length === 0) {\n console.error('No context files found (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules).');\n process.exit(2);\n }\n\n // Merge into existing .faf if present, otherwise create new\n const existing = findFafFile(dir);\n if (existing) {\n const prev = readFaf(existing);\n if (!prev.project) prev.project = {};\n if (data.project!.name && !prev.project.name) prev.project.name = data.project!.name;\n if (data.project!.goal && !prev.project.goal) prev.project.goal = data.project!.goal;\n if (data.project!.main_language && !prev.project.main_language) prev.project.main_language = data.project!.main_language;\n writeFaf(existing, prev);\n console.log(`${fafCyan('◆')} recover merged into ${existing}`);\n } else {\n const outPath = join(dir, 'project.faf');\n writeFaf(outPath, data);\n console.log(`${fafCyan('◆')} recover created ${outPath}`);\n }\n\n console.log(dim(` sources: ${sources.join(', ')}`));\n}\n",
184
+ "import { findFafFile, readFaf, writeFaf } from '../interop/faf.js';\nimport { SLOTS } from '../core/slots.js';\nimport { fafCyan, dim, bold } from '../ui/colors.js';\n\nconst CURRENT_VERSION = '2.5.0';\n\nexport interface MigrateOptions {\n dryRun?: boolean;\n}\n\n/** Migrate .faf to latest version */\nexport function migrateCommand(options: MigrateOptions = {}): void {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const data = readFaf(fafPath);\n const oldVersion = data.faf_version ?? 'unknown';\n\n if (oldVersion === CURRENT_VERSION) {\n console.log(`${fafCyan('◆')} migrate already at v${CURRENT_VERSION}`);\n return;\n }\n\n // Update version\n data.faf_version = CURRENT_VERSION;\n\n // Ensure all section roots exist\n if (!data.project) data.project = {};\n if (!data.stack) data.stack = {};\n if (!data.human_context) data.human_context = {};\n if (!data.monorepo) data.monorepo = {};\n\n if (options.dryRun) {\n console.log(`${fafCyan('◆')} migrate ${dim('(dry run)')} v${oldVersion} → v${CURRENT_VERSION}`);\n console.log(dim(` would update ${fafPath}`));\n return;\n }\n\n writeFaf(fafPath, data);\n console.log(`${fafCyan('◆')} migrate v${oldVersion} → v${CURRENT_VERSION}`);\n console.log(dim(` updated ${fafPath}`));\n}\n",
185
+ "import { isPro } from '../core/pro.js';\nimport { bold, dim, fafCyan, orange } from '../ui/colors.js';\n\n/** Pro features & licensing */\nexport function proCommand(subcommand?: string): void {\n if (subcommand === 'features') {\n showFeatures();\n } else if (subcommand === 'activate') {\n activatePro();\n } else {\n showStatus();\n }\n}\n\nfunction showStatus(): void {\n const status = isPro();\n console.log(`${fafCyan('pro')} ${dim('— FAF Pro status')}\\n`);\n console.log(` Status: ${status ? orange(bold('PRO')) : bold('Free')}`);\n console.log('');\n if (!status) {\n console.log(dim(' Upgrade: faf pro activate'));\n }\n}\n\nfunction showFeatures(): void {\n console.log(`${fafCyan('pro')} ${dim('— Pro features')}\\n`);\n const features = [\n ['tri-sync', '.faf ↔ CLAUDE.md ↔ MEMORY.md'],\n ['enterprise slots', '33-slot scoring (slots 22-33)'],\n ['advanced analytics', 'Drift tracking & team metrics'],\n ];\n for (const [name, desc] of features) {\n console.log(` ${fafCyan('◆')} ${bold(name)} ${dim('—')} ${desc}`);\n }\n console.log('');\n}\n\nfunction activatePro(): void {\n console.log(`${fafCyan('pro')} ${dim('— activate')}\\n`);\n console.log(' Set FAF_PRO=1 in your environment to enable Pro features.');\n console.log('');\n console.log(dim(' export FAF_PRO=1'));\n console.log('');\n console.log(dim(' Visit: https://faf.one/pro'));\n\n // Try to also open the upgrade URL in the browser. Fire-and-forget;\n // the printed link above is the always-on fallback.\n // `open` v9+ is ESM-only, so we use dynamic import.\n import('open')\n .then(({ default: open }) => open('https://faf.one/pro'))\n .catch(() => {});\n}\n",
186
+ "import { gzipSync } from 'zlib';\nimport { findFafFile, readFafRaw } from '../interop/faf.js';\nimport { fafCyan, dim } from '../ui/colors.js';\n\nexport interface ShareOptions {\n copy?: boolean;\n raw?: boolean;\n}\n\n/** Share .faf via URL */\nexport function shareCommand(options: ShareOptions = {}): void {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const yaml = readFafRaw(fafPath);\n const compressed = gzipSync(Buffer.from(yaml));\n const encoded = compressed.toString('base64url');\n\n if (options.raw) {\n console.log(encoded);\n return;\n }\n\n const url = `https://faf.one/share?d=${encoded}`;\n console.log(`${fafCyan('◆')} share ${dim(fafPath)}\\n`);\n console.log(` ${url}`);\n\n if (options.copy) {\n try {\n const { execSync } = require('child_process');\n const platform = process.platform;\n if (platform === 'darwin') {\n execSync('pbcopy', { input: url });\n } else if (platform === 'linux') {\n execSync('xclip -selection clipboard', { input: url });\n }\n console.log(dim('\\n copied to clipboard'));\n } catch {\n console.log(dim('\\n copy failed — install xclip or pbcopy'));\n }\n }\n}\n",
187
+ "import { mkdirSync, writeFileSync, rmSync } from 'fs';\nimport { tmpdir } from 'os';\nimport { join } from 'path';\nimport { readFafRaw } from '../interop/faf.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { enrichScore } from '../core/scorer.js';\nimport { displayScore } from '../ui/display.js';\nimport { fafCyan, dim, bold } from '../ui/colors.js';\n\n/** Demo walkthrough — show what faf does without modifying user's project */\nexport function demoCommand(): void {\n const demoDir = join(tmpdir(), `faf-demo-${Date.now()}`);\n mkdirSync(demoDir, { recursive: true });\n\n console.log(`${fafCyan('demo')} ${dim('— FAF in action')}\\n`);\n\n // Step 1: Create a sample .faf\n const sampleYaml = `faf_version: 2.5.0\nproject:\n name: acme-app\n goal: Full-stack web application for team collaboration\n main_language: TypeScript\nstack:\n frontend: React\n css_framework: Tailwind CSS\n ui_library: shadcn/ui\n state_management: Zustand\n backend: Express\n api_type: REST\n runtime: Node.js\n database: PostgreSQL\n connection: Prisma\n hosting: Vercel\n build: Vite\n cicd: GitHub Actions\nhuman_context:\n who: Startup engineering team\n what: Real-time collaboration platform\n why: Replace fragmented team tools\n where: Cloud (Vercel + AWS)\n when: \"2026\"\n how: Agile sprints with CI/CD\n`;\n\n const fafPath = join(demoDir, 'project.faf');\n writeFileSync(fafPath, sampleYaml);\n\n console.log(` ${bold('1.')} Created sample project.faf`);\n console.log(dim(` ${fafPath}\\n`));\n\n // Step 2: Score it\n console.log(` ${bold('2.')} Scoring...`);\n const result = enrichScore(kernel.score(readFafRaw(fafPath)));\n console.log('');\n displayScore(result, 'project.faf', true);\n\n // Cleanup\n rmSync(demoDir, { recursive: true, force: true });\n\n console.log(`\\n${dim(' Demo complete. Run \"faf init\" in your project to get started.')}`);\n}\n",
188
+ "import { SLOTS } from '../core/slots.js';\nimport { FORMATS } from '../detect/formats.js';\nimport { bold, dim, fafCyan } from '../ui/colors.js';\n\nexport interface SearchOptions {\n slots?: boolean;\n formats?: boolean;\n}\n\n/** Search slots and formats by keyword */\nexport function searchCommand(query: string, options: SearchOptions = {}): void {\n if (!query) {\n console.error('Usage: faf search <keyword>');\n process.exit(2);\n }\n\n const q = query.toLowerCase();\n const searchAll = !options.slots && !options.formats;\n\n let found = 0;\n\n // Search slots\n if (searchAll || options.slots) {\n const matches = SLOTS.filter(s =>\n s.path.toLowerCase().includes(q) ||\n s.description.toLowerCase().includes(q) ||\n s.category.toLowerCase().includes(q)\n );\n if (matches.length > 0) {\n console.log(`${fafCyan('slots')} ${dim(`— ${matches.length} match${matches.length === 1 ? '' : 'es'}`)}\\n`);\n for (const s of matches) {\n console.log(` ${bold(`#${s.index}`)} ${s.path} ${dim('—')} ${s.description} ${dim(`[${s.category}]`)}`);\n }\n console.log('');\n found += matches.length;\n }\n }\n\n // Search formats\n if (searchAll || options.formats) {\n const matches = FORMATS.filter(f =>\n f.name.toLowerCase().includes(q) ||\n f.extensions.some(e => e.toLowerCase().includes(q)) ||\n f.category.toLowerCase().includes(q)\n );\n if (matches.length > 0) {\n console.log(`${fafCyan('formats')} ${dim(`— ${matches.length} match${matches.length === 1 ? '' : 'es'}`)}\\n`);\n for (const f of matches) {\n console.log(` ${bold(f.name)} ${dim(f.extensions.join(', '))} ${dim(`[${f.category}]`)}`);\n }\n console.log('');\n found += matches.length;\n }\n }\n\n if (found === 0) {\n console.log(dim(` No results for \"${query}\"`));\n }\n}\n",
189
+ "import { writeFileSync } from 'fs';\nimport { findFafFile, readFaf, readFafRaw } from '../interop/faf.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { enrichScore } from '../core/scorer.js';\nimport { fafCyan, dim } from '../ui/colors.js';\n\nexport interface TafOptions {\n output?: string;\n}\n\n/** Generate TAF receipt (Test Archive Format) */\nexport function tafCommand(options: TafOptions = {}): void {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const data = readFaf(fafPath);\n const yaml = readFafRaw(fafPath);\n const result = enrichScore(kernel.score(yaml));\n\n const receipt = {\n taf_version: '1.0.0',\n generated: new Date().toISOString(),\n source: fafPath,\n project: data.project?.name ?? 'unknown',\n faf_version: data.faf_version ?? 'unknown',\n score: result.score,\n tier: result.tier.name,\n populated: result.populated,\n active: result.active,\n total: result.total,\n slots: result.slots,\n };\n\n const json = JSON.stringify(receipt, null, 2);\n\n if (options.output) {\n writeFileSync(options.output, json, 'utf-8');\n console.log(`${fafCyan('◆')} taf receipt written to ${options.output}`);\n } else {\n console.log(json);\n }\n}\n",
190
+ "import { createInterface } from 'readline';\nimport { existsSync, readFileSync, writeFileSync, unlinkSync } from 'fs';\nimport { join } from 'path';\nimport { findFafFile, readFaf, readFafRaw, writeFaf } from '../interop/faf.js';\nimport { SLOTS } from '../core/slots.js';\nimport { isPlaceholder } from '../core/slots.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { enrichScore } from '../core/scorer.js';\nimport { displayScore } from '../ui/display.js';\nimport { bold, dim, fafCyan } from '../ui/colors.js';\n\nexport interface GoOptions {\n resume?: boolean;\n}\n\nconst SESSION_FILE = '.faf-session.json';\n\ninterface GoSession {\n slotIndex: number;\n fafPath: string;\n}\n\n/** Get a nested value from an object by dot-path */\nfunction getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n for (const part of parts) {\n if (current === null || current === undefined || typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return current;\n}\n\n/** Set a nested value in an object by dot-path */\nfunction setNestedValue(obj: Record<string, unknown>, path: string, value: string): void {\n const parts = path.split('.');\n let current: Record<string, unknown> = obj;\n for (let i = 0; i < parts.length - 1; i++) {\n if (!current[parts[i]] || typeof current[parts[i]] !== 'object') {\n current[parts[i]] = {};\n }\n current = current[parts[i]] as Record<string, unknown>;\n }\n current[parts[parts.length - 1]] = value;\n}\n\n/** Guided interview to gold code */\nexport async function goCommand(options: GoOptions = {}): Promise<void> {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const dir = process.cwd();\n const sessionPath = join(dir, SESSION_FILE);\n\n // Resume session if requested\n let startIndex = 0;\n if (options.resume && existsSync(sessionPath)) {\n try {\n const session: GoSession = JSON.parse(readFileSync(sessionPath, 'utf-8'));\n startIndex = session.slotIndex;\n console.log(dim(` resuming from slot #${startIndex + 1}`));\n } catch { /* ignore corrupted session */ }\n }\n\n const data = readFaf(fafPath);\n\n // Find empty slots\n const emptySlots = SLOTS.filter(s => {\n const val = getNestedValue(data as Record<string, unknown>, s.path);\n return isPlaceholder(val) && val !== 'slotignored';\n });\n\n if (emptySlots.length === 0) {\n console.log(`${fafCyan('◆')} go all slots populated`);\n const result = enrichScore(kernel.score(readFafRaw(fafPath)));\n displayScore(result, fafPath);\n return;\n }\n\n console.log(`${fafCyan('go')} ${dim('— guided interview')}`);\n console.log(dim(` ${emptySlots.length} empty slots. Enter a value, \"skip\" to skip, or \"quit\" to stop.\\n`));\n\n const rl = createInterface({ input: process.stdin, output: process.stdout });\n\n const ask = (prompt: string): Promise<string> =>\n new Promise(resolve => rl.question(prompt, resolve));\n\n let filled = 0;\n const slotsToProcess = emptySlots.slice(startIndex);\n\n for (let i = 0; i < slotsToProcess.length; i++) {\n const slot = slotsToProcess[i];\n const answer = await ask(` ${bold(`#${slot.index}`)} ${slot.description} ${dim(`(${slot.path})`)}: `);\n\n if (answer.toLowerCase() === 'quit') {\n // Save session for resume\n const session: GoSession = { slotIndex: startIndex + i, fafPath };\n writeFileSync(sessionPath, JSON.stringify(session), 'utf-8');\n console.log(dim(`\\n session saved. Resume with: faf go --resume`));\n break;\n }\n\n if (answer.toLowerCase() === 'skip' || answer.trim() === '') {\n continue;\n }\n\n setNestedValue(data as Record<string, unknown>, slot.path, answer.trim());\n filled++;\n }\n\n rl.close();\n\n if (filled > 0) {\n writeFaf(fafPath, data);\n console.log(`\\n${fafCyan('◆')} go filled ${filled} slot${filled === 1 ? '' : 's'}`);\n }\n\n // Show updated score\n const result = enrichScore(kernel.score(readFafRaw(fafPath)));\n displayScore(result, fafPath);\n\n // Clean up session file if we finished all slots\n if (existsSync(sessionPath)) {\n try { unlinkSync(sessionPath); } catch { /* ignore */ }\n }\n}\n",
191
+ "import { findFafFile, readFaf, readFafRaw, writeFaf } from '../interop/faf.js';\nimport { SLOTS } from '../core/slots.js';\nimport { isPlaceholder } from '../core/slots.js';\nimport * as kernel from '../wasm/kernel.js';\nimport { enrichScore } from '../core/scorer.js';\nimport { displayScore } from '../ui/display.js';\nimport { bold, dim, fafCyan } from '../ui/colors.js';\n\n/** Get a nested value from an object by dot-path */\nfunction getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n for (const part of parts) {\n if (current === null || current === undefined || typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return current;\n}\n\n/** Set a nested value in an object by dot-path */\nfunction setNestedValue(obj: Record<string, unknown>, path: string, value: string): void {\n const parts = path.split('.');\n let current: Record<string, unknown> = obj;\n for (let i = 0; i < parts.length - 1; i++) {\n if (!current[parts[i]] || typeof current[parts[i]] !== 'object') {\n current[parts[i]] = {};\n }\n current = current[parts[i]] as Record<string, unknown>;\n }\n current[parts[parts.length - 1]] = value;\n}\n\n/** AI-powered features */\nexport async function aiCommand(subcommand?: string): Promise<void> {\n if (subcommand === 'analyze') {\n await analyzeCommand();\n } else if (subcommand === 'enhance') {\n await enhanceCommand();\n } else {\n console.log(`${fafCyan('ai')} ${dim('— AI-powered features')}\\n`);\n console.log(` ${bold('faf ai enhance')} ${dim('— fill empty slots via Claude')}`);\n console.log(` ${bold('faf ai analyze')} ${dim('— get improvement suggestions')}`);\n console.log('');\n console.log(dim(' Requires ANTHROPIC_API_KEY environment variable.'));\n }\n}\n\nasync function getClient(): Promise<any> {\n const apiKey = process.env.ANTHROPIC_API_KEY;\n if (!apiKey) {\n console.error('Error: ANTHROPIC_API_KEY not set.\\n\\n export ANTHROPIC_API_KEY=sk-...');\n process.exit(2);\n }\n\n try {\n const { default: Anthropic } = await import('@anthropic-ai/sdk');\n return new Anthropic({ apiKey });\n } catch {\n console.error('Error: @anthropic-ai/sdk not installed.\\n\\n npm install @anthropic-ai/sdk');\n process.exit(2);\n }\n}\n\nasync function enhanceCommand(): Promise<void> {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const data = readFaf(fafPath);\n const yaml = readFafRaw(fafPath);\n\n // Find empty slots\n const emptySlots = SLOTS.filter(s => {\n const val = getNestedValue(data as Record<string, unknown>, s.path);\n return isPlaceholder(val) && val !== 'slotignored';\n });\n\n if (emptySlots.length === 0) {\n console.log(`${fafCyan('◆')} ai enhance all slots populated`);\n return;\n }\n\n console.log(`${fafCyan('ai')} enhance ${dim(`filling ${emptySlots.length} empty slots...`)}`);\n\n const client = await getClient();\n\n const slotList = emptySlots.map(s => `- ${s.path}: ${s.description}`).join('\\n');\n const prompt = `Given this project .faf file:\\n\\n${yaml}\\n\\nFill in these empty slots with reasonable values based on the project context. Return ONLY a JSON object mapping dot-paths to values.\\n\\nEmpty slots:\\n${slotList}\\n\\nRespond with ONLY valid JSON, no markdown fences.`;\n\n const response = await client.messages.create({\n model: 'claude-haiku-4-5-20251001',\n max_tokens: 1024,\n messages: [{ role: 'user', content: prompt }],\n });\n\n try {\n const text = response.content[0].text;\n const suggestions = JSON.parse(text);\n let filled = 0;\n\n for (const slot of emptySlots) {\n const value = suggestions[slot.path];\n if (value && typeof value === 'string') {\n setNestedValue(data as Record<string, unknown>, slot.path, value);\n console.log(` ${fafCyan('●')} ${slot.path} ${dim('←')} ${value}`);\n filled++;\n }\n }\n\n if (filled > 0) {\n writeFaf(fafPath, data);\n console.log(`\\n${fafCyan('◆')} ai enhance filled ${filled} slot${filled === 1 ? '' : 's'}`);\n const result = enrichScore(kernel.score(readFafRaw(fafPath)));\n displayScore(result, fafPath);\n }\n } catch {\n console.error('Error: Could not parse AI response.');\n }\n}\n\nasync function analyzeCommand(): Promise<void> {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const yaml = readFafRaw(fafPath);\n\n console.log(`${fafCyan('ai')} analyze ${dim('getting suggestions...')}`);\n\n const client = await getClient();\n\n const response = await client.messages.create({\n model: 'claude-haiku-4-5-20251001',\n max_tokens: 1024,\n messages: [{\n role: 'user',\n content: `Analyze this .faf project context file and provide 3-5 specific suggestions for improvement. Focus on completeness, accuracy, and best practices.\\n\\n${yaml}\\n\\nBe concise. One line per suggestion.`,\n }],\n });\n\n console.log('');\n console.log(response.content[0].text);\n}\n",
192
+ "import { existsSync, readFileSync, writeFileSync, readdirSync } from 'fs';\nimport { join, basename } from 'path';\nimport { findFafFile, readFaf, writeFaf } from '../interop/faf.js';\nimport { parse } from 'yaml';\nimport { fafCyan, dim, bold } from '../ui/colors.js';\nimport type { FafData } from '../core/types.js';\n\n/** Conductor integration — import/export conductor config */\nexport function conductorCommand(subcommand?: string, path?: string): void {\n if (subcommand === 'import') {\n conductorImport(path);\n } else if (subcommand === 'export') {\n conductorExport();\n } else {\n console.log(`${fafCyan('conductor')} ${dim('— conductor integration')}\\n`);\n console.log(` ${bold('faf conductor import <path>')} ${dim('— import conductor config into .faf')}`);\n console.log(` ${bold('faf conductor export')} ${dim('— generate conductor config from .faf')}`);\n }\n}\n\nfunction conductorImport(configPath?: string): void {\n if (!configPath) {\n console.error('Usage: faf conductor import <path>');\n process.exit(2);\n }\n\n if (!existsSync(configPath)) {\n console.error(`Error: path not found: ${configPath}`);\n process.exit(2);\n }\n\n const data: FafData = { faf_version: '2.5.0', project: {} };\n\n // Try to read YAML/JSON files from the config directory or file\n if (existsSync(configPath) && configPath.endsWith('.json')) {\n const raw = JSON.parse(readFileSync(configPath, 'utf-8'));\n if (raw.name) data.project!.name = raw.name;\n if (raw.description) data.project!.goal = raw.description;\n if (raw.language) data.project!.main_language = raw.language;\n } else if (existsSync(configPath) && (configPath.endsWith('.yml') || configPath.endsWith('.yaml'))) {\n const raw = parse(readFileSync(configPath, 'utf-8'));\n if (raw.name) data.project!.name = raw.name;\n if (raw.description) data.project!.goal = raw.description;\n if (raw.language) data.project!.main_language = raw.language;\n } else {\n // Directory: scan for config files\n try {\n const files = readdirSync(configPath);\n for (const file of files) {\n const filePath = join(configPath, file);\n if (file.endsWith('.json')) {\n try {\n const raw = JSON.parse(readFileSync(filePath, 'utf-8'));\n if (raw.name && !data.project!.name) data.project!.name = raw.name;\n if (raw.description && !data.project!.goal) data.project!.goal = raw.description;\n } catch { /* skip malformed files */ }\n }\n }\n } catch {\n console.error(`Error: could not read directory: ${configPath}`);\n process.exit(2);\n }\n }\n\n // Merge into existing .faf or create new\n const dir = process.cwd();\n const existing = findFafFile(dir);\n if (existing) {\n const prev = readFaf(existing);\n if (!prev.project) prev.project = {};\n if (data.project!.name && !prev.project.name) prev.project.name = data.project!.name;\n if (data.project!.goal && !prev.project.goal) prev.project.goal = data.project!.goal;\n if (data.project!.main_language && !prev.project.main_language) prev.project.main_language = data.project!.main_language;\n writeFaf(existing, prev);\n console.log(`${fafCyan('◆')} conductor import merged into ${existing}`);\n } else {\n const outPath = join(dir, 'project.faf');\n writeFaf(outPath, data);\n console.log(`${fafCyan('◆')} conductor import created ${outPath}`);\n }\n}\n\nfunction conductorExport(): void {\n const fafPath = findFafFile();\n if (!fafPath) {\n console.error(\"Error: project.faf not found\\n\\n Run 'faf init' to create one.\");\n process.exit(2);\n }\n\n const data = readFaf(fafPath);\n\n const config = {\n name: data.project?.name ?? '',\n description: data.project?.goal ?? '',\n language: data.project?.main_language ?? '',\n stack: data.stack ?? {},\n };\n\n console.log(JSON.stringify(config, null, 2));\n}\n",
193
+ "#!/usr/bin/env node\n\nimport { Command } from 'commander';\nimport { scoreCommand } from './commands/score.js';\nimport { initCommand } from './commands/init.js';\nimport { autoCommand } from './commands/auto.js';\nimport { syncCommand } from './commands/sync.js';\nimport { compileCommand } from './commands/compile.js';\nimport { decompileCommand } from './commands/decompile.js';\nimport { checkCommand } from './commands/check.js';\nimport { exportCommand } from './commands/export.js';\nimport { gitCommand } from './commands/git.js';\nimport { infoCommand } from './commands/info.js';\nimport { formatsCommand } from './commands/formats.js';\nimport { clearCommand } from './commands/clear.js';\nimport { convertCommand } from './commands/convert.js';\nimport { contextCommand } from './commands/context.js';\nimport { driftCommand } from './commands/drift.js';\nimport { editCommand } from './commands/edit.js';\nimport { recoverCommand } from './commands/recover.js';\nimport { migrateCommand } from './commands/migrate.js';\nimport { proCommand } from './commands/pro.js';\nimport { shareCommand } from './commands/share.js';\nimport { demoCommand } from './commands/demo.js';\nimport { searchCommand } from './commands/search.js';\nimport { tafCommand } from './commands/taf.js';\nimport { goCommand } from './commands/go.js';\nimport { aiCommand } from './commands/ai.js';\nimport { conductorCommand } from './commands/conductor.js';\n\nconst { version: VERSION } = require('../package.json');\n\nconst program = new Command();\n\nprogram\n .name('faf')\n .description('Foundational AI-Context Format — project DNA for any AI')\n .version(VERSION, '-v, --version');\n\n// === Core Commands (Top 6) ===\n\nprogram\n .command('init')\n .description('Create .faf from your project')\n .option('--yolo', 'Quick init with sensible defaults')\n .option('--quick', 'Alias for --yolo')\n .option('--force', 'Overwrite existing project.faf')\n .option('--output <path>', 'Output path')\n .action((options) => initCommand(options));\n\nprogram\n .command('auto')\n .description('Zero to 100% in one command')\n .action(() => autoCommand());\n\nprogram\n .command('go')\n .description('Guided interview to gold code')\n .option('--resume', 'Resume previous session')\n .action((options) => goCommand(options));\n\nprogram\n .command('score [file]')\n .description('Score a .faf file')\n .option('--verbose', 'Show slot breakdown')\n .option('--status', 'Compact one-liner output')\n .option('--json', 'Output as JSON')\n .action((file, options) => scoreCommand(file, options));\n\nprogram\n .command('sync')\n .description('.faf ↔ CLAUDE.md (bi-sync, mtime auto-direction)')\n .option('--watch', 'Watch for changes')\n .option('--direction <dir>', 'Force direction: auto|push|pull', 'auto')\n .action((options) => syncCommand(options));\n\n// === Power Commands ===\n\nprogram\n .command('compile [file]')\n .description('Compile .faf to .fafb binary')\n .option('--output <path>', 'Output path')\n .action((file, options) => compileCommand(file, options));\n\nprogram\n .command('decompile <file>')\n .description('Decompile .fafb to JSON')\n .option('--output <path>', 'Output path')\n .action((file, options) => decompileCommand(file, options));\n\nprogram\n .command('git <url>')\n .description('Instant .faf from any GitHub repo')\n .action((url) => gitCommand(url));\n\nprogram\n .command('export')\n .description('Export context files from .faf')\n .option('--agents', 'Generate AGENTS.md')\n .option('--cursor', 'Generate .cursorrules')\n .option('--gemini', 'Generate GEMINI.md')\n .option('--conductor', 'Generate conductor config')\n .option('--all', 'Generate all formats')\n .action((options) => exportCommand(options));\n\nprogram\n .command('check [file]')\n .description('Validate .faf file')\n .option('--strict', 'Require 100% score')\n .option('--fix', 'Auto-fix issues')\n .option('--doctor', 'Full diagnostic')\n .option('--trust', 'Verify trust chain')\n .action((file, options) => checkCommand(file, options));\n\nprogram\n .command('info')\n .description('Show version and system info')\n .option('--version', 'Show version')\n .option('--faq', 'Show FAQ')\n .option('--index', 'Show command index')\n .option('--stacks', 'Show supported stacks')\n .action((options) => infoCommand(options));\n\n// === Phase A Commands ===\n\nprogram\n .command('formats')\n .description('Show supported formats')\n .action(() => formatsCommand());\n\nprogram\n .command('clear')\n .description('Clear cached data')\n .action(() => clearCommand());\n\nprogram\n .command('convert')\n .description('Convert .faf to other formats')\n .option('--json', 'Output as JSON')\n .action((options) => convertCommand(options));\n\nprogram\n .command('context')\n .description('Generate context output')\n .action(() => contextCommand());\n\nprogram\n .command('drift')\n .description('Check context drift')\n .action(() => driftCommand());\n\nprogram\n .command('edit <path> <value>')\n .description('Edit .faf fields')\n .action((path, value) => editCommand(path, value));\n\n// === Phase B Commands ===\n\nprogram\n .command('recover')\n .description('Recover .faf from context files')\n .action(() => recoverCommand());\n\nprogram\n .command('migrate')\n .description('Migrate .faf to latest version')\n .option('--dry-run', 'Preview changes without writing')\n .action((options) => migrateCommand(options));\n\nprogram\n .command('pro [subcommand]')\n .description('Pro features & licensing')\n .action((subcommand) => proCommand(subcommand));\n\nprogram\n .command('share')\n .description('Share .faf via URL')\n .option('--copy', 'Copy to clipboard')\n .option('--raw', 'Output encoded string only')\n .action((options) => shareCommand(options));\n\nprogram\n .command('demo')\n .description('Demo walkthrough')\n .action(() => demoCommand());\n\nprogram\n .command('search <query>')\n .description('Search slots and formats')\n .option('--slots', 'Search slots only')\n .option('--formats', 'Search formats only')\n .action((query, options) => searchCommand(query, options));\n\nprogram\n .command('taf')\n .description('Test Archive Format receipt')\n .option('--output <path>', 'Write receipt to file')\n .action((options) => tafCommand(options));\n\n// === Phase C Commands ===\n\nprogram\n .command('ai [subcommand]')\n .description('AI-powered features (enhance|analyze)')\n .action((subcommand) => aiCommand(subcommand));\n\nprogram\n .command('conductor [subcommand] [path]')\n .description('Conductor integration')\n .action((subcommand, path) => conductorCommand(subcommand, path));\n\n// === Soft Deprecation Aliases (v5.x compat) ===\n\nprogram.command('bi-sync', { hidden: true }).action(() => syncCommand());\nprogram.command('status', { hidden: true }).action(() => scoreCommand(undefined, { status: true }));\nprogram.command('agents', { hidden: true }).action(() => exportCommand({ agents: true }));\nprogram.command('cursor', { hidden: true }).action(() => exportCommand({ cursor: true }));\nprogram.command('gemini', { hidden: true }).action(() => exportCommand({ gemini: true }));\nprogram.command('validate', { hidden: true }).action((file: string) => checkCommand(file));\nprogram.command('yolo', { hidden: true }).action(() => initCommand({ yolo: true }));\n\n// === Parse and run ===\n\n// No command given → show Nelly header + score + help\nif (process.argv.length <= 2) {\n // Wrap top-level await in an async IIFE so `bun build --compile` accepts it.\n // (Plain `bun build` tolerates top-level await; --compile is stricter.)\n (async () => {\n const { bold, dim, fafCyan } = await import('./ui/colors.js');\n const cwd = process.cwd().replace(process.env.HOME ?? '', '~');\n\n // Nelly — pixel-art elephant (10×6 grid, half-block rendering)\n const G = '\\x1b[38;2;150;150;150m'; // gray fg\n const GB = '\\x1b[48;2;150;150;150m'; // gray bg\n const DF = '\\x1b[38;2;29;29;29m'; // dark fg (▄ trick)\n const DB = '\\x1b[48;2;29;29;29m'; // dark bg\n const RS = '\\x1b[0m';\n console.log('');\n console.log(`${DB} ${G}▄${GB}███████${DB}${G}▄${RS}`);\n console.log(`${DB} ${GB}${G}█${DB}${G}▀${GB}███████${RS} ${fafCyan(bold('faf'))} ${dim(`v${VERSION}`)}`);\n const GR = '\\x1b[38;2;39;174;96m'; // grass green\n console.log(`${DB}${G}▀${GB}${DF}▄${DB}${GR}░${GB}${G}██${DB}${GR}░░${GB}${G}██${DB}${GR}░${RS} ${dim('Nelly Never Forgets')}`);\n console.log(`${GR}▔▔▔▔▔▔▔▔▔▔▔▔${RS}`);\n console.log(`${dim(' ' + cwd)}`);\n console.log('');\n try { await scoreCommand(undefined, { status: true }); } catch {}\n console.log('');\n console.log(` ${dim('Run')} ${fafCyan('faf --help')} ${dim('for commands')}`);\n })();\n} else {\n program.parse(process.argv);\n}\n"
194
+ ],
195
+ "mappings": ";wzBAGA,MAAM,WAAuB,KAAM,CAOjC,WAAW,CAAC,EAAU,EAAM,EAAS,CACnC,MAAM,CAAO,EAEb,MAAM,kBAAkB,KAAM,KAAK,WAAW,EAC9C,KAAK,KAAO,KAAK,YAAY,KAC7B,KAAK,KAAO,EACZ,KAAK,SAAW,EAChB,KAAK,YAAc,OAEvB,CAKA,MAAM,WAA6B,EAAe,CAKhD,WAAW,CAAC,EAAS,CACnB,MAAM,EAAG,4BAA6B,CAAO,EAE7C,MAAM,kBAAkB,KAAM,KAAK,WAAW,EAC9C,KAAK,KAAO,KAAK,YAAY,KAEjC,CAEQ,kBAAiB,GACjB,wBAAuB,qBCtC/B,IAAQ,8BAER,MAAM,EAAS,CAUb,WAAW,CAAC,EAAM,EAAa,CAQ7B,OAPA,KAAK,YAAc,GAAe,GAClC,KAAK,SAAW,GAChB,KAAK,SAAW,OAChB,KAAK,aAAe,OACpB,KAAK,wBAA0B,OAC/B,K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