lane-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1061 -0
- package/dist/cli/index.js +7413 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.cjs +3249 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1985 -0
- package/dist/index.d.ts +1985 -0
- package/dist/index.js +3200 -0
- package/dist/index.js.map +1 -0
- package/dist/server/index.js +2610 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server-http.cjs +2378 -0
- package/dist/server-http.cjs.map +1 -0
- package/dist/server-http.js +2376 -0
- package/dist/server-http.js.map +1 -0
- package/dist/server-stdio.cjs +2356 -0
- package/dist/server-stdio.cjs.map +1 -0
- package/dist/server-stdio.js +2354 -0
- package/dist/server-stdio.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js","../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/argument.js","../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/help.js","../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/option.js","../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js","../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/command.js","../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/index.js","../../src/auth/token-store.ts","../../src/crypto/signature.ts","../../src/errors.ts","../../src/client.ts","../../src/config.ts","../../src/resources/base.ts","../../src/resources/auth.ts","../../src/resources/wallets.ts","../../src/resources/pay.ts","../../src/resources/products.ts","../../src/resources/checkout.ts","../../src/resources/sell.ts","../../src/resources/admin.ts","../../src/resources/webhooks.ts","../../src/resources/vic.ts","../../src/resources/metering.ts","../../src/resources/payouts.ts","../../src/resources/teams.ts","../../src/resources/agents.ts","../../src/resources/audit.ts","../../src/resources/identity.ts","../../src/resources/subscriptions.ts","../../src/resources/merchants.ts","../../src/lane.ts","../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs","../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js","../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js","../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js","../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js","../../src/cli/commands/login.ts","../../src/auth/browser-flow.ts","../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js","../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/index.js","../../node_modules/.pnpm/is-wsl@3.1.1/node_modules/is-wsl/index.js","../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js","../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js","../../node_modules/.pnpm/powershell-utils@0.1.0/node_modules/powershell-utils/index.js","../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/utilities.js","../../node_modules/.pnpm/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js","../../node_modules/.pnpm/default-browser@5.5.0/node_modules/default-browser/index.js","../../node_modules/.pnpm/default-browser-id@5.0.1/node_modules/default-browser-id/index.js","../../node_modules/.pnpm/run-applescript@7.1.0/node_modules/run-applescript/index.js","../../node_modules/.pnpm/bundle-name@4.1.0/node_modules/bundle-name/index.js","../../node_modules/.pnpm/default-browser@5.5.0/node_modules/default-browser/windows.js","../../node_modules/.pnpm/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js","../../src/cli/commands/logout.ts","../../src/cli/commands/whoami.ts","../../src/cli/commands/add-card.ts","../../src/cli/commands/cards.ts","../../src/cli/commands/balance.ts","../../src/cli/commands/set-budget.ts","../../src/cli/commands/transactions.ts","../../src/cli/commands/pay.ts","../../src/cli/commands/rotate-key.ts","../../src/cli/commands/setup-mcp.ts","../../src/cli/commands/dashboard.ts","../../src/cli/commands/vendor.ts","../../src/cli/commands/schema.ts","../../src/cli/commands/wallet.ts","../../src/cli/commands/checkout.ts","../../src/cli/index.ts"],"sourcesContent":["/**\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","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","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","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","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","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","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","// ---------------------------------------------------------------------------\n// Lane SDK — Token Store\n// ---------------------------------------------------------------------------\n// Reads/writes credentials to ~/.lane/credentials.json.\n// File permissions enforced at 0600 (owner read/write only) for SOC 2.\n// ---------------------------------------------------------------------------\n\nimport { readFile, writeFile, mkdir, stat, chmod } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { homedir } from 'node:os';\nimport type { Credentials, TokenStore } from '../types.js';\n\nconst LANE_DIR = '.lane';\nconst CREDENTIALS_FILE = 'credentials.json';\nconst SECURE_FILE_MODE = 0o600;\nconst SECURE_DIR_MODE = 0o700;\n\n/**\n * File-system backed token store.\n *\n * Stores credentials at ~/.lane/credentials.json with strict permissions.\n * Implements the TokenStore interface so it can be swapped for Redis,\n * Keychain, etc.\n */\nexport class FileTokenStore implements TokenStore {\n private readonly dirPath: string;\n private readonly filePath: string;\n\n constructor(basePath?: string) {\n this.dirPath = basePath ?? join(homedir(), LANE_DIR);\n this.filePath = join(this.dirPath, CREDENTIALS_FILE);\n }\n\n /**\n * Read credentials from disk. Returns null if file doesn't exist.\n * Warns to stderr if file permissions are too permissive.\n */\n async read(): Promise<Credentials | null> {\n try {\n await this.validatePermissions();\n const raw = await readFile(this.filePath, 'utf-8');\n const parsed: unknown = JSON.parse(raw);\n return this.validateCredentials(parsed);\n } catch (err) {\n if (isNodeError(err) && err.code === 'ENOENT') {\n return null;\n }\n throw err;\n }\n }\n\n /**\n * Write credentials to disk with secure permissions.\n */\n async write(credentials: Credentials): Promise<void> {\n await this.ensureDirectory();\n\n const data = JSON.stringify(credentials, null, 2) + '\\n';\n await writeFile(this.filePath, data, { mode: SECURE_FILE_MODE });\n }\n\n /**\n * Remove the credentials file.\n */\n async clear(): Promise<void> {\n try {\n const { unlink } = await import('node:fs/promises');\n await unlink(this.filePath);\n } catch (err) {\n if (isNodeError(err) && err.code === 'ENOENT') {\n return; // Already gone\n }\n throw err;\n }\n }\n\n /** Return the path to the credentials file (for CLI display). */\n get path(): string {\n return this.filePath;\n }\n\n // -------------------------------------------------------------------------\n // Private\n // -------------------------------------------------------------------------\n\n private async ensureDirectory(): Promise<void> {\n await mkdir(this.dirPath, { recursive: true, mode: SECURE_DIR_MODE });\n }\n\n /**\n * Check file permissions and warn if too open.\n * SOC 2 control: credentials should only be readable by owner.\n */\n private async validatePermissions(): Promise<void> {\n try {\n const stats = await stat(this.filePath);\n const mode = stats.mode & 0o777;\n if (mode !== SECURE_FILE_MODE) {\n process.stderr.write(\n `[lane] Warning: ${this.filePath} has permissions ${mode.toString(8)}. ` +\n `Expected ${SECURE_FILE_MODE.toString(8)}. Fixing...\\n`,\n );\n await chmod(this.filePath, SECURE_FILE_MODE);\n }\n } catch {\n // File might not exist yet — that's fine\n }\n }\n\n private validateCredentials(parsed: unknown): Credentials | null {\n if (\n typeof parsed !== 'object' ||\n parsed === null ||\n !('apiKey' in parsed) ||\n typeof (parsed as Record<string, unknown>)['apiKey'] !== 'string'\n ) {\n return null;\n }\n return parsed as Credentials;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Utilities\n// ---------------------------------------------------------------------------\n\nfunction isNodeError(err: unknown): err is NodeJS.ErrnoException {\n return err instanceof Error && 'code' in err;\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — HMAC-SHA256 Request Signing\n// ---------------------------------------------------------------------------\n// Signs every SDK request to prevent tampering and replay attacks.\n// Mirrors server/middleware/signature.js from the Lane backend.\n//\n// Signature = HMAC-SHA256(key, \"{method}\\n{path}\\n{timestamp}\\n{bodyHash}\")\n// ---------------------------------------------------------------------------\n\nimport { createHmac, createHash, timingSafeEqual } from 'node:crypto';\n\n/** Maximum age of a signed request before it's considered stale (5 minutes). */\nconst TIMESTAMP_TOLERANCE_SECONDS = 300;\n\nexport interface SignatureComponents {\n method: string;\n path: string;\n timestamp: number;\n body?: string;\n}\n\nexport class HMACSignature {\n private readonly secret: string;\n\n constructor(secret: string) {\n this.secret = secret;\n }\n\n /**\n * Sign request components and return the hex-encoded HMAC-SHA256 signature.\n */\n sign(components: SignatureComponents): string {\n const bodyHash = components.body\n ? createHash('sha256').update(components.body).digest('hex')\n : createHash('sha256').update('').digest('hex');\n\n const payload = [\n components.method.toUpperCase(),\n components.path,\n components.timestamp.toString(),\n bodyHash,\n ].join('\\n');\n\n return createHmac('sha256', this.secret).update(payload).digest('hex');\n }\n\n /**\n * Verify a signature against request components.\n * Uses constant-time comparison to prevent timing attacks.\n */\n verify(\n signature: string,\n components: SignatureComponents,\n toleranceSeconds: number = TIMESTAMP_TOLERANCE_SECONDS,\n ): boolean {\n // Reject stale timestamps to prevent replay attacks\n const now = Math.floor(Date.now() / 1000);\n if (Math.abs(now - components.timestamp) > toleranceSeconds) {\n return false;\n }\n\n const expected = this.sign(components);\n return constantTimeEqual(expected, signature);\n }\n\n /**\n * Generate the signature headers for an outgoing request.\n */\n headers(components: SignatureComponents): Record<string, string> {\n const signature = this.sign(components);\n return {\n 'X-Lane-Timestamp': components.timestamp.toString(),\n 'X-Lane-Signature': `sha256=${signature}`,\n };\n }\n}\n\n/**\n * Verify a webhook payload signature.\n *\n * @param payload - Raw webhook body string\n * @param signature - Value of X-Lane-Signature header\n * @param secret - Webhook signing secret\n * @param timestamp - Value of X-Lane-Timestamp header\n */\nexport function verifyWebhookSignature(\n payload: string,\n signature: string,\n secret: string,\n timestamp: number,\n): boolean {\n const hmac = new HMACSignature(secret);\n const sig = signature.startsWith('sha256=')\n ? signature.slice(7)\n : signature;\n\n return hmac.verify(sig, {\n method: 'POST',\n path: '/webhook',\n timestamp,\n body: payload,\n });\n}\n\n/**\n * Constant-time string comparison to prevent timing attacks.\n */\nfunction constantTimeEqual(a: string, b: string): boolean {\n if (a.length !== b.length) {\n return false;\n }\n\n const bufA = Buffer.from(a, 'utf8');\n const bufB = Buffer.from(b, 'utf8');\n return timingSafeEqual(bufA, bufB);\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Error Hierarchy\n// ---------------------------------------------------------------------------\n// Every error is structured for agent consumption. Agents need codes,\n// categories, and suggested actions — not string messages.\n// ---------------------------------------------------------------------------\n\nexport interface LaneErrorOptions {\n code: string;\n statusCode: number;\n requestId?: string;\n retryable?: boolean;\n suggestedAction?: string;\n}\n\n/**\n * Base error class for all Lane SDK errors.\n *\n * Carries structured metadata so agents can make programmatic decisions\n * without parsing human-readable messages.\n */\nexport class LaneError extends Error {\n /** Machine-readable error code (e.g. 'budget_exceeded'). */\n readonly code: string;\n\n /** HTTP status code from the API (or synthetic for client-side errors). */\n readonly statusCode: number;\n\n /** Request ID for support and audit trail correlation. */\n readonly requestId: string;\n\n /** Whether the caller should retry this request. */\n readonly retryable: boolean;\n\n /** Human-readable suggestion for what the agent should do next. */\n readonly suggestedAction?: string;\n\n /** Executable suggestion for agents (e.g. \"lane.wallet.deposit(2000)\"). */\n fix?: string;\n\n /** Current state context for agent decision-making. */\n currentState?: Record<string, unknown>;\n\n constructor(message: string, options: LaneErrorOptions) {\n super(message);\n this.name = 'LaneError';\n this.code = options.code;\n this.statusCode = options.statusCode;\n this.requestId = options.requestId ?? 'unknown';\n this.retryable = options.retryable ?? false;\n this.suggestedAction = options.suggestedAction;\n\n // Maintain proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, new.target.prototype);\n }\n\n /** Serialize to a plain object for structured logging / JSON responses. */\n toJSON(): Record<string, unknown> {\n const json: Record<string, unknown> = {\n name: this.name,\n message: this.message,\n code: this.code,\n statusCode: this.statusCode,\n requestId: this.requestId,\n retryable: this.retryable,\n suggestedAction: this.suggestedAction,\n };\n if (this.fix !== undefined) {\n json.fix = this.fix;\n }\n if (this.currentState !== undefined) {\n json.currentState = this.currentState;\n }\n return json;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Authentication Errors (401, 403)\n// ---------------------------------------------------------------------------\n\nexport class LaneAuthError extends LaneError {\n constructor(\n message: string,\n options: Omit<LaneErrorOptions, 'statusCode'> & { statusCode?: number },\n ) {\n super(message, { statusCode: 401, ...options });\n this.name = 'LaneAuthError';\n }\n\n static invalidApiKey(requestId?: string): LaneAuthError {\n return new LaneAuthError('Invalid API key. Check your key and try again.', {\n code: 'invalid_api_key',\n statusCode: 401,\n requestId,\n suggestedAction:\n 'Verify the API key is correct. Run `lane whoami` to check authentication.',\n });\n }\n\n static expiredToken(requestId?: string): LaneAuthError {\n return new LaneAuthError('Authentication token has expired.', {\n code: 'expired_token',\n statusCode: 401,\n requestId,\n suggestedAction: 'Run `lane login` to re-authenticate.',\n });\n }\n\n static insufficientScope(\n requiredScope: string,\n requestId?: string,\n ): LaneAuthError {\n return new LaneAuthError(\n `API key lacks required permission: ${requiredScope}`,\n {\n code: 'insufficient_scope',\n statusCode: 403,\n requestId,\n suggestedAction:\n 'Generate a new API key with the required permissions in the dashboard.',\n },\n );\n }\n}\n\n// ---------------------------------------------------------------------------\n// Payment Errors (402, 502)\n// ---------------------------------------------------------------------------\n\nexport class LanePaymentError extends LaneError {\n constructor(message: string, options: LaneErrorOptions) {\n super(message, options);\n this.name = 'LanePaymentError';\n }\n\n static declined(requestId?: string): LanePaymentError {\n return new LanePaymentError('Payment was declined by the card issuer.', {\n code: 'payment_declined',\n statusCode: 402,\n requestId,\n suggestedAction:\n 'The card was declined. Ask the developer to check their card or add a new one.',\n });\n }\n\n static insufficientFunds(currentBalance?: number, required?: number, requestId?: string): LanePaymentError {\n const error = new LanePaymentError('Insufficient wallet balance', {\n code: 'insufficient_funds',\n statusCode: 402,\n requestId,\n suggestedAction:\n 'Check wallet balance and deposit more funds',\n });\n if (currentBalance !== undefined && required !== undefined) {\n error.fix = `lane.wallet.deposit(${required - currentBalance})`;\n error.currentState = { balance: currentBalance, required };\n }\n return error;\n }\n\n static merchantUnavailable(\n merchant: string,\n requestId?: string,\n ): LanePaymentError {\n return new LanePaymentError(\n `Merchant \"${merchant}\" is temporarily unavailable.`,\n {\n code: 'merchant_unavailable',\n statusCode: 502,\n requestId,\n retryable: true,\n suggestedAction:\n 'The merchant endpoint is down. Try again in a few minutes or choose an alternative.',\n },\n );\n }\n\n static serviceError(requestId?: string): LanePaymentError {\n return new LanePaymentError(\n 'Payment service encountered an internal error.',\n {\n code: 'payment_service_error',\n statusCode: 502,\n requestId,\n retryable: true,\n suggestedAction:\n 'Payment service temporarily unavailable. Try again in a few minutes.',\n },\n );\n }\n}\n\n// ---------------------------------------------------------------------------\n// Budget Errors (402)\n// ---------------------------------------------------------------------------\n\nexport class LaneBudgetError extends LaneError {\n /** The budget limit that was exceeded. */\n readonly limit: number;\n\n /** The amount that was requested. */\n readonly requested: number;\n\n constructor(\n message: string,\n options: LaneErrorOptions & { limit: number; requested: number },\n ) {\n super(message, options);\n this.name = 'LaneBudgetError';\n this.limit = options.limit;\n this.requested = options.requested;\n }\n\n static dailyExceeded(\n limit: number,\n requested: number,\n requestId?: string,\n ): LaneBudgetError {\n return new LaneBudgetError(\n `Daily spending limit of $${(limit / 100).toFixed(2)} exceeded. Requested: $${(requested / 100).toFixed(2)}.`,\n {\n code: 'daily_limit_exceeded',\n statusCode: 402,\n requestId,\n limit,\n requested,\n suggestedAction:\n 'Ask the developer to increase the daily limit or approve this transaction.',\n },\n );\n }\n\n static taskExceeded(\n limit: number,\n requested: number,\n requestId?: string,\n ): LaneBudgetError {\n return new LaneBudgetError(\n `Per-task spending limit of $${(limit / 100).toFixed(2)} exceeded. Requested: $${(requested / 100).toFixed(2)}.`,\n {\n code: 'task_limit_exceeded',\n statusCode: 402,\n requestId,\n limit,\n requested,\n suggestedAction:\n 'Ask the developer to increase the per-task limit or approve this transaction.',\n },\n );\n }\n\n static monthlyExceeded(\n limit: number,\n requested: number,\n requestId?: string,\n ): LaneBudgetError {\n return new LaneBudgetError(\n `Monthly spending limit of $${(limit / 100).toFixed(2)} exceeded. Requested: $${(requested / 100).toFixed(2)}.`,\n {\n code: 'monthly_limit_exceeded',\n statusCode: 402,\n requestId,\n limit,\n requested,\n suggestedAction:\n 'Ask the developer to increase the monthly limit.',\n },\n );\n }\n\n static merchantNotAllowed(\n merchant: string,\n requestId?: string,\n ): LaneBudgetError {\n return new LaneBudgetError(\n `Merchant \"${merchant}\" is not on the spending allowlist.`,\n {\n code: 'merchant_not_allowed',\n statusCode: 402,\n requestId,\n limit: 0,\n requested: 0,\n suggestedAction:\n 'This merchant is not on your allowlist. Ask the developer to add it via the dashboard.',\n },\n );\n }\n\n override toJSON(): Record<string, unknown> {\n return {\n ...super.toJSON(),\n limit: this.limit,\n requested: this.requested,\n };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Not Found Errors (404)\n// ---------------------------------------------------------------------------\n\nexport class LaneNotFoundError extends LaneError {\n constructor(resource: string, id: string, requestId?: string) {\n super(`${resource} \"${id}\" not found.`, {\n code: `${resource.toLowerCase()}_not_found`,\n statusCode: 404,\n requestId,\n suggestedAction: `The ${resource.toLowerCase()} does not exist or you don't have access to it.`,\n });\n this.name = 'LaneNotFoundError';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Rate Limit Errors (429)\n// ---------------------------------------------------------------------------\n\nexport class LaneRateLimitError extends LaneError {\n /** Seconds until the rate limit resets. */\n readonly retryAfter: number;\n\n constructor(retryAfter: number, requestId?: string) {\n super(`Rate limit exceeded. Retry after ${retryAfter} seconds.`, {\n code: 'rate_limit_exceeded',\n statusCode: 429,\n requestId,\n retryable: true,\n suggestedAction: `Wait ${retryAfter} seconds before retrying.`,\n });\n this.name = 'LaneRateLimitError';\n this.retryAfter = retryAfter;\n }\n\n override toJSON(): Record<string, unknown> {\n return {\n ...super.toJSON(),\n retryAfter: this.retryAfter,\n };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Validation Errors (400)\n// ---------------------------------------------------------------------------\n\nexport interface FieldError {\n field: string;\n message: string;\n}\n\nexport class LaneValidationError extends LaneError {\n readonly fields: FieldError[];\n\n constructor(fields: FieldError[], requestId?: string) {\n const fieldMessages = fields\n .map((f) => `${f.field}: ${f.message}`)\n .join('; ');\n super(`Validation error: ${fieldMessages}`, {\n code: 'validation_error',\n statusCode: 400,\n requestId,\n suggestedAction: 'Check the request parameters and try again.',\n });\n this.name = 'LaneValidationError';\n this.fields = fields;\n }\n\n override toJSON(): Record<string, unknown> {\n return {\n ...super.toJSON(),\n fields: this.fields,\n };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Factory: Build typed error from API response\n// ---------------------------------------------------------------------------\n\nexport interface APIErrorBody {\n error: {\n code: string;\n message: string;\n statusCode: number;\n retryable?: boolean;\n suggestedAction?: string;\n retryAfter?: number;\n limit?: number;\n requested?: number;\n fields?: FieldError[];\n };\n requestId: string;\n}\n\n/** Parse an API error response into the appropriate typed LaneError subclass. */\nexport function createErrorFromResponse(body: APIErrorBody): LaneError {\n const { error, requestId } = body;\n\n // Authentication\n if (error.statusCode === 401 || error.statusCode === 403) {\n return new LaneAuthError(error.message, {\n code: error.code,\n statusCode: error.statusCode,\n requestId,\n suggestedAction: error.suggestedAction,\n });\n }\n\n // Rate limiting\n if (error.statusCode === 429) {\n return new LaneRateLimitError(error.retryAfter ?? 60, requestId);\n }\n\n // Validation\n if (error.statusCode === 400 && error.fields) {\n return new LaneValidationError(error.fields, requestId);\n }\n\n // Budget\n if (error.code.includes('limit_exceeded') || error.code === 'merchant_not_allowed') {\n return new LaneBudgetError(error.message, {\n code: error.code,\n statusCode: error.statusCode,\n requestId,\n limit: error.limit ?? 0,\n requested: error.requested ?? 0,\n suggestedAction: error.suggestedAction,\n });\n }\n\n // Payment\n if (\n error.code.startsWith('payment_') ||\n error.code === 'insufficient_funds' ||\n error.code === 'merchant_unavailable'\n ) {\n return new LanePaymentError(error.message, {\n code: error.code,\n statusCode: error.statusCode,\n requestId,\n retryable: error.retryable,\n suggestedAction: error.suggestedAction,\n });\n }\n\n // Not found\n if (error.statusCode === 404) {\n return new LaneNotFoundError('Resource', error.code.replace('_not_found', ''), requestId);\n }\n\n // Fallback\n return new LaneError(error.message, {\n code: error.code,\n statusCode: error.statusCode,\n requestId,\n retryable: error.retryable,\n suggestedAction: error.suggestedAction,\n });\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — HTTP Client\n// ---------------------------------------------------------------------------\n// Central HTTP client with:\n// - Bearer token authentication\n// - HMAC-SHA256 request signing\n// - Idempotency key support\n// - Automatic retries with exponential backoff\n// - Circuit breaker for downstream resilience\n// - Request ID propagation for audit trails\n// - Structured error parsing\n// ---------------------------------------------------------------------------\n\nimport { EventEmitter } from 'node:events';\nimport { randomUUID } from 'node:crypto';\nimport type { ResolvedConfig, RequestOptions, APIResponse } from './types.js';\nimport { HMACSignature } from './crypto/signature.js';\nimport {\n LaneError,\n LaneRateLimitError,\n createErrorFromResponse,\n type APIErrorBody,\n} from './errors.js';\n\n// ---------------------------------------------------------------------------\n// Circuit Breaker\n// ---------------------------------------------------------------------------\n\ntype CircuitState = 'closed' | 'open' | 'half_open';\n\nclass CircuitBreaker {\n private state: CircuitState = 'closed';\n private failureCount = 0;\n private lastFailureTime = 0;\n\n constructor(\n private readonly failureThreshold: number = 3,\n private readonly resetTimeoutMs: number = 30_000,\n ) {}\n\n get isOpen(): boolean {\n if (this.state === 'open') {\n // Check if reset timeout has elapsed -> move to half-open\n if (Date.now() - this.lastFailureTime >= this.resetTimeoutMs) {\n this.state = 'half_open';\n return false;\n }\n return true;\n }\n return false;\n }\n\n recordSuccess(): void {\n this.failureCount = 0;\n this.state = 'closed';\n }\n\n recordFailure(): void {\n this.failureCount++;\n this.lastFailureTime = Date.now();\n if (this.failureCount >= this.failureThreshold) {\n this.state = 'open';\n }\n }\n}\n\n// ---------------------------------------------------------------------------\n// LaneClient\n// ---------------------------------------------------------------------------\n\nexport interface LaneClientEvents {\n request: [{ method: string; path: string; requestId: string }];\n response: [{ statusCode: number; requestId: string; durationMs: number }];\n error: [{ error: LaneError; requestId: string }];\n retry: [{ attempt: number; maxRetries: number; requestId: string }];\n}\n\n/**\n * Low-level HTTP client for the Lane API.\n *\n * Handles authentication, signing, retries, circuit breaking, and error\n * parsing. All Resource classes delegate HTTP calls through this client.\n */\nexport class LaneClient extends EventEmitter<LaneClientEvents> {\n private readonly config: ResolvedConfig;\n private readonly signer: HMACSignature;\n private readonly circuitBreaker: CircuitBreaker;\n\n constructor(config: ResolvedConfig) {\n super();\n this.config = config;\n this.signer = new HMACSignature(config.apiKey);\n this.circuitBreaker = new CircuitBreaker(\n config.circuitBreaker?.failureThreshold,\n config.circuitBreaker?.resetTimeoutMs,\n );\n }\n\n /** Whether this client is operating in test mode. */\n get testMode(): boolean {\n return this.config.testMode;\n }\n\n /** The resolved base URL. */\n get baseUrl(): string {\n return this.config.baseUrl;\n }\n\n // -------------------------------------------------------------------------\n // Public convenience methods\n // -------------------------------------------------------------------------\n\n async get<T>(path: string, query?: RequestOptions['query']): Promise<APIResponse<T>> {\n return this.request<T>({ method: 'GET', path, query });\n }\n\n async post<T>(\n path: string,\n body?: Record<string, unknown>,\n idempotencyKey?: string,\n ): Promise<APIResponse<T>> {\n return this.request<T>({ method: 'POST', path, body, idempotencyKey });\n }\n\n async put<T>(\n path: string,\n body?: Record<string, unknown>,\n ): Promise<APIResponse<T>> {\n return this.request<T>({ method: 'PUT', path, body });\n }\n\n async delete<T>(path: string): Promise<APIResponse<T>> {\n return this.request<T>({ method: 'DELETE', path });\n }\n\n // -------------------------------------------------------------------------\n // Core request method with retries\n // -------------------------------------------------------------------------\n\n async request<T>(options: RequestOptions): Promise<APIResponse<T>> {\n const requestId = `req_${randomUUID().replace(/-/g, '').slice(0, 24)}`;\n let lastError: Error | undefined;\n\n const maxAttempts = this.isRetryable(options.method)\n ? this.config.maxRetries + 1\n : 1;\n\n for (let attempt = 1; attempt <= maxAttempts; attempt++) {\n if (attempt > 1) {\n this.emit('retry', {\n attempt,\n maxRetries: this.config.maxRetries,\n requestId,\n });\n await this.backoff(attempt);\n }\n\n try {\n return await this.executeRequest<T>(options, requestId);\n } catch (err) {\n lastError = err instanceof Error ? err : new Error(String(err));\n\n // Don't retry non-retryable errors\n if (err instanceof LaneError && !err.retryable) {\n throw err;\n }\n\n // Respect rate limit retry-after\n if (err instanceof LaneRateLimitError) {\n if (attempt < maxAttempts) {\n await sleep(err.retryAfter * 1000);\n continue;\n }\n throw err;\n }\n }\n }\n\n throw lastError ?? new Error('Request failed with no error details');\n }\n\n // -------------------------------------------------------------------------\n // Private\n // -------------------------------------------------------------------------\n\n private async executeRequest<T>(\n options: RequestOptions,\n requestId: string,\n ): Promise<APIResponse<T>> {\n // Circuit breaker check\n if (this.circuitBreaker.isOpen) {\n throw new LaneError('Service temporarily unavailable (circuit breaker open).', {\n code: 'circuit_breaker_open',\n statusCode: 503,\n requestId,\n retryable: true,\n suggestedAction: 'Payment service temporarily unavailable. Try again in 30 seconds.',\n });\n }\n\n const url = this.buildUrl(options.path, options.query);\n const bodyStr = options.body ? JSON.stringify(options.body) : undefined;\n const timestamp = Math.floor(Date.now() / 1000);\n\n // Sign the request\n const signatureHeaders = this.signer.headers({\n method: options.method,\n path: options.path,\n timestamp,\n body: bodyStr,\n });\n\n const headers: Record<string, string> = {\n 'Authorization': `Bearer ${this.config.apiKey}`,\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'X-Lane-Request-Id': requestId,\n 'User-Agent': 'lane-sdk/0.1.0',\n ...signatureHeaders,\n };\n\n if (options.idempotencyKey) {\n headers['X-Idempotency-Key'] = options.idempotencyKey;\n }\n\n this.emit('request', { method: options.method, path: options.path, requestId });\n const startTime = Date.now();\n\n const controller = new AbortController();\n const timeoutId = setTimeout(\n () => controller.abort(),\n options.timeout ?? this.config.timeout,\n );\n\n try {\n const response = await fetch(url, {\n method: options.method,\n headers,\n body: bodyStr,\n signal: controller.signal,\n });\n\n const durationMs = Date.now() - startTime;\n this.emit('response', {\n statusCode: response.status,\n requestId,\n durationMs,\n });\n\n if (!response.ok) {\n const errorBody = await this.parseErrorBody(response, requestId);\n const error = createErrorFromResponse(errorBody);\n\n this.emit('error', { error, requestId });\n\n // Record failure for circuit breaker (only server errors)\n if (response.status >= 500) {\n this.circuitBreaker.recordFailure();\n }\n\n throw error;\n }\n\n this.circuitBreaker.recordSuccess();\n\n const data = (await response.json()) as T;\n\n return {\n data,\n requestId,\n testMode: this.config.testMode,\n rateLimitRemaining: parseIntHeader(response, 'X-RateLimit-Remaining'),\n rateLimitLimit: parseIntHeader(response, 'X-RateLimit-Limit'),\n rateLimitReset: parseIntHeader(response, 'X-RateLimit-Reset'),\n };\n } catch (err) {\n if (err instanceof LaneError) throw err;\n\n // AbortController timeout\n if (err instanceof DOMException && err.name === 'AbortError') {\n this.circuitBreaker.recordFailure();\n throw new LaneError('Request timed out.', {\n code: 'request_timeout',\n statusCode: 408,\n requestId,\n retryable: true,\n suggestedAction: 'The request took too long. Try again.',\n });\n }\n\n // Network / DNS errors\n this.circuitBreaker.recordFailure();\n throw new LaneError(\n `Network error: ${err instanceof Error ? err.message : String(err)}`,\n {\n code: 'network_error',\n statusCode: 0,\n requestId,\n retryable: true,\n suggestedAction: 'Check your network connection and try again.',\n },\n );\n } finally {\n clearTimeout(timeoutId);\n }\n }\n\n private buildUrl(\n path: string,\n query?: Record<string, string | number | boolean | undefined>,\n ): string {\n const url = new URL(path, this.config.baseUrl);\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n return url.toString();\n }\n\n private async parseErrorBody(\n response: Response,\n requestId: string,\n ): Promise<APIErrorBody> {\n try {\n const body = (await response.json()) as Partial<APIErrorBody>;\n if (body.error && body.requestId) {\n return body as APIErrorBody;\n }\n // API returned JSON but not our error format\n return {\n error: {\n code: 'unknown_error',\n message: JSON.stringify(body),\n statusCode: response.status,\n },\n requestId,\n };\n } catch {\n // Non-JSON response\n return {\n error: {\n code: 'unknown_error',\n message: `HTTP ${response.status}: ${response.statusText}`,\n statusCode: response.status,\n },\n requestId,\n };\n }\n }\n\n private isRetryable(method: string): boolean {\n // Only retry idempotent methods or methods with idempotency keys\n return ['GET', 'PUT', 'DELETE'].includes(method) || method === 'POST';\n }\n\n private async backoff(attempt: number): Promise<void> {\n // Exponential backoff: 1s, 3s (with jitter)\n const baseDelay = Math.min(1000 * Math.pow(2, attempt - 2), 5000);\n const jitter = Math.random() * 500;\n await sleep(baseDelay + jitter);\n }\n}\n\n// ---------------------------------------------------------------------------\n// Utility\n// ---------------------------------------------------------------------------\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction parseIntHeader(response: Response, name: string): number | undefined {\n const value = response.headers.get(name);\n if (value === null) return undefined;\n const parsed = parseInt(value, 10);\n return isNaN(parsed) ? undefined : parsed;\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Config Resolution\n// ---------------------------------------------------------------------------\n// Resolution order (first match wins):\n// 1. Constructor argument: new Lane({ apiKey: 'lane_sk_...' })\n// 2. Environment variable: LANE_API_KEY\n// 3. Credentials file: ~/.lane/credentials.json\n// ---------------------------------------------------------------------------\n\nimport type { LaneConfig, ResolvedConfig, TokenStore } from './types.js';\nimport { FileTokenStore } from './auth/token-store.js';\n\nconst DEFAULT_BASE_URL = 'https://api.getonlane.com';\nconst DEFAULT_TIMEOUT = 30_000;\nconst DEFAULT_MAX_RETRIES = 2;\n\n/**\n * Resolve SDK configuration from multiple sources.\n *\n * Immutable after construction — no config drift during a session.\n */\nexport async function resolveConfig(\n options: LaneConfig = {},\n tokenStore?: TokenStore,\n): Promise<ResolvedConfig> {\n // 1. Constructor argument\n let apiKey = options.apiKey;\n\n // 2. Environment variable\n if (!apiKey) {\n apiKey = process.env['LANE_API_KEY'];\n }\n\n // 3. Credentials file\n if (!apiKey) {\n const store = tokenStore ?? new FileTokenStore();\n const creds = await store.read();\n if (creds) {\n apiKey = creds.apiKey;\n }\n }\n\n if (!apiKey) {\n throw new Error(\n 'No API key found. Provide one via:\\n' +\n ' 1. new Lane({ apiKey: \"lane_sk_...\" })\\n' +\n ' 2. LANE_API_KEY environment variable\\n' +\n ' 3. Run `lane login` to authenticate',\n );\n }\n\n const testMode =\n options.testMode ??\n (process.env['LANE_TEST_MODE'] === 'true' ||\n apiKey.startsWith('lane_sk_test_'));\n\n const baseUrl =\n options.baseUrl ??\n process.env['LANE_BASE_URL'] ??\n DEFAULT_BASE_URL;\n\n const timeout =\n options.timeout ??\n (process.env['LANE_TIMEOUT']\n ? parseInt(process.env['LANE_TIMEOUT'], 10)\n : DEFAULT_TIMEOUT);\n\n const maxRetries =\n options.maxRetries ??\n (process.env['LANE_MAX_RETRIES']\n ? parseInt(process.env['LANE_MAX_RETRIES'], 10)\n : DEFAULT_MAX_RETRIES);\n\n return Object.freeze({\n apiKey,\n baseUrl,\n testMode,\n timeout,\n maxRetries,\n circuitBreaker: options.circuitBreaker ? Object.freeze({\n failureThreshold: options.circuitBreaker.failureThreshold ?? 3,\n resetTimeoutMs: options.circuitBreaker.resetTimeoutMs ?? 30_000,\n }) : undefined,\n });\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Abstract Resource Base Class\n// ---------------------------------------------------------------------------\n// Every API resource (Wallets, Pay, Products, etc.) extends this class.\n// Provides typed access to the underlying LaneClient and common patterns.\n// ---------------------------------------------------------------------------\n\nimport type { LaneClient } from '../client.js';\nimport type { APIResponse, PaginatedResponse } from '../types.js';\n\n/**\n * Abstract base class for all Lane API resources.\n *\n * Subclasses focus on domain logic; the base class handles HTTP delegation,\n * pagination helpers, and idempotency key forwarding.\n */\nexport abstract class Resource {\n protected readonly client: LaneClient;\n\n constructor(client: LaneClient) {\n this.client = client;\n }\n\n /** The API path prefix for this resource (e.g. '/api/sdk/wallets'). */\n protected abstract get basePath(): string;\n\n // -----------------------------------------------------------------------\n // Convenience wrappers that prepend basePath\n // -----------------------------------------------------------------------\n\n protected async _get<T>(\n subpath: string = '',\n query?: Record<string, string | number | boolean | undefined>,\n ): Promise<APIResponse<T>> {\n return this.client.get<T>(`${this.basePath}${subpath}`, query);\n }\n\n protected async _post<T>(\n subpath: string = '',\n body?: Record<string, unknown>,\n idempotencyKey?: string,\n ): Promise<APIResponse<T>> {\n return this.client.post<T>(`${this.basePath}${subpath}`, body, idempotencyKey);\n }\n\n protected async _put<T>(\n subpath: string = '',\n body?: Record<string, unknown>,\n ): Promise<APIResponse<T>> {\n return this.client.put<T>(`${this.basePath}${subpath}`, body);\n }\n\n protected async _delete<T>(subpath: string = ''): Promise<APIResponse<T>> {\n return this.client.delete<T>(`${this.basePath}${subpath}`);\n }\n\n /**\n * Helper for paginated list endpoints.\n */\n protected async _list<T>(\n subpath: string = '',\n params?: { limit?: number; offset?: number } & Record<string, unknown>,\n ): Promise<PaginatedResponse<T>> {\n const query: Record<string, string | number | boolean | undefined> = {};\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n query[key] = typeof value === 'object' ? JSON.stringify(value) : (value as string | number | boolean);\n }\n }\n }\n const response = await this.client.get<PaginatedResponse<T>>(\n `${this.basePath}${subpath}`,\n query,\n );\n return response.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Auth Resource\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type { DeveloperProfile, RotateKeyResult } from '../types.js';\n\nexport class Auth extends Resource {\n protected get basePath(): string {\n return '/api/sdk/auth';\n }\n\n /** Get the authenticated developer's profile. */\n async whoami(): Promise<DeveloperProfile> {\n const res = await this._get<DeveloperProfile>('/whoami');\n return res.data;\n }\n\n /**\n * Start a login session. Returns a URL the developer opens in their browser.\n */\n async login(): Promise<{ sessionId: string; authUrl: string; port: number }> {\n const res = await this._post<{ sessionId: string; authUrl: string; port: number }>('/login');\n return res.data;\n }\n\n /**\n * Exchange a one-time code (from browser callback) for an API key.\n */\n async exchangeCode(code: string, sessionId: string): Promise<{ apiKey: string; developerId: string }> {\n const res = await this._post<{ apiKey: string; developerId: string }>('/token', {\n code,\n sessionId,\n });\n return res.data;\n }\n\n /**\n * Rotate the API key. Old key remains valid for 15 minutes.\n */\n async rotateKey(): Promise<RotateKeyResult> {\n const res = await this._post<RotateKeyResult>('/rotate');\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Wallets Resource\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n Wallet,\n Card,\n CreateWalletParams,\n PaginatedResponse,\n DepositParams,\n DepositResult,\n AutoReloadConfig,\n CardAttributes,\n WalletBalance,\n CheckoutProfile,\n SetCheckoutProfileParams,\n MerchantAccount,\n SaveMerchantAccountParams,\n} from '../types.js';\n\nexport class Wallets extends Resource {\n protected get basePath(): string {\n return '/api/sdk/wallets';\n }\n\n /** Create a new wallet, optionally scoped to an end user. */\n async create(params: CreateWalletParams = {}): Promise<Wallet> {\n const res = await this._post<Wallet>('', {\n userId: params.userId,\n }, params.idempotencyKey);\n return res.data;\n }\n\n /** Get a wallet by ID. */\n async get(walletId: string): Promise<Wallet> {\n const res = await this._get<Wallet>(`/${walletId}`);\n return res.data;\n }\n\n /** List all wallets for the authenticated developer. */\n async list(params?: { limit?: number; offset?: number }): Promise<PaginatedResponse<Wallet>> {\n return this._list<Wallet>('', params);\n }\n\n /** List cards in a wallet. Returns last4/brand only — never full PAN. */\n async listCards(walletId: string): Promise<Card[]> {\n const res = await this._get<Card[]>(`/${walletId}/cards`);\n return res.data;\n }\n\n /**\n * Get a secure link for the end user to add a card via VGS Collect.\n * PAN goes directly to VGS vault — Lane never sees it.\n */\n async getAddCardLink(walletId: string): Promise<{ url: string; expiresAt: string }> {\n const res = await this._get<{ url: string; expiresAt: string }>(`/${walletId}/add-card-link`);\n return res.data;\n }\n\n /** Revoke a wallet. All linked tokens are immediately invalidated. */\n async revoke(walletId: string): Promise<void> {\n await this._delete(`/${walletId}`);\n }\n\n /** Remove a specific card from a wallet. */\n async removeCard(walletId: string, cardId: string): Promise<void> {\n await this._delete(`/${walletId}/cards/${cardId}`);\n }\n\n /** Deposit funds into a wallet. */\n async deposit(walletId: string, params: DepositParams): Promise<DepositResult> {\n const res = await this._post<DepositResult>(\n `/${walletId}/deposit`,\n { amount: params.amount } as Record<string, unknown>,\n params.idempotencyKey,\n );\n return res.data;\n }\n\n /** Get wallet balance and metadata. */\n async balance(walletId?: string): Promise<WalletBalance> {\n const res = await this._get<WalletBalance>(`/${walletId ?? 'default'}/balance`);\n return res.data;\n }\n\n /** Configure auto-reload for a wallet. */\n async setAutoReload(walletId: string, config: AutoReloadConfig): Promise<AutoReloadConfig> {\n const res = await this._put<AutoReloadConfig>(\n `/${walletId}/auto-reload`,\n config as unknown as Record<string, unknown>,\n );\n return res.data;\n }\n\n /** Get card attributes for a wallet. */\n async getAttributes(walletId: string): Promise<CardAttributes> {\n const res = await this._get<CardAttributes>(`/${walletId}/card-attributes`);\n return res.data;\n }\n\n /** Set the checkout profile for a wallet (billing, shipping, email). */\n async setProfile(walletId: string, profile: SetCheckoutProfileParams): Promise<CheckoutProfile> {\n const res = await this._post<CheckoutProfile>(`/${walletId}/profile`, profile as unknown as Record<string, unknown>);\n return res.data;\n }\n\n /** Get the checkout profile. Addresses and email are visible; no sensitive data. */\n async getProfile(walletId: string): Promise<CheckoutProfile> {\n const res = await this._get<CheckoutProfile>(`/${walletId}/profile`);\n return res.data;\n }\n\n /** Update the checkout profile (partial). */\n async updateProfile(walletId: string, updates: Partial<SetCheckoutProfileParams>): Promise<CheckoutProfile> {\n const res = await this._put<CheckoutProfile>(`/${walletId}/profile`, updates as Record<string, unknown>);\n return res.data;\n }\n\n /** Save a merchant account (for sites without guest checkout). */\n async saveMerchantAccount(walletId: string, params: SaveMerchantAccountParams): Promise<MerchantAccount> {\n const res = await this._post<MerchantAccount>(`/${walletId}/merchant-accounts`, params as unknown as Record<string, unknown>);\n return res.data;\n }\n\n /** List saved merchant accounts (domain + email only). */\n async listMerchantAccounts(walletId: string): Promise<MerchantAccount[]> {\n const res = await this._get<MerchantAccount[]>(`/${walletId}/merchant-accounts`);\n return res.data;\n }\n\n /** Remove a saved merchant account. */\n async removeMerchantAccount(walletId: string, accountId: string): Promise<void> {\n await this._delete(`/${walletId}/merchant-accounts/${accountId}`);\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Pay Resource (Agentic Tokens + Payment Execution)\n// ---------------------------------------------------------------------------\n\nimport { createHash } from 'node:crypto';\nimport { Resource } from './base.js';\nimport type {\n AgenticToken,\n CreateTokenParams,\n ExecutePaymentParams,\n Transaction,\n RefundParams,\n Refund,\n PaginatedResponse,\n} from '../types.js';\n\nexport class Pay extends Resource {\n protected get basePath(): string {\n return '/api/sdk/pay';\n }\n\n /**\n * Create a scoped agentic token — amount-limited, merchant-locked,\n * time-bounded. The token can be used to execute a single payment.\n */\n async createToken(params: CreateTokenParams): Promise<AgenticToken> {\n const res = await this._post<AgenticToken>('/tokens', {\n walletId: params.walletId,\n amount: params.amount,\n currency: params.currency ?? 'USD',\n merchant: params.merchant ?? '*',\n expiresIn: params.expiresIn ?? '1h',\n permissions: params.permissions ?? [],\n }, params.idempotencyKey);\n return res.data;\n }\n\n /**\n * Execute a payment. Routed via the best available path:\n * 1. Billing API (for services like OpenAI, Replicate, Vercel)\n * 2. ACP-enabled merchant checkout\n * 3. VIC agentic token (when available)\n *\n * Idempotency key is strongly recommended to prevent double charges.\n */\n async execute(params: ExecutePaymentParams): Promise<Transaction> {\n // Auto-generate idempotency key if not provided (amount + recipient + 5-min window)\n const idempotencyKey = params.idempotencyKey ?? this.generateIdempotencyKey(params);\n\n const res = await this._post<Transaction>('/execute', {\n tokenId: params.tokenId,\n recipient: params.recipient,\n amount: params.amount,\n currency: params.currency ?? 'USD',\n description: params.description,\n }, idempotencyKey);\n return res.data;\n }\n\n private generateIdempotencyKey(params: ExecutePaymentParams): string {\n const window = Math.floor(Date.now() / (5 * 60 * 1000)); // 5-minute window\n const input = `${params.amount}:${params.recipient}:${params.currency ?? 'USD'}:${window}`;\n return `auto_${createHash('sha256').update(input).digest('hex').slice(0, 24)}`;\n }\n\n /** Get a transaction by ID. */\n async getTransaction(transactionId: string): Promise<Transaction> {\n const res = await this._get<Transaction>(`/transactions/${transactionId}`);\n return res.data;\n }\n\n /** List transactions with optional filters. */\n async listTransactions(params?: {\n limit?: number;\n offset?: number;\n cardId?: string;\n status?: Transaction['status'];\n }): Promise<PaginatedResponse<Transaction>> {\n return this._list<Transaction>('/transactions', params);\n }\n\n /**\n * Initiate a refund. Full or partial.\n *\n * Refund routing mirrors payment routing:\n * - Billing API merchants: calls their refund API\n * - ACP merchants: initiates refund through PSP\n * - VIC transactions: standard Visa dispute flow\n */\n async refund(params: RefundParams): Promise<Refund> {\n const res = await this._post<Refund>('/refunds', {\n transactionId: params.transactionId,\n amount: params.amount,\n reason: params.reason,\n }, params.idempotencyKey);\n return res.data;\n }\n\n /** Get a refund by ID. */\n async getRefund(refundId: string): Promise<Refund> {\n const res = await this._get<Refund>(`/refunds/${refundId}`);\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Products Resource (Discovery)\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n Product,\n ProductSearchParams,\n SoftwareProductSearchParams,\n Merchant,\n PaginatedResponse,\n} from '../types.js';\n\nexport class Products extends Resource {\n protected get basePath(): string {\n return '/api/sdk/products';\n }\n\n /** Search the Lane product catalog. */\n async search(params: ProductSearchParams | SoftwareProductSearchParams): Promise<PaginatedResponse<Product>> {\n return this._list<Product>('/search', { ...params });\n }\n\n /** Get a product by ID. */\n async get(productId: string): Promise<Product> {\n const res = await this._get<Product>(`/${productId}`);\n return res.data;\n }\n\n /** List available merchants. */\n async listMerchants(params?: {\n limit?: number;\n offset?: number;\n query?: string;\n }): Promise<PaginatedResponse<Merchant>> {\n return this._list<Merchant>('/merchants', params);\n }\n\n /** Get a merchant by ID or slug. */\n async getMerchant(merchantIdOrSlug: string): Promise<Merchant> {\n const res = await this.client.get<Merchant>(`/api/sdk/merchants/${merchantIdOrSlug}`);\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Checkout Resource\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n CheckoutSession,\n CreateCheckoutParams,\n SoftwareCheckoutParams,\n Order,\n SoftwareOrder,\n} from '../types.js';\n\nexport class Checkout extends Resource {\n protected get basePath(): string {\n return '/api/sdk/checkout';\n }\n\n /** Create a new checkout session for a product. */\n async create(params: CreateCheckoutParams | SoftwareCheckoutParams): Promise<CheckoutSession> {\n const body: Record<string, unknown> = {\n productId: params.productId,\n walletId: params.walletId,\n quantity: params.quantity ?? 1,\n };\n if ('plan' in params && params.plan !== undefined) {\n body.plan = params.plan;\n }\n if ('parameters' in params && params.parameters !== undefined) {\n body.parameters = params.parameters;\n }\n const res = await this._post<CheckoutSession>('', body, params.idempotencyKey);\n return res.data;\n }\n\n /** Complete a checkout session — processes payment and returns the order. */\n async complete(sessionId: string): Promise<Order | SoftwareOrder> {\n const res = await this._post<Order | SoftwareOrder>(`/${sessionId}/complete`);\n return res.data;\n }\n\n /** Get the status of a checkout session. */\n async get(sessionId: string): Promise<CheckoutSession> {\n const res = await this._get<CheckoutSession>(`/${sessionId}`);\n return res.data;\n }\n\n /** Cancel a pending checkout session. */\n async cancel(sessionId: string): Promise<CheckoutSession> {\n const res = await this._post<CheckoutSession>(`/${sessionId}/cancel`);\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Sell Resource (Make-a-SaaS)\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n Product,\n CreateProductParams,\n ProductAnalytics,\n AnalyticsParams,\n PaginatedResponse,\n SCPManifest,\n} from '../types.js';\n\nexport class Sell extends Resource {\n protected get basePath(): string {\n return '/api/sdk/sell';\n }\n\n /**\n * List a product for sale on the Lane marketplace.\n *\n * Lane will:\n * 1. List the product in the Product API (discoverable by any agent)\n * 2. Create a proxy endpoint (handles auth + metering)\n * 3. Generate API keys for buyers automatically\n * 4. Meter usage and bill buyer wallets\n * 5. Pay out to seller (minus Lane fee)\n */\n async create(params: CreateProductParams): Promise<Product> {\n const res = await this._post<Product>('/products', {\n name: params.name,\n type: params.type,\n endpoint: params.endpoint,\n mcpEndpoint: params.mcpEndpoint,\n pricing: params.pricing,\n description: params.description,\n auth: params.auth,\n }, params.idempotencyKey);\n return res.data;\n }\n\n /** Update an existing product listing. */\n async update(productId: string, params: Partial<CreateProductParams>): Promise<Product> {\n const res = await this._put<Product>(`/products/${productId}`, params as Record<string, unknown>);\n return res.data;\n }\n\n /** Deactivate a product listing (soft delete). */\n async deactivate(productId: string): Promise<void> {\n await this._delete(`/products/${productId}`);\n }\n\n /** Get a product you've listed. */\n async get(productId: string): Promise<Product> {\n const res = await this._get<Product>(`/products/${productId}`);\n return res.data;\n }\n\n /** List all products you've listed for sale. */\n async list(params?: { limit?: number; offset?: number }): Promise<PaginatedResponse<Product>> {\n return this._list<Product>('/products', params);\n }\n\n /** Get analytics for a product you've listed. */\n async analytics(params: AnalyticsParams): Promise<ProductAnalytics> {\n const res = await this._get<ProductAnalytics>(\n `/products/${params.productId}/analytics`,\n { period: params.period },\n );\n return res.data;\n }\n\n /** List a software product using an SCP manifest. */\n async createSoftwareProduct(manifest: SCPManifest): Promise<Product> {\n const res = await this._post<Product>('/software', manifest as unknown as Record<string, unknown>);\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Admin Resource (Enterprise / Team Management)\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n BudgetConfig,\n SpendingSummary,\n TeamMember,\n PaginatedResponse,\n} from '../types.js';\n\nexport class Admin extends Resource {\n protected get basePath(): string {\n return '/api/sdk/admin';\n }\n\n // -------------------------------------------------------------------------\n // Spending\n // -------------------------------------------------------------------------\n\n /** Get spending summary with optional grouping by team/developer/agent. */\n async spending(params: {\n period: string;\n groupBy?: 'team' | 'developer' | 'agent';\n }): Promise<SpendingSummary> {\n const res = await this._get<SpendingSummary>('/spending', params);\n return res.data;\n }\n\n // -------------------------------------------------------------------------\n // Budgets\n // -------------------------------------------------------------------------\n\n /** Get current budget configuration. */\n async getBudget(scope?: { teamId?: string; developerId?: string }): Promise<BudgetConfig> {\n const res = await this._get<BudgetConfig>('/budgets', scope);\n return res.data;\n }\n\n /** Update budget limits. */\n async setBudget(\n config: BudgetConfig & { teamId?: string; developerId?: string },\n ): Promise<BudgetConfig> {\n const res = await this._put<BudgetConfig>('/budgets', config as Record<string, unknown>);\n return res.data;\n }\n\n // -------------------------------------------------------------------------\n // Team Members\n // -------------------------------------------------------------------------\n\n /** List team members. */\n async listMembers(params?: {\n limit?: number;\n offset?: number;\n teamId?: string;\n }): Promise<PaginatedResponse<TeamMember>> {\n return this._list<TeamMember>('/members', params);\n }\n\n /** Invite a team member. */\n async inviteMember(params: {\n email: string;\n role: TeamMember['role'];\n teamId?: string;\n }): Promise<TeamMember> {\n const res = await this._post<TeamMember>('/members', params);\n return res.data;\n }\n\n /** Update a team member's role. */\n async updateMember(memberId: string, params: { role: TeamMember['role'] }): Promise<TeamMember> {\n const res = await this._put<TeamMember>(`/members/${memberId}`, params);\n return res.data;\n }\n\n /** Remove a team member. */\n async removeMember(memberId: string): Promise<void> {\n await this._delete(`/members/${memberId}`);\n }\n\n // -------------------------------------------------------------------------\n // Account Management (GDPR)\n // -------------------------------------------------------------------------\n\n /**\n * Export all developer data as JSON (GDPR data portability).\n */\n async exportData(): Promise<Record<string, unknown>> {\n const res = await this._get<Record<string, unknown>>('/export');\n return res.data;\n }\n\n /**\n * Delete the developer account and purge all PII (GDPR right to erasure).\n * Transaction records are anonymized (amount + merchant retained for regulatory).\n */\n async deleteAccount(): Promise<{ status: string; deletionCompletesAt: string }> {\n const res = await this._delete<{ status: string; deletionCompletesAt: string }>('/account');\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Webhooks Resource\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport { verifyWebhookSignature } from '../crypto/signature.js';\nimport type { WebhookConfig, WebhookPayload, PaginatedResponse } from '../types.js';\n\nexport class Webhooks extends Resource {\n protected get basePath(): string {\n return '/api/sdk/webhooks';\n }\n\n /** Register a new webhook endpoint. */\n async create(params: Omit<WebhookConfig, 'id'>): Promise<WebhookConfig> {\n const res = await this._post<WebhookConfig>('', params as Record<string, unknown>);\n return res.data;\n }\n\n /** List registered webhooks. */\n async list(): Promise<PaginatedResponse<WebhookConfig>> {\n return this._list<WebhookConfig>();\n }\n\n /** Get a webhook by ID. */\n async get(webhookId: string): Promise<WebhookConfig> {\n const res = await this._get<WebhookConfig>(`/${webhookId}`);\n return res.data;\n }\n\n /** Update a webhook configuration. */\n async update(webhookId: string, params: Partial<WebhookConfig>): Promise<WebhookConfig> {\n const res = await this._put<WebhookConfig>(`/${webhookId}`, params as Record<string, unknown>);\n return res.data;\n }\n\n /** Delete a webhook endpoint. */\n async delete(webhookId: string): Promise<void> {\n await this._delete(`/${webhookId}`);\n }\n\n /**\n * Verify a webhook payload's signature.\n *\n * Use this in your webhook handler to confirm the payload was sent by Lane.\n *\n * @param payload - Raw request body string\n * @param signature - Value of X-Lane-Signature header\n * @param secret - Your webhook signing secret\n * @param timestamp - Value of X-Lane-Timestamp header (unix seconds)\n */\n verify(\n payload: string,\n signature: string,\n secret: string,\n timestamp: number,\n ): boolean {\n return verifyWebhookSignature(payload, signature, secret, timestamp);\n }\n\n /**\n * Parse and verify a webhook payload in one step.\n * Throws if signature is invalid.\n */\n constructEvent(\n payload: string,\n signature: string,\n secret: string,\n timestamp: number,\n ): WebhookPayload {\n if (!this.verify(payload, signature, secret, timestamp)) {\n throw new Error('Invalid webhook signature');\n }\n return JSON.parse(payload) as WebhookPayload;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — VIC Resource (Visa Intelligent Commerce Agentic Tokens)\n// ---------------------------------------------------------------------------\n// Phase 2: THE MOAT — issue Visa-authenticated credentials that work at\n// any Visa-accepting merchant. Upgrades from \"call billing API\" to\n// \"issue a Visa credential.\"\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n VICToken,\n VICIssuanceParams,\n NetworkTokenPayload,\n PaginatedResponse,\n} from '../types.js';\n\nexport class VIC extends Resource {\n protected get basePath(): string {\n return '/api/sdk/vic';\n }\n\n /**\n * Issue a VIC agentic token. This provisions a Visa network token (DPAN)\n * scoped to the agent's constraints: amount limits, merchant restrictions,\n * and time bounds.\n *\n * The token works at any Visa-accepting merchant — not just Lane catalog.\n */\n async issue(params: VICIssuanceParams): Promise<VICToken> {\n const res = await this._post<VICToken>('/tokens', {\n walletId: params.walletId,\n cardId: params.cardId,\n maxTransactionAmount: params.maxTransactionAmount,\n allowedMCCs: params.allowedMCCs,\n expiresIn: params.expiresIn ?? '24h',\n }, params.idempotencyKey);\n return res.data;\n }\n\n /**\n * Get a transaction-specific cryptogram for a VIC token.\n * Called just before payment execution — the cryptogram is single-use.\n */\n async getCryptogram(tokenId: string, params: {\n amount: number;\n currency: string;\n merchantId: string;\n }): Promise<NetworkTokenPayload> {\n const res = await this._post<NetworkTokenPayload>(\n `/tokens/${tokenId}/cryptogram`,\n params as Record<string, unknown>,\n );\n return res.data;\n }\n\n /** Get a VIC token by ID. */\n async get(tokenId: string): Promise<VICToken> {\n const res = await this._get<VICToken>(`/tokens/${tokenId}`);\n return res.data;\n }\n\n /** List VIC tokens for a wallet. */\n async list(params?: {\n walletId?: string;\n status?: VICToken['status'];\n limit?: number;\n offset?: number;\n }): Promise<PaginatedResponse<VICToken>> {\n return this._list<VICToken>('/tokens', params);\n }\n\n /** Revoke a VIC token immediately. */\n async revoke(tokenId: string): Promise<VICToken> {\n const res = await this._post<VICToken>(`/tokens/${tokenId}/revoke`);\n return res.data;\n }\n\n /** Suspend a VIC token (can be reactivated). */\n async suspend(tokenId: string): Promise<VICToken> {\n const res = await this._post<VICToken>(`/tokens/${tokenId}/suspend`);\n return res.data;\n }\n\n /** Reactivate a suspended VIC token. */\n async reactivate(tokenId: string): Promise<VICToken> {\n const res = await this._post<VICToken>(`/tokens/${tokenId}/reactivate`);\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Metering Resource (Make-a-SaaS Usage Tracking)\n// ---------------------------------------------------------------------------\n// Phase 4: Sellers track API usage, and Lane handles billing.\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n UsageRecord,\n UsageReport,\n MeteringConfig,\n PaginatedResponse,\n} from '../types.js';\n\nexport class Metering extends Resource {\n protected get basePath(): string {\n return '/api/sdk/metering';\n }\n\n /**\n * Record a usage event (API call, token consumption, etc.).\n * Called by the seller's service when a buyer uses it.\n */\n async record(params: {\n productId: string;\n buyerId: string;\n quantity: number;\n unit?: string;\n idempotencyKey?: string;\n }): Promise<UsageRecord> {\n const res = await this._post<UsageRecord>('/usage', {\n productId: params.productId,\n buyerId: params.buyerId,\n quantity: params.quantity,\n unit: params.unit ?? 'calls',\n }, params.idempotencyKey);\n return res.data;\n }\n\n /**\n * Record a batch of usage events efficiently.\n */\n async recordBatch(records: {\n productId: string;\n buyerId: string;\n quantity: number;\n unit?: string;\n timestamp?: string;\n }[]): Promise<{ recorded: number; failed: number }> {\n const res = await this._post<{ recorded: number; failed: number }>('/usage/batch', {\n records,\n });\n return res.data;\n }\n\n /** Query usage for a product. */\n async query(params: {\n productId: string;\n buyerId?: string;\n startDate?: string;\n endDate?: string;\n limit?: number;\n offset?: number;\n }): Promise<PaginatedResponse<UsageRecord>> {\n return this._list<UsageRecord>('/usage', params);\n }\n\n /** Get an aggregated usage report. */\n async report(params: {\n productId: string;\n period: string;\n }): Promise<UsageReport> {\n const res = await this._get<UsageReport>('/reports', params);\n return res.data;\n }\n\n /** Get or update metering config for a product. */\n async getConfig(productId: string): Promise<MeteringConfig> {\n const res = await this._get<MeteringConfig>(`/config/${productId}`);\n return res.data;\n }\n\n async setConfig(productId: string, config: MeteringConfig): Promise<MeteringConfig> {\n const res = await this._put<MeteringConfig>(`/config/${productId}`, config as unknown as Record<string, unknown>);\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Payouts Resource (Seller Disbursements)\n// ---------------------------------------------------------------------------\n// Phase 4: Sellers receive payouts from Lane for their product sales.\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type { Payout, PayoutConfig, PaginatedResponse } from '../types.js';\n\nexport class Payouts extends Resource {\n protected get basePath(): string {\n return '/api/sdk/payouts';\n }\n\n /** Get payout configuration. */\n async getConfig(): Promise<PayoutConfig> {\n const res = await this._get<PayoutConfig>('/config');\n return res.data;\n }\n\n /** Set up or update payout configuration. */\n async setConfig(config: {\n destination: PayoutConfig['destination'];\n destinationId: string;\n schedule?: PayoutConfig['schedule'];\n currency?: string;\n minimumPayout?: number;\n }): Promise<PayoutConfig> {\n const res = await this._put<PayoutConfig>('/config', config as Record<string, unknown>);\n return res.data;\n }\n\n /** List payouts. */\n async list(params?: {\n status?: Payout['status'];\n limit?: number;\n offset?: number;\n }): Promise<PaginatedResponse<Payout>> {\n return this._list<Payout>('', params);\n }\n\n /** Get a specific payout. */\n async get(payoutId: string): Promise<Payout> {\n const res = await this._get<Payout>(`/${payoutId}`);\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Teams Resource (Corporate Agent Spend)\n// ---------------------------------------------------------------------------\n// Phase 5: Hierarchical team management with budget cascading.\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n Team,\n CreateTeamParams,\n TeamMember,\n BudgetConfig,\n HierarchicalBudget,\n PaginatedResponse,\n} from '../types.js';\n\nexport class Teams extends Resource {\n protected get basePath(): string {\n return '/api/sdk/teams';\n }\n\n /** Create a new team. */\n async create(params: CreateTeamParams): Promise<Team> {\n const res = await this._post<Team>('', params as unknown as Record<string, unknown>);\n return res.data;\n }\n\n /** List teams. */\n async list(params?: { limit?: number; offset?: number }): Promise<PaginatedResponse<Team>> {\n return this._list<Team>('', params);\n }\n\n /** Get a team by ID. */\n async get(teamId: string): Promise<Team> {\n const res = await this._get<Team>(`/${teamId}`);\n return res.data;\n }\n\n /** Update a team. */\n async update(teamId: string, params: { name?: string; budget?: BudgetConfig }): Promise<Team> {\n const res = await this._put<Team>(`/${teamId}`, params as Record<string, unknown>);\n return res.data;\n }\n\n /** Delete a team. */\n async delete(teamId: string): Promise<void> {\n await this._delete(`/${teamId}`);\n }\n\n /** Add a member to a team. */\n async addMember(teamId: string, params: { email: string; role: TeamMember['role'] }): Promise<TeamMember> {\n const res = await this._post<TeamMember>(`/${teamId}/members`, params);\n return res.data;\n }\n\n /** List team members. */\n async listMembers(teamId: string, params?: { limit?: number; offset?: number }): Promise<PaginatedResponse<TeamMember>> {\n return this._list<TeamMember>(`/${teamId}/members`, params);\n }\n\n /** Remove a member from a team. */\n async removeMember(teamId: string, memberId: string): Promise<void> {\n await this._delete(`/${teamId}/members/${memberId}`);\n }\n\n /** Get the hierarchical budget for a team (org > team > developer > agent). */\n async getHierarchicalBudget(teamId: string): Promise<HierarchicalBudget> {\n const res = await this._get<HierarchicalBudget>(`/${teamId}/budget/hierarchy`);\n return res.data;\n }\n\n /** Set the team-level budget. */\n async setBudget(teamId: string, budget: BudgetConfig): Promise<BudgetConfig> {\n const res = await this._put<BudgetConfig>(`/${teamId}/budget`, budget as unknown as Record<string, unknown>);\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Agents Resource (Fleet Management)\n// ---------------------------------------------------------------------------\n// Phase 5: Register, manage, and constrain agents in a fleet.\n// Each agent gets a policy governing its capabilities and spending.\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n AgentRecord,\n RegisterAgentParams,\n AgentPolicy,\n PaginatedResponse,\n} from '../types.js';\n\nexport class Agents extends Resource {\n protected get basePath(): string {\n return '/api/sdk/agents';\n }\n\n /** Register a new agent in the fleet. */\n async register(params: RegisterAgentParams): Promise<AgentRecord> {\n const res = await this._post<AgentRecord>('', params as unknown as Record<string, unknown>);\n return res.data;\n }\n\n /** Get an agent by ID. */\n async get(agentId: string): Promise<AgentRecord> {\n const res = await this._get<AgentRecord>(`/${agentId}`);\n return res.data;\n }\n\n /** List agents in the fleet. */\n async list(params?: {\n status?: AgentRecord['status'];\n limit?: number;\n offset?: number;\n }): Promise<PaginatedResponse<AgentRecord>> {\n return this._list<AgentRecord>('', params);\n }\n\n /** Update an agent's policy. */\n async setPolicy(agentId: string, policy: AgentPolicy): Promise<AgentRecord> {\n const res = await this._put<AgentRecord>(`/${agentId}/policy`, policy as unknown as Record<string, unknown>);\n return res.data;\n }\n\n /** Suspend an agent (temporary, can be reactivated). */\n async suspend(agentId: string): Promise<AgentRecord> {\n const res = await this._post<AgentRecord>(`/${agentId}/suspend`);\n return res.data;\n }\n\n /** Reactivate a suspended agent. */\n async reactivate(agentId: string): Promise<AgentRecord> {\n const res = await this._post<AgentRecord>(`/${agentId}/reactivate`);\n return res.data;\n }\n\n /** Permanently revoke an agent. */\n async revoke(agentId: string): Promise<AgentRecord> {\n const res = await this._post<AgentRecord>(`/${agentId}/revoke`);\n return res.data;\n }\n\n /** Assign a wallet to an agent (per-agent wallet). */\n async assignWallet(agentId: string, walletId: string): Promise<AgentRecord> {\n const res = await this._put<AgentRecord>(`/${agentId}/wallet`, { walletId });\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Audit Resource (SOC 2 Audit Trail)\n// ---------------------------------------------------------------------------\n// Phase 5: Immutable audit trail for all SDK actions.\n// Every API call, payment, and admin action is logged.\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type { AuditEntry, AuditQueryParams, PaginatedResponse } from '../types.js';\n\nexport class Audit extends Resource {\n protected get basePath(): string {\n return '/api/sdk/audit';\n }\n\n /** Query audit log entries. */\n async query(params?: AuditQueryParams): Promise<PaginatedResponse<AuditEntry>> {\n return this._list<AuditEntry>('/logs', params ? { ...params } : undefined);\n }\n\n /** Get a specific audit entry by ID. */\n async get(entryId: string): Promise<AuditEntry> {\n const res = await this._get<AuditEntry>(`/logs/${entryId}`);\n return res.data;\n }\n\n /**\n * Export audit logs for a date range (SOC 2 compliance).\n * Returns a download URL for the audit log archive.\n */\n async export(params: {\n startDate: string;\n endDate: string;\n format?: 'json' | 'csv';\n }): Promise<{ downloadUrl: string; expiresAt: string }> {\n const res = await this._post<{ downloadUrl: string; expiresAt: string }>('/export', params);\n return res.data;\n }\n\n /** Get audit summary/statistics for a period. */\n async summary(params: {\n period: string;\n groupBy?: 'action' | 'actor' | 'resource';\n }): Promise<{\n totalEntries: number;\n byAction: Record<string, number>;\n byActorType: Record<string, number>;\n topActors: { id: string; count: number }[];\n }> {\n const res = await this._get<{\n totalEntries: number;\n byAction: Record<string, number>;\n byActorType: Record<string, number>;\n topActors: { id: string; count: number }[];\n }>('/summary', params);\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Identity Resource (Agent Identity)\n// ---------------------------------------------------------------------------\n// Phase 6: Lane-issued agent identity. KYC chain:\n// Human -> Lane -> Agent -> Transaction\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n AgentIdentity,\n RegisterIdentityParams,\n VerifyIdentityParams,\n IdentityAttestation,\n PaginatedResponse,\n} from '../types.js';\n\nexport class Identity extends Resource {\n protected get basePath(): string {\n return '/api/sdk/identity';\n }\n\n /**\n * Register an agent for identity verification.\n * This starts the KYC chain: Human (developer) vouches for Agent.\n */\n async register(params: RegisterIdentityParams): Promise<AgentIdentity> {\n const res = await this._post<AgentIdentity>('', params as unknown as Record<string, unknown>);\n return res.data;\n }\n\n /**\n * Complete identity verification using a developer-provided code.\n * This establishes the Human -> Lane -> Agent chain.\n */\n async verify(params: VerifyIdentityParams): Promise<AgentIdentity> {\n const res = await this._post<AgentIdentity>(\n `/${params.identityId}/verify`,\n { verificationCode: params.verificationCode },\n );\n return res.data;\n }\n\n /** Get an agent identity by ID. */\n async get(identityId: string): Promise<AgentIdentity> {\n const res = await this._get<AgentIdentity>(`/${identityId}`);\n return res.data;\n }\n\n /** List agent identities. */\n async list(params?: {\n agentId?: string;\n status?: AgentIdentity['status'];\n limit?: number;\n offset?: number;\n }): Promise<PaginatedResponse<AgentIdentity>> {\n return this._list<AgentIdentity>('', params);\n }\n\n /**\n * Get the current attestation for a verified identity.\n * The attestation is a cryptographic proof that Lane has verified the\n * Human -> Agent chain.\n */\n async getAttestation(identityId: string): Promise<IdentityAttestation> {\n const res = await this._get<IdentityAttestation>(`/${identityId}/attestation`);\n return res.data;\n }\n\n /**\n * Refresh the attestation (generates a new signed document).\n * Useful when the previous attestation is nearing expiry.\n */\n async refreshAttestation(identityId: string): Promise<IdentityAttestation> {\n const res = await this._post<IdentityAttestation>(`/${identityId}/attestation/refresh`);\n return res.data;\n }\n\n /** Suspend an agent identity. */\n async suspend(identityId: string): Promise<AgentIdentity> {\n const res = await this._post<AgentIdentity>(`/${identityId}/suspend`);\n return res.data;\n }\n\n /** Revoke an agent identity permanently. */\n async revoke(identityId: string): Promise<AgentIdentity> {\n const res = await this._post<AgentIdentity>(`/${identityId}/revoke`);\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Subscriptions Resource\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n Subscription,\n CreateSubscriptionParams,\n UpdateSubscriptionParams,\n PaginatedResponse,\n} from '../types.js';\n\nexport class Subscriptions extends Resource {\n protected get basePath(): string {\n return '/api/sdk/subscriptions';\n }\n\n /** Create a new subscription. */\n async create(params: CreateSubscriptionParams): Promise<Subscription> {\n const res = await this._post<Subscription>('', params as unknown as Record<string, unknown>);\n return res.data;\n }\n\n /** List subscriptions, optionally filtered by status. */\n async list(params?: { status?: string; limit?: number; offset?: number }): Promise<PaginatedResponse<Subscription>> {\n return this._list<Subscription>('', params);\n }\n\n /** Get a subscription by ID. */\n async get(subscriptionId: string): Promise<Subscription> {\n const res = await this._get<Subscription>(`/${subscriptionId}`);\n return res.data;\n }\n\n /** Cancel a subscription. */\n async cancel(subscriptionId: string): Promise<Subscription> {\n const res = await this._post<Subscription>(`/${subscriptionId}/cancel`, {});\n return res.data;\n }\n\n /** Upgrade a subscription to a higher plan. */\n async upgrade(subscriptionId: string, params: UpdateSubscriptionParams): Promise<Subscription> {\n const res = await this._post<Subscription>(`/${subscriptionId}/upgrade`, params as unknown as Record<string, unknown>);\n return res.data;\n }\n\n /** Downgrade a subscription to a lower plan. */\n async downgrade(subscriptionId: string, params: UpdateSubscriptionParams): Promise<Subscription> {\n const res = await this._post<Subscription>(`/${subscriptionId}/downgrade`, params as unknown as Record<string, unknown>);\n return res.data;\n }\n\n /** Pause a subscription. */\n async pause(subscriptionId: string): Promise<Subscription> {\n const res = await this._post<Subscription>(`/${subscriptionId}/pause`, {});\n return res.data;\n }\n\n /** Resume a paused subscription. */\n async resume(subscriptionId: string): Promise<Subscription> {\n const res = await this._post<Subscription>(`/${subscriptionId}/resume`, {});\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Merchants Resource (Directory)\n// ---------------------------------------------------------------------------\n\nimport { Resource } from './base.js';\nimport type {\n PaginatedResponse,\n DirectoryMerchant,\n MerchantSearchParams,\n ProtocolDiscoveryResult,\n MerchantVerticalSummary,\n} from '../types.js';\n\nexport class Merchants extends Resource {\n protected get basePath(): string {\n return '/api/sdk/merchants';\n }\n\n /** List/search the merchant directory. */\n async list(params?: MerchantSearchParams): Promise<PaginatedResponse<DirectoryMerchant>> {\n return this._list<DirectoryMerchant>('', params as Record<string, unknown>);\n }\n\n /** Get a merchant by ID, slug, or domain. */\n async get(idOrSlug: string): Promise<DirectoryMerchant> {\n const res = await this._get<DirectoryMerchant>(`/${idOrSlug}`);\n return res.data;\n }\n\n /** List merchants that support a specific protocol. */\n async listByProtocol(\n protocol: string,\n params?: Omit<MerchantSearchParams, 'protocol'>,\n ): Promise<PaginatedResponse<DirectoryMerchant>> {\n return this._list<DirectoryMerchant>('', { ...params, protocol } as Record<string, unknown>);\n }\n\n /** List merchants in a specific vertical. */\n async listByVertical(\n vertical: string,\n params?: Omit<MerchantSearchParams, 'vertical'>,\n ): Promise<PaginatedResponse<DirectoryMerchant>> {\n return this._list<DirectoryMerchant>('', { ...params, vertical } as Record<string, unknown>);\n }\n\n /** List only Lane-onboarded merchants. */\n async listOnboarded(\n params?: Omit<MerchantSearchParams, 'tier'>,\n ): Promise<PaginatedResponse<DirectoryMerchant>> {\n return this._list<DirectoryMerchant>('', { ...params, tier: 'lane_onboarded' } as Record<string, unknown>);\n }\n\n /** List all verticals with subcategories and counts. */\n async verticals(): Promise<MerchantVerticalSummary[]> {\n const res = await this._get<MerchantVerticalSummary[]>('/verticals');\n return res.data;\n }\n\n /** Discover a protocol-compatible merchant by domain. */\n async discover(domain: string): Promise<ProtocolDiscoveryResult> {\n const res = await this._post<ProtocolDiscoveryResult>('/discover', { domain });\n return res.data;\n }\n}\n","// ---------------------------------------------------------------------------\n// Lane SDK — Main Class\n// ---------------------------------------------------------------------------\n// This is the primary entry point for the SDK. It composes all resources\n// and provides a clean, Stripe-like interface:\n//\n// const lane = new Lane({ apiKey: 'lane_sk_...' })\n// const wallet = await lane.wallets.create({ userId: 'u1' })\n// const txn = await lane.pay.execute({ ... })\n// ---------------------------------------------------------------------------\n\nimport { LaneClient } from './client.js';\nimport { resolveConfig } from './config.js';\nimport { Auth } from './resources/auth.js';\nimport { Wallets } from './resources/wallets.js';\nimport { Pay } from './resources/pay.js';\nimport { Products } from './resources/products.js';\nimport { Checkout } from './resources/checkout.js';\nimport { Sell } from './resources/sell.js';\nimport { Admin } from './resources/admin.js';\nimport { Webhooks } from './resources/webhooks.js';\nimport { VIC } from './resources/vic.js';\nimport { Metering } from './resources/metering.js';\nimport { Payouts } from './resources/payouts.js';\nimport { Teams } from './resources/teams.js';\nimport { Agents } from './resources/agents.js';\nimport { Audit } from './resources/audit.js';\nimport { Identity } from './resources/identity.js';\nimport { Subscriptions } from './resources/subscriptions.js';\nimport { Merchants } from './resources/merchants.js';\nimport type { LaneConfig, ResolvedConfig, TokenStore } from './types.js';\n\n/**\n * Lane SDK client.\n *\n * Provides access to all Lane API resources through a composable,\n * object-oriented interface. Resources are lazily initialized on first access.\n *\n * @example\n * ```typescript\n * import Lane from 'lane'\n *\n * const lane = await Lane.create({ apiKey: process.env.LANE_KEY })\n *\n * const wallet = await lane.wallets.create({ userId: 'user_123' })\n * const products = await lane.products.search({ query: 'API credits' })\n * const txn = await lane.pay.execute({ recipient: 'replicate.com', amount: 20 })\n * ```\n */\nexport class Lane {\n private readonly client: LaneClient;\n private readonly _config: ResolvedConfig;\n\n // Lazily initialized resources\n private _auth?: Auth;\n private _wallets?: Wallets;\n private _pay?: Pay;\n private _products?: Products;\n private _checkout?: Checkout;\n private _sell?: Sell;\n private _admin?: Admin;\n private _webhooks?: Webhooks;\n private _vic?: VIC;\n private _metering?: Metering;\n private _payouts?: Payouts;\n private _teams?: Teams;\n private _agents?: Agents;\n private _audit?: Audit;\n private _identity?: Identity;\n private _subscriptions?: Subscriptions;\n private _merchants?: Merchants;\n\n /**\n * Private constructor — use `Lane.create()` for async config resolution,\n * or `new Lane(resolvedConfig)` if you've already resolved config.\n */\n private constructor(config: ResolvedConfig) {\n this._config = config;\n this.client = new LaneClient(config);\n }\n\n /**\n * Create a new Lane SDK instance with async config resolution.\n *\n * Resolves API key from: constructor > env var > credentials file.\n */\n static async create(options: LaneConfig = {}): Promise<Lane> {\n const config = await resolveConfig(options, options.tokenStore);\n return new Lane(config);\n }\n\n /**\n * Create a Lane SDK instance synchronously (requires explicit apiKey).\n *\n * Use this when you already have the API key and don't need file-based\n * credential resolution.\n */\n static fromApiKey(apiKey: string, options: Omit<LaneConfig, 'apiKey'> = {}): Lane {\n const testMode = options.testMode ?? apiKey.startsWith('lane_sk_test_');\n const config: ResolvedConfig = Object.freeze({\n apiKey,\n baseUrl: options.baseUrl ?? process.env['LANE_BASE_URL'] ?? 'https://api.getonlane.com',\n testMode,\n timeout: options.timeout ?? 30_000,\n maxRetries: options.maxRetries ?? 2,\n circuitBreaker: options.circuitBreaker ? Object.freeze({\n failureThreshold: options.circuitBreaker.failureThreshold ?? 3,\n resetTimeoutMs: options.circuitBreaker.resetTimeoutMs ?? 30_000,\n }) : undefined,\n });\n return new Lane(config);\n }\n\n // -------------------------------------------------------------------------\n // Resource Accessors (lazy initialization)\n // -------------------------------------------------------------------------\n\n /** Authentication — login, whoami, key rotation. */\n get auth(): Auth {\n return (this._auth ??= new Auth(this.client));\n }\n\n /** Wallets — create, list cards, add card, revoke. */\n get wallets(): Wallets {\n return (this._wallets ??= new Wallets(this.client));\n }\n\n /** Pay — agentic tokens, payment execution, refunds. */\n get pay(): Pay {\n return (this._pay ??= new Pay(this.client));\n }\n\n /** Products — search catalog, list merchants. */\n get products(): Products {\n return (this._products ??= new Products(this.client));\n }\n\n /** Checkout — create and complete checkout sessions. */\n get checkout(): Checkout {\n return (this._checkout ??= new Checkout(this.client));\n }\n\n /** Sell — list products for sale, analytics (Make-a-SaaS). */\n get sell(): Sell {\n return (this._sell ??= new Sell(this.client));\n }\n\n /** Admin — spending, budgets, team management, GDPR. */\n get admin(): Admin {\n return (this._admin ??= new Admin(this.client));\n }\n\n /** Webhooks — register, verify, manage webhook endpoints. */\n get webhooks(): Webhooks {\n return (this._webhooks ??= new Webhooks(this.client));\n }\n\n /** VIC — Visa Intelligent Commerce agentic tokens (Phase 2). */\n get vic(): VIC {\n return (this._vic ??= new VIC(this.client));\n }\n\n /** Metering — usage tracking for Make-a-SaaS sellers (Phase 4). */\n get metering(): Metering {\n return (this._metering ??= new Metering(this.client));\n }\n\n /** Payouts — seller disbursements (Phase 4). */\n get payouts(): Payouts {\n return (this._payouts ??= new Payouts(this.client));\n }\n\n /** Teams — team management with hierarchical budgets (Phase 5). */\n get teams(): Teams {\n return (this._teams ??= new Teams(this.client));\n }\n\n /** Agents — fleet management with per-agent policies (Phase 5). */\n get agents(): Agents {\n return (this._agents ??= new Agents(this.client));\n }\n\n /** Audit — immutable audit trail for SOC 2 compliance (Phase 5). */\n get audit(): Audit {\n return (this._audit ??= new Audit(this.client));\n }\n\n /** Identity — agent identity and KYC chain (Phase 6). */\n get identity(): Identity {\n return (this._identity ??= new Identity(this.client));\n }\n\n /** Subscriptions — manage software subscriptions (SCP). */\n get subscriptions(): Subscriptions {\n return (this._subscriptions ??= new Subscriptions(this.client));\n }\n\n /** Merchants — discover and search the merchant directory. */\n get merchants(): Merchants {\n return (this._merchants ??= new Merchants(this.client));\n }\n\n // -------------------------------------------------------------------------\n // Observability\n // -------------------------------------------------------------------------\n\n /** Subscribe to SDK events (request, response, error, retry). */\n on(\n event: 'request' | 'response' | 'error' | 'retry',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n listener: (...args: any[]) => void,\n ): this {\n this.client.on(event, listener);\n return this;\n }\n\n // -------------------------------------------------------------------------\n // Metadata\n // -------------------------------------------------------------------------\n\n /** Whether this instance is operating in test mode. */\n get testMode(): boolean {\n return this._config.testMode;\n }\n\n /** The resolved base URL. */\n get baseUrl(): string {\n return this._config.baseUrl;\n }\n}\n","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","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n","// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n","import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\n\t\t},\n\t},\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u001B')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\nimport { FileTokenStore } from '../../auth/token-store.js';\nimport { runBrowserAuthFlow } from '../../auth/browser-flow.js';\n\nexport const loginCommand = new Command('login')\n .alias('signup')\n .description('Authenticate with Lane (opens browser)')\n .action(async () => {\n const store = new FileTokenStore();\n\n // Check if already logged in\n const existing = await store.read();\n if (existing) {\n console.log(chalk.yellow('Already authenticated. Use `lane logout` first to re-authenticate.'));\n console.log(` Credentials: ${store.path}`);\n return;\n }\n\n console.log(chalk.blue('Starting authentication...'));\n\n try {\n // Create a temporary client to call the login endpoint\n // (no API key needed for the login initiation)\n const baseUrl = process.env['LANE_BASE_URL'] ?? 'https://api.getonlane.com';\n const response = await fetch(`${baseUrl}/api/sdk/auth/login`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n });\n\n if (!response.ok) {\n throw new Error(`Login initiation failed: ${response.statusText}`);\n }\n\n const { sessionId, authUrl } = (await response.json()) as {\n sessionId: string;\n authUrl: string;\n };\n\n console.log(chalk.blue('Opening browser for authentication...'));\n\n // Run the browser flow — waits for callback\n const code = await runBrowserAuthFlow(authUrl);\n\n // Exchange code for API key\n const tokenResponse = await fetch(`${baseUrl}/api/sdk/auth/token`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ code, sessionId }),\n });\n\n if (!tokenResponse.ok) {\n throw new Error('Failed to exchange auth code for API key.');\n }\n\n const { apiKey, developerId } = (await tokenResponse.json()) as {\n apiKey: string;\n developerId: string;\n };\n\n // Store credentials\n await store.write({\n apiKey,\n developerId,\n environment: apiKey.startsWith('lane_sk_test_') ? 'test' : 'live',\n });\n\n console.log(chalk.green('Authenticated successfully.'));\n console.log(` Credentials stored at: ${store.path}`);\n console.log(` Dashboard: ${chalk.underline('app.getonlane.com/agent/dashboard')}`);\n } catch (err) {\n console.error(chalk.red(`Authentication failed: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","// ---------------------------------------------------------------------------\n// Lane SDK — Browser-Based Auth Flow\n// ---------------------------------------------------------------------------\n// 1. CLI starts a local HTTP server on an ephemeral port\n// 2. Opens browser to app.getonlane.com/sdk/authorize?s=xxx&port=yyy\n// 3. User logs in via Supabase Auth\n// 4. Backend generates API key, redirects to localhost:<port>/callback?code=xxx\n// 5. CLI exchanges code for API key, writes to ~/.lane/credentials.json\n// ---------------------------------------------------------------------------\n\nimport { createServer, type Server, type IncomingMessage, type ServerResponse } from 'node:http';\nimport open from 'open';\n\nconst AUTH_TIMEOUT_MS = 300_000; // 5 minutes\n\nexport interface AuthFlowResult {\n code: string;\n sessionId: string;\n}\n\n/**\n * Run the browser-based login flow.\n *\n * Opens the user's browser to Lane's auth page. Waits for the callback\n * on a local ephemeral port. Returns the one-time code.\n */\nexport async function runBrowserAuthFlow(authUrl: string): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const server = createServer((req: IncomingMessage, res: ServerResponse) => {\n const url = new URL(req.url ?? '/', `http://localhost`);\n\n if (url.pathname === '/callback') {\n const code = url.searchParams.get('code');\n const error = url.searchParams.get('error');\n\n if (error) {\n res.writeHead(200, { 'Content-Type': 'text/html' });\n res.end(errorPage(error));\n cleanup();\n reject(new Error(`Authentication failed: ${error}`));\n return;\n }\n\n if (code) {\n res.writeHead(200, { 'Content-Type': 'text/html' });\n res.end(successPage());\n cleanup();\n resolve(code);\n return;\n }\n\n res.writeHead(400, { 'Content-Type': 'text/plain' });\n res.end('Missing code parameter');\n return;\n }\n\n res.writeHead(404, { 'Content-Type': 'text/plain' });\n res.end('Not found');\n });\n\n const timeout = setTimeout(() => {\n cleanup();\n reject(new Error('Authentication timed out. Please try again.'));\n }, AUTH_TIMEOUT_MS);\n\n function cleanup(): void {\n clearTimeout(timeout);\n server.close();\n }\n\n // Listen on ephemeral port\n server.listen(0, '127.0.0.1', () => {\n const address = server.address();\n if (!address || typeof address === 'string') {\n reject(new Error('Failed to start local auth server'));\n return;\n }\n\n const port = address.port;\n const fullUrl = `${authUrl}&redirect_port=${port}`;\n\n open(fullUrl).catch(() => {\n // If browser open fails, tell the user to open manually\n process.stderr.write(`\\nOpen this URL in your browser:\\n${fullUrl}\\n\\n`);\n });\n });\n\n server.on('error', (err) => {\n cleanup();\n reject(err);\n });\n });\n}\n\n/**\n * Open the VGS Collect card entry page in the browser.\n */\nexport async function openCardEntry(url: string): Promise<void> {\n await open(url).catch(() => {\n process.stderr.write(`\\nOpen this URL in your browser to add your card:\\n${url}\\n\\n`);\n });\n}\n\n// ---------------------------------------------------------------------------\n// HTML Pages\n// ---------------------------------------------------------------------------\n\nfunction successPage(): string {\n return `<!DOCTYPE html>\n<html>\n<head><title>Lane - Authenticated</title></head>\n<body style=\"font-family: -apple-system, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #f8f9fa;\">\n <div style=\"text-align: center;\">\n <h1 style=\"color: #10b981; font-size: 24px;\">Authenticated</h1>\n <p style=\"color: #6b7280;\">You can close this tab and return to your terminal.</p>\n </div>\n</body>\n</html>`;\n}\n\nfunction errorPage(error: string): string {\n return `<!DOCTYPE html>\n<html>\n<head><title>Lane - Error</title></head>\n<body style=\"font-family: -apple-system, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #f8f9fa;\">\n <div style=\"text-align: center;\">\n <h1 style=\"color: #ef4444; font-size: 24px;\">Authentication Failed</h1>\n <p style=\"color: #6b7280;\">${escapeHtml(error)}</p>\n <p style=\"color: #6b7280;\">Please try again with <code>lane login</code>.</p>\n </div>\n</body>\n</html>`;\n}\n\nfunction escapeHtml(str: string): string {\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"');\n}\n","import process from 'node:process';\nimport path from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport childProcess from 'node:child_process';\nimport fs, {constants as fsConstants} from 'node:fs/promises';\nimport {\n\tisWsl,\n\tpowerShellPath,\n\tconvertWslPathToWindows,\n\tcanAccessPowerShell,\n\twslDefaultBrowser,\n} from 'wsl-utils';\nimport {executePowerShell} from 'powershell-utils';\nimport defineLazyProperty from 'define-lazy-prop';\nimport defaultBrowser, {_windowsBrowserProgIdMap} from 'default-browser';\nimport isInsideContainer from 'is-inside-container';\nimport isInSsh from 'is-in-ssh';\n\nconst fallbackAttemptSymbol = Symbol('fallbackAttempt');\n\n// Path to included `xdg-open`.\nconst __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : '';\nconst localXdgOpenPath = path.join(__dirname, 'xdg-open');\n\nconst {platform, arch} = process;\n\nconst tryEachApp = async (apps, opener) => {\n\tif (apps.length === 0) {\n\t\t// No app was provided\n\t\treturn;\n\t}\n\n\tconst errors = [];\n\n\tfor (const app of apps) {\n\t\ttry {\n\t\t\treturn await opener(app); // eslint-disable-line no-await-in-loop\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t}\n\n\tthrow new AggregateError(errors, 'Failed to open in all supported apps');\n};\n\n// eslint-disable-next-line complexity\nconst baseOpen = async options => {\n\toptions = {\n\t\twait: false,\n\t\tbackground: false,\n\t\tnewInstance: false,\n\t\tallowNonzeroExitCode: false,\n\t\t...options,\n\t};\n\n\tconst isFallbackAttempt = options[fallbackAttemptSymbol] === true;\n\tdelete options[fallbackAttemptSymbol];\n\n\tif (Array.isArray(options.app)) {\n\t\treturn tryEachApp(options.app, singleApp => baseOpen({\n\t\t\t...options,\n\t\t\tapp: singleApp,\n\t\t\t[fallbackAttemptSymbol]: true,\n\t\t}));\n\t}\n\n\tlet {name: app, arguments: appArguments = []} = options.app ?? {};\n\tappArguments = [...appArguments];\n\n\tif (Array.isArray(app)) {\n\t\treturn tryEachApp(app, appName => baseOpen({\n\t\t\t...options,\n\t\t\tapp: {\n\t\t\t\tname: appName,\n\t\t\t\targuments: appArguments,\n\t\t\t},\n\t\t\t[fallbackAttemptSymbol]: true,\n\t\t}));\n\t}\n\n\tif (app === 'browser' || app === 'browserPrivate') {\n\t\t// IDs from default-browser for macOS and windows are the same.\n\t\t// IDs are lowercased to increase chances of a match.\n\t\tconst ids = {\n\t\t\t'com.google.chrome': 'chrome',\n\t\t\t'google-chrome.desktop': 'chrome',\n\t\t\t'com.brave.browser': 'brave',\n\t\t\t'org.mozilla.firefox': 'firefox',\n\t\t\t'firefox.desktop': 'firefox',\n\t\t\t'com.microsoft.msedge': 'edge',\n\t\t\t'com.microsoft.edge': 'edge',\n\t\t\t'com.microsoft.edgemac': 'edge',\n\t\t\t'microsoft-edge.desktop': 'edge',\n\t\t\t'com.apple.safari': 'safari',\n\t\t};\n\n\t\t// Incognito flags for each browser in `apps`.\n\t\tconst flags = {\n\t\t\tchrome: '--incognito',\n\t\t\tbrave: '--incognito',\n\t\t\tfirefox: '--private-window',\n\t\t\tedge: '--inPrivate',\n\t\t\t// Safari doesn't support private mode via command line\n\t\t};\n\n\t\tlet browser;\n\t\tif (isWsl) {\n\t\t\tconst progId = await wslDefaultBrowser();\n\t\t\tconst browserInfo = _windowsBrowserProgIdMap.get(progId);\n\t\t\tbrowser = browserInfo ?? {};\n\t\t} else {\n\t\t\tbrowser = await defaultBrowser();\n\t\t}\n\n\t\tif (browser.id in ids) {\n\t\t\tconst browserName = ids[browser.id.toLowerCase()];\n\n\t\t\tif (app === 'browserPrivate') {\n\t\t\t\t// Safari doesn't support private mode via command line\n\t\t\t\tif (browserName === 'safari') {\n\t\t\t\t\tthrow new Error('Safari doesn\\'t support opening in private mode via command line');\n\t\t\t\t}\n\n\t\t\t\tappArguments.push(flags[browserName]);\n\t\t\t}\n\n\t\t\treturn baseOpen({\n\t\t\t\t...options,\n\t\t\t\tapp: {\n\t\t\t\t\tname: apps[browserName],\n\t\t\t\t\targuments: appArguments,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\tthrow new Error(`${browser.name} is not supported as a default browser`);\n\t}\n\n\tlet command;\n\tconst cliArguments = [];\n\tconst childProcessOptions = {};\n\n\t// Determine if we should use Windows/PowerShell behavior in WSL.\n\t// We only use Windows integration if PowerShell is actually accessible.\n\t// This allows the package to work in sandboxed WSL environments where Windows access is restricted.\n\tlet shouldUseWindowsInWsl = false;\n\tif (isWsl && !isInsideContainer() && !isInSsh && !app) {\n\t\tshouldUseWindowsInWsl = await canAccessPowerShell();\n\t}\n\n\tif (platform === 'darwin') {\n\t\tcommand = 'open';\n\n\t\tif (options.wait) {\n\t\t\tcliArguments.push('--wait-apps');\n\t\t}\n\n\t\tif (options.background) {\n\t\t\tcliArguments.push('--background');\n\t\t}\n\n\t\tif (options.newInstance) {\n\t\t\tcliArguments.push('--new');\n\t\t}\n\n\t\tif (app) {\n\t\t\tcliArguments.push('-a', app);\n\t\t}\n\t} else if (platform === 'win32' || shouldUseWindowsInWsl) {\n\t\tcommand = await powerShellPath();\n\n\t\tcliArguments.push(...executePowerShell.argumentsPrefix);\n\n\t\tif (!isWsl) {\n\t\t\tchildProcessOptions.windowsVerbatimArguments = true;\n\t\t}\n\n\t\t// Convert WSL Linux paths to Windows paths\n\t\tif (isWsl && options.target) {\n\t\t\toptions.target = await convertWslPathToWindows(options.target);\n\t\t}\n\n\t\t// Suppress PowerShell progress messages that are written to stderr\n\t\tconst encodedArguments = ['$ProgressPreference = \\'SilentlyContinue\\';', 'Start'];\n\n\t\tif (options.wait) {\n\t\t\tencodedArguments.push('-Wait');\n\t\t}\n\n\t\tif (app) {\n\t\t\tencodedArguments.push(executePowerShell.escapeArgument(app));\n\t\t\tif (options.target) {\n\t\t\t\tappArguments.push(options.target);\n\t\t\t}\n\t\t} else if (options.target) {\n\t\t\tencodedArguments.push(executePowerShell.escapeArgument(options.target));\n\t\t}\n\n\t\tif (appArguments.length > 0) {\n\t\t\tappArguments = appArguments.map(argument => executePowerShell.escapeArgument(argument));\n\t\t\tencodedArguments.push('-ArgumentList', appArguments.join(','));\n\t\t}\n\n\t\t// Using Base64-encoded command, accepted by PowerShell, to allow special characters.\n\t\toptions.target = executePowerShell.encodeCommand(encodedArguments.join(' '));\n\n\t\tif (!options.wait) {\n\t\t\t// PowerShell will keep the parent process alive unless stdio is ignored.\n\t\t\tchildProcessOptions.stdio = 'ignore';\n\t\t}\n\t} else {\n\t\tif (app) {\n\t\t\tcommand = app;\n\t\t} else {\n\t\t\t// When bundled by Webpack, there's no actual package file path and no local `xdg-open`.\n\t\t\tconst isBundled = !__dirname || __dirname === '/';\n\n\t\t\t// Check if local `xdg-open` exists and is executable.\n\t\t\tlet exeLocalXdgOpen = false;\n\t\t\ttry {\n\t\t\t\tawait fs.access(localXdgOpenPath, fsConstants.X_OK);\n\t\t\t\texeLocalXdgOpen = true;\n\t\t\t} catch {}\n\n\t\t\tconst useSystemXdgOpen = process.versions.electron\n\t\t\t\t?? (platform === 'android' || isBundled || !exeLocalXdgOpen);\n\t\t\tcommand = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath;\n\t\t}\n\n\t\tif (appArguments.length > 0) {\n\t\t\tcliArguments.push(...appArguments);\n\t\t}\n\n\t\tif (!options.wait) {\n\t\t\t// `xdg-open` will block the process unless stdio is ignored\n\t\t\t// and it's detached from the parent even if it's unref'd.\n\t\t\tchildProcessOptions.stdio = 'ignore';\n\t\t\tchildProcessOptions.detached = true;\n\t\t}\n\t}\n\n\tif (platform === 'darwin' && appArguments.length > 0) {\n\t\tcliArguments.push('--args', ...appArguments);\n\t}\n\n\t// IMPORTANT: On macOS, the target MUST come AFTER '--args'.\n\t// When using --args, ALL following arguments are passed to the app.\n\t// Example: open -a \"chrome\" --args --incognito https://site.com\n\t// This passes BOTH --incognito AND https://site.com to Chrome.\n\t// Without this order, Chrome won't open in incognito. See #332.\n\tif (options.target) {\n\t\tcliArguments.push(options.target);\n\t}\n\n\tconst subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);\n\n\tif (options.wait) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tsubprocess.once('error', reject);\n\n\t\t\tsubprocess.once('close', exitCode => {\n\t\t\t\tif (!options.allowNonzeroExitCode && exitCode !== 0) {\n\t\t\t\t\treject(new Error(`Exited with code ${exitCode}`));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresolve(subprocess);\n\t\t\t});\n\t\t});\n\t}\n\n\t// When we're in a fallback attempt, we need to detect launch failures before trying the next app.\n\t// Wait for the close event to check the exit code before unreffing.\n\t// The launcher (open/xdg-open/PowerShell) exits quickly (~10-30ms) even on success.\n\tif (isFallbackAttempt) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tsubprocess.once('error', reject);\n\n\t\t\tsubprocess.once('spawn', () => {\n\t\t\t\t// Keep error handler active for post-spawn errors\n\t\t\t\tsubprocess.once('close', exitCode => {\n\t\t\t\t\tsubprocess.off('error', reject);\n\n\t\t\t\t\tif (exitCode !== 0) {\n\t\t\t\t\t\treject(new Error(`Exited with code ${exitCode}`));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tsubprocess.unref();\n\t\t\t\t\tresolve(subprocess);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\n\tsubprocess.unref();\n\n\t// Handle spawn errors before the caller can attach listeners.\n\t// This prevents unhandled error events from crashing the process.\n\treturn new Promise((resolve, reject) => {\n\t\tsubprocess.once('error', reject);\n\n\t\t// Wait for the subprocess to spawn before resolving.\n\t\t// This ensures the process is established before the caller continues,\n\t\t// preventing issues when process.exit() is called immediately after.\n\t\tsubprocess.once('spawn', () => {\n\t\t\tsubprocess.off('error', reject);\n\t\t\tresolve(subprocess);\n\t\t});\n\t});\n};\n\nconst open = (target, options) => {\n\tif (typeof target !== 'string') {\n\t\tthrow new TypeError('Expected a `target`');\n\t}\n\n\treturn baseOpen({\n\t\t...options,\n\t\ttarget,\n\t});\n};\n\nexport const openApp = (name, options) => {\n\tif (typeof name !== 'string' && !Array.isArray(name)) {\n\t\tthrow new TypeError('Expected a valid `name`');\n\t}\n\n\tconst {arguments: appArguments = []} = options ?? {};\n\tif (appArguments !== undefined && appArguments !== null && !Array.isArray(appArguments)) {\n\t\tthrow new TypeError('Expected `appArguments` as Array type');\n\t}\n\n\treturn baseOpen({\n\t\t...options,\n\t\tapp: {\n\t\t\tname,\n\t\t\targuments: appArguments,\n\t\t},\n\t});\n};\n\nfunction detectArchBinary(binary) {\n\tif (typeof binary === 'string' || Array.isArray(binary)) {\n\t\treturn binary;\n\t}\n\n\tconst {[arch]: archBinary} = binary;\n\n\tif (!archBinary) {\n\t\tthrow new Error(`${arch} is not supported`);\n\t}\n\n\treturn archBinary;\n}\n\nfunction detectPlatformBinary({[platform]: platformBinary}, {wsl} = {}) {\n\tif (wsl && isWsl) {\n\t\treturn detectArchBinary(wsl);\n\t}\n\n\tif (!platformBinary) {\n\t\tthrow new Error(`${platform} is not supported`);\n\t}\n\n\treturn detectArchBinary(platformBinary);\n}\n\nexport const apps = {\n\tbrowser: 'browser',\n\tbrowserPrivate: 'browserPrivate',\n};\n\ndefineLazyProperty(apps, 'chrome', () => detectPlatformBinary({\n\tdarwin: 'google chrome',\n\twin32: 'chrome',\n\t// `chromium-browser` is the older deb package name used by Ubuntu/Debian before snap.\n\tlinux: ['google-chrome', 'google-chrome-stable', 'chromium', 'chromium-browser'],\n}, {\n\twsl: {\n\t\tia32: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe',\n\t\tx64: ['/mnt/c/Program Files/Google/Chrome/Application/chrome.exe', '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'],\n\t},\n}));\n\ndefineLazyProperty(apps, 'brave', () => detectPlatformBinary({\n\tdarwin: 'brave browser',\n\twin32: 'brave',\n\tlinux: ['brave-browser', 'brave'],\n}, {\n\twsl: {\n\t\tia32: '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe',\n\t\tx64: ['/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe', '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe'],\n\t},\n}));\n\ndefineLazyProperty(apps, 'firefox', () => detectPlatformBinary({\n\tdarwin: 'firefox',\n\twin32: String.raw`C:\\Program Files\\Mozilla Firefox\\firefox.exe`,\n\tlinux: 'firefox',\n}, {\n\twsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe',\n}));\n\ndefineLazyProperty(apps, 'edge', () => detectPlatformBinary({\n\tdarwin: 'microsoft edge',\n\twin32: 'msedge',\n\tlinux: ['microsoft-edge', 'microsoft-edge-dev'],\n}, {\n\twsl: '/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',\n}));\n\ndefineLazyProperty(apps, 'safari', () => detectPlatformBinary({\n\tdarwin: 'Safari',\n}));\n\nexport default open;\n","import {promisify} from 'node:util';\nimport childProcess from 'node:child_process';\nimport fs, {constants as fsConstants} from 'node:fs/promises';\nimport isWsl from 'is-wsl';\nimport {powerShellPath as windowsPowerShellPath, executePowerShell} from 'powershell-utils';\nimport {parseMountPointFromConfig} from './utilities.js';\n\nconst execFile = promisify(childProcess.execFile);\n\nexport const wslDrivesMountPoint = (() => {\n\t// Default value for \"root\" param\n\t// according to https://docs.microsoft.com/en-us/windows/wsl/wsl-config\n\tconst defaultMountPoint = '/mnt/';\n\n\tlet mountPoint;\n\n\treturn async function () {\n\t\tif (mountPoint) {\n\t\t\t// Return memoized mount point value\n\t\t\treturn mountPoint;\n\t\t}\n\n\t\tconst configFilePath = '/etc/wsl.conf';\n\n\t\tlet isConfigFileExists = false;\n\t\ttry {\n\t\t\tawait fs.access(configFilePath, fsConstants.F_OK);\n\t\t\tisConfigFileExists = true;\n\t\t} catch {}\n\n\t\tif (!isConfigFileExists) {\n\t\t\treturn defaultMountPoint;\n\t\t}\n\n\t\tconst configContent = await fs.readFile(configFilePath, {encoding: 'utf8'});\n\t\tconst parsedMountPoint = parseMountPointFromConfig(configContent);\n\n\t\tif (parsedMountPoint === undefined) {\n\t\t\treturn defaultMountPoint;\n\t\t}\n\n\t\tmountPoint = parsedMountPoint;\n\t\tmountPoint = mountPoint.endsWith('/') ? mountPoint : `${mountPoint}/`;\n\n\t\treturn mountPoint;\n\t};\n})();\n\nexport const powerShellPathFromWsl = async () => {\n\tconst mountPoint = await wslDrivesMountPoint();\n\treturn `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;\n};\n\nexport const powerShellPath = isWsl ? powerShellPathFromWsl : windowsPowerShellPath;\n\n// Cache for PowerShell accessibility check\nlet canAccessPowerShellPromise;\n\nexport const canAccessPowerShell = async () => {\n\tcanAccessPowerShellPromise ??= (async () => {\n\t\ttry {\n\t\t\tconst psPath = await powerShellPath();\n\t\t\tawait fs.access(psPath, fsConstants.X_OK);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\t// PowerShell is not accessible (either doesn't exist, no execute permission, or other error)\n\t\t\treturn false;\n\t\t}\n\t})();\n\n\treturn canAccessPowerShellPromise;\n};\n\nexport const wslDefaultBrowser = async () => {\n\tconst psPath = await powerShellPath();\n\tconst command = String.raw`(Get-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice\").ProgId`;\n\n\tconst {stdout} = await executePowerShell(command, {powerShellPath: psPath});\n\n\treturn stdout.trim();\n};\n\nexport const convertWslPathToWindows = async path => {\n\t// Don't convert URLs\n\tif (/^[a-z]+:\\/\\//i.test(path)) {\n\t\treturn path;\n\t}\n\n\ttry {\n\t\tconst {stdout} = await execFile('wslpath', ['-aw', path], {encoding: 'utf8'});\n\t\treturn stdout.trim();\n\t} catch {\n\t\t// If wslpath fails, return the original path\n\t\treturn path;\n\t}\n};\n\nexport {default as isWsl} from 'is-wsl';\n","import process from 'node:process';\nimport os from 'node:os';\nimport fs from 'node:fs';\nimport isInsideContainer from 'is-inside-container';\n\nconst isWsl = () => {\n\tif (process.platform !== 'linux') {\n\t\treturn false;\n\t}\n\n\tif (os.release().toLowerCase().includes('microsoft')) {\n\t\tif (isInsideContainer()) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\ttry {\n\t\tif (fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft')) {\n\t\t\treturn !isInsideContainer();\n\t\t}\n\t} catch {}\n\n\t// Fallback for custom kernels: check WSL-specific paths.\n\tif (\n\t\tfs.existsSync('/proc/sys/fs/binfmt_misc/WSLInterop')\n\t\t|| fs.existsSync('/run/WSL')\n\t) {\n\t\treturn !isInsideContainer();\n\t}\n\n\treturn false;\n};\n\nexport default process.env.__IS_WSL_TEST__ ? isWsl : isWsl();\n","import fs from 'node:fs';\nimport isDocker from 'is-docker';\n\nlet cachedResult;\n\n// Podman detection\nconst hasContainerEnv = () => {\n\ttry {\n\t\tfs.statSync('/run/.containerenv');\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\nexport default function isInsideContainer() {\n\t// TODO: Use `??=` when targeting Node.js 16.\n\tif (cachedResult === undefined) {\n\t\tcachedResult = hasContainerEnv() || isDocker();\n\t}\n\n\treturn cachedResult;\n}\n","import fs from 'node:fs';\n\nlet isDockerCached;\n\nfunction hasDockerEnv() {\n\ttry {\n\t\tfs.statSync('/.dockerenv');\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction hasDockerCGroup() {\n\ttry {\n\t\treturn fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport default function isDocker() {\n\t// TODO: Use `??=` when targeting Node.js 16.\n\tif (isDockerCached === undefined) {\n\t\tisDockerCached = hasDockerEnv() || hasDockerCGroup();\n\t}\n\n\treturn isDockerCached;\n}\n","import process from 'node:process';\nimport {Buffer} from 'node:buffer';\nimport {promisify} from 'node:util';\nimport childProcess from 'node:child_process';\nimport fs, {constants as fsConstants} from 'node:fs/promises';\n\nconst execFile = promisify(childProcess.execFile);\n\nexport const powerShellPath = () => `${process.env.SYSTEMROOT || process.env.windir || String.raw`C:\\Windows`}\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe`;\n\n// Cache for PowerShell accessibility check\nlet canAccessCache;\n\nexport const canAccessPowerShell = async () => {\n\tcanAccessCache ??= (async () => {\n\t\ttry {\n\t\t\tawait fs.access(powerShellPath(), fsConstants.X_OK);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t})();\n\n\treturn canAccessCache;\n};\n\nexport const executePowerShell = async (command, options = {}) => {\n\tconst {\n\t\tpowerShellPath: psPath,\n\t\t...execFileOptions\n\t} = options;\n\n\tconst encodedCommand = executePowerShell.encodeCommand(command);\n\n\treturn execFile(\n\t\tpsPath ?? powerShellPath(),\n\t\t[\n\t\t\t...executePowerShell.argumentsPrefix,\n\t\t\tencodedCommand,\n\t\t],\n\t\t{\n\t\t\tencoding: 'utf8',\n\t\t\t...execFileOptions,\n\t\t},\n\t);\n};\n\nexecutePowerShell.argumentsPrefix = [\n\t'-NoProfile',\n\t'-NonInteractive',\n\t'-ExecutionPolicy',\n\t'Bypass',\n\t'-EncodedCommand',\n];\n\nexecutePowerShell.encodeCommand = command => Buffer.from(command, 'utf16le').toString('base64');\n\nexecutePowerShell.escapeArgument = value => `'${String(value).replaceAll('\\'', '\\'\\'')}'`;\n","export function parseMountPointFromConfig(content) {\n\tfor (const line of content.split('\\n')) {\n\t\t// Skip comment lines\n\t\tif (/^\\s*#/.test(line)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Match root at start of line (after optional whitespace)\n\t\tconst match = /^\\s*root\\s*=\\s*(?<mountPoint>\"[^\"]*\"|'[^']*'|[^#]*)/.exec(line);\n\t\tif (!match) {\n\t\t\tcontinue;\n\t\t}\n\n\t\treturn match.groups.mountPoint\n\t\t\t.trim()\n\t\t\t// Strip surrounding quotes\n\t\t\t.replaceAll(/^[\"']|[\"']$/g, '');\n\t}\n}\n","export default function defineLazyProperty(object, propertyName, valueGetter) {\n\tconst define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});\n\n\tObject.defineProperty(object, propertyName, {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget() {\n\t\t\tconst result = valueGetter();\n\t\t\tdefine(result);\n\t\t\treturn result;\n\t\t},\n\t\tset(value) {\n\t\t\tdefine(value);\n\t\t}\n\t});\n\n\treturn object;\n}\n","import {promisify} from 'node:util';\nimport process from 'node:process';\nimport {execFile} from 'node:child_process';\nimport defaultBrowserId from 'default-browser-id';\nimport bundleName from 'bundle-name';\nimport windows from './windows.js';\n\nexport {_windowsBrowserProgIdMap} from './windows.js';\n\nconst execFileAsync = promisify(execFile);\n\n// Inlined: https://github.com/sindresorhus/titleize/blob/main/index.js\nconst titleize = string => string.toLowerCase().replaceAll(/(?:^|\\s|-)\\S/g, x => x.toUpperCase());\n\nexport default async function defaultBrowser() {\n\tif (process.platform === 'darwin') {\n\t\tconst id = await defaultBrowserId();\n\t\tconst name = await bundleName(id);\n\t\treturn {name, id};\n\t}\n\n\tif (process.platform === 'linux') {\n\t\tconst {stdout} = await execFileAsync('xdg-mime', ['query', 'default', 'x-scheme-handler/http']);\n\t\tconst id = stdout.trim();\n\t\tconst name = titleize(id.replace(/.desktop$/, '').replace('-', ' '));\n\t\treturn {name, id};\n\t}\n\n\tif (process.platform === 'win32') {\n\t\treturn windows();\n\t}\n\n\tthrow new Error('Only macOS, Linux, and Windows are supported');\n}\n","import {promisify} from 'node:util';\nimport process from 'node:process';\nimport {execFile} from 'node:child_process';\n\nconst execFileAsync = promisify(execFile);\n\nexport default async function defaultBrowserId() {\n\tif (process.platform !== 'darwin') {\n\t\tthrow new Error('macOS only');\n\t}\n\n\tconst {stdout} = await execFileAsync('defaults', ['read', 'com.apple.LaunchServices/com.apple.launchservices.secure', 'LSHandlers']);\n\n\t// `(?!-)` is to prevent matching `LSHandlerRoleAll = \"-\";`.\n\tconst match = /LSHandlerRoleAll = \"(?!-)(?<id>[^\"]+?)\";\\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);\n\n\tconst browserId = match?.groups.id ?? 'com.apple.Safari';\n\n\t// Correct the case for Safari's bundle identifier\n\tif (browserId === 'com.apple.safari') {\n\t\treturn 'com.apple.Safari';\n\t}\n\n\treturn browserId;\n}\n","import process from 'node:process';\nimport {promisify} from 'node:util';\nimport {execFile, execFileSync} from 'node:child_process';\n\nconst execFileAsync = promisify(execFile);\n\nexport async function runAppleScript(script, {humanReadableOutput = true, signal} = {}) {\n\tif (process.platform !== 'darwin') {\n\t\tthrow new Error('macOS only');\n\t}\n\n\tconst outputArguments = humanReadableOutput ? [] : ['-ss'];\n\n\tconst execOptions = {};\n\tif (signal) {\n\t\texecOptions.signal = signal;\n\t}\n\n\tconst {stdout} = await execFileAsync('osascript', ['-e', script, outputArguments], execOptions);\n\treturn stdout.trim();\n}\n\nexport function runAppleScriptSync(script, {humanReadableOutput = true} = {}) {\n\tif (process.platform !== 'darwin') {\n\t\tthrow new Error('macOS only');\n\t}\n\n\tconst outputArguments = humanReadableOutput ? [] : ['-ss'];\n\n\tconst stdout = execFileSync('osascript', ['-e', script, ...outputArguments], {\n\t\tencoding: 'utf8',\n\t\tstdio: ['ignore', 'pipe', 'ignore'],\n\t\ttimeout: 500,\n\t});\n\n\treturn stdout.trim();\n}\n","import {runAppleScript} from 'run-applescript';\n\nexport default async function bundleName(bundleId) {\n\treturn runAppleScript(`tell application \"Finder\" to set app_path to application file id \"${bundleId}\" as string\\ntell application \"System Events\" to get value of property list item \"CFBundleName\" of property list file (app_path & \":Contents:Info.plist\")`);\n}\n","import {promisify} from 'node:util';\nimport {execFile} from 'node:child_process';\n\nconst execFileAsync = promisify(execFile);\n\n// TODO: Fix the casing of bundle identifiers in the next major version.\n\n// Windows doesn't have browser IDs in the same way macOS/Linux does so we give fake\n// ones that look real and match the macOS/Linux versions for cross-platform apps.\nconst windowsBrowserProgIds = {\n\tMSEdgeHTM: {name: 'Edge', id: 'com.microsoft.edge'}, // The missing `L` is correct.\n\tMSEdgeBHTML: {name: 'Edge Beta', id: 'com.microsoft.edge.beta'},\n\tMSEdgeDHTML: {name: 'Edge Dev', id: 'com.microsoft.edge.dev'},\n\tAppXq0fevzme2pys62n3e0fbqa7peapykr8v: {name: 'Edge', id: 'com.microsoft.edge.old'},\n\tChromeHTML: {name: 'Chrome', id: 'com.google.chrome'},\n\tChromeBHTML: {name: 'Chrome Beta', id: 'com.google.chrome.beta'},\n\tChromeDHTML: {name: 'Chrome Dev', id: 'com.google.chrome.dev'},\n\tChromiumHTM: {name: 'Chromium', id: 'org.chromium.Chromium'},\n\tBraveHTML: {name: 'Brave', id: 'com.brave.Browser'},\n\tBraveBHTML: {name: 'Brave Beta', id: 'com.brave.Browser.beta'},\n\tBraveDHTML: {name: 'Brave Dev', id: 'com.brave.Browser.dev'},\n\tBraveSSHTM: {name: 'Brave Nightly', id: 'com.brave.Browser.nightly'},\n\tFirefoxURL: {name: 'Firefox', id: 'org.mozilla.firefox'},\n\tOperaStable: {name: 'Opera', id: 'com.operasoftware.Opera'},\n\tVivaldiHTM: {name: 'Vivaldi', id: 'com.vivaldi.Vivaldi'},\n\t'IE.HTTP': {name: 'Internet Explorer', id: 'com.microsoft.ie'},\n};\n\nexport const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));\n\nexport class UnknownBrowserError extends Error {}\n\nexport default async function defaultBrowser(_execFileAsync = execFileAsync) {\n\tconst {stdout} = await _execFileAsync('reg', [\n\t\t'QUERY',\n\t\t' HKEY_CURRENT_USER\\\\Software\\\\Microsoft\\\\Windows\\\\Shell\\\\Associations\\\\UrlAssociations\\\\http\\\\UserChoice',\n\t\t'/v',\n\t\t'ProgId',\n\t]);\n\n\tconst match = /ProgId\\s*REG_SZ\\s*(?<id>\\S+)/.exec(stdout);\n\tif (!match) {\n\t\tthrow new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);\n\t}\n\n\tconst {id} = match.groups;\n\n\t// Windows can append a hash suffix to ProgIds using a dot or hyphen\n\t// (e.g., `ChromeHTML.ABC123`, `FirefoxURL-6F193CCC56814779`).\n\t// Try exact match first, then try without the suffix.\n\tconst dotIndex = id.lastIndexOf('.');\n\tconst hyphenIndex = id.lastIndexOf('-');\n\tconst baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);\n\tconst baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);\n\n\treturn windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? {name: id, id};\n}\n","import process from 'node:process';\n\nconst isInSsh = Boolean(process.env.SSH_CONNECTION\n\t|| process.env.SSH_CLIENT\n\t|| process.env.SSH_TTY);\n\nexport default isInSsh;\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { FileTokenStore } from '../../auth/token-store.js';\n\nexport const logoutCommand = new Command('logout')\n .description('Clear local credentials')\n .action(async () => {\n const store = new FileTokenStore();\n await store.clear();\n console.log(chalk.green('Logged out. Credentials removed.'));\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\n\nexport const whoamiCommand = new Command('whoami')\n .description('Print authenticated developer profile')\n .action(async () => {\n try {\n const lane = await Lane.create();\n const profile = await lane.auth.whoami();\n console.log(` Email: ${profile.email}`);\n console.log(` Plan: ${profile.plan}`);\n console.log(` Member since: ${profile.memberSince}`);\n console.log(` ID: ${profile.id}`);\n if (lane.testMode) {\n console.log(chalk.yellow(' Mode: TEST'));\n }\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\nimport { openCardEntry } from '../../auth/browser-flow.js';\n\nexport const addCardCommand = new Command('add-card')\n .description('Add a payment card via secure browser form (VGS Collect)')\n .option('--wallet <id>', 'Wallet ID (uses default if not specified)')\n .action(async (options) => {\n try {\n const lane = await Lane.create();\n\n // Get or create wallet\n let walletId = options.wallet;\n if (!walletId) {\n // Use the developer's default wallet\n const wallets = await lane.wallets.list({ limit: 1 });\n if (wallets.data.length === 0) {\n // Create default wallet\n const wallet = await lane.wallets.create();\n walletId = wallet.id;\n } else {\n walletId = wallets.data[0]!.id;\n }\n }\n\n console.log(chalk.blue('Opening secure card entry in your browser...'));\n console.log(chalk.dim('Your card number goes directly to VGS vault. Lane never sees it.'));\n\n const { url } = await lane.wallets.getAddCardLink(walletId);\n await openCardEntry(url);\n\n console.log(chalk.dim('\\nWaiting for card entry to complete...'));\n console.log(chalk.dim('(Press Ctrl+C to cancel)'));\n\n // Poll for the card to appear\n const maxWait = 300_000; // 5 minutes\n const pollInterval = 3_000;\n const startTime = Date.now();\n\n while (Date.now() - startTime < maxWait) {\n await new Promise((resolve) => setTimeout(resolve, pollInterval));\n const cards = await lane.wallets.listCards(walletId);\n if (cards.length > 0) {\n const latest = cards[cards.length - 1]!;\n console.log(chalk.green(`\\nCard ending in ${latest.last4} (${latest.brand}) saved.`));\n console.log(` Manage cards: ${chalk.underline('app.getonlane.com/agent/dashboard/cards')}`);\n return;\n }\n }\n\n console.log(chalk.yellow('\\nTimed out waiting for card entry. Check your browser.'));\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\n\nexport const cardsCommand = new Command('cards')\n .description('List all payment cards (last4 and brand only)')\n .option('--wallet <id>', 'Wallet ID (uses default if not specified)')\n .option('--format <format>', 'Output format (json or table)', 'table')\n .action(async (options) => {\n try {\n const lane = await Lane.create();\n\n let walletId = options.wallet;\n if (!walletId) {\n const wallets = await lane.wallets.list({ limit: 1 });\n if (wallets.data.length === 0) {\n console.log(chalk.yellow('No wallets found. Run `lane add-card` to get started.'));\n return;\n }\n walletId = wallets.data[0]!.id;\n }\n\n const cards = await lane.wallets.listCards(walletId);\n\n if (cards.length === 0) {\n console.log(chalk.yellow('No cards found. Run `lane add-card` to add one.'));\n return;\n }\n\n if (options.format === 'json') {\n console.log(JSON.stringify(cards, null, 2));\n return;\n }\n\n console.log(chalk.bold('Your cards:\\n'));\n for (const card of cards) {\n const defaultBadge = card.isDefault ? chalk.green(' (default)') : '';\n const statusBadge = card.status === 'inactive' ? chalk.red(' [inactive]') : '';\n console.log(` ${card.brand.padEnd(12)} **** ${card.last4}${defaultBadge}${statusBadge}`);\n }\n console.log(`\\n Manage: ${chalk.underline('app.getonlane.com/agent/dashboard/cards')}`);\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\n\nexport const balanceCommand = new Command('balance')\n .description('Show spending limits and remaining budget')\n .option('--format <format>', 'Output format (json or table)', 'table')\n .action(async (options) => {\n try {\n const lane = await Lane.create();\n const budget = await lane.admin.getBudget();\n const spending = await lane.admin.spending({ period: '1d' });\n\n if (options.format === 'json') {\n console.log(JSON.stringify({ budget, spending }, null, 2));\n return;\n }\n\n console.log(chalk.bold('Budget status:\\n'));\n\n if (budget.dailyLimit) {\n const remaining = budget.dailyLimit - spending.total;\n const pct = Math.round((spending.total / budget.dailyLimit) * 100);\n const color = pct > 80 ? chalk.red : pct > 50 ? chalk.yellow : chalk.green;\n console.log(` Daily: ${color(`$${(spending.total / 100).toFixed(2)}`)} / $${(budget.dailyLimit / 100).toFixed(2)} (${color(`${pct}%`)})`);\n console.log(` Remaining: $${(remaining / 100).toFixed(2)}`);\n } else {\n console.log(` Daily: ${chalk.dim('no limit set')}`);\n }\n\n if (budget.perTaskLimit) {\n console.log(` Per-task: $${(budget.perTaskLimit / 100).toFixed(2)}`);\n }\n if (budget.weeklyLimit) {\n console.log(` Weekly: $${(budget.weeklyLimit / 100).toFixed(2)}`);\n }\n if (budget.monthlyLimit) {\n console.log(` Monthly: $${(budget.monthlyLimit / 100).toFixed(2)}`);\n }\n\n console.log(`\\n Adjust: ${chalk.underline('app.getonlane.com/agent/dashboard/budgets')}`);\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\n\nexport const setBudgetCommand = new Command('set-budget')\n .description('Set spending limits for your agents')\n .option('--daily <amount>', 'Daily spending limit in dollars')\n .option('--weekly <amount>', 'Weekly spending limit in dollars')\n .option('--monthly <amount>', 'Monthly spending limit in dollars')\n .option('--per-task <amount>', 'Per-task spending limit in dollars')\n .action(async (options) => {\n try {\n const lane = await Lane.create();\n\n const config: Record<string, number | undefined> = {};\n if (options.daily) config['dailyLimit'] = Math.round(parseFloat(options.daily) * 100);\n if (options.weekly) config['weeklyLimit'] = Math.round(parseFloat(options.weekly) * 100);\n if (options.monthly) config['monthlyLimit'] = Math.round(parseFloat(options.monthly) * 100);\n if (options.perTask) config['perTaskLimit'] = Math.round(parseFloat(options.perTask) * 100);\n\n if (Object.keys(config).length === 0) {\n console.log(chalk.yellow('No limits specified. Use --daily, --weekly, --monthly, or --per-task.'));\n console.log(chalk.dim('Example: lane set-budget --daily 50 --per-task 20'));\n return;\n }\n\n const updated = await lane.admin.setBudget(config as Parameters<typeof lane.admin.setBudget>[0]);\n\n console.log(chalk.green('Budget updated:\\n'));\n if (updated.dailyLimit) console.log(` Daily limit: $${(updated.dailyLimit / 100).toFixed(2)}`);\n if (updated.weeklyLimit) console.log(` Weekly limit: $${(updated.weeklyLimit / 100).toFixed(2)}`);\n if (updated.monthlyLimit) console.log(` Monthly limit: $${(updated.monthlyLimit / 100).toFixed(2)}`);\n if (updated.perTaskLimit) console.log(` Per-task limit: $${(updated.perTaskLimit / 100).toFixed(2)}`);\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\n\nexport const transactionsCommand = new Command('transactions')\n .description('View spending history')\n .option('--limit <n>', 'Number of transactions to show', '10')\n .option('--format <format>', 'Output format (json or table)', 'table')\n .action(async (options) => {\n try {\n const lane = await Lane.create();\n const result = await lane.pay.listTransactions({\n limit: parseInt(options.limit, 10),\n });\n\n if (result.data.length === 0) {\n console.log(chalk.yellow('No transactions yet.'));\n return;\n }\n\n if (options.format === 'json') {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n\n console.log(chalk.bold('Recent transactions:\\n'));\n console.log(\n ` ${'DATE'.padEnd(12)}${'AMOUNT'.padEnd(12)}${'RECIPIENT'.padEnd(20)}${'STATUS'.padEnd(10)}DESCRIPTION`,\n );\n console.log(chalk.dim(' ' + '-'.repeat(70)));\n\n for (const txn of result.data) {\n const date = new Date(txn.createdAt).toLocaleDateString('en-US', {\n month: 'short',\n day: '2-digit',\n });\n const amount = `$${(txn.amount / 100).toFixed(2)}`;\n const statusColor =\n txn.status === 'success' ? chalk.green :\n txn.status === 'denied' ? chalk.red :\n txn.status === 'refunded' ? chalk.yellow :\n chalk.dim;\n const testBadge = txn.testMode ? chalk.dim(' [TEST]') : '';\n\n console.log(\n ` ${date.padEnd(12)}${amount.padEnd(12)}${txn.recipient.padEnd(20)}${statusColor(txn.status.padEnd(10))}${txn.description ?? ''}${testBadge}`,\n );\n }\n\n console.log(`\\n Total: ${result.total} transactions`);\n console.log(` Full history: ${chalk.underline('app.getonlane.com/agent/dashboard/transactions')}`);\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\n\nexport const payCommand = new Command('pay')\n .description('Execute a payment to a merchant or service')\n .requiredOption('--amount <dollars>', 'Payment amount in dollars')\n .requiredOption('--recipient <merchant>', 'Merchant or service to pay')\n .option('--description <text>', 'What this payment is for')\n .option('--currency <code>', 'Currency code (default: USD)', 'USD')\n .option('--idempotency-key <key>', 'Unique key to prevent duplicate charges')\n .option('--test', 'Force test mode')\n .option('--dry-run', 'Validate payment without executing')\n .option('--format <format>', 'Output format (json or table)', 'table')\n .action(async (options) => {\n try {\n const lane = await Lane.create();\n const amount = parseFloat(options.amount);\n\n if (isNaN(amount) || amount <= 0) {\n console.error(chalk.red('Error: --amount must be a positive number'));\n process.exit(1);\n }\n\n const testMode = lane.testMode || options.test;\n if (testMode) {\n console.log(chalk.dim('[TEST MODE]'));\n }\n\n if (options.dryRun) {\n console.log(chalk.green('✓ Payment validation passed'));\n console.log(JSON.stringify({\n recipient: options.recipient,\n amount,\n currency: options.currency,\n description: options.description ?? null,\n dryRun: true,\n }, null, 2));\n return;\n }\n\n console.log(chalk.dim(`Paying $${amount.toFixed(2)} to ${options.recipient}...`));\n\n const txn = await lane.pay.execute({\n recipient: options.recipient,\n amount: Math.round(amount * 100), // convert to cents\n currency: options.currency,\n description: options.description,\n idempotencyKey: options.idempotencyKey,\n });\n\n if (options.format === 'json') {\n console.log(JSON.stringify(txn, null, 2));\n } else {\n const statusColor = txn.status === 'success' ? chalk.green : txn.status === 'pending' ? chalk.yellow : chalk.red;\n\n console.log('');\n console.log(statusColor(` ${testMode ? '[TEST] ' : ''}Transaction ${txn.id}: $${(txn.amount / 100).toFixed(2)} to ${txn.recipient} — ${txn.status}`));\n if (txn.receiptUrl) {\n console.log(chalk.dim(` Receipt: ${txn.receiptUrl}`));\n }\n }\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\nimport { FileTokenStore } from '../../auth/token-store.js';\n\nexport const rotateKeyCommand = new Command('rotate-key')\n .description('Rotate your API key (old key remains valid for 15 minutes)')\n .action(async () => {\n try {\n const lane = await Lane.create();\n const result = await lane.auth.rotateKey();\n\n // Update local credentials with new key\n const store = new FileTokenStore();\n const existing = await store.read();\n if (existing) {\n await store.write({ ...existing, apiKey: result.apiKey });\n }\n\n console.log(chalk.green('API key rotated successfully.\\n'));\n console.log(` New key prefix: ${chalk.bold(result.apiKey.slice(0, 16))}...`);\n console.log(` Old key valid until: ${chalk.yellow(result.expiresOldKeyAt)}`);\n console.log(chalk.dim('\\n Credentials updated at ~/.lane/credentials.json'));\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { readFile, writeFile, mkdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { homedir } from 'node:os';\n\nconst MCP_CONFIG_PATHS: Record<string, string> = {\n 'claude-code': join(homedir(), '.claude', 'mcp_servers.json'),\n 'cursor': join(homedir(), '.cursor', 'mcp_servers.json'),\n};\n\nexport const setupMcpCommand = new Command('setup-mcp')\n .description('Auto-configure Lane MCP server for Claude Code / Cursor')\n .option('--target <editor>', 'Target editor (claude-code, cursor)', 'claude-code')\n .action(async (options) => {\n try {\n const target = options.target as string;\n const configPath = MCP_CONFIG_PATHS[target];\n\n if (!configPath) {\n console.error(chalk.red(`Unknown target: ${target}. Supported: ${Object.keys(MCP_CONFIG_PATHS).join(', ')}`));\n process.exit(1);\n }\n\n // Read existing config or create new\n let config: Record<string, unknown> = {};\n try {\n const existing = await readFile(configPath, 'utf-8');\n config = JSON.parse(existing) as Record<string, unknown>;\n } catch {\n // File doesn't exist — create it\n }\n\n // Add Lane MCP server\n const mcpServers = (config['mcpServers'] ?? {}) as Record<string, unknown>;\n mcpServers['lane'] = {\n command: 'npx',\n args: ['lane-mcp-server'],\n env: {},\n };\n config['mcpServers'] = mcpServers;\n\n // Write config\n const dir = join(configPath, '..');\n await mkdir(dir, { recursive: true });\n await writeFile(configPath, JSON.stringify(config, null, 2) + '\\n');\n\n console.log(chalk.green(`Lane MCP server added to ${target}.`));\n console.log(chalk.dim('\\nYour agent now has access to:'));\n console.log(' whoami - Check who\\'s authenticated');\n console.log(' list_cards - See available payment methods (last4 only)');\n console.log(' check_balance - See remaining budget');\n console.log(' pay - Make a payment (within your limits)');\n console.log(' list_transactions - View spending history');\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport open from 'open';\n\nconst DASHBOARD_URL = 'https://app.getonlane.com/agent/dashboard';\n\nexport const dashboardCommand = new Command('dashboard')\n .description('Open the Lane dashboard in your browser')\n .option('--page <page>', 'Dashboard page (cards, budgets, transactions, agents, sell, team, settings)')\n .action(async (options) => {\n const page = options.page as string | undefined;\n const url = page ? `${DASHBOARD_URL}/${page}` : DASHBOARD_URL;\n\n console.log(chalk.blue(`Opening ${url}...`));\n await open(url).catch(() => {\n console.log(`Open this URL in your browser: ${chalk.underline(url)}`);\n });\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { readFileSync, existsSync } from 'fs';\nimport { resolve } from 'path';\n\nconst vendorCommand = new Command('vendor')\n .description('Manage software vendor product listings');\n\nvendorCommand\n .command('register')\n .description('Register a product from lane.json in current directory')\n .option('--file <path>', 'Path to lane.json', 'lane.json')\n .option('--dry-run', 'Validate without registering')\n .action(async (options) => {\n try {\n const filePath = resolve(process.cwd(), options.file);\n if (!existsSync(filePath)) {\n console.error(chalk.red(`No lane.json found at ${filePath}`));\n console.error(chalk.yellow('Create a lane.json file with your SCP manifest. See: https://docs.getonlane.com/scp'));\n process.exit(1);\n }\n\n const manifest = JSON.parse(readFileSync(filePath, 'utf-8'));\n\n if (options.dryRun) {\n console.log(chalk.green('✓ Manifest valid'));\n console.log(JSON.stringify(manifest, null, 2));\n return;\n }\n\n const { Lane } = await import('../../lane.js');\n const lane = await Lane.create();\n const product = await lane.sell.createSoftwareProduct(manifest);\n console.log(chalk.green(`✓ Product registered: ${product.id}`));\n console.log(JSON.stringify(product, null, 2));\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\nvendorCommand\n .command('status')\n .description('Check listing status, revenue, and usage')\n .option('--format <format>', 'Output format (json or table)', 'json')\n .action(async (options) => {\n try {\n const { Lane } = await import('../../lane.js');\n const lane = await Lane.create();\n const products = await lane.sell.list();\n\n if (options.format === 'table') {\n console.table(products.data.map(p => ({\n id: p.id,\n name: p.name,\n type: p.type,\n pricing: p.pricing.model,\n })));\n } else {\n console.log(JSON.stringify(products, null, 2));\n }\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\nexport { vendorCommand };\n","import { Command } from 'commander';\n\nconst SCHEMAS: Record<string, object> = {\n 'checkout.create': {\n method: 'checkout.create',\n description: 'Create a checkout session to purchase a product',\n parameters: {\n required: {\n productId: { type: 'string', description: 'Product ID to purchase' },\n paymentSource: { type: 'string', enum: ['wallet'], description: 'Payment source' },\n },\n optional: {\n plan: { type: 'string', description: 'Plan ID for software products' },\n parameters: { type: 'object', description: 'SCP selection parameters (e.g., custom_domain, webhook_url)' },\n merchantId: { type: 'string', description: 'Merchant ID for e-commerce purchases' },\n items: { type: 'array', description: 'Array of { productId, quantity } for e-commerce' },\n shippingAddress: { type: 'object', description: 'Shipping address for physical goods' },\n },\n },\n returns: {\n orderId: 'string',\n status: 'string',\n credentials: '{ type, value, envVar, expiresAt } (for software)',\n sdk: '{ package, install, quickstart } (for software)',\n subscription: '{ plan, billingPeriod, nextCharge, amount } (for subscriptions)',\n },\n },\n 'products.search': {\n method: 'products.search',\n description: 'Search for products across all categories',\n parameters: {\n optional: {\n query: { type: 'string', description: 'Search query' },\n type: { type: 'string', enum: ['ecommerce', 'software', 'skill', 'oss'], description: 'Product type filter' },\n pricingModel: { type: 'string', enum: ['fixed', 'subscription', 'consumption'], description: 'Pricing model filter' },\n category: { type: 'string', description: 'Product category' },\n limit: { type: 'number', description: 'Max results (default 20)' },\n cursor: { type: 'string', description: 'Pagination cursor' },\n },\n },\n },\n 'subscriptions.list': {\n method: 'subscriptions.list',\n description: 'List active subscriptions',\n parameters: {\n optional: {\n status: { type: 'string', enum: ['active', 'paused', 'canceled', 'past_due'], description: 'Filter by status' },\n limit: { type: 'number', description: 'Max results' },\n cursor: { type: 'string', description: 'Pagination cursor' },\n },\n },\n },\n 'subscriptions.create': {\n method: 'subscriptions.create',\n description: 'Subscribe to a software product',\n parameters: {\n required: {\n productId: { type: 'string', description: 'Product ID to subscribe to' },\n plan: { type: 'string', description: 'Plan ID' },\n paymentSource: { type: 'string', enum: ['wallet'], description: 'Payment source' },\n },\n optional: {\n parameters: { type: 'object', description: 'SCP selection parameters' },\n },\n },\n },\n 'subscriptions.cancel': {\n method: 'subscriptions.cancel',\n description: 'Cancel an active subscription',\n parameters: {\n required: {\n subscriptionId: { type: 'string', description: 'Subscription ID to cancel' },\n },\n },\n },\n 'wallets.deposit': {\n method: 'wallets.deposit',\n description: 'Deposit funds into wallet by charging card on file',\n parameters: {\n required: {\n amount: { type: 'number', description: 'Amount in cents (e.g., 5000 = $50.00)' },\n },\n optional: {\n idempotencyKey: { type: 'string', description: 'Idempotency key for deduplication' },\n },\n },\n },\n 'wallets.balance': {\n method: 'wallets.balance',\n description: 'Get wallet balance and card info',\n parameters: {\n optional: {\n walletId: { type: 'string', description: 'Wallet ID (default: primary wallet)' },\n },\n },\n },\n 'sell.createSoftwareProduct': {\n method: 'sell.createSoftwareProduct',\n description: 'List a software product for sale via SCP manifest',\n parameters: {\n required: {\n scp_version: { type: 'string', description: 'SCP version (e.g., \"1.0\")' },\n product: { type: 'object', description: '{ id, name, vendor, type, description, category[] }' },\n plans: { type: 'array', description: 'Array of plan definitions with pricing' },\n provisioning: { type: 'object', description: '{ method, credentials_type, env_var_name, sdk_package }' },\n },\n },\n },\n};\n\nexport const schemaCommand = new Command('schema')\n .argument('<method>', 'Resource.method path (e.g. checkout.create)')\n .description('Inspect method parameters and return types')\n .action((methodPath: string) => {\n const schema = SCHEMAS[methodPath];\n if (!schema) {\n const available = Object.keys(SCHEMAS).join(', ');\n console.error(`Unknown method: ${methodPath}`);\n console.error(`Available: ${available}`);\n process.exit(1);\n }\n console.log(JSON.stringify(schema, null, 2));\n });\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\n\nconst walletCommand = new Command('wallet')\n .description('Manage wallet funds and settings');\n\nwalletCommand\n .command('deposit <dollars>')\n .description('Deposit funds into your wallet (amount in dollars)')\n .option('--idempotency-key <key>', 'Unique key to prevent duplicate deposits')\n .action(async (dollars: string, options) => {\n try {\n const lane = await Lane.create();\n const amount = parseFloat(dollars);\n\n if (isNaN(amount) || amount <= 0) {\n console.error(chalk.red('Error: amount must be a positive number'));\n process.exit(1);\n }\n\n const cents = Math.round(amount * 100);\n\n // Get default wallet\n const wallets = await lane.wallets.list({ limit: 1 });\n if (wallets.data.length === 0) {\n console.error(chalk.yellow('No wallets found. Run `lane add-card` to get started.'));\n process.exit(1);\n }\n const walletId = wallets.data[0]!.id;\n\n console.log(chalk.dim(`Depositing $${amount.toFixed(2)} into wallet...`));\n\n const result = await lane.wallets.deposit(walletId, {\n amount: cents,\n idempotencyKey: options.idempotencyKey,\n });\n\n console.log(chalk.green(`✓ Deposited $${(result.amount / 100).toFixed(2)}`));\n console.log(` New balance: $${(result.newBalance / 100).toFixed(2)} ${result.currency}`);\n console.log(chalk.dim(` Transaction: ${result.transactionId}`));\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\nwalletCommand\n .command('auto-reload')\n .description('Configure automatic wallet reload')\n .requiredOption('--threshold <dollars>', 'Reload when balance drops below this amount (dollars)')\n .requiredOption('--amount <dollars>', 'Amount to reload (dollars)')\n .option('--disable', 'Disable auto-reload')\n .action(async (options) => {\n try {\n const lane = await Lane.create();\n\n const wallets = await lane.wallets.list({ limit: 1 });\n if (wallets.data.length === 0) {\n console.error(chalk.yellow('No wallets found. Run `lane add-card` to get started.'));\n process.exit(1);\n }\n const walletId = wallets.data[0]!.id;\n\n const threshold = Math.round(parseFloat(options.threshold) * 100);\n const amount = Math.round(parseFloat(options.amount) * 100);\n\n if (isNaN(threshold) || isNaN(amount)) {\n console.error(chalk.red('Error: --threshold and --amount must be valid numbers'));\n process.exit(1);\n }\n\n const config = await lane.wallets.setAutoReload(walletId, {\n enabled: !options.disable,\n threshold,\n amount,\n });\n\n if (config.enabled) {\n console.log(chalk.green('✓ Auto-reload enabled'));\n console.log(` Threshold: $${(config.threshold / 100).toFixed(2)}`);\n console.log(` Amount: $${(config.amount / 100).toFixed(2)}`);\n } else {\n console.log(chalk.yellow('Auto-reload disabled'));\n }\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\nwalletCommand\n .command('balance')\n .description('Show wallet balance')\n .option('--format <format>', 'Output format (json or table)', 'json')\n .action(async (options) => {\n try {\n const lane = await Lane.create();\n const balance = await lane.wallets.balance();\n\n if (options.format === 'table') {\n console.log(chalk.bold('Wallet balance:\\n'));\n console.log(` Balance: $${(balance.balance / 100).toFixed(2)} ${balance.currency}`);\n if (balance.card) {\n console.log(` Card: ${balance.card.brand} **** ${balance.card.last4}`);\n }\n if (balance.autoReload) {\n const status = balance.autoReload.enabled ? chalk.green('enabled') : chalk.dim('disabled');\n console.log(` Auto-reload: ${status}`);\n }\n } else {\n console.log(JSON.stringify(balance, null, 2));\n }\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\nexport { walletCommand };\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { Lane } from '../../lane.js';\n\nexport const checkoutCommand = new Command('checkout')\n .description('Purchase a product from the Lane catalog')\n .requiredOption('--product <id>', 'Product ID to purchase')\n .option('--plan <id>', 'Plan ID for software subscriptions')\n .option('--quantity <n>', 'Quantity to purchase', '1')\n .option('--dry-run', 'Validate without purchasing')\n .option('--format <format>', 'Output format (json or table)', 'json')\n .action(async (options) => {\n try {\n const lane = await Lane.create();\n\n const wallets = await lane.wallets.list({ limit: 1 });\n if (wallets.data.length === 0) {\n console.error(chalk.yellow('No wallets found. Run `lane add-card` to get started.'));\n process.exit(1);\n }\n const walletId = wallets.data[0]!.id;\n\n if (options.dryRun) {\n console.log(chalk.green('✓ Checkout validation passed'));\n console.log(JSON.stringify({\n productId: options.product,\n walletId,\n plan: options.plan ?? null,\n quantity: parseInt(options.quantity, 10),\n dryRun: true,\n }, null, 2));\n return;\n }\n\n console.log(chalk.dim('Creating checkout session...'));\n\n const session = await lane.checkout.create({\n productId: options.product,\n walletId,\n quantity: parseInt(options.quantity, 10),\n });\n\n const order = await lane.checkout.complete(session.id);\n\n if (options.format === 'table') {\n console.log(chalk.bold('\\nOrder complete:\\n'));\n console.log(` Order ID: ${order.id}`);\n console.log(` Product: ${order.productId}`);\n console.log(` Amount: $${(order.amount / 100).toFixed(2)} ${order.currency}`);\n console.log(` Status: ${chalk.green(order.status)}`);\n if (order.apiKey) {\n console.log(` API Key: ${order.apiKey}`);\n }\n if (order.endpoint) {\n console.log(` Endpoint: ${order.endpoint}`);\n }\n } else {\n console.log(JSON.stringify(order, null, 2));\n }\n } catch (err) {\n console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n","// ---------------------------------------------------------------------------\n// Lane CLI — Entry Point\n// ---------------------------------------------------------------------------\n// npx lane <command>\n// ---------------------------------------------------------------------------\n\nimport { Command } from 'commander';\nimport { loginCommand } from './commands/login.js';\nimport { logoutCommand } from './commands/logout.js';\nimport { whoamiCommand } from './commands/whoami.js';\nimport { addCardCommand } from './commands/add-card.js';\nimport { cardsCommand } from './commands/cards.js';\nimport { balanceCommand } from './commands/balance.js';\nimport { setBudgetCommand } from './commands/set-budget.js';\nimport { transactionsCommand } from './commands/transactions.js';\nimport { payCommand } from './commands/pay.js';\nimport { rotateKeyCommand } from './commands/rotate-key.js';\nimport { setupMcpCommand } from './commands/setup-mcp.js';\nimport { dashboardCommand } from './commands/dashboard.js';\nimport { vendorCommand } from './commands/vendor.js';\nimport { schemaCommand } from './commands/schema.js';\nimport { walletCommand } from './commands/wallet.js';\nimport { checkoutCommand } from './commands/checkout.js';\n\nconst program = new Command();\n\nprogram\n .name('lane')\n .description('Add wallets and payments to your AI agents')\n .version('0.1.0');\n\n// Auth\nprogram.addCommand(loginCommand);\nprogram.addCommand(logoutCommand);\nprogram.addCommand(whoamiCommand);\n\n// Wallet\nprogram.addCommand(addCardCommand);\nprogram.addCommand(cardsCommand);\nprogram.addCommand(balanceCommand);\nprogram.addCommand(setBudgetCommand);\nprogram.addCommand(transactionsCommand);\nprogram.addCommand(payCommand);\nprogram.addCommand(rotateKeyCommand);\nprogram.addCommand(walletCommand);\n\n// Commerce\nprogram.addCommand(checkoutCommand);\nprogram.addCommand(vendorCommand);\nprogram.addCommand(schemaCommand);\n\n// Setup\nprogram.addCommand(setupMcpCommand);\nprogram.addCommand(dashboardCommand);\n\nprogram.parse();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAGA,QAAMA,kBAAN,cAA6B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOjC,YAAY,UAAU,MAAM,SAAS;AACnC,cAAM,OAAO;AAEb,cAAM,kBAAkB,MAAM,KAAK,WAAW;AAC9C,aAAK,OAAO,KAAK,YAAY;AAC7B,aAAK,OAAO;AACZ,aAAK,WAAW;AAChB,aAAK,cAAc;AAAA,MACrB;AAAA,IACF;AAKA,QAAMC,wBAAN,cAAmCD,gBAAe;AAAA;AAAA;AAAA;AAAA;AAAA,MAKhD,YAAY,SAAS;AACnB,cAA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I,QAAQ;AAE5BA,SACG,KAAK,MAAM,EACX,YAAY,4CAA4C,EACxD,QAAQ,OAAO;AAGlBA,SAAQ,WAAW,YAAY;AAC/BA,SAAQ,WAAW,aAAa;AAChCA,SAAQ,WAAW,aAAa;AAGhCA,SAAQ,WAAW,cAAc;AACjCA,SAAQ,WAAW,YAAY;AAC/BA,SAAQ,WAAW,cAAc;AACjCA,SAAQ,WAAW,gBAAgB;AACnCA,SAAQ,WAAW,mBAAmB;AACtCA,SAAQ,WAAW,UAAU;AAC7BA,SAAQ,WAAW,gBAAgB;AACnCA,SAAQ,WAAW,aAAa;AAGhCA,SAAQ,WAAW,eAAe;AAClCA,SAAQ,WAAW,aAAa;AAChCA,SAAQ,WAAW,aAAa;AAGhCA,SAAQ,WAAW,eAAe;AAClCA,SAAQ,WAAW,gBAAgB;AAEnCA,SAAQ,MAAM;","names":["CommanderError","InvalidArgumentError","InvalidArgumentError","Argument","Help","cmd","InvalidArgumentError","Option","str","EventEmitter","childProcess","path","fs","process","Argument","CommanderError","Help","Option","Command","option","Argument","Command","CommanderError","InvalidArgumentError","Help","Option","resolve","path","createHash","commander","process","styles","chalk","styles","open","process","childProcess","fs","fsConstants","promisify","childProcess","fs","fsConstants","process","os","fs","fs","fs","process","os","fs","process","Buffer","fs","Buffer","execFile","promisify","childProcess","fs","fsConstants","powerShellPath","path","promisify","process","execFile","promisify","process","execFile","process","promisify","execFile","execFileAsync","promisify","execFile","execFileAsync","execFileAsync","promisify","execFile","defaultBrowser","process","process","process","apps","defaultBrowser","powerShellPath","fs","fsConstants","childProcess","resolve","resolve","resolve","readFile","writeFile","mkdir","join","homedir","Lane","program"]}
|