@profullstack/threatcrush 0.2.1 → 0.3.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 +1 -0
- package/dist/daemon.js +2821 -208
- package/dist/daemon.js.map +1 -1
- package/dist/index.js +4138 -590
- package/dist/index.js.map +1 -1
- package/dist/systemd/threatcrushd.service +10 -3
- package/package.json +6 -3
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/error.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/argument.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/help.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/option.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/suggestSimilar.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/command.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/index.js","../src/core/state.ts","../src/tui/app.tsx","../src/daemon/paths.ts","../src/core/ipc-client.ts","../src/daemon/pidfile.ts","../src/tui/dashboard.ts","../../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json","../../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/parser.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/create-datetime.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/format-num.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/create-datetime-float.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/create-date.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/create-time.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/toml-parser.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/parse-pretty-error.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/parse-string.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/parse-async.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/parse-stream.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/parse.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/stringify.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/toml.js","../../../node_modules/.pnpm/commander@13.1.0/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/index.ts","../src/commands/monitor.ts","../src/core/logger.ts","../src/core/log-parser.ts","../src/commands/scan.ts","../../../node_modules/.pnpm/ora@8.2.0/node_modules/ora/index.js","../../../node_modules/.pnpm/cli-cursor@5.0.0/node_modules/cli-cursor/index.js","../../../node_modules/.pnpm/restore-cursor@5.1.0/node_modules/restore-cursor/index.js","../../../node_modules/.pnpm/mimic-function@5.0.1/node_modules/mimic-function/index.js","../../../node_modules/.pnpm/onetime@7.0.0/node_modules/onetime/index.js","../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/src/signals.ts","../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/src/index.ts","../../../node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js","../../../node_modules/.pnpm/log-symbols@6.0.0/node_modules/log-symbols/index.js","../../../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js","../../../node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js","../../../node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup-data.js","../../../node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/utilities.js","../../../node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup.js","../../../node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/index.js","../../../node_modules/.pnpm/emoji-regex@10.6.0/node_modules/emoji-regex/index.mjs","../../../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js","../../../node_modules/.pnpm/is-interactive@2.0.0/node_modules/is-interactive/index.js","../../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js","../../../node_modules/.pnpm/stdin-discarder@0.2.2/node_modules/stdin-discarder/index.js","../src/core/run-result.ts","../src/commands/init.ts","../src/core/config.ts","../src/core/cli-config.ts","../src/commands/login.ts","../src/core/module-loader.ts","../src/commands/status.ts","../src/commands/modules.ts","../src/commands/pentest.ts","../src/commands/orgs.ts","../src/commands/servers.ts","../src/commands/connect.ts","../src/commands/daemon.ts","../src/daemon/index.ts","../src/daemon/ipc-server.ts","../src/daemon/event-bus.ts","../src/daemon/module-host.ts","../src/daemon/watchers/log-watcher.ts","../src/daemon/watchers/journal-watcher.ts","../src/daemon/alerts/smtp.ts","../src/daemon/alerts/index.ts","../src/daemon/workers/runs-worker.ts","../src/core/telemetry.ts","../src/commands/service.ts","../src/commands/welcome.ts","../src/commands/properties.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.length > 3 && this._name.slice(-3) === '...') {\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 _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\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._concatValue(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 return `${option.description} (${extraInfo.join(', ')})`;\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 * 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 if (argumentList.length > 0) {\n output = output.concat([\n helper.styleTitle('Arguments:'),\n ...argumentList,\n '',\n ]);\n }\n\n // Options\n const optionList = helper.visibleOptions(cmd).map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n if (optionList.length > 0) {\n output = output.concat([\n helper.styleTitle('Options:'),\n ...optionList,\n '',\n ]);\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 if (globalOptionList.length > 0) {\n output = output.concat([\n helper.styleTitle('Global Options:'),\n ...globalOptionList,\n '',\n ]);\n }\n }\n\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(cmd)),\n helper.styleSubcommandDescription(helper.subcommandDescription(cmd)),\n );\n });\n if (commandList.length > 0) {\n output = output.concat([\n helper.styleTitle('Commands:'),\n ...commandList,\n '',\n ]);\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 }\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 _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\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._concatValue(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 * 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 }\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 Object.assign(this._outputConfiguration, configuration);\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|*)} [fn] - custom argument processing function\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, fn, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof fn === 'function') {\n argument.default(defaultValue).argParser(fn);\n } else {\n argument.default(fn);\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 && 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 return this;\n }\n\n enableOrNameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = enableOrNameAndArgs.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\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 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.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.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._concatValue(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 && 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 && 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[]} argv\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(argv) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n const args = argv.slice();\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n // parse options\n let activeVariadicOption = null;\n while (args.length) {\n const arg = args.shift();\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args);\n break;\n }\n\n if (activeVariadicOption && !maybeOption(arg)) {\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.shift();\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 (args.length > 0 && !maybeOption(args[0])) {\n value = args.shift();\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, emit and put back remainder of arg for further processing\n this.emit(`option:${option.name()}`);\n args.unshift(`-${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 if (maybeOption(arg)) {\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 if (args.length > 0) unknown.push(...args);\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg);\n if (args.length > 0) operands.push(...args);\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg);\n if (args.length > 0) dest.push(...args);\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 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 disabling built-in help option.\n if (typeof flags === 'boolean') {\n // true is not an expected value. Do something sensible but no unit-test.\n // istanbul ignore if\n if (flags) {\n this._helpOption = this._helpOption ?? undefined; // preserve existing option\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n flags = flags ?? '-h, --help';\n description = description ?? 'display help for command';\n this._helpOption = this.createOption(flags, description);\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 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","import Database from 'better-sqlite3';\nimport type { ThreatEvent } from '../types/events.js';\n\nlet db: Database.Database | null = null;\nlet dbUnavailable = false;\n\nexport function isStateDbAvailable(): boolean {\n return db !== null;\n}\n\nexport function initStateDB(dbPath: string = '/var/lib/threatcrush/state.db'): Database.Database {\n if (db) return db;\n if (dbUnavailable) {\n throw new Error('state db unavailable (previous init failed)');\n }\n\n try {\n try {\n db = new Database(dbPath);\n } catch {\n // Fall back to in-memory if we can't write to the path\n db = new Database(':memory:');\n }\n } catch (err) {\n // Native binding missing or unloadable — mark DB unavailable so callers\n // can degrade gracefully instead of throwing on every IPC request.\n dbUnavailable = true;\n throw err;\n }\n\n db.pragma('journal_mode = WAL');\n\n db.exec(`\n CREATE TABLE IF NOT EXISTS events (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n timestamp TEXT NOT NULL,\n module TEXT NOT NULL,\n category TEXT NOT NULL,\n severity TEXT NOT NULL,\n message TEXT NOT NULL,\n source_ip TEXT,\n details TEXT\n );\n\n CREATE TABLE IF NOT EXISTS module_state (\n module TEXT NOT NULL,\n key TEXT NOT NULL,\n value TEXT,\n PRIMARY KEY (module, key)\n );\n\n CREATE TABLE IF NOT EXISTS stats (\n key TEXT PRIMARY KEY,\n value TEXT NOT NULL,\n updated_at TEXT NOT NULL\n );\n\n CREATE INDEX IF NOT EXISTS idx_events_timestamp ON events(timestamp);\n CREATE INDEX IF NOT EXISTS idx_events_module ON events(module);\n CREATE INDEX IF NOT EXISTS idx_events_severity ON events(severity);\n CREATE INDEX IF NOT EXISTS idx_events_source_ip ON events(source_ip);\n `);\n\n return db;\n}\n\nexport function insertEvent(event: ThreatEvent): number {\n const database = tryDb();\n if (!database) return -1;\n const stmt = database.prepare(`\n INSERT INTO events (timestamp, module, category, severity, message, source_ip, details)\n VALUES (?, ?, ?, ?, ?, ?, ?)\n `);\n const result = stmt.run(\n event.timestamp.toISOString(),\n event.module,\n event.category,\n event.severity,\n event.message,\n event.source_ip || null,\n event.details ? JSON.stringify(event.details) : null,\n );\n return result.lastInsertRowid as number;\n}\n\nfunction tryDb(): Database.Database | null {\n if (db) return db;\n if (dbUnavailable) return null;\n try {\n return initStateDB();\n } catch {\n return null;\n }\n}\n\nexport function getRecentEvents(limit: number = 50): ThreatEvent[] {\n const database = tryDb();\n if (!database) return [];\n const rows = database.prepare(`\n SELECT * FROM events ORDER BY timestamp DESC LIMIT ?\n `).all(limit) as any[];\n return rows.map(rowToEvent);\n}\n\nexport function getEventCount(since?: Date): number {\n const database = tryDb();\n if (!database) return 0;\n if (since) {\n return (database.prepare(`SELECT COUNT(*) as count FROM events WHERE timestamp >= ?`)\n .get(since.toISOString()) as any).count;\n }\n return (database.prepare(`SELECT COUNT(*) as count FROM events`).get() as any).count;\n}\n\nexport function getThreatCount(since?: Date): number {\n const database = tryDb();\n if (!database) return 0;\n const severities = \"('medium','high','critical')\";\n if (since) {\n return (database.prepare(\n `SELECT COUNT(*) as count FROM events WHERE severity IN ${severities} AND timestamp >= ?`\n ).get(since.toISOString()) as any).count;\n }\n return (database.prepare(\n `SELECT COUNT(*) as count FROM events WHERE severity IN ${severities}`\n ).get() as any).count;\n}\n\nexport function getTopSources(limit: number = 10): Array<{ ip: string; count: number }> {\n const database = tryDb();\n if (!database) return [];\n return database.prepare(`\n SELECT source_ip as ip, COUNT(*) as count FROM events\n WHERE source_ip IS NOT NULL\n GROUP BY source_ip ORDER BY count DESC LIMIT ?\n `).all(limit) as any[];\n}\n\nexport function getModuleState(module: string, key: string): unknown {\n const database = db || initStateDB();\n const row = database.prepare(`SELECT value FROM module_state WHERE module = ? AND key = ?`)\n .get(module, key) as any;\n if (!row) return undefined;\n try {\n return JSON.parse(row.value);\n } catch {\n return row.value;\n }\n}\n\nexport function setModuleState(module: string, key: string, value: unknown): void {\n const database = db || initStateDB();\n database.prepare(`\n INSERT OR REPLACE INTO module_state (module, key, value) VALUES (?, ?, ?)\n `).run(module, key, JSON.stringify(value));\n}\n\nfunction rowToEvent(row: any): ThreatEvent {\n return {\n id: row.id,\n timestamp: new Date(row.timestamp),\n module: row.module,\n category: row.category,\n severity: row.severity,\n message: row.message,\n source_ip: row.source_ip,\n details: row.details ? JSON.parse(row.details) : undefined,\n };\n}\n\nexport function closeDB(): void {\n if (db) {\n db.close();\n db = null;\n }\n}\n","import React, { useEffect, useReducer, useRef } from 'react';\nimport type { ThreatEvent, EventSeverity } from '../types/events.js';\nimport type { DaemonStatusReply } from '../daemon/ipc-protocol.js';\nimport { IpcClient } from '../core/ipc-client.js';\n\ninterface ModuleRow { name: string; status: string; events: number; detail?: string }\n\ninterface State {\n connected: boolean;\n connectionLabel: string;\n events: ThreatEvent[];\n counters: { events: number; threats: number; modules: number };\n severity: Record<EventSeverity, number>;\n modules: ModuleRow[];\n topSources: Array<{ ip: string; count: number }>;\n timeline: number[];\n daemonStatus: DaemonStatusReply | null;\n paused: boolean;\n}\n\ntype Action =\n | { type: 'connected'; label: string; status: DaemonStatusReply }\n | { type: 'connection_lost'; label: string }\n | { type: 'event'; event: ThreatEvent }\n | { type: 'tick' }\n | { type: 'modules'; modules: ModuleRow[] }\n | { type: 'top'; top: Array<{ ip: string; count: number }> }\n | { type: 'counters'; counters: { events: number; threats: number } }\n | { type: 'pause' }\n | { type: 'reset' };\n\nconst DEMO: ThreatEvent[] = [\n { timestamp: new Date(), module: 'ssh-guard', category: 'auth', severity: 'info', message: 'SSH login accepted for ubuntu', source_ip: '10.0.0.1' },\n { timestamp: new Date(), module: 'log-watcher', category: 'web', severity: 'info', message: 'GET /api/health → 200', source_ip: '172.16.0.50' },\n { timestamp: new Date(), module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Failed SSH login for root', source_ip: '45.33.22.11' },\n { timestamp: new Date(), module: 'log-watcher', category: 'web', severity: 'critical', message: 'Attack [SQLI]: GET /search?q=1%27+OR+1%3D1', source_ip: '185.220.101.44' },\n { timestamp: new Date(), module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Brute force — 6 failures in 45s', source_ip: '45.33.22.11' },\n { timestamp: new Date(), module: 'log-watcher', category: 'web', severity: 'critical', message: 'Attack [PATH_TRAVERSAL]: GET /../../etc/passwd', source_ip: '185.220.101.44' },\n { timestamp: new Date(), module: 'log-watcher', category: 'web', severity: 'medium', message: 'Server error 502: GET /api/users', source_ip: '10.0.0.2' },\n { timestamp: new Date(), module: 'dns-monitor', category: 'network', severity: 'medium', message: 'DNS tunneling suspected: TXT queries', source_ip: '103.44.8.2' },\n];\n\nconst initialState: State = {\n connected: false,\n connectionLabel: 'connecting...',\n events: [],\n counters: { events: 0, threats: 0, modules: 0 },\n severity: { info: 0, low: 0, medium: 0, high: 0, critical: 0 },\n modules: [],\n topSources: [],\n timeline: Array(30).fill(0),\n daemonStatus: null,\n paused: false,\n};\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case 'connected':\n return {\n ...state,\n connected: true,\n connectionLabel: action.label,\n daemonStatus: action.status,\n modules: action.status.modules,\n counters: {\n events: action.status.counters.events,\n threats: action.status.counters.threats,\n modules: action.status.modules.length,\n },\n };\n case 'connection_lost':\n return { ...state, connected: false, connectionLabel: action.label };\n case 'event': {\n if (state.paused) return state;\n const events = [...state.events, action.event].slice(-300);\n const severity = { ...state.severity, [action.event.severity]: state.severity[action.event.severity] + 1 };\n const isThreat = action.event.severity === 'medium' || action.event.severity === 'high' || action.event.severity === 'critical';\n return {\n ...state,\n events,\n severity,\n counters: {\n ...state.counters,\n events: state.counters.events + 1,\n threats: state.counters.threats + (isThreat ? 1 : 0),\n },\n };\n }\n case 'tick':\n return { ...state, timeline: [...state.timeline.slice(1), state.events.length] };\n case 'modules':\n return { ...state, modules: action.modules, counters: { ...state.counters, modules: action.modules.length } };\n case 'top':\n return { ...state, topSources: action.top };\n case 'counters':\n return { ...state, counters: { ...state.counters, events: action.counters.events, threats: action.counters.threats } };\n case 'pause':\n return { ...state, paused: !state.paused };\n case 'reset':\n return { ...initialState, connected: state.connected, connectionLabel: state.connectionLabel, daemonStatus: state.daemonStatus, modules: state.modules };\n }\n}\n\nconst severityColor: Record<EventSeverity, string> = {\n info: 'green',\n low: 'cyan',\n medium: 'yellow',\n high: 'red',\n critical: 'magenta',\n};\n\nfunction fmtTime(d: Date): string {\n return d.toISOString().slice(11, 19);\n}\n\nfunction eventLine(event: ThreatEvent): string {\n const color = severityColor[event.severity];\n const ts = fmtTime(event.timestamp);\n const ip = event.source_ip ? ` (${event.source_ip})` : '';\n const sev = `[${event.severity.toUpperCase()}]`.padEnd(10);\n const mod = `[${event.module}]`.padEnd(14);\n return `{${color}-bold}${ts}{/${color}-bold} {cyan-fg}${mod}{/cyan-fg} {${color}-fg}${sev}{/${color}-fg} ${event.message}${ip}`;\n}\n\nfunction sparklineRow(values: number[], width: number): string {\n const bars = ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'];\n const max = Math.max(1, ...values);\n const slice = values.slice(-width);\n return slice.map((v) => bars[Math.min(bars.length - 1, Math.floor((v / max) * (bars.length - 1)))]).join('');\n}\n\nfunction severityBarRow(label: string, count: number, total: number, color: string): string {\n const pct = total > 0 ? Math.round((count / total) * 100) : 0;\n const width = 20;\n const filled = Math.round((pct / 100) * width);\n const bar = `{${color}-fg}${'█'.repeat(filled)}{/}${'·'.repeat(Math.max(0, width - filled))}`;\n return ` {bold}${label.padEnd(8)}{/bold} ${bar} {${color}-fg}${String(count).padStart(4)}{/} ${String(pct).padStart(3)}%`;\n}\n\ninterface AppProps {\n client: IpcClient | null;\n onExit: () => void;\n}\n\nexport function App({ client, onExit }: AppProps): React.ReactElement {\n const [state, dispatch] = useReducer(reducer, initialState);\n const screenRef = useRef<{ focus: () => void } | null>(null);\n\n useEffect(() => {\n if (!client) {\n dispatch({ type: 'connection_lost', label: 'demo mode — no daemon' });\n let i = 0;\n const timer = setInterval(() => {\n const base = DEMO[i % DEMO.length];\n dispatch({ type: 'event', event: { ...base, timestamp: new Date() } });\n i++;\n }, 1800);\n return () => clearInterval(timer);\n }\n\n let mounted = true;\n\n // Route pushed IPC events directly into our reducer.\n (client as unknown as { opts: { onEvent?: (e: ThreatEvent) => void } }).opts.onEvent = (event) => {\n if (!mounted) return;\n dispatch({ type: 'event', event });\n };\n\n client.status()\n .then((status) => { if (mounted) dispatch({ type: 'connected', label: `daemon pid ${status.pid} · v${status.version}`, status }); })\n .catch(() => dispatch({ type: 'connection_lost', label: 'daemon ipc error' }));\n\n client.subscribe(['event', 'module']).catch(() => {});\n\n const refresh = setInterval(async () => {\n try {\n const [mods, top, counters] = await Promise.all([\n client.request<ModuleRow[]>('module_list'),\n client.topSources(8),\n client.counters(),\n ]);\n dispatch({ type: 'modules', modules: mods });\n dispatch({ type: 'top', top });\n dispatch({ type: 'counters', counters: { events: counters.total, threats: counters.threats } });\n } catch {\n dispatch({ type: 'connection_lost', label: 'daemon disconnected' });\n }\n }, 2000);\n\n return () => {\n mounted = false;\n clearInterval(refresh);\n };\n }, [client]);\n\n useEffect(() => {\n const tick = setInterval(() => dispatch({ type: 'tick' }), 1000);\n return () => clearInterval(tick);\n }, []);\n\n const totalSeverity = Object.values(state.severity).reduce((a, b) => a + b, 0);\n const feedLines = state.events.slice(-60).map(eventLine).join('\\n');\n const spark = sparklineRow(state.timeline, 28);\n const modRows = state.modules.length === 0\n ? ' {gray-fg}(no modules reported){/gray-fg}'\n : state.modules.map((m) => ` ${m.status === 'running' ? '{green-fg}●{/}' : '{cyan-fg}○{/}'} {bold}${m.name.padEnd(16)}{/} {gray-fg}${m.status.padEnd(10)} ${m.events} evt{/}`).join('\\n');\n const topRows = state.topSources.length === 0\n ? ' {gray-fg}(no sources yet){/gray-fg}'\n : state.topSources.map((s) => ` {magenta-fg}${s.ip.padEnd(18)}{/} {bold}${String(s.count).padStart(5)}{/}`).join('\\n');\n\n const statusColor = state.connected ? 'green' : 'yellow';\n const statusGlyph = state.connected ? '●' : '○';\n\n return (\n <element keyable={true} ref={(ref: unknown) => { screenRef.current = ref as { focus: () => void }; }}\n onKey-q={onExit} onKey-escape={onExit} onKey-C-c={onExit}\n onKey-p={() => dispatch({ type: 'pause' })}\n onKey-r={() => dispatch({ type: 'reset' })}\n >\n <box top={0} left={0} width=\"100%\" height={3}\n border={{ type: 'line' }}\n style={{ border: { fg: 'green' } }}\n tags={true}\n content={` {green-fg}⚡ ThreatCrush{/} — Interactive Security Dashboard {gray-fg}|{/} {${statusColor}-fg}${statusGlyph} ${state.connectionLabel}{/}${state.paused ? ' {yellow-fg}· PAUSED{/}' : ''}`}\n />\n\n <box top={3} left={0} width=\"25%\" height={3} border={{ type: 'line' }} style={{ border: { fg: 'green' } }} label=\" Events \" tags={true}\n content={` {green-fg}{bold}${state.counters.events}{/bold}{/}`} />\n <box top={3} left=\"25%\" width=\"25%\" height={3} border={{ type: 'line' }} style={{ border: { fg: 'red' } }} label=\" Threats \" tags={true}\n content={` {red-fg}{bold}${state.counters.threats}{/bold}{/}`} />\n <box top={3} left=\"50%\" width=\"25%\" height={3} border={{ type: 'line' }} style={{ border: { fg: 'cyan' } }} label=\" Modules \" tags={true}\n content={` {cyan-fg}{bold}${state.counters.modules}{/bold}{/}`} />\n <box top={3} left=\"75%\" width=\"25%\" height={3} border={{ type: 'line' }} style={{ border: { fg: statusColor } }} label=\" Status \" tags={true}\n content={` {${statusColor}-fg}${statusGlyph} ${state.connected ? 'MONITORING' : 'DEMO'}{/}`} />\n\n <box top={6} left={0} width=\"40%\" height={10} border={{ type: 'line' }} style={{ border: { fg: 'yellow' } }} label=\" Severity \" tags={true}\n content={[\n severityBarRow('Info', state.severity.info, totalSeverity, 'green'),\n severityBarRow('Low', state.severity.low, totalSeverity, 'cyan'),\n severityBarRow('Medium', state.severity.medium, totalSeverity, 'yellow'),\n severityBarRow('High', state.severity.high, totalSeverity, 'red'),\n severityBarRow('Critical', state.severity.critical, totalSeverity, 'magenta'),\n ].join('\\n')} />\n\n <box top={6} left=\"40%\" width=\"30%\" height={10} border={{ type: 'line' }} style={{ border: { fg: 'magenta' } }} label=\" Top Sources \" tags={true}\n content={topRows} />\n\n <box top={6} left=\"70%\" width=\"30%\" height={10} border={{ type: 'line' }} style={{ border: { fg: 'blue' } }} label=\" Events / sec \" tags={true}\n content={`\\n {blue-fg}${spark}{/}\\n\\n {gray-fg}last ${state.timeline.length}s{/}`} />\n\n <scrollabletext top={16} left={0} width=\"70%\" height=\"100%-18\"\n border={{ type: 'line' }}\n style={{ border: { fg: 'green' } }}\n label=\" Live Event Feed \"\n tags={true}\n scrollable={true}\n alwaysScroll={true}\n scrollbar={{ ch: ' ', style: { bg: 'green' } }}\n content={feedLines || ' {gray-fg}(no events yet — waiting for the daemon...){/gray-fg}'} />\n\n <box top={16} left=\"70%\" width=\"30%\" height=\"100%-18\"\n border={{ type: 'line' }}\n style={{ border: { fg: 'cyan' } }}\n label=\" Modules \"\n tags={true}\n content={modRows} />\n\n <box bottom={0} left={0} width=\"100%\" height={3}\n border={{ type: 'line' }}\n style={{ border: { fg: 'green' } }}\n tags={true}\n content=\" {green-fg}q{/}:quit {green-fg}p{/}:pause {green-fg}r{/}:reset {gray-fg}| Ctrl-C exits | daemon over IPC{/}\" />\n </element>\n );\n}\n","import { existsSync, mkdirSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\n\nfunction canWriteSystemPaths(): boolean {\n if (process.platform !== 'linux') return false;\n if (process.getuid && process.getuid() === 0) return true;\n try {\n if (!existsSync('/etc/threatcrush')) return false;\n mkdirSync('/etc/threatcrush/.probe', { recursive: true });\n return true;\n } catch {\n return false;\n }\n}\n\nconst systemMode = canWriteSystemPaths();\nconst userBase = join(homedir(), '.threatcrush');\n\nexport const PATHS = systemMode\n ? {\n mode: 'system' as const,\n configDir: '/etc/threatcrush',\n configFile: '/etc/threatcrush/threatcrushd.conf',\n confD: '/etc/threatcrush/threatcrushd.conf.d',\n moduleDir: '/etc/threatcrush/modules',\n logDir: '/var/log/threatcrush',\n logFile: '/var/log/threatcrush/threatcrushd.log',\n stateDir: '/var/lib/threatcrush',\n stateDb: '/var/lib/threatcrush/state.db',\n runDir: '/var/run/threatcrush',\n pidFile: '/var/run/threatcrush/threatcrushd.pid',\n socket: '/var/run/threatcrush/threatcrushd.sock',\n }\n : {\n mode: 'user' as const,\n configDir: userBase,\n configFile: join(userBase, 'threatcrushd.conf'),\n confD: join(userBase, 'threatcrushd.conf.d'),\n moduleDir: join(userBase, 'modules'),\n logDir: join(userBase, 'logs'),\n logFile: join(userBase, 'logs', 'threatcrushd.log'),\n stateDir: join(userBase, 'state'),\n stateDb: join(userBase, 'state', 'state.db'),\n runDir: join(userBase, 'run'),\n pidFile: join(userBase, 'run', 'threatcrushd.pid'),\n socket: join(userBase, 'run', 'threatcrushd.sock'),\n };\n\nexport function ensureRuntimeDirs(): void {\n for (const dir of [PATHS.configDir, PATHS.confD, PATHS.moduleDir, PATHS.logDir, PATHS.stateDir, PATHS.runDir]) {\n try {\n mkdirSync(dir, { recursive: true });\n } catch {\n // best-effort\n }\n }\n}\n","import { createConnection, Socket } from 'node:net';\nimport { existsSync } from 'node:fs';\nimport { PATHS } from '../daemon/paths.js';\nimport type {\n IpcRequest,\n IpcResponse,\n IpcPush,\n DaemonStatusReply,\n} from '../daemon/ipc-protocol.js';\nimport type { ThreatEvent } from '../types/events.js';\n\nexport interface IpcClientOptions {\n socketPath?: string;\n onEvent?: (event: ThreatEvent) => void;\n onModule?: (info: { name: string; status: string; detail?: string }) => void;\n}\n\ntype Pending = {\n resolve: (value: unknown) => void;\n reject: (err: Error) => void;\n};\n\nexport class IpcClient {\n private socket: Socket | null = null;\n private buffer = '';\n private nextId = 1;\n private pending = new Map<number, Pending>();\n private socketPath: string;\n\n constructor(private opts: IpcClientOptions = {}) {\n this.socketPath = opts.socketPath || PATHS.socket;\n }\n\n static isDaemonRunning(socketPath = PATHS.socket): boolean {\n return existsSync(socketPath);\n }\n\n async connect(timeoutMs = 2000): Promise<void> {\n if (!existsSync(this.socketPath)) {\n throw new Error(`threatcrushd socket not found at ${this.socketPath}`);\n }\n\n return new Promise((resolve, reject) => {\n const sock = createConnection(this.socketPath);\n const timer = setTimeout(() => {\n sock.destroy();\n reject(new Error('ipc connect timeout'));\n }, timeoutMs);\n\n sock.once('connect', () => {\n clearTimeout(timer);\n this.socket = sock;\n sock.setEncoding('utf-8');\n sock.on('data', (chunk) => this.onData(chunk.toString()));\n sock.on('close', () => this.onClose());\n sock.on('error', () => this.onClose());\n resolve();\n });\n\n sock.once('error', (err) => {\n clearTimeout(timer);\n reject(err);\n });\n });\n }\n\n close(): void {\n this.socket?.destroy();\n this.socket = null;\n }\n\n async request<T>(method: IpcRequest['method'], params?: Record<string, unknown>): Promise<T> {\n if (!this.socket) throw new Error('not connected');\n const id = this.nextId++;\n const frame: IpcRequest = params\n ? ({ id, method, params } as IpcRequest)\n : ({ id, method } as IpcRequest);\n\n return new Promise<T>((resolve, reject) => {\n this.pending.set(id, { resolve: resolve as (v: unknown) => void, reject });\n this.socket!.write(JSON.stringify(frame) + '\\n', (err) => {\n if (err) {\n this.pending.delete(id);\n reject(err);\n }\n });\n });\n }\n\n async ping(): Promise<'pong'> {\n return this.request<'pong'>('ping');\n }\n\n async status(): Promise<DaemonStatusReply> {\n return this.request<DaemonStatusReply>('status');\n }\n\n async recentEvents(limit = 50): Promise<ThreatEvent[]> {\n return this.request<ThreatEvent[]>('recent_events', { limit });\n }\n\n async topSources(limit = 10): Promise<Array<{ ip: string; count: number }>> {\n return this.request('top_sources', { limit });\n }\n\n async counters() {\n return this.request<{ total: number; threats: number; last24h: number; threats24h: number }>('counters');\n }\n\n async subscribe(channels: Array<'event' | 'module'>): Promise<void> {\n await this.request('subscribe', { channels });\n }\n\n async shutdown(): Promise<void> {\n await this.request('shutdown');\n }\n\n private onData(chunk: string): void {\n this.buffer += chunk;\n let idx;\n while ((idx = this.buffer.indexOf('\\n')) >= 0) {\n const line = this.buffer.slice(0, idx);\n this.buffer = this.buffer.slice(idx + 1);\n if (!line.trim()) continue;\n try {\n const msg = JSON.parse(line) as IpcResponse | IpcPush;\n if ('push' in msg) {\n if (msg.push === 'event' && this.opts.onEvent) {\n const raw = msg.payload as ThreatEvent & { timestamp: string | Date };\n this.opts.onEvent({ ...raw, timestamp: new Date(raw.timestamp) });\n } else if (msg.push === 'module' && this.opts.onModule) {\n this.opts.onModule(msg.payload as { name: string; status: string; detail?: string });\n }\n continue;\n }\n const pending = this.pending.get(msg.id);\n if (!pending) continue;\n this.pending.delete(msg.id);\n if (msg.ok) pending.resolve(msg.result);\n else pending.reject(new Error(msg.error || 'ipc error'));\n } catch {\n // skip malformed frame\n }\n }\n }\n\n private onClose(): void {\n for (const { reject } of this.pending.values()) {\n reject(new Error('daemon connection closed'));\n }\n this.pending.clear();\n this.socket = null;\n }\n}\n","import { existsSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs';\nimport { PATHS, ensureRuntimeDirs } from './paths.js';\n\nexport function writePidFile(): void {\n ensureRuntimeDirs();\n writeFileSync(PATHS.pidFile, String(process.pid), 'utf-8');\n}\n\nexport function readPidFile(): number | null {\n if (!existsSync(PATHS.pidFile)) return null;\n const raw = readFileSync(PATHS.pidFile, 'utf-8').trim();\n const pid = parseInt(raw, 10);\n return Number.isFinite(pid) ? pid : null;\n}\n\nexport function removePidFile(): void {\n try {\n if (existsSync(PATHS.pidFile)) unlinkSync(PATHS.pidFile);\n } catch {\n // ignore\n }\n}\n\nexport function isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function findRunningDaemon(): number | null {\n const pid = readPidFile();\n if (pid && isProcessAlive(pid)) return pid;\n if (pid) removePidFile();\n return null;\n}\n","import blessed from 'blessed';\nimport React from 'react';\nimport { render } from 'react-blessed';\nimport { App } from './app.js';\nimport { IpcClient } from '../core/ipc-client.js';\nimport { findRunningDaemon } from '../daemon/pidfile.js';\nimport { closeDB } from '../core/state.js';\n\nexport async function startDashboard(): Promise<void> {\n const screen = blessed.screen({\n smartCSR: true,\n fullUnicode: true,\n title: 'ThreatCrush TUI Dashboard',\n });\n\n let client: IpcClient | null = null;\n if (findRunningDaemon()) {\n client = new IpcClient();\n try {\n await client.connect();\n } catch {\n client = null;\n }\n }\n\n const exit = () => {\n try { client?.close(); } catch {}\n try { closeDB(); } catch {}\n screen.destroy();\n process.exit(0);\n };\n\n render(React.createElement(App, { client, onExit: exit }), screen);\n\n screen.key(['C-c', 'q', 'escape'], exit);\n}\n","{\n\t\"dots\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠋\",\n\t\t\t\"⠙\",\n\t\t\t\"⠹\",\n\t\t\t\"⠸\",\n\t\t\t\"⠼\",\n\t\t\t\"⠴\",\n\t\t\t\"⠦\",\n\t\t\t\"⠧\",\n\t\t\t\"⠇\",\n\t\t\t\"⠏\"\n\t\t]\n\t},\n\t\"dots2\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⣾\",\n\t\t\t\"⣽\",\n\t\t\t\"⣻\",\n\t\t\t\"⢿\",\n\t\t\t\"⡿\",\n\t\t\t\"⣟\",\n\t\t\t\"⣯\",\n\t\t\t\"⣷\"\n\t\t]\n\t},\n\t\"dots3\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠋\",\n\t\t\t\"⠙\",\n\t\t\t\"⠚\",\n\t\t\t\"⠞\",\n\t\t\t\"⠖\",\n\t\t\t\"⠦\",\n\t\t\t\"⠴\",\n\t\t\t\"⠲\",\n\t\t\t\"⠳\",\n\t\t\t\"⠓\"\n\t\t]\n\t},\n\t\"dots4\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠄\",\n\t\t\t\"⠆\",\n\t\t\t\"⠇\",\n\t\t\t\"⠋\",\n\t\t\t\"⠙\",\n\t\t\t\"⠸\",\n\t\t\t\"⠰\",\n\t\t\t\"⠠\",\n\t\t\t\"⠰\",\n\t\t\t\"⠸\",\n\t\t\t\"⠙\",\n\t\t\t\"⠋\",\n\t\t\t\"⠇\",\n\t\t\t\"⠆\"\n\t\t]\n\t},\n\t\"dots5\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠋\",\n\t\t\t\"⠙\",\n\t\t\t\"⠚\",\n\t\t\t\"⠒\",\n\t\t\t\"⠂\",\n\t\t\t\"⠂\",\n\t\t\t\"⠒\",\n\t\t\t\"⠲\",\n\t\t\t\"⠴\",\n\t\t\t\"⠦\",\n\t\t\t\"⠖\",\n\t\t\t\"⠒\",\n\t\t\t\"⠐\",\n\t\t\t\"⠐\",\n\t\t\t\"⠒\",\n\t\t\t\"⠓\",\n\t\t\t\"⠋\"\n\t\t]\n\t},\n\t\"dots6\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠁\",\n\t\t\t\"⠉\",\n\t\t\t\"⠙\",\n\t\t\t\"⠚\",\n\t\t\t\"⠒\",\n\t\t\t\"⠂\",\n\t\t\t\"⠂\",\n\t\t\t\"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\t\t\t\"⠐\",\n\t\t\t\"⠐\",\n\t\t\t\"⠒\",\n\t\t\t\"⠓\",\n\t\t\t\"⠋\",\n\t\t\t\"⠉\",\n\t\t\t\"⠈\",\n\t\t\t\"⠈\"\n\t\t]\n\t},\n\t\"dots9\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⢹\",\n\t\t\t\"⢺\",\n\t\t\t\"⢼\",\n\t\t\t\"⣸\",\n\t\t\t\"⣇\",\n\t\t\t\"⡧\",\n\t\t\t\"⡗\",\n\t\t\t\"⡏\"\n\t\t]\n\t},\n\t\"dots10\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⢄\",\n\t\t\t\"⢂\",\n\t\t\t\"⢁\",\n\t\t\t\"⡁\",\n\t\t\t\"⡈\",\n\t\t\t\"⡐\",\n\t\t\t\"⡠\"\n\t\t]\n\t},\n\t\"dots11\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"⠁\",\n\t\t\t\"⠂\",\n\t\t\t\"⠄\",\n\t\t\t\"⡀\",\n\t\t\t\"⢀\",\n\t\t\t\"⠠\",\n\t\t\t\"⠐\",\n\t\t\t\"⠈\"\n\t\t]\n\t},\n\t\"dots12\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⢀⠀\",\n\t\t\t\"⡀⠀\",\n\t\t\t\"⠄⠀\",\n\t\t\t\"⢂⠀\",\n\t\t\t\"⡂⠀\",\n\t\t\t\"⠅⠀\",\n\t\t\t\"⢃⠀\",\n\t\t\t\"⡃⠀\",\n\t\t\t\"⠍⠀\",\n\t\t\t\"⢋⠀\",\n\t\t\t\"⡋⠀\",\n\t\t\t\"⠍⠁\",\n\t\t\t\"⢋⠁\",\n\t\t\t\"⡋⠁\",\n\t\t\t\"⠍⠉\",\n\t\t\t\"⠋⠉\",\n\t\t\t\"⠋⠉\",\n\t\t\t\"⠉⠙\",\n\t\t\t\"⠉⠙\",\n\t\t\t\"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\t\t\t\"⠟\",\n\t\t\t\"⡛\",\n\t\t\t\"⠛\",\n\t\t\t\"⠫\",\n\t\t\t\"⢋\",\n\t\t\t\"⠋\",\n\t\t\t\"⠍\",\n\t\t\t\"⡉\",\n\t\t\t\"⠉\",\n\t\t\t\"⠑\",\n\t\t\t\"⠡\",\n\t\t\t\"⢁\"\n\t\t]\n\t},\n\t\"line\": {\n\t\t\"interval\": 130,\n\t\t\"frames\": [\n\t\t\t\"-\",\n\t\t\t\"\\\\\",\n\t\t\t\"|\",\n\t\t\t\"/\"\n\t\t]\n\t},\n\t\"line2\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"⠂\",\n\t\t\t\"-\",\n\t\t\t\"–\",\n\t\t\t\"—\",\n\t\t\t\"–\",\n\t\t\t\"-\"\n\t\t]\n\t},\n\t\"pipe\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"┤\",\n\t\t\t\"┘\",\n\t\t\t\"┴\",\n\t\t\t\"└\",\n\t\t\t\"├\",\n\t\t\t\"┌\",\n\t\t\t\"┬\",\n\t\t\t\"┐\"\n\t\t]\n\t},\n\t\"simpleDots\": {\n\t\t\"interval\": 400,\n\t\t\"frames\": [\n\t\t\t\". \",\n\t\t\t\".. \",\n\t\t\t\"...\",\n\t\t\t\" \"\n\t\t]\n\t},\n\t\"simpleDotsScrolling\": {\n\t\t\"interval\": 200,\n\t\t\"frames\": [\n\t\t\t\". \",\n\t\t\t\".. \",\n\t\t\t\"...\",\n\t\t\t\" ..\",\n\t\t\t\" .\",\n\t\t\t\" \"\n\t\t]\n\t},\n\t\"star\": {\n\t\t\"interval\": 70,\n\t\t\"frames\": [\n\t\t\t\"✶\",\n\t\t\t\"✸\",\n\t\t\t\"✹\",\n\t\t\t\"✺\",\n\t\t\t\"✹\",\n\t\t\t\"✷\"\n\t\t]\n\t},\n\t\"star2\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"+\",\n\t\t\t\"x\",\n\t\t\t\"*\"\n\t\t]\n\t},\n\t\"flip\": {\n\t\t\"interval\": 70,\n\t\t\"frames\": [\n\t\t\t\"_\",\n\t\t\t\"_\",\n\t\t\t\"_\",\n\t\t\t\"-\",\n\t\t\t\"`\",\n\t\t\t\"`\",\n\t\t\t\"'\",\n\t\t\t\"´\",\n\t\t\t\"-\",\n\t\t\t\"_\",\n\t\t\t\"_\",\n\t\t\t\"_\"\n\t\t]\n\t},\n\t\"hamburger\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"☱\",\n\t\t\t\"☲\",\n\t\t\t\"☴\"\n\t\t]\n\t},\n\t\"growVertical\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"▁\",\n\t\t\t\"▃\",\n\t\t\t\"▄\",\n\t\t\t\"▅\",\n\t\t\t\"▆\",\n\t\t\t\"▇\",\n\t\t\t\"▆\",\n\t\t\t\"▅\",\n\t\t\t\"▄\",\n\t\t\t\"▃\"\n\t\t]\n\t},\n\t\"growHorizontal\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"▏\",\n\t\t\t\"▎\",\n\t\t\t\"▍\",\n\t\t\t\"▌\",\n\t\t\t\"▋\",\n\t\t\t\"▊\",\n\t\t\t\"▉\",\n\t\t\t\"▊\",\n\t\t\t\"▋\",\n\t\t\t\"▌\",\n\t\t\t\"▍\",\n\t\t\t\"▎\"\n\t\t]\n\t},\n\t\"balloon\": {\n\t\t\"interval\": 140,\n\t\t\"frames\": [\n\t\t\t\" \",\n\t\t\t\".\",\n\t\t\t\"o\",\n\t\t\t\"O\",\n\t\t\t\"@\",\n\t\t\t\"*\",\n\t\t\t\" \"\n\t\t]\n\t},\n\t\"balloon2\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\".\",\n\t\t\t\"o\",\n\t\t\t\"O\",\n\t\t\t\"°\",\n\t\t\t\"O\",\n\t\t\t\"o\",\n\t\t\t\".\"\n\t\t]\n\t},\n\t\"noise\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"▓\",\n\t\t\t\"▒\",\n\t\t\t\"░\"\n\t\t]\n\t},\n\t\"bounce\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"⠁\",\n\t\t\t\"⠂\",\n\t\t\t\"⠄\",\n\t\t\t\"⠂\"\n\t\t]\n\t},\n\t\"boxBounce\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"▖\",\n\t\t\t\"▘\",\n\t\t\t\"▝\",\n\t\t\t\"▗\"\n\t\t]\n\t},\n\t\"boxBounce2\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"▌\",\n\t\t\t\"▀\",\n\t\t\t\"▐\",\n\t\t\t\"▄\"\n\t\t]\n\t},\n\t\"triangle\": {\n\t\t\"interval\": 50,\n\t\t\"frames\": [\n\t\t\t\"◢\",\n\t\t\t\"◣\",\n\t\t\t\"◤\",\n\t\t\t\"◥\"\n\t\t]\n\t},\n\t\"binary\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"010010\",\n \"001100\",\n \"100101\",\n \"111010\",\n \"111101\",\n \"010111\",\n\t\t\t\"101011\",\n\t\t\t\"111000\",\n\t\t\t\"110011\",\n\t\t\t\"110101\"\n\t\t]\n\t},\n\t\"arc\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"◜\",\n\t\t\t\"◠\",\n\t\t\t\"◝\",\n\t\t\t\"◞\",\n\t\t\t\"◡\",\n\t\t\t\"◟\"\n\t\t]\n\t},\n\t\"circle\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"◡\",\n\t\t\t\"⊙\",\n\t\t\t\"◠\"\n\t\t]\n\t},\n\t\"squareCorners\": {\n\t\t\"interval\": 180,\n\t\t\"frames\": [\n\t\t\t\"◰\",\n\t\t\t\"◳\",\n\t\t\t\"◲\",\n\t\t\t\"◱\"\n\t\t]\n\t},\n\t\"circleQuarters\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"◴\",\n\t\t\t\"◷\",\n\t\t\t\"◶\",\n\t\t\t\"◵\"\n\t\t]\n\t},\n\t\"circleHalves\": {\n\t\t\"interval\": 50,\n\t\t\"frames\": [\n\t\t\t\"◐\",\n\t\t\t\"◓\",\n\t\t\t\"◑\",\n\t\t\t\"◒\"\n\t\t]\n\t},\n\t\"squish\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"╫\",\n\t\t\t\"╪\"\n\t\t]\n\t},\n\t\"toggle\": {\n\t\t\"interval\": 250,\n\t\t\"frames\": [\n\t\t\t\"⊶\",\n\t\t\t\"⊷\"\n\t\t]\n\t},\n\t\"toggle2\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"▫\",\n\t\t\t\"▪\"\n\t\t]\n\t},\n\t\"toggle3\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"□\",\n\t\t\t\"■\"\n\t\t]\n\t},\n\t\"toggle4\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"■\",\n\t\t\t\"□\",\n\t\t\t\"▪\",\n\t\t\t\"▫\"\n\t\t]\n\t},\n\t\"toggle5\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"▮\",\n\t\t\t\"▯\"\n\t\t]\n\t},\n\t\"toggle6\": {\n\t\t\"interval\": 300,\n\t\t\"frames\": [\n\t\t\t\"ဝ\",\n\t\t\t\"၀\"\n\t\t]\n\t},\n\t\"toggle7\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⦾\",\n\t\t\t\"⦿\"\n\t\t]\n\t},\n\t\"toggle8\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"◍\",\n\t\t\t\"◌\"\n\t\t]\n\t},\n\t\"toggle9\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"◉\",\n\t\t\t\"◎\"\n\t\t]\n\t},\n\t\"toggle10\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"㊂\",\n\t\t\t\"㊀\",\n\t\t\t\"㊁\"\n\t\t]\n\t},\n\t\"toggle11\": {\n\t\t\"interval\": 50,\n\t\t\"frames\": [\n\t\t\t\"⧇\",\n\t\t\t\"⧆\"\n\t\t]\n\t},\n\t\"toggle12\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"☗\",\n\t\t\t\"☖\"\n\t\t]\n\t},\n\t\"toggle13\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"=\",\n\t\t\t\"*\",\n\t\t\t\"-\"\n\t\t]\n\t},\n\t\"arrow\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"←\",\n\t\t\t\"↖\",\n\t\t\t\"↑\",\n\t\t\t\"↗\",\n\t\t\t\"→\",\n\t\t\t\"↘\",\n\t\t\t\"↓\",\n\t\t\t\"↙\"\n\t\t]\n\t},\n\t\"arrow2\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⬆️ \",\n\t\t\t\"↗️ \",\n\t\t\t\"➡️ \",\n\t\t\t\"↘️ \",\n\t\t\t\"⬇️ \",\n\t\t\t\"↙️ \",\n\t\t\t\"⬅️ \",\n\t\t\t\"↖️ \"\n\t\t]\n\t},\n\t\"arrow3\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"▹▹▹▹▹\",\n\t\t\t\"▸▹▹▹▹\",\n\t\t\t\"▹▸▹▹▹\",\n\t\t\t\"▹▹▸▹▹\",\n\t\t\t\"▹▹▹▸▹\",\n\t\t\t\"▹▹▹▹▸\"\n\t\t]\n\t},\n\t\"bouncingBar\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"[ ]\",\n\t\t\t\"[= ]\",\n\t\t\t\"[== ]\",\n\t\t\t\"[=== ]\",\n\t\t\t\"[====]\",\n\t\t\t\"[ ===]\",\n\t\t\t\"[ ==]\",\n\t\t\t\"[ =]\",\n\t\t\t\"[ ]\",\n\t\t\t\"[ =]\",\n\t\t\t\"[ ==]\",\n\t\t\t\"[ ===]\",\n\t\t\t\"[====]\",\n\t\t\t\"[=== ]\",\n\t\t\t\"[== ]\",\n\t\t\t\"[= ]\"\n\t\t]\n\t},\n\t\"bouncingBall\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ●)\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"(● )\"\n\t\t]\n\t},\n\t\"smiley\": {\n\t\t\"interval\": 200,\n\t\t\"frames\": [\n\t\t\t\"😄 \",\n\t\t\t\"😝 \"\n\t\t]\n\t},\n\t\"monkey\": {\n\t\t\"interval\": 300,\n\t\t\"frames\": [\n\t\t\t\"🙈 \",\n\t\t\t\"🙈 \",\n\t\t\t\"🙉 \",\n\t\t\t\"🙊 \"\n\t\t]\n\t},\n\t\"hearts\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"💛 \",\n\t\t\t\"💙 \",\n\t\t\t\"💜 \",\n\t\t\t\"💚 \",\n\t\t\t\"❤️ \"\n\t\t]\n\t},\n\t\"clock\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"🕛 \",\n\t\t\t\"🕐 \",\n\t\t\t\"🕑 \",\n\t\t\t\"🕒 \",\n\t\t\t\"🕓 \",\n\t\t\t\"🕔 \",\n\t\t\t\"🕕 \",\n\t\t\t\"🕖 \",\n\t\t\t\"🕗 \",\n\t\t\t\"🕘 \",\n\t\t\t\"🕙 \",\n\t\t\t\"🕚 \"\n\t\t]\n\t},\n\t\"earth\": {\n\t\t\"interval\": 180,\n\t\t\"frames\": [\n\t\t\t\"🌍 \",\n\t\t\t\"🌎 \",\n\t\t\t\"🌏 \"\n\t\t]\n\t},\n\t\"material\": {\n\t\t\"interval\": 17,\n\t\t\"frames\": [\n\t\t\t\"█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"███████▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"████████▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"██████████▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"███████████▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████████▁▁▁▁▁▁▁\",\n\t\t\t\"██████████████▁▁▁▁▁▁\",\n\t\t\t\"██████████████▁▁▁▁▁▁\",\n\t\t\t\"▁██████████████▁▁▁▁▁\",\n\t\t\t\"▁██████████████▁▁▁▁▁\",\n\t\t\t\"▁██████████████▁▁▁▁▁\",\n\t\t\t\"▁▁██████████████▁▁▁▁\",\n\t\t\t\"▁▁▁██████████████▁▁▁\",\n\t\t\t\"▁▁▁▁█████████████▁▁▁\",\n\t\t\t\"▁▁▁▁██████████████▁▁\",\n\t\t\t\"▁▁▁▁██████████████▁▁\",\n\t\t\t\"▁▁▁▁▁██████████████▁\",\n\t\t\t\"▁▁▁▁▁██████████████▁\",\n\t\t\t\"▁▁▁▁▁██████████████▁\",\n\t\t\t\"▁▁▁▁▁▁██████████████\",\n\t\t\t\"▁▁▁▁▁▁██████████████\",\n\t\t\t\"▁▁▁▁▁▁▁█████████████\",\n\t\t\t\"▁▁▁▁▁▁▁█████████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁████████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁████████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁███████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁███████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁██████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁██████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁███████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████\",\n\t\t\t\"█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\n\t\t\t\"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\n\t\t\t\"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\n\t\t\t\"███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\n\t\t\t\"████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\n\t\t\t\"█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"██████▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"████████▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"███████████▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"████████████▁▁▁▁▁▁▁▁\",\n\t\t\t\"████████████▁▁▁▁▁▁▁▁\",\n\t\t\t\"██████████████▁▁▁▁▁▁\",\n\t\t\t\"██████████████▁▁▁▁▁▁\",\n\t\t\t\"▁██████████████▁▁▁▁▁\",\n\t\t\t\"▁██████████████▁▁▁▁▁\",\n\t\t\t\"▁▁▁█████████████▁▁▁▁\",\n\t\t\t\"▁▁▁▁▁████████████▁▁▁\",\n\t\t\t\"▁▁▁▁▁████████████▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁███████████▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁█████████▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁█████████▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁█████████▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁█████████▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁█████████▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁████████▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁████████▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁███████▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁███████▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁███████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁███████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\"\n\t\t]\n\t},\n\t\"moon\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"🌑 \",\n\t\t\t\"🌒 \",\n\t\t\t\"🌓 \",\n\t\t\t\"🌔 \",\n\t\t\t\"🌕 \",\n\t\t\t\"🌖 \",\n\t\t\t\"🌗 \",\n\t\t\t\"🌘 \"\n\t\t]\n\t},\n\t\"runner\": {\n\t\t\"interval\": 140,\n\t\t\"frames\": [\n\t\t\t\"🚶 \",\n\t\t\t\"🏃 \"\n\t\t]\n\t},\n\t\"pong\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"▐⠂ ▌\",\n\t\t\t\"▐⠈ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⡀ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠈ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⡀ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠈ ▌\",\n\t\t\t\"▐ ⠂▌\",\n\t\t\t\"▐ ⠠▌\",\n\t\t\t\"▐ ⡀▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠈ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⡀ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠈ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⡀ ▌\",\n\t\t\t\"▐⠠ ▌\"\n\t\t]\n\t},\n\t\"shark\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"▐|\\\\____________▌\",\n\t\t\t\"▐_|\\\\___________▌\",\n\t\t\t\"▐__|\\\\__________▌\",\n\t\t\t\"▐___|\\\\_________▌\",\n\t\t\t\"▐____|\\\\________▌\",\n\t\t\t\"▐_____|\\\\_______▌\",\n\t\t\t\"▐______|\\\\______▌\",\n\t\t\t\"▐_______|\\\\_____▌\",\n\t\t\t\"▐________|\\\\____▌\",\n\t\t\t\"▐_________|\\\\___▌\",\n\t\t\t\"▐__________|\\\\__▌\",\n\t\t\t\"▐___________|\\\\_▌\",\n\t\t\t\"▐____________|\\\\▌\",\n\t\t\t\"▐____________/|▌\",\n\t\t\t\"▐___________/|_▌\",\n\t\t\t\"▐__________/|__▌\",\n\t\t\t\"▐_________/|___▌\",\n\t\t\t\"▐________/|____▌\",\n\t\t\t\"▐_______/|_____▌\",\n\t\t\t\"▐______/|______▌\",\n\t\t\t\"▐_____/|_______▌\",\n\t\t\t\"▐____/|________▌\",\n\t\t\t\"▐___/|_________▌\",\n\t\t\t\"▐__/|__________▌\",\n\t\t\t\"▐_/|___________▌\",\n\t\t\t\"▐/|____________▌\"\n\t\t]\n\t},\n\t\"dqpb\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"d\",\n\t\t\t\"q\",\n\t\t\t\"p\",\n\t\t\t\"b\"\n\t\t]\n\t},\n\t\"weather\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"☀️ \",\n\t\t\t\"☀️ \",\n\t\t\t\"☀️ \",\n\t\t\t\"🌤 \",\n\t\t\t\"⛅️ \",\n\t\t\t\"🌥 \",\n\t\t\t\"☁️ \",\n\t\t\t\"🌧 \",\n\t\t\t\"🌨 \",\n\t\t\t\"🌧 \",\n\t\t\t\"🌨 \",\n\t\t\t\"🌧 \",\n\t\t\t\"🌨 \",\n\t\t\t\"⛈ \",\n\t\t\t\"🌨 \",\n\t\t\t\"🌧 \",\n\t\t\t\"🌨 \",\n\t\t\t\"☁️ \",\n\t\t\t\"🌥 \",\n\t\t\t\"⛅️ \",\n\t\t\t\"🌤 \",\n\t\t\t\"☀️ \",\n\t\t\t\"☀️ \"\n\t\t]\n\t},\n\t\"christmas\": {\n\t\t\"interval\": 400,\n\t\t\"frames\": [\n\t\t\t\"🌲\",\n\t\t\t\"🎄\"\n\t\t]\n\t},\n\t\"grenade\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"، \",\n\t\t\t\"′ \",\n\t\t\t\" ´ \",\n\t\t\t\" ‾ \",\n\t\t\t\" ⸌\",\n\t\t\t\" ⸊\",\n\t\t\t\" |\",\n\t\t\t\" ⁎\",\n\t\t\t\" ⁕\",\n\t\t\t\" ෴ \",\n\t\t\t\" ⁓\",\n\t\t\t\" \",\n\t\t\t\" \",\n\t\t\t\" \"\n\t\t]\n\t},\n\t\"point\": {\n\t\t\"interval\": 125,\n\t\t\"frames\": [\n\t\t\t\"∙∙∙\",\n\t\t\t\"●∙∙\",\n\t\t\t\"∙●∙\",\n\t\t\t\"∙∙●\",\n\t\t\t\"∙∙∙\"\n\t\t]\n\t},\n\t\"layer\": {\n\t\t\"interval\": 150,\n\t\t\"frames\": [\n\t\t\t\"-\",\n\t\t\t\"=\",\n\t\t\t\"≡\"\n\t\t]\n\t},\n\t\"betaWave\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"ρββββββ\",\n\t\t\t\"βρβββββ\",\n\t\t\t\"ββρββββ\",\n\t\t\t\"βββρβββ\",\n\t\t\t\"ββββρββ\",\n\t\t\t\"βββββρβ\",\n\t\t\t\"ββββββρ\"\n\t\t]\n\t},\n\t\"fingerDance\": {\n\t\t\"interval\": 160,\n\t\t\"frames\": [\n\t\t\t\"🤘 \",\n\t\t\t\"🤟 \",\n\t\t\t\"🖖 \",\n\t\t\t\"✋ \",\n\t\t\t\"🤚 \",\n\t\t\t\"👆 \"\n\t\t]\n\t},\n\t\"fistBump\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"🤜\\u3000\\u3000\\u3000\\u3000🤛 \",\n\t\t\t\"🤜\\u3000\\u3000\\u3000\\u3000🤛 \",\n\t\t\t\"🤜\\u3000\\u3000\\u3000\\u3000🤛 \",\n\t\t\t\"\\u3000🤜\\u3000\\u3000🤛\\u3000 \",\n\t\t\t\"\\u3000\\u3000🤜🤛\\u3000\\u3000 \",\n\t\t\t\"\\u3000🤜✨🤛\\u3000\\u3000 \",\n\t\t\t\"🤜\\u3000✨\\u3000🤛\\u3000 \"\n\t\t]\n\t},\n\t\"soccerHeader\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\" 🧑⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \"\n\t\t]\n\t},\n\t\"mindblown\": {\n\t\t\"interval\": 160,\n\t\t\"frames\": [\n\t\t\t\"😐 \",\n\t\t\t\"😐 \",\n\t\t\t\"😮 \",\n\t\t\t\"😮 \",\n\t\t\t\"😦 \",\n\t\t\t\"😦 \",\n\t\t\t\"😧 \",\n\t\t\t\"😧 \",\n\t\t\t\"🤯 \",\n\t\t\t\"💥 \",\n\t\t\t\"✨ \",\n\t\t\t\"\\u3000 \",\n\t\t\t\"\\u3000 \",\n\t\t\t\"\\u3000 \"\n\t\t]\n\t},\n\t\"speaker\": {\n\t\t\"interval\": 160,\n\t\t\"frames\": [\n\t\t\t\"🔈 \",\n\t\t\t\"🔉 \",\n\t\t\t\"🔊 \",\n\t\t\t\"🔉 \"\n\t\t]\n\t},\n\t\"orangePulse\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"🔸 \",\n\t\t\t\"🔶 \",\n\t\t\t\"🟠 \",\n\t\t\t\"🟠 \",\n\t\t\t\"🔶 \"\n\t\t]\n\t},\n\t\"bluePulse\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"🔹 \",\n\t\t\t\"🔷 \",\n\t\t\t\"🔵 \",\n\t\t\t\"🔵 \",\n\t\t\t\"🔷 \"\n\t\t]\n\t},\n\t\"orangeBluePulse\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"🔸 \",\n\t\t\t\"🔶 \",\n\t\t\t\"🟠 \",\n\t\t\t\"🟠 \",\n\t\t\t\"🔶 \",\n\t\t\t\"🔹 \",\n\t\t\t\"🔷 \",\n\t\t\t\"🔵 \",\n\t\t\t\"🔵 \",\n\t\t\t\"🔷 \"\n\t\t]\n\t},\n\t\"timeTravel\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"🕛 \",\n\t\t\t\"🕚 \",\n\t\t\t\"🕙 \",\n\t\t\t\"🕘 \",\n\t\t\t\"🕗 \",\n\t\t\t\"🕖 \",\n\t\t\t\"🕕 \",\n\t\t\t\"🕔 \",\n\t\t\t\"🕓 \",\n\t\t\t\"🕒 \",\n\t\t\t\"🕑 \",\n\t\t\t\"🕐 \"\n\t\t]\n\t},\n\t\"aesthetic\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"▰▱▱▱▱▱▱\",\n\t\t\t\"▰▰▱▱▱▱▱\",\n\t\t\t\"▰▰▰▱▱▱▱\",\n\t\t\t\"▰▰▰▰▱▱▱\",\n\t\t\t\"▰▰▰▰▰▱▱\",\n\t\t\t\"▰▰▰▰▰▰▱\",\n\t\t\t\"▰▰▰▰▰▰▰\",\n\t\t\t\"▰▱▱▱▱▱▱\"\n\t\t]\n\t},\n\t\"dwarfFortress\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\" ██████£££ \",\n\t\t\t\"☺██████£££ \",\n\t\t\t\"☺██████£££ \",\n\t\t\t\"☺▓█████£££ \",\n\t\t\t\"☺▓█████£££ \",\n\t\t\t\"☺▒█████£££ \",\n\t\t\t\"☺▒█████£££ \",\n\t\t\t\"☺░█████£££ \",\n\t\t\t\"☺░█████£££ \",\n\t\t\t\"☺ █████£££ \",\n\t\t\t\" ☺█████£££ \",\n\t\t\t\" ☺█████£££ \",\n\t\t\t\" ☺▓████£££ \",\n\t\t\t\" ☺▓████£££ \",\n\t\t\t\" ☺▒████£££ \",\n\t\t\t\" ☺▒████£££ \",\n\t\t\t\" ☺░████£££ \",\n\t\t\t\" ☺░████£££ \",\n\t\t\t\" ☺ ████£££ \",\n\t\t\t\" ☺████£££ \",\n\t\t\t\" ☺████£££ \",\n\t\t\t\" ☺▓███£££ \",\n\t\t\t\" ☺▓███£££ \",\n\t\t\t\" ☺▒███£££ \",\n\t\t\t\" ☺▒███£££ \",\n\t\t\t\" ☺░███£££ \",\n\t\t\t\" ☺░███£££ \",\n\t\t\t\" ☺ ███£££ \",\n\t\t\t\" ☺███£££ \",\n\t\t\t\" ☺███£££ \",\n\t\t\t\" ☺▓██£££ \",\n\t\t\t\" ☺▓██£££ \",\n\t\t\t\" ☺▒██£££ \",\n\t\t\t\" ☺▒██£££ \",\n\t\t\t\" ☺░██£££ \",\n\t\t\t\" ☺░██£££ \",\n\t\t\t\" ☺ ██£££ \",\n\t\t\t\" ☺██£££ \",\n\t\t\t\" ☺██£££ \",\n\t\t\t\" ☺▓█£££ \",\n\t\t\t\" ☺▓█£££ \",\n\t\t\t\" ☺▒█£££ \",\n\t\t\t\" ☺▒█£££ \",\n\t\t\t\" ☺░█£££ \",\n\t\t\t\" ☺░█£££ \",\n\t\t\t\" ☺ █£££ \",\n\t\t\t\" ☺█£££ \",\n\t\t\t\" ☺█£££ \",\n\t\t\t\" ☺▓£££ \",\n\t\t\t\" ☺▓£££ \",\n\t\t\t\" ☺▒£££ \",\n\t\t\t\" ☺▒£££ \",\n\t\t\t\" ☺░£££ \",\n\t\t\t\" ☺░£££ \",\n\t\t\t\" ☺ £££ \",\n\t\t\t\" ☺£££ \",\n\t\t\t\" ☺£££ \",\n\t\t\t\" ☺▓££ \",\n\t\t\t\" ☺▓££ \",\n\t\t\t\" ☺▒££ \",\n\t\t\t\" ☺▒££ \",\n\t\t\t\" ☺░££ \",\n\t\t\t\" ☺░££ \",\n\t\t\t\" ☺ ££ \",\n\t\t\t\" ☺££ \",\n\t\t\t\" ☺££ \",\n\t\t\t\" ☺▓£ \",\n\t\t\t\" ☺▓£ \",\n\t\t\t\" ☺▒£ \",\n\t\t\t\" ☺▒£ \",\n\t\t\t\" ☺░£ \",\n\t\t\t\" ☺░£ \",\n\t\t\t\" ☺ £ \",\n\t\t\t\" ☺£ \",\n\t\t\t\" ☺£ \",\n\t\t\t\" ☺▓ \",\n\t\t\t\" ☺▓ \",\n\t\t\t\" ☺▒ \",\n\t\t\t\" ☺▒ \",\n\t\t\t\" ☺░ \",\n\t\t\t\" ☺░ \",\n\t\t\t\" ☺ \",\n\t\t\t\" ☺ &\",\n\t\t\t\" ☺ ☼&\",\n\t\t\t\" ☺ ☼ &\",\n\t\t\t\" ☺☼ &\",\n\t\t\t\" ☺☼ & \",\n\t\t\t\" ‼ & \",\n\t\t\t\" ☺ & \",\n\t\t\t\" ‼ & \",\n\t\t\t\" ☺ & \",\n\t\t\t\" ‼ & \",\n\t\t\t\" ☺ & \",\n\t\t\t\"‼ & \",\n\t\t\t\" & \",\n\t\t\t\" & \",\n\t\t\t\" & ░ \",\n\t\t\t\" & ▒ \",\n\t\t\t\" & ▓ \",\n\t\t\t\" & £ \",\n\t\t\t\" & ░£ \",\n\t\t\t\" & ▒£ \",\n\t\t\t\" & ▓£ \",\n\t\t\t\" & ££ \",\n\t\t\t\" & ░££ \",\n\t\t\t\" & ▒££ \",\n\t\t\t\"& ▓££ \",\n\t\t\t\"& £££ \",\n\t\t\t\" ░£££ \",\n\t\t\t\" ▒£££ \",\n\t\t\t\" ▓£££ \",\n\t\t\t\" █£££ \",\n\t\t\t\" ░█£££ \",\n\t\t\t\" ▒█£££ \",\n\t\t\t\" ▓█£££ \",\n\t\t\t\" ██£££ \",\n\t\t\t\" ░██£££ \",\n\t\t\t\" ▒██£££ \",\n\t\t\t\" ▓██£££ \",\n\t\t\t\" ███£££ \",\n\t\t\t\" ░███£££ \",\n\t\t\t\" ▒███£££ \",\n\t\t\t\" ▓███£££ \",\n\t\t\t\" ████£££ \",\n\t\t\t\" ░████£££ \",\n\t\t\t\" ▒████£££ \",\n\t\t\t\" ▓████£££ \",\n\t\t\t\" █████£££ \",\n\t\t\t\" ░█████£££ \",\n\t\t\t\" ▒█████£££ \",\n\t\t\t\" ▓█████£££ \",\n\t\t\t\" ██████£££ \",\n\t\t\t\" ██████£££ \"\n\t\t]\n\t}\n}\n","'use strict';\n\nconst spinners = Object.assign({}, require('./spinners.json')); // eslint-disable-line import/extensions\n\nconst spinnersList = Object.keys(spinners);\n\nObject.defineProperty(spinners, 'random', {\n\tget() {\n\t\tconst randomIndex = Math.floor(Math.random() * spinnersList.length);\n\t\tconst spinnerName = spinnersList[randomIndex];\n\t\treturn spinners[spinnerName];\n\t}\n});\n\nmodule.exports = spinners;\n","'use strict'\nconst ParserEND = 0x110000\nclass ParserError extends Error {\n /* istanbul ignore next */\n constructor (msg, filename, linenumber) {\n super('[ParserError] ' + msg, filename, linenumber)\n this.name = 'ParserError'\n this.code = 'ParserError'\n if (Error.captureStackTrace) Error.captureStackTrace(this, ParserError)\n }\n}\nclass State {\n constructor (parser) {\n this.parser = parser\n this.buf = ''\n this.returned = null\n this.result = null\n this.resultTable = null\n this.resultArr = null\n }\n}\nclass Parser {\n constructor () {\n this.pos = 0\n this.col = 0\n this.line = 0\n this.obj = {}\n this.ctx = this.obj\n this.stack = []\n this._buf = ''\n this.char = null\n this.ii = 0\n this.state = new State(this.parseStart)\n }\n\n parse (str) {\n /* istanbul ignore next */\n if (str.length === 0 || str.length == null) return\n\n this._buf = String(str)\n this.ii = -1\n this.char = -1\n let getNext\n while (getNext === false || this.nextChar()) {\n getNext = this.runOne()\n }\n this._buf = null\n }\n nextChar () {\n if (this.char === 0x0A) {\n ++this.line\n this.col = -1\n }\n ++this.ii\n this.char = this._buf.codePointAt(this.ii)\n ++this.pos\n ++this.col\n return this.haveBuffer()\n }\n haveBuffer () {\n return this.ii < this._buf.length\n }\n runOne () {\n return this.state.parser.call(this, this.state.returned)\n }\n finish () {\n this.char = ParserEND\n let last\n do {\n last = this.state.parser\n this.runOne()\n } while (this.state.parser !== last)\n\n this.ctx = null\n this.state = null\n this._buf = null\n\n return this.obj\n }\n next (fn) {\n /* istanbul ignore next */\n if (typeof fn !== 'function') throw new ParserError('Tried to set state to non-existent state: ' + JSON.stringify(fn))\n this.state.parser = fn\n }\n goto (fn) {\n this.next(fn)\n return this.runOne()\n }\n call (fn, returnWith) {\n if (returnWith) this.next(returnWith)\n this.stack.push(this.state)\n this.state = new State(fn)\n }\n callNow (fn, returnWith) {\n this.call(fn, returnWith)\n return this.runOne()\n }\n return (value) {\n /* istanbul ignore next */\n if (this.stack.length === 0) throw this.error(new ParserError('Stack underflow'))\n if (value === undefined) value = this.state.buf\n this.state = this.stack.pop()\n this.state.returned = value\n }\n returnNow (value) {\n this.return(value)\n return this.runOne()\n }\n consume () {\n /* istanbul ignore next */\n if (this.char === ParserEND) throw this.error(new ParserError('Unexpected end-of-buffer'))\n this.state.buf += this._buf[this.ii]\n }\n error (err) {\n err.line = this.line\n err.col = this.col\n err.pos = this.pos\n return err\n }\n /* istanbul ignore next */\n parseStart () {\n throw new ParserError('Must declare a parseStart method')\n }\n}\nParser.END = ParserEND\nParser.Error = ParserError\nmodule.exports = Parser\n","'use strict'\nmodule.exports = value => {\n const date = new Date(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nmodule.exports = (d, num) => {\n num = String(num)\n while (num.length < d) num = '0' + num\n return num\n}\n","'use strict'\nconst f = require('./format-num.js')\n\nclass FloatingDateTime extends Date {\n constructor (value) {\n super(value + 'Z')\n this.isFloating = true\n }\n toISOString () {\n const date = `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`\n const time = `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`\n return `${date}T${time}`\n }\n}\n\nmodule.exports = value => {\n const date = new FloatingDateTime(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nconst f = require('./format-num.js')\nconst DateTime = global.Date\n\nclass Date extends DateTime {\n constructor (value) {\n super(value)\n this.isDate = true\n }\n toISOString () {\n return `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`\n }\n}\n\nmodule.exports = value => {\n const date = new Date(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nconst f = require('./format-num.js')\n\nclass Time extends Date {\n constructor (value) {\n super(`0000-01-01T${value}Z`)\n this.isTime = true\n }\n toISOString () {\n return `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`\n }\n}\n\nmodule.exports = value => {\n const date = new Time(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\n/* eslint-disable no-new-wrappers, no-eval, camelcase, operator-linebreak */\nmodule.exports = makeParserClass(require('./parser.js'))\nmodule.exports.makeParserClass = makeParserClass\n\nclass TomlError extends Error {\n constructor (msg) {\n super(msg)\n this.name = 'TomlError'\n /* istanbul ignore next */\n if (Error.captureStackTrace) Error.captureStackTrace(this, TomlError)\n this.fromTOML = true\n this.wrapped = null\n }\n}\nTomlError.wrap = err => {\n const terr = new TomlError(err.message)\n terr.code = err.code\n terr.wrapped = err\n return terr\n}\nmodule.exports.TomlError = TomlError\n\nconst createDateTime = require('./create-datetime.js')\nconst createDateTimeFloat = require('./create-datetime-float.js')\nconst createDate = require('./create-date.js')\nconst createTime = require('./create-time.js')\n\nconst CTRL_I = 0x09\nconst CTRL_J = 0x0A\nconst CTRL_M = 0x0D\nconst CTRL_CHAR_BOUNDARY = 0x1F // the last non-character in the latin1 region of unicode, except DEL\nconst CHAR_SP = 0x20\nconst CHAR_QUOT = 0x22\nconst CHAR_NUM = 0x23\nconst CHAR_APOS = 0x27\nconst CHAR_PLUS = 0x2B\nconst CHAR_COMMA = 0x2C\nconst CHAR_HYPHEN = 0x2D\nconst CHAR_PERIOD = 0x2E\nconst CHAR_0 = 0x30\nconst CHAR_1 = 0x31\nconst CHAR_7 = 0x37\nconst CHAR_9 = 0x39\nconst CHAR_COLON = 0x3A\nconst CHAR_EQUALS = 0x3D\nconst CHAR_A = 0x41\nconst CHAR_E = 0x45\nconst CHAR_F = 0x46\nconst CHAR_T = 0x54\nconst CHAR_U = 0x55\nconst CHAR_Z = 0x5A\nconst CHAR_LOWBAR = 0x5F\nconst CHAR_a = 0x61\nconst CHAR_b = 0x62\nconst CHAR_e = 0x65\nconst CHAR_f = 0x66\nconst CHAR_i = 0x69\nconst CHAR_l = 0x6C\nconst CHAR_n = 0x6E\nconst CHAR_o = 0x6F\nconst CHAR_r = 0x72\nconst CHAR_s = 0x73\nconst CHAR_t = 0x74\nconst CHAR_u = 0x75\nconst CHAR_x = 0x78\nconst CHAR_z = 0x7A\nconst CHAR_LCUB = 0x7B\nconst CHAR_RCUB = 0x7D\nconst CHAR_LSQB = 0x5B\nconst CHAR_BSOL = 0x5C\nconst CHAR_RSQB = 0x5D\nconst CHAR_DEL = 0x7F\nconst SURROGATE_FIRST = 0xD800\nconst SURROGATE_LAST = 0xDFFF\n\nconst escapes = {\n [CHAR_b]: '\\u0008',\n [CHAR_t]: '\\u0009',\n [CHAR_n]: '\\u000A',\n [CHAR_f]: '\\u000C',\n [CHAR_r]: '\\u000D',\n [CHAR_QUOT]: '\\u0022',\n [CHAR_BSOL]: '\\u005C'\n}\n\nfunction isDigit (cp) {\n return cp >= CHAR_0 && cp <= CHAR_9\n}\nfunction isHexit (cp) {\n return (cp >= CHAR_A && cp <= CHAR_F) || (cp >= CHAR_a && cp <= CHAR_f) || (cp >= CHAR_0 && cp <= CHAR_9)\n}\nfunction isBit (cp) {\n return cp === CHAR_1 || cp === CHAR_0\n}\nfunction isOctit (cp) {\n return (cp >= CHAR_0 && cp <= CHAR_7)\n}\nfunction isAlphaNumQuoteHyphen (cp) {\n return (cp >= CHAR_A && cp <= CHAR_Z)\n || (cp >= CHAR_a && cp <= CHAR_z)\n || (cp >= CHAR_0 && cp <= CHAR_9)\n || cp === CHAR_APOS\n || cp === CHAR_QUOT\n || cp === CHAR_LOWBAR\n || cp === CHAR_HYPHEN\n}\nfunction isAlphaNumHyphen (cp) {\n return (cp >= CHAR_A && cp <= CHAR_Z)\n || (cp >= CHAR_a && cp <= CHAR_z)\n || (cp >= CHAR_0 && cp <= CHAR_9)\n || cp === CHAR_LOWBAR\n || cp === CHAR_HYPHEN\n}\nconst _type = Symbol('type')\nconst _declared = Symbol('declared')\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst defineProperty = Object.defineProperty\nconst descriptor = {configurable: true, enumerable: true, writable: true, value: undefined}\n\nfunction hasKey (obj, key) {\n if (hasOwnProperty.call(obj, key)) return true\n if (key === '__proto__') defineProperty(obj, '__proto__', descriptor)\n return false\n}\n\nconst INLINE_TABLE = Symbol('inline-table')\nfunction InlineTable () {\n return Object.defineProperties({}, {\n [_type]: {value: INLINE_TABLE}\n })\n}\nfunction isInlineTable (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INLINE_TABLE\n}\n\nconst TABLE = Symbol('table')\nfunction Table () {\n return Object.defineProperties({}, {\n [_type]: {value: TABLE},\n [_declared]: {value: false, writable: true}\n })\n}\nfunction isTable (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === TABLE\n}\n\nconst _contentType = Symbol('content-type')\nconst INLINE_LIST = Symbol('inline-list')\nfunction InlineList (type) {\n return Object.defineProperties([], {\n [_type]: {value: INLINE_LIST},\n [_contentType]: {value: type}\n })\n}\nfunction isInlineList (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INLINE_LIST\n}\n\nconst LIST = Symbol('list')\nfunction List () {\n return Object.defineProperties([], {\n [_type]: {value: LIST}\n })\n}\nfunction isList (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === LIST\n}\n\n// in an eval, to let bundlers not slurp in a util proxy\nlet _custom\ntry {\n const utilInspect = eval(\"require('util').inspect\")\n _custom = utilInspect.custom\n} catch (_) {\n /* eval require not available in transpiled bundle */\n}\n/* istanbul ignore next */\nconst _inspect = _custom || 'inspect'\n\nclass BoxedBigInt {\n constructor (value) {\n try {\n this.value = global.BigInt.asIntN(64, value)\n } catch (_) {\n /* istanbul ignore next */\n this.value = null\n }\n Object.defineProperty(this, _type, {value: INTEGER})\n }\n isNaN () {\n return this.value === null\n }\n /* istanbul ignore next */\n toString () {\n return String(this.value)\n }\n /* istanbul ignore next */\n [_inspect] () {\n return `[BigInt: ${this.toString()}]}`\n }\n valueOf () {\n return this.value\n }\n}\n\nconst INTEGER = Symbol('integer')\nfunction Integer (value) {\n let num = Number(value)\n // -0 is a float thing, not an int thing\n if (Object.is(num, -0)) num = 0\n /* istanbul ignore else */\n if (global.BigInt && !Number.isSafeInteger(num)) {\n return new BoxedBigInt(value)\n } else {\n /* istanbul ignore next */\n return Object.defineProperties(new Number(num), {\n isNaN: {value: function () { return isNaN(this) }},\n [_type]: {value: INTEGER},\n [_inspect]: {value: () => `[Integer: ${value}]`}\n })\n }\n}\nfunction isInteger (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INTEGER\n}\n\nconst FLOAT = Symbol('float')\nfunction Float (value) {\n /* istanbul ignore next */\n return Object.defineProperties(new Number(value), {\n [_type]: {value: FLOAT},\n [_inspect]: {value: () => `[Float: ${value}]`}\n })\n}\nfunction isFloat (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === FLOAT\n}\n\nfunction tomlType (value) {\n const type = typeof value\n if (type === 'object') {\n /* istanbul ignore if */\n if (value === null) return 'null'\n if (value instanceof Date) return 'datetime'\n /* istanbul ignore else */\n if (_type in value) {\n switch (value[_type]) {\n case INLINE_TABLE: return 'inline-table'\n case INLINE_LIST: return 'inline-list'\n /* istanbul ignore next */\n case TABLE: return 'table'\n /* istanbul ignore next */\n case LIST: return 'list'\n case FLOAT: return 'float'\n case INTEGER: return 'integer'\n }\n }\n }\n return type\n}\n\nfunction makeParserClass (Parser) {\n class TOMLParser extends Parser {\n constructor () {\n super()\n this.ctx = this.obj = Table()\n }\n\n /* MATCH HELPER */\n atEndOfWord () {\n return this.char === CHAR_NUM || this.char === CTRL_I || this.char === CHAR_SP || this.atEndOfLine()\n }\n atEndOfLine () {\n return this.char === Parser.END || this.char === CTRL_J || this.char === CTRL_M\n }\n\n parseStart () {\n if (this.char === Parser.END) {\n return null\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseTableOrList)\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else if (isAlphaNumQuoteHyphen(this.char)) {\n return this.callNow(this.parseAssignStatement)\n } else {\n throw this.error(new TomlError(`Unknown character \"${this.char}\"`))\n }\n }\n\n // HELPER, this strips any whitespace and comments to the end of the line\n // then RETURNS. Last state in a production.\n parseWhitespaceToEOL () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else if (this.char === CHAR_NUM) {\n return this.goto(this.parseComment)\n } else if (this.char === Parser.END || this.char === CTRL_J) {\n return this.return()\n } else {\n throw this.error(new TomlError('Unexpected character, expected only whitespace or comments till end of line'))\n }\n }\n\n /* ASSIGNMENT: key = value */\n parseAssignStatement () {\n return this.callNow(this.parseAssign, this.recordAssignStatement)\n }\n recordAssignStatement (kv) {\n let target = this.ctx\n let finalKey = kv.key.pop()\n for (let kw of kv.key) {\n if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n target = target[kw] = target[kw] || Table()\n }\n if (hasKey(target, finalKey)) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n // unbox our numbers\n if (isInteger(kv.value) || isFloat(kv.value)) {\n target[finalKey] = kv.value.valueOf()\n } else {\n target[finalKey] = kv.value\n }\n return this.goto(this.parseWhitespaceToEOL)\n }\n\n /* ASSSIGNMENT expression, key = value possibly inside an inline table */\n parseAssign () {\n return this.callNow(this.parseKeyword, this.recordAssignKeyword)\n }\n recordAssignKeyword (key) {\n if (this.state.resultTable) {\n this.state.resultTable.push(key)\n } else {\n this.state.resultTable = [key]\n }\n return this.goto(this.parseAssignKeywordPreDot)\n }\n parseAssignKeywordPreDot () {\n if (this.char === CHAR_PERIOD) {\n return this.next(this.parseAssignKeywordPostDot)\n } else if (this.char !== CHAR_SP && this.char !== CTRL_I) {\n return this.goto(this.parseAssignEqual)\n }\n }\n parseAssignKeywordPostDot () {\n if (this.char !== CHAR_SP && this.char !== CTRL_I) {\n return this.callNow(this.parseKeyword, this.recordAssignKeyword)\n }\n }\n\n parseAssignEqual () {\n if (this.char === CHAR_EQUALS) {\n return this.next(this.parseAssignPreValue)\n } else {\n throw this.error(new TomlError('Invalid character, expected \"=\"'))\n }\n }\n parseAssignPreValue () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseValue, this.recordAssignValue)\n }\n }\n recordAssignValue (value) {\n return this.returnNow({key: this.state.resultTable, value: value})\n }\n\n /* COMMENTS: #...eol */\n parseComment () {\n do {\n if (this.char === Parser.END || this.char === CTRL_J) {\n return this.return()\n }\n } while (this.nextChar())\n }\n\n /* TABLES AND LISTS, [foo] and [[foo]] */\n parseTableOrList () {\n if (this.char === CHAR_LSQB) {\n this.next(this.parseList)\n } else {\n return this.goto(this.parseTable)\n }\n }\n\n /* TABLE [foo.bar.baz] */\n parseTable () {\n this.ctx = this.obj\n return this.goto(this.parseTableNext)\n }\n parseTableNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseKeyword, this.parseTableMore)\n }\n }\n parseTableMore (keyword) {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CHAR_RSQB) {\n if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n } else {\n this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table()\n this.ctx[_declared] = true\n }\n return this.next(this.parseWhitespaceToEOL)\n } else if (this.char === CHAR_PERIOD) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx = this.ctx[keyword] = Table()\n } else if (isTable(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword]\n } else if (isList(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1]\n } else {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n return this.next(this.parseTableNext)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n\n /* LIST [[a.b.c]] */\n parseList () {\n this.ctx = this.obj\n return this.goto(this.parseListNext)\n }\n parseListNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseKeyword, this.parseListMore)\n }\n }\n parseListMore (keyword) {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CHAR_RSQB) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx[keyword] = List()\n }\n if (isInlineList(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline array\"))\n } else if (isList(this.ctx[keyword])) {\n const next = Table()\n this.ctx[keyword].push(next)\n this.ctx = next\n } else {\n throw this.error(new TomlError(\"Can't redefine an existing key\"))\n }\n return this.next(this.parseListEnd)\n } else if (this.char === CHAR_PERIOD) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx = this.ctx[keyword] = Table()\n } else if (isInlineList(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline array\"))\n } else if (isInlineTable(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline table\"))\n } else if (isList(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1]\n } else if (isTable(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword]\n } else {\n throw this.error(new TomlError(\"Can't redefine an existing key\"))\n }\n return this.next(this.parseListNext)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n parseListEnd (keyword) {\n if (this.char === CHAR_RSQB) {\n return this.next(this.parseWhitespaceToEOL)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n\n /* VALUE string, number, boolean, inline list, inline object */\n parseValue () {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key without value'))\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseDoubleString)\n } if (this.char === CHAR_APOS) {\n return this.next(this.parseSingleString)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n return this.goto(this.parseNumberSign)\n } else if (this.char === CHAR_i) {\n return this.next(this.parseInf)\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan)\n } else if (isDigit(this.char)) {\n return this.goto(this.parseNumberOrDateTime)\n } else if (this.char === CHAR_t || this.char === CHAR_f) {\n return this.goto(this.parseBoolean)\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseInlineList, this.recordValue)\n } else if (this.char === CHAR_LCUB) {\n return this.call(this.parseInlineTable, this.recordValue)\n } else {\n throw this.error(new TomlError('Unexpected character, expecting string, number, datetime, boolean, inline array or inline table'))\n }\n }\n recordValue (value) {\n return this.returnNow(value)\n }\n\n parseInf () {\n if (this.char === CHAR_n) {\n return this.next(this.parseInf2)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"inf\", \"+inf\" or \"-inf\"'))\n }\n }\n parseInf2 () {\n if (this.char === CHAR_f) {\n if (this.state.buf === '-') {\n return this.return(-Infinity)\n } else {\n return this.return(Infinity)\n }\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"inf\", \"+inf\" or \"-inf\"'))\n }\n }\n\n parseNan () {\n if (this.char === CHAR_a) {\n return this.next(this.parseNan2)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"nan\"'))\n }\n }\n parseNan2 () {\n if (this.char === CHAR_n) {\n return this.return(NaN)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"nan\"'))\n }\n }\n\n /* KEYS, barewords or basic, literal, or dotted */\n parseKeyword () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseBasicString)\n } else if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralString)\n } else {\n return this.goto(this.parseBareKey)\n }\n }\n\n /* KEYS: barewords */\n parseBareKey () {\n do {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key ended without value'))\n } else if (isAlphaNumHyphen(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 0) {\n throw this.error(new TomlError('Empty bare keys are not allowed'))\n } else {\n return this.returnNow()\n }\n } while (this.nextChar())\n }\n\n /* STRINGS, single quoted (literal) */\n parseSingleString () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiStringMaybe)\n } else {\n return this.goto(this.parseLiteralString)\n }\n }\n parseLiteralString () {\n do {\n if (this.char === CHAR_APOS) {\n return this.return()\n } else if (this.atEndOfLine()) {\n throw this.error(new TomlError('Unterminated string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I)) {\n throw this.errorControlCharInString()\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n parseLiteralMultiStringMaybe () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiString)\n } else {\n return this.returnNow()\n }\n }\n parseLiteralMultiString () {\n if (this.char === CTRL_M) {\n return null\n } else if (this.char === CTRL_J) {\n return this.next(this.parseLiteralMultiStringContent)\n } else {\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n parseLiteralMultiStringContent () {\n do {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiEnd)\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated multi-line string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M)) {\n throw this.errorControlCharInString()\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n parseLiteralMultiEnd () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiEnd2)\n } else {\n this.state.buf += \"'\"\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n parseLiteralMultiEnd2 () {\n if (this.char === CHAR_APOS) {\n return this.return()\n } else {\n this.state.buf += \"''\"\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n\n /* STRINGS double quoted */\n parseDoubleString () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiStringMaybe)\n } else {\n return this.goto(this.parseBasicString)\n }\n }\n parseBasicString () {\n do {\n if (this.char === CHAR_BSOL) {\n return this.call(this.parseEscape, this.recordEscapeReplacement)\n } else if (this.char === CHAR_QUOT) {\n return this.return()\n } else if (this.atEndOfLine()) {\n throw this.error(new TomlError('Unterminated string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I)) {\n throw this.errorControlCharInString()\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n recordEscapeReplacement (replacement) {\n this.state.buf += replacement\n return this.goto(this.parseBasicString)\n }\n parseMultiStringMaybe () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiString)\n } else {\n return this.returnNow()\n }\n }\n parseMultiString () {\n if (this.char === CTRL_M) {\n return null\n } else if (this.char === CTRL_J) {\n return this.next(this.parseMultiStringContent)\n } else {\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiStringContent () {\n do {\n if (this.char === CHAR_BSOL) {\n return this.call(this.parseMultiEscape, this.recordMultiEscapeReplacement)\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiEnd)\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated multi-line string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M)) {\n throw this.errorControlCharInString()\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n errorControlCharInString () {\n let displayCode = '\\\\u00'\n if (this.char < 16) {\n displayCode += '0'\n }\n displayCode += this.char.toString(16)\n\n return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${displayCode} instead`))\n }\n recordMultiEscapeReplacement (replacement) {\n this.state.buf += replacement\n return this.goto(this.parseMultiStringContent)\n }\n parseMultiEnd () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiEnd2)\n } else {\n this.state.buf += '\"'\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiEnd2 () {\n if (this.char === CHAR_QUOT) {\n return this.return()\n } else {\n this.state.buf += '\"\"'\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiEscape () {\n if (this.char === CTRL_M || this.char === CTRL_J) {\n return this.next(this.parseMultiTrim)\n } else if (this.char === CHAR_SP || this.char === CTRL_I) {\n return this.next(this.parsePreMultiTrim)\n } else {\n return this.goto(this.parseEscape)\n }\n }\n parsePreMultiTrim () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CTRL_M || this.char === CTRL_J) {\n return this.next(this.parseMultiTrim)\n } else {\n throw this.error(new TomlError(\"Can't escape whitespace\"))\n }\n }\n parseMultiTrim () {\n // explicitly whitespace here, END should follow the same path as chars\n if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else {\n return this.returnNow()\n }\n }\n parseEscape () {\n if (this.char in escapes) {\n return this.return(escapes[this.char])\n } else if (this.char === CHAR_u) {\n return this.call(this.parseSmallUnicode, this.parseUnicodeReturn)\n } else if (this.char === CHAR_U) {\n return this.call(this.parseLargeUnicode, this.parseUnicodeReturn)\n } else {\n throw this.error(new TomlError('Unknown escape character: ' + this.char))\n }\n }\n parseUnicodeReturn (char) {\n try {\n const codePoint = parseInt(char, 16)\n if (codePoint >= SURROGATE_FIRST && codePoint <= SURROGATE_LAST) {\n throw this.error(new TomlError('Invalid unicode, character in range 0xD800 - 0xDFFF is reserved'))\n }\n return this.returnNow(String.fromCodePoint(codePoint))\n } catch (err) {\n throw this.error(TomlError.wrap(err))\n }\n }\n parseSmallUnicode () {\n if (!isHexit(this.char)) {\n throw this.error(new TomlError('Invalid character in unicode sequence, expected hex'))\n } else {\n this.consume()\n if (this.state.buf.length >= 4) return this.return()\n }\n }\n parseLargeUnicode () {\n if (!isHexit(this.char)) {\n throw this.error(new TomlError('Invalid character in unicode sequence, expected hex'))\n } else {\n this.consume()\n if (this.state.buf.length >= 8) return this.return()\n }\n }\n\n /* NUMBERS */\n parseNumberSign () {\n this.consume()\n return this.next(this.parseMaybeSignedInfOrNan)\n }\n parseMaybeSignedInfOrNan () {\n if (this.char === CHAR_i) {\n return this.next(this.parseInf)\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan)\n } else {\n return this.callNow(this.parseNoUnder, this.parseNumberIntegerStart)\n }\n }\n parseNumberIntegerStart () {\n if (this.char === CHAR_0) {\n this.consume()\n return this.next(this.parseNumberIntegerExponentOrDecimal)\n } else {\n return this.goto(this.parseNumberInteger)\n }\n }\n parseNumberIntegerExponentOrDecimal () {\n if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseNumberInteger () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseNoUnder () {\n if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD || this.char === CHAR_E || this.char === CHAR_e) {\n throw this.error(new TomlError('Unexpected character, expected digit'))\n } else if (this.atEndOfWord()) {\n throw this.error(new TomlError('Incomplete number'))\n }\n return this.returnNow()\n }\n parseNoUnderHexOctBinLiteral () {\n if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD) {\n throw this.error(new TomlError('Unexpected character, expected digit'))\n } else if (this.atEndOfWord()) {\n throw this.error(new TomlError('Incomplete number'))\n }\n return this.returnNow()\n }\n parseNumberFloat () {\n if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else {\n return this.returnNow(Float(this.state.buf))\n }\n }\n parseNumberExponentSign () {\n if (isDigit(this.char)) {\n return this.goto(this.parseNumberExponent)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.call(this.parseNoUnder, this.parseNumberExponent)\n } else {\n throw this.error(new TomlError('Unexpected character, expected -, + or digit'))\n }\n }\n parseNumberExponent () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder)\n } else {\n return this.returnNow(Float(this.state.buf))\n }\n }\n\n /* NUMBERS or DATETIMES */\n parseNumberOrDateTime () {\n if (this.char === CHAR_0) {\n this.consume()\n return this.next(this.parseNumberBaseOrDateTime)\n } else {\n return this.goto(this.parseNumberOrDateTimeOnly)\n }\n }\n parseNumberOrDateTimeOnly () {\n // note, if two zeros are in a row then it MUST be a date\n if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder, this.parseNumberInteger)\n } else if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length > 4) this.next(this.parseNumberInteger)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (this.char === CHAR_HYPHEN) {\n return this.goto(this.parseDateTime)\n } else if (this.char === CHAR_COLON) {\n return this.goto(this.parseOnlyTimeHour)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseDateTimeOnly () {\n if (this.state.buf.length < 4) {\n if (isDigit(this.char)) {\n return this.consume()\n } else if (this.char === CHAR_COLON) {\n return this.goto(this.parseOnlyTimeHour)\n } else {\n throw this.error(new TomlError('Expected digit while parsing year part of a date'))\n }\n } else {\n if (this.char === CHAR_HYPHEN) {\n return this.goto(this.parseDateTime)\n } else {\n throw this.error(new TomlError('Expected hyphen (-) while parsing year part of date'))\n }\n }\n }\n parseNumberBaseOrDateTime () {\n if (this.char === CHAR_b) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerBin)\n } else if (this.char === CHAR_o) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerOct)\n } else if (this.char === CHAR_x) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerHex)\n } else if (this.char === CHAR_PERIOD) {\n return this.goto(this.parseNumberInteger)\n } else if (isDigit(this.char)) {\n return this.goto(this.parseDateTimeOnly)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseIntegerHex () {\n if (isHexit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseIntegerOct () {\n if (isOctit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseIntegerBin () {\n if (isBit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n\n /* DATETIME */\n parseDateTime () {\n // we enter here having just consumed the year and about to consume the hyphen\n if (this.state.buf.length < 4) {\n throw this.error(new TomlError('Years less than 1000 must be zero padded to four characters'))\n }\n this.state.result = this.state.buf\n this.state.buf = ''\n return this.next(this.parseDateMonth)\n }\n parseDateMonth () {\n if (this.char === CHAR_HYPHEN) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Months less than 10 must be zero padded to two characters'))\n }\n this.state.result += '-' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseDateDay)\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseDateDay () {\n if (this.char === CHAR_T || this.char === CHAR_SP) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Days less than 10 must be zero padded to two characters'))\n }\n this.state.result += '-' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseStartTimeHour)\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDate(this.state.result + '-' + this.state.buf))\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseStartTimeHour () {\n if (this.atEndOfWord()) {\n return this.returnNow(createDate(this.state.result))\n } else {\n return this.goto(this.parseTimeHour)\n }\n }\n parseTimeHour () {\n if (this.char === CHAR_COLON) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Hours less than 10 must be zero padded to two characters'))\n }\n this.state.result += 'T' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeMin)\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseTimeMin () {\n if (this.state.buf.length < 2 && isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeSec)\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseTimeSec () {\n if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length === 2) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeZoneOrFraction)\n }\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n\n parseOnlyTimeHour () {\n /* istanbul ignore else */\n if (this.char === CHAR_COLON) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Hours less than 10 must be zero padded to two characters'))\n }\n this.state.result = this.state.buf\n this.state.buf = ''\n return this.next(this.parseOnlyTimeMin)\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeMin () {\n if (this.state.buf.length < 2 && isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseOnlyTimeSec)\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeSec () {\n if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length === 2) {\n return this.next(this.parseOnlyTimeFractionMaybe)\n }\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeFractionMaybe () {\n this.state.result += ':' + this.state.buf\n if (this.char === CHAR_PERIOD) {\n this.state.buf = ''\n this.next(this.parseOnlyTimeFraction)\n } else {\n return this.return(createTime(this.state.result))\n }\n }\n parseOnlyTimeFraction () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.atEndOfWord()) {\n if (this.state.buf.length === 0) throw this.error(new TomlError('Expected digit in milliseconds'))\n return this.returnNow(createTime(this.state.result + '.' + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n\n parseTimeZoneOrFraction () {\n if (this.char === CHAR_PERIOD) {\n this.consume()\n this.next(this.parseDateTimeFraction)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.next(this.parseTimeZoneHour)\n } else if (this.char === CHAR_Z) {\n this.consume()\n return this.return(createDateTime(this.state.result + this.state.buf))\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n parseDateTimeFraction () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 1) {\n throw this.error(new TomlError('Expected digit in milliseconds'))\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.next(this.parseTimeZoneHour)\n } else if (this.char === CHAR_Z) {\n this.consume()\n return this.return(createDateTime(this.state.result + this.state.buf))\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n parseTimeZoneHour () {\n if (isDigit(this.char)) {\n this.consume()\n // FIXME: No more regexps\n if (/\\d\\d$/.test(this.state.buf)) return this.next(this.parseTimeZoneSep)\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected digit'))\n }\n }\n parseTimeZoneSep () {\n if (this.char === CHAR_COLON) {\n this.consume()\n this.next(this.parseTimeZoneMin)\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected colon'))\n }\n }\n parseTimeZoneMin () {\n if (isDigit(this.char)) {\n this.consume()\n if (/\\d\\d$/.test(this.state.buf)) return this.return(createDateTime(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected digit'))\n }\n }\n\n /* BOOLEAN */\n parseBoolean () {\n /* istanbul ignore else */\n if (this.char === CHAR_t) {\n this.consume()\n return this.next(this.parseTrue_r)\n } else if (this.char === CHAR_f) {\n this.consume()\n return this.next(this.parseFalse_a)\n }\n }\n parseTrue_r () {\n if (this.char === CHAR_r) {\n this.consume()\n return this.next(this.parseTrue_u)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n parseTrue_u () {\n if (this.char === CHAR_u) {\n this.consume()\n return this.next(this.parseTrue_e)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n parseTrue_e () {\n if (this.char === CHAR_e) {\n return this.return(true)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_a () {\n if (this.char === CHAR_a) {\n this.consume()\n return this.next(this.parseFalse_l)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_l () {\n if (this.char === CHAR_l) {\n this.consume()\n return this.next(this.parseFalse_s)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_s () {\n if (this.char === CHAR_s) {\n this.consume()\n return this.next(this.parseFalse_e)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_e () {\n if (this.char === CHAR_e) {\n return this.return(false)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n /* INLINE LISTS */\n parseInlineList () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {\n return null\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CHAR_RSQB) {\n return this.return(this.state.resultArr || InlineList())\n } else {\n return this.callNow(this.parseValue, this.recordInlineListValue)\n }\n }\n recordInlineListValue (value) {\n if (this.state.resultArr) {\n const listType = this.state.resultArr[_contentType]\n const valueType = tomlType(value)\n if (listType !== valueType) {\n throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${listType} and ${valueType}`))\n }\n } else {\n this.state.resultArr = InlineList(tomlType(value))\n }\n if (isFloat(value) || isInteger(value)) {\n // unbox now that we've verified they're ok\n this.state.resultArr.push(value.valueOf())\n } else {\n this.state.resultArr.push(value)\n }\n return this.goto(this.parseInlineListNext)\n }\n parseInlineListNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {\n return null\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CHAR_COMMA) {\n return this.next(this.parseInlineList)\n } else if (this.char === CHAR_RSQB) {\n return this.goto(this.parseInlineList)\n } else {\n throw this.error(new TomlError('Invalid character, expected whitespace, comma (,) or close bracket (])'))\n }\n }\n\n /* INLINE TABLE */\n parseInlineTable () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_RCUB) {\n return this.return(this.state.resultTable || InlineTable())\n } else {\n if (!this.state.resultTable) this.state.resultTable = InlineTable()\n return this.callNow(this.parseAssign, this.recordInlineTableValue)\n }\n }\n recordInlineTableValue (kv) {\n let target = this.state.resultTable\n let finalKey = kv.key.pop()\n for (let kw of kv.key) {\n if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n target = target[kw] = target[kw] || Table()\n }\n if (hasKey(target, finalKey)) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n if (isInteger(kv.value) || isFloat(kv.value)) {\n target[finalKey] = kv.value.valueOf()\n } else {\n target[finalKey] = kv.value\n }\n return this.goto(this.parseInlineTableNext)\n }\n parseInlineTableNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_COMMA) {\n return this.next(this.parseInlineTable)\n } else if (this.char === CHAR_RCUB) {\n return this.goto(this.parseInlineTable)\n } else {\n throw this.error(new TomlError('Invalid character, expected whitespace, comma (,) or close bracket (])'))\n }\n }\n }\n return TOMLParser\n}\n","'use strict'\nmodule.exports = prettyError\n\nfunction prettyError (err, buf) {\n /* istanbul ignore if */\n if (err.pos == null || err.line == null) return err\n let msg = err.message\n msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:\\n`\n\n /* istanbul ignore else */\n if (buf && buf.split) {\n const lines = buf.split(/\\n/)\n const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length\n let linePadding = ' '\n while (linePadding.length < lineNumWidth) linePadding += ' '\n for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {\n let lineNum = String(ii + 1)\n if (lineNum.length < lineNumWidth) lineNum = ' ' + lineNum\n if (err.line === ii) {\n msg += lineNum + '> ' + lines[ii] + '\\n'\n msg += linePadding + ' '\n for (let hh = 0; hh < err.col; ++hh) {\n msg += ' '\n }\n msg += '^\\n'\n } else {\n msg += lineNum + ': ' + lines[ii] + '\\n'\n }\n }\n }\n err.message = msg + '\\n'\n return err\n}\n","'use strict'\nmodule.exports = parseString\n\nconst TOMLParser = require('./lib/toml-parser.js')\nconst prettyError = require('./parse-pretty-error.js')\n\nfunction parseString (str) {\n if (global.Buffer && global.Buffer.isBuffer(str)) {\n str = str.toString('utf8')\n }\n const parser = new TOMLParser()\n try {\n parser.parse(str)\n return parser.finish()\n } catch (err) {\n throw prettyError(err, str)\n }\n}\n","'use strict'\nmodule.exports = parseAsync\n\nconst TOMLParser = require('./lib/toml-parser.js')\nconst prettyError = require('./parse-pretty-error.js')\n\nfunction parseAsync (str, opts) {\n if (!opts) opts = {}\n const index = 0\n const blocksize = opts.blocksize || 40960\n const parser = new TOMLParser()\n return new Promise((resolve, reject) => {\n setImmediate(parseAsyncNext, index, blocksize, resolve, reject)\n })\n function parseAsyncNext (index, blocksize, resolve, reject) {\n if (index >= str.length) {\n try {\n return resolve(parser.finish())\n } catch (err) {\n return reject(prettyError(err, str))\n }\n }\n try {\n parser.parse(str.slice(index, index + blocksize))\n setImmediate(parseAsyncNext, index + blocksize, blocksize, resolve, reject)\n } catch (err) {\n reject(prettyError(err, str))\n }\n }\n}\n","'use strict'\nmodule.exports = parseStream\n\nconst stream = require('stream')\nconst TOMLParser = require('./lib/toml-parser.js')\n\nfunction parseStream (stm) {\n if (stm) {\n return parseReadable(stm)\n } else {\n return parseTransform(stm)\n }\n}\n\nfunction parseReadable (stm) {\n const parser = new TOMLParser()\n stm.setEncoding('utf8')\n return new Promise((resolve, reject) => {\n let readable\n let ended = false\n let errored = false\n function finish () {\n ended = true\n if (readable) return\n try {\n resolve(parser.finish())\n } catch (err) {\n reject(err)\n }\n }\n function error (err) {\n errored = true\n reject(err)\n }\n stm.once('end', finish)\n stm.once('error', error)\n readNext()\n\n function readNext () {\n readable = true\n let data\n while ((data = stm.read()) !== null) {\n try {\n parser.parse(data)\n } catch (err) {\n return error(err)\n }\n }\n readable = false\n /* istanbul ignore if */\n if (ended) return finish()\n /* istanbul ignore if */\n if (errored) return\n stm.once('readable', readNext)\n }\n })\n}\n\nfunction parseTransform () {\n const parser = new TOMLParser()\n return new stream.Transform({\n objectMode: true,\n transform (chunk, encoding, cb) {\n try {\n parser.parse(chunk.toString(encoding))\n } catch (err) {\n this.emit('error', err)\n }\n cb()\n },\n flush (cb) {\n try {\n this.push(parser.finish())\n } catch (err) {\n this.emit('error', err)\n }\n cb()\n }\n })\n}\n","'use strict'\nmodule.exports = require('./parse-string.js')\nmodule.exports.async = require('./parse-async.js')\nmodule.exports.stream = require('./parse-stream.js')\nmodule.exports.prettyError = require('./parse-pretty-error.js')\n","'use strict'\nmodule.exports = stringify\nmodule.exports.value = stringifyInline\n\nfunction stringify (obj) {\n if (obj === null) throw typeError('null')\n if (obj === void (0)) throw typeError('undefined')\n if (typeof obj !== 'object') throw typeError(typeof obj)\n\n if (typeof obj.toJSON === 'function') obj = obj.toJSON()\n if (obj == null) return null\n const type = tomlType(obj)\n if (type !== 'table') throw typeError(type)\n return stringifyObject('', '', obj)\n}\n\nfunction typeError (type) {\n return new Error('Can only stringify objects, not ' + type)\n}\n\nfunction arrayOneTypeError () {\n return new Error(\"Array values can't have mixed types\")\n}\n\nfunction getInlineKeys (obj) {\n return Object.keys(obj).filter(key => isInline(obj[key]))\n}\nfunction getComplexKeys (obj) {\n return Object.keys(obj).filter(key => !isInline(obj[key]))\n}\n\nfunction toJSON (obj) {\n let nobj = Array.isArray(obj) ? [] : Object.prototype.hasOwnProperty.call(obj, '__proto__') ? {['__proto__']: undefined} : {}\n for (let prop of Object.keys(obj)) {\n if (obj[prop] && typeof obj[prop].toJSON === 'function' && !('toISOString' in obj[prop])) {\n nobj[prop] = obj[prop].toJSON()\n } else {\n nobj[prop] = obj[prop]\n }\n }\n return nobj\n}\n\nfunction stringifyObject (prefix, indent, obj) {\n obj = toJSON(obj)\n var inlineKeys\n var complexKeys\n inlineKeys = getInlineKeys(obj)\n complexKeys = getComplexKeys(obj)\n var result = []\n var inlineIndent = indent || ''\n inlineKeys.forEach(key => {\n var type = tomlType(obj[key])\n if (type !== 'undefined' && type !== 'null') {\n result.push(inlineIndent + stringifyKey(key) + ' = ' + stringifyAnyInline(obj[key], true))\n }\n })\n if (result.length > 0) result.push('')\n var complexIndent = prefix && inlineKeys.length > 0 ? indent + ' ' : ''\n complexKeys.forEach(key => {\n result.push(stringifyComplex(prefix, complexIndent, key, obj[key]))\n })\n return result.join('\\n')\n}\n\nfunction isInline (value) {\n switch (tomlType(value)) {\n case 'undefined':\n case 'null':\n case 'integer':\n case 'nan':\n case 'float':\n case 'boolean':\n case 'string':\n case 'datetime':\n return true\n case 'array':\n return value.length === 0 || tomlType(value[0]) !== 'table'\n case 'table':\n return Object.keys(value).length === 0\n /* istanbul ignore next */\n default:\n return false\n }\n}\n\nfunction tomlType (value) {\n if (value === undefined) {\n return 'undefined'\n } else if (value === null) {\n return 'null'\n /* eslint-disable valid-typeof */\n } else if (typeof value === 'bigint' || (Number.isInteger(value) && !Object.is(value, -0))) {\n return 'integer'\n } else if (typeof value === 'number') {\n return 'float'\n } else if (typeof value === 'boolean') {\n return 'boolean'\n } else if (typeof value === 'string') {\n return 'string'\n } else if ('toISOString' in value) {\n return isNaN(value) ? 'undefined' : 'datetime'\n } else if (Array.isArray(value)) {\n return 'array'\n } else {\n return 'table'\n }\n}\n\nfunction stringifyKey (key) {\n var keyStr = String(key)\n if (/^[-A-Za-z0-9_]+$/.test(keyStr)) {\n return keyStr\n } else {\n return stringifyBasicString(keyStr)\n }\n}\n\nfunction stringifyBasicString (str) {\n return '\"' + escapeString(str).replace(/\"/g, '\\\\\"') + '\"'\n}\n\nfunction stringifyLiteralString (str) {\n return \"'\" + str + \"'\"\n}\n\nfunction numpad (num, str) {\n while (str.length < num) str = '0' + str\n return str\n}\n\nfunction escapeString (str) {\n return str.replace(/\\\\/g, '\\\\\\\\')\n .replace(/[\\b]/g, '\\\\b')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\f/g, '\\\\f')\n .replace(/\\r/g, '\\\\r')\n /* eslint-disable no-control-regex */\n .replace(/([\\u0000-\\u001f\\u007f])/, c => '\\\\u' + numpad(4, c.codePointAt(0).toString(16)))\n /* eslint-enable no-control-regex */\n}\n\nfunction stringifyMultilineString (str) {\n let escaped = str.split(/\\n/).map(str => {\n return escapeString(str).replace(/\"(?=\"\")/g, '\\\\\"')\n }).join('\\n')\n if (escaped.slice(-1) === '\"') escaped += '\\\\\\n'\n return '\"\"\"\\n' + escaped + '\"\"\"'\n}\n\nfunction stringifyAnyInline (value, multilineOk) {\n let type = tomlType(value)\n if (type === 'string') {\n if (multilineOk && /\\n/.test(value)) {\n type = 'string-multiline'\n } else if (!/[\\b\\t\\n\\f\\r']/.test(value) && /\"/.test(value)) {\n type = 'string-literal'\n }\n }\n return stringifyInline(value, type)\n}\n\nfunction stringifyInline (value, type) {\n /* istanbul ignore if */\n if (!type) type = tomlType(value)\n switch (type) {\n case 'string-multiline':\n return stringifyMultilineString(value)\n case 'string':\n return stringifyBasicString(value)\n case 'string-literal':\n return stringifyLiteralString(value)\n case 'integer':\n return stringifyInteger(value)\n case 'float':\n return stringifyFloat(value)\n case 'boolean':\n return stringifyBoolean(value)\n case 'datetime':\n return stringifyDatetime(value)\n case 'array':\n return stringifyInlineArray(value.filter(_ => tomlType(_) !== 'null' && tomlType(_) !== 'undefined' && tomlType(_) !== 'nan'))\n case 'table':\n return stringifyInlineTable(value)\n /* istanbul ignore next */\n default:\n throw typeError(type)\n }\n}\n\nfunction stringifyInteger (value) {\n /* eslint-disable security/detect-unsafe-regex */\n return String(value).replace(/\\B(?=(\\d{3})+(?!\\d))/g, '_')\n}\n\nfunction stringifyFloat (value) {\n if (value === Infinity) {\n return 'inf'\n } else if (value === -Infinity) {\n return '-inf'\n } else if (Object.is(value, NaN)) {\n return 'nan'\n } else if (Object.is(value, -0)) {\n return '-0.0'\n }\n var chunks = String(value).split('.')\n var int = chunks[0]\n var dec = chunks[1] || 0\n return stringifyInteger(int) + '.' + dec\n}\n\nfunction stringifyBoolean (value) {\n return String(value)\n}\n\nfunction stringifyDatetime (value) {\n return value.toISOString()\n}\n\nfunction isNumber (type) {\n return type === 'float' || type === 'integer'\n}\nfunction arrayType (values) {\n var contentType = tomlType(values[0])\n if (values.every(_ => tomlType(_) === contentType)) return contentType\n // mixed integer/float, emit as floats\n if (values.every(_ => isNumber(tomlType(_)))) return 'float'\n return 'mixed'\n}\nfunction validateArray (values) {\n const type = arrayType(values)\n if (type === 'mixed') {\n throw arrayOneTypeError()\n }\n return type\n}\n\nfunction stringifyInlineArray (values) {\n values = toJSON(values)\n const type = validateArray(values)\n var result = '['\n var stringified = values.map(_ => stringifyInline(_, type))\n if (stringified.join(', ').length > 60 || /\\n/.test(stringified)) {\n result += '\\n ' + stringified.join(',\\n ') + '\\n'\n } else {\n result += ' ' + stringified.join(', ') + (stringified.length > 0 ? ' ' : '')\n }\n return result + ']'\n}\n\nfunction stringifyInlineTable (value) {\n value = toJSON(value)\n var result = []\n Object.keys(value).forEach(key => {\n result.push(stringifyKey(key) + ' = ' + stringifyAnyInline(value[key], false))\n })\n return '{ ' + result.join(', ') + (result.length > 0 ? ' ' : '') + '}'\n}\n\nfunction stringifyComplex (prefix, indent, key, value) {\n var valueType = tomlType(value)\n /* istanbul ignore else */\n if (valueType === 'array') {\n return stringifyArrayOfTables(prefix, indent, key, value)\n } else if (valueType === 'table') {\n return stringifyComplexTable(prefix, indent, key, value)\n } else {\n throw typeError(valueType)\n }\n}\n\nfunction stringifyArrayOfTables (prefix, indent, key, values) {\n values = toJSON(values)\n validateArray(values)\n var firstValueType = tomlType(values[0])\n /* istanbul ignore if */\n if (firstValueType !== 'table') throw typeError(firstValueType)\n var fullKey = prefix + stringifyKey(key)\n var result = ''\n values.forEach(table => {\n if (result.length > 0) result += '\\n'\n result += indent + '[[' + fullKey + ']]\\n'\n result += stringifyObject(fullKey + '.', indent, table)\n })\n return result\n}\n\nfunction stringifyComplexTable (prefix, indent, key, value) {\n var fullKey = prefix + stringifyKey(key)\n var result = ''\n if (getInlineKeys(value).length > 0) {\n result += indent + '[' + fullKey + ']\\n'\n }\n return result + stringifyObject(fullKey + '.', indent, value)\n}\n","'use strict'\nexports.parse = require('./parse.js')\nexports.stringify = require('./stringify.js')\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","#!/usr/bin/env node\n\nimport { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport readline from \"readline\";\nimport { execSync } from \"node:child_process\";\nimport { readFileSync, writeFileSync, mkdirSync, existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { homedir } from \"node:os\";\nimport { monitorCommand } from \"./commands/monitor.js\";\nimport { scanCommand } from \"./commands/scan.js\";\nimport { initCommand } from \"./commands/init.js\";\nimport { statusCommand } from \"./commands/status.js\";\nimport { modulesCommand } from \"./commands/modules.js\";\nimport { pentestCommand } from \"./commands/pentest.js\";\nimport { orgsCommand } from \"./commands/orgs.js\";\nimport { serversCommand } from \"./commands/servers.js\";\nimport { connectCommand } from \"./commands/connect.js\";\nimport { daemonForeground, daemonStart, daemonStop } from \"./commands/daemon.js\";\nimport { installServiceCommand, uninstallServiceCommand } from \"./commands/service.js\";\nimport { loginCommand, logoutCommand, whoamiCommand } from \"./commands/login.js\";\nimport { welcomeCommand } from \"./commands/welcome.js\";\nimport {\n propertiesAddCommand,\n propertiesImportCommand,\n propertiesListCommand,\n propertiesRemoveCommand,\n propertiesRunCommand,\n propertiesRunsCommand,\n} from \"./commands/properties.js\";\nimport { PATHS } from \"./daemon/paths.js\";\n\nlet PKG_VERSION = \"0.1.8\";\ntry {\n const pkg = JSON.parse(readFileSync(join(__dirname, \"..\", \"package.json\"), \"utf-8\"));\n PKG_VERSION = pkg.version;\n} catch {}\n\nconst LOGO = `\n${chalk.green(\" ████████╗██╗ ██╗██████╗ ███████╗ █████╗ ████████╗\")}\n${chalk.green(\" ╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗╚══██╔══╝\")}\n${chalk.green(\" ██║ ███████║██████╔╝█████╗ ███████║ ██║ \")}\n${chalk.green(\" ██║ ██╔══██║██╔══██╗██╔══╝ ██╔══██║ ██║ \")}\n${chalk.green(\" ██║ ██║ ██║██║ ██║███████╗██║ ██║ ██║ \")}\n${chalk.green(\" ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝\")}\n${chalk.dim(\" C R U S H\")}\n`;\n\nconst API_URL = process.env.THREATCRUSH_API_URL || \"https://threatcrush.com\";\nconst PKG_NAME = \"@profullstack/threatcrush\";\nconst DESKTOP_PKG_NAME = \"@profullstack/threatcrush-desktop\";\nconst INSTALL_CONFIG_PATH = join(homedir(), \".threatcrush\", \"install.json\");\n\n// ─── Helpers ───\n\nasync function joinWaitlist(email: string): Promise<{ referral_code?: string } | null> {\n try {\n const res = await fetch(`${API_URL}/api/waitlist`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ email }),\n });\n return await res.json();\n } catch {\n return null;\n }\n}\n\nfunction detectPackageManager(): string {\n // Check what installed us\n try {\n const npmGlobal = execSync(\"npm ls -g --depth=0 --json 2>/dev/null\", { encoding: \"utf-8\" });\n if (npmGlobal.includes(PKG_NAME)) return \"npm\";\n } catch {}\n try {\n execSync(\"pnpm --version\", { stdio: \"pipe\" });\n return \"pnpm\";\n } catch {}\n try {\n execSync(\"yarn --version\", { stdio: \"pipe\" });\n return \"yarn\";\n } catch {}\n try {\n execSync(\"bun --version\", { stdio: \"pipe\" });\n return \"bun\";\n } catch {}\n return \"npm\";\n}\n\nfunction readInstallConfig(): { installMode?: string; packageManager?: string; installMethod?: string } {\n try {\n return JSON.parse(readFileSync(INSTALL_CONFIG_PATH, \"utf-8\"));\n } catch {\n return {};\n }\n}\n\nfunction getGlobalInstallCommand(pm: string, pkgName: string, action: \"install\" | \"update\" | \"remove\"): string {\n const commands: Record<string, Record<string, string>> = {\n npm: {\n install: `npm i -g ${pkgName}`,\n update: `npm update -g ${pkgName}`,\n remove: `npm uninstall -g ${pkgName}`,\n },\n pnpm: {\n install: `pnpm add -g ${pkgName}`,\n update: `pnpm update -g ${pkgName}`,\n remove: `pnpm remove -g ${pkgName}`,\n },\n yarn: {\n install: `yarn global add ${pkgName}`,\n update: `yarn global upgrade ${pkgName}`,\n remove: `yarn global remove ${pkgName}`,\n },\n bun: {\n install: `bun add -g ${pkgName}`,\n update: `bun update -g ${pkgName}`,\n remove: `bun remove -g ${pkgName}`,\n },\n };\n\n return commands[pm]?.[action] || commands.npm[action];\n}\n\nfunction packageLooksInstalled(pm: string, pkgName: string): boolean {\n try {\n const listCommands: Record<string, string> = {\n npm: `npm ls -g ${pkgName} --depth=0`,\n pnpm: `pnpm list -g ${pkgName} --depth=0`,\n yarn: `yarn global list --pattern ${pkgName}`,\n bun: `bun pm ls -g`,\n };\n\n const output = execSync(listCommands[pm] || listCommands.npm, {\n encoding: \"utf-8\",\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n });\n\n return output.includes(pkgName);\n } catch {\n return false;\n }\n}\n\n// ─── Program ───\n\nconst program = new Command();\n\nprogram\n .name(\"threatcrush\")\n .description(\n `${chalk.green(\"⚡ ThreatCrush\")} — All-in-one security agent\n\n Monitor every connection on every port. Detect live attacks,\n scan your code, pentest your APIs, and alert you in real-time.\n\n ${chalk.dim(\"Website:\")} ${chalk.green(\"https://threatcrush.com\")}\n ${chalk.dim(\"GitHub:\")} ${chalk.green(\"https://github.com/profullstack/threatcrush\")}\n ${chalk.dim(\"npm:\")} ${chalk.green(\"https://www.npmjs.com/package/@profullstack/threatcrush\")}\n ${chalk.dim(\"License:\")} ${chalk.green(\"$499 lifetime\")} (or $399 with referral)\n\n${chalk.dim(\"Examples:\")}\n ${chalk.green(\"$\")} threatcrush monitor ${chalk.dim(\"# Real-time monitoring\")}\n ${chalk.green(\"$\")} threatcrush tui ${chalk.dim(\"# Interactive dashboard\")}\n ${chalk.green(\"$\")} threatcrush scan ./src ${chalk.dim(\"# Scan code for vulns\")}\n ${chalk.green(\"$\")} threatcrush pentest URL ${chalk.dim(\"# Pen test a URL\")}\n ${chalk.green(\"$\")} threatcrush modules install ${chalk.dim(\"# Install a module\")}\n ${chalk.green(\"$\")} threatcrush update ${chalk.dim(\"# Update to latest\")}\n ${chalk.green(\"$\")} threatcrush remove ${chalk.dim(\"# Uninstall completely\")}`)\n .version(PKG_VERSION, \"-v, --version\", \"Show version number\")\n .helpOption(\"-h, --help\", \"Show this help\")\n .addHelpText(\"after\", `\n${chalk.dim(\"─────────────────────────────────────────────────────\")}\n${chalk.dim(\"Modules:\")}\n ThreatCrush uses pluggable security modules. Core modules included:\n ${chalk.green(\"network-monitor\")} All TCP/UDP traffic, port scans, SYN floods\n ${chalk.green(\"log-watcher\")} nginx, Apache, syslog, journald\n ${chalk.green(\"ssh-guard\")} Failed logins, brute force, tunneling\n ${chalk.green(\"code-scanner\")} Vulnerabilities, secrets, dependency CVEs\n ${chalk.green(\"pentest-engine\")} SQLi, XSS, SSRF, API fuzzing\n ${chalk.green(\"dns-monitor\")} DNS tunneling, DGA detection\n ${chalk.green(\"firewall-rules\")} Auto-blocks via iptables/nftables\n ${chalk.green(\"alert-system\")} Slack, Discord, email, webhook, PagerDuty\n\n Browse community modules: ${chalk.green(\"threatcrush store\")}\n`);\n\n// ─── Real commands ───\n\nprogram\n .command(\"monitor\")\n .description(\"Real-time security monitoring (all ports, all protocols)\")\n .option(\"-m, --module <modules>\", \"Comma-separated module filter (e.g. ssh-guard,log-watcher)\")\n .option(\"--tui\", \"Launch the interactive TUI dashboard\")\n .action(async (opts) => {\n await monitorCommand({\n module: opts.module,\n tui: opts.tui,\n });\n });\n\nprogram\n .command(\"tui\")\n .description(\"Interactive security dashboard (htop for security)\")\n .alias(\"dashboard\")\n .action(async () => {\n await monitorCommand({ tui: true });\n });\n\nprogram\n .command(\"init\")\n .description(\"Sign in, auto-detect services, and configure ThreatCrush\")\n .action(async () => {\n await initCommand();\n });\n\nprogram\n .command(\"login\")\n .description(\"Log in to your threatcrush.com account\")\n .option(\"-e, --email <email>\", \"Email to log in with\")\n .action(async (opts) => {\n await loginCommand({ email: opts.email });\n });\n\nprogram\n .command(\"logout\")\n .description(\"Clear stored threatcrush.com credentials\")\n .action(async () => {\n await logoutCommand();\n });\n\nprogram\n .command(\"whoami\")\n .description(\"Show the currently logged-in threatcrush.com account\")\n .action(async () => {\n await whoamiCommand();\n });\n\nprogram\n .command(\"scan\")\n .description(\"Scan codebase for vulnerabilities and secrets\")\n .argument(\"[path]\", \"Path to scan\", \".\")\n .action(async (targetPath: string) => {\n await scanCommand(targetPath);\n });\n\nprogram\n .command(\"pentest\")\n .description(\"Penetration test URLs and APIs\")\n .argument(\"<url>\", \"Target URL to pentest\")\n .action(async (url: string) => {\n await pentestCommand(url);\n });\n\nprogram\n .command(\"status\")\n .description(\"Show daemon status and loaded modules\")\n .action(async () => {\n await statusCommand();\n });\n\nprogram\n .command(\"start\")\n .description(\"Start the ThreatCrush daemon in the background\")\n .action(async () => {\n console.log(LOGO);\n await daemonStart();\n });\n\nprogram\n .command(\"stop\")\n .description(\"Stop the ThreatCrush daemon\")\n .action(async () => {\n console.log(LOGO);\n await daemonStop();\n });\n\nprogram\n .command(\"daemon\")\n .description(\"Run threatcrushd in the foreground (systemd / Docker ExecStart)\")\n .action(async () => {\n await daemonForeground();\n });\n\nprogram\n .command(\"install-service\")\n .description(\"Install the threatcrushd systemd unit (Linux, requires sudo)\")\n .action(async () => {\n await installServiceCommand();\n });\n\nprogram\n .command(\"uninstall-service\")\n .description(\"Remove the threatcrushd systemd unit (Linux, requires sudo)\")\n .action(async () => {\n await uninstallServiceCommand();\n });\n\nprogram\n .command(\"logs\")\n .description(\"Tail daemon logs\")\n .action(async () => {\n console.log(LOGO);\n const logPath = PATHS.logFile;\n if (!existsSync(logPath)) {\n console.log(chalk.yellow(` No log file found at ${logPath}`));\n console.log(chalk.dim(\" Start the daemon first with `threatcrush start`\\n\"));\n return;\n }\n console.log(chalk.green(` Tailing ${logPath}...\\n`));\n console.log(chalk.gray(\" Press Ctrl+C to stop\\n\"));\n execSync(`tail -f ${logPath}`, { stdio: \"inherit\" });\n });\n\nprogram\n .command(\"activate\")\n .description(\"Activate your license key\")\n .action(async () => {\n console.log(LOGO);\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n const key = await new Promise<string>((resolve) => {\n rl.question(chalk.green(\" Enter your ThreatCrush license key: \"), (answer) => {\n rl.close();\n resolve(answer.trim());\n });\n });\n\n if (!key) {\n console.log(chalk.red(\"\\n No key provided.\\n\"));\n return;\n }\n\n console.log(chalk.dim(\"\\n Activating license...\"));\n try {\n const res = await fetch(`${API_URL}/api/auth/activate`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ license_key: key }),\n });\n const result = await res.json() as Record<string, unknown>;\n\n if (!res.ok) {\n console.log(chalk.red(`\\n ✗ Activation failed: ${(result as Record<string, string>).error || \"Unknown error\"}\\n`));\n return;\n }\n\n console.log(chalk.green(\"\\n ✓ License activated successfully!\\n\"));\n console.log(chalk.dim(` Status: ${String(result.status ?? \"active\")}`));\n console.log(chalk.dim(` Expires: ${String(result.expires ?? \"never\")}\\n`));\n } catch {\n console.log(chalk.red(\"\\n ✗ Activation failed. Check your connection and try again.\\n\"));\n }\n });\n\n// ─── Real commands ───\n\nprogram\n .command(\"update\")\n .description(\"Update ThreatCrush CLI and installed bundle\")\n .option(\"--cli\", \"Update CLI only\")\n .option(\"--modules\", \"Update modules only\")\n .option(\"--desktop\", \"Update desktop app too\")\n .action(async (opts) => {\n console.log(LOGO);\n\n if (opts.modules) {\n console.log(LOGO);\n console.log(chalk.yellow(\" Updating modules...\\n\"));\n const pm = detectPackageManager();\n const commands = [\n getGlobalInstallCommand(pm, PKG_NAME, \"update\"),\n ];\n try {\n for (const cmd of commands) {\n console.log(chalk.green(` → ${cmd}\\n`));\n execSync(cmd, { stdio: \"inherit\" });\n }\n console.log(chalk.green(\"\\n ✓ Modules updated successfully!\\n\"));\n } catch (err) {\n console.log(chalk.red(\"\\n ✗ Module update failed. Try manually:\\n\"));\n for (const cmd of commands) {\n console.log(chalk.dim(` ${cmd}`));\n }\n console.log();\n }\n return;\n }\n\n const pm = detectPackageManager();\n const installConfig = readInstallConfig();\n const installMode = opts.cli ? \"server\" : (opts.desktop ? \"desktop\" : installConfig.installMode || \"server\");\n\n console.log(chalk.dim(` Detected package manager: ${pm}`));\n console.log(chalk.dim(` Install mode: ${installMode}\\n`));\n\n const commands = [getGlobalInstallCommand(pm, PKG_NAME, \"update\")];\n\n if (installMode === \"desktop\") {\n commands.push(getGlobalInstallCommand(pm, DESKTOP_PKG_NAME, \"update\"));\n }\n\n try {\n for (const cmd of commands) {\n console.log(chalk.green(` → ${cmd}\\n`));\n execSync(cmd, { stdio: \"inherit\" });\n }\n\n console.log(chalk.green(\"\\n ✓ ThreatCrush updated successfully!\\n\"));\n if (installMode === \"desktop\") {\n console.log(chalk.dim(\" Updated bundle: CLI + desktop app\\n\"));\n } else {\n console.log(chalk.dim(\" Updated bundle: CLI only\\n\"));\n }\n } catch (err) {\n console.log(chalk.red(\"\\n ✗ Update failed. Try manually:\\n\"));\n for (const cmd of commands) {\n console.log(chalk.dim(` ${cmd}`));\n }\n console.log();\n }\n });\n\nprogram\n .command(\"remove\")\n .description(\"Uninstall ThreatCrush and the installed bundle\")\n .alias(\"uninstall\")\n .action(async () => {\n console.log(LOGO);\n\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n const confirm = await new Promise<string>((resolve) => {\n rl.question(chalk.yellow(\" Are you sure you want to uninstall ThreatCrush? (y/N): \"), (answer) => {\n rl.close();\n resolve(answer.trim().toLowerCase());\n });\n });\n\n if (confirm !== \"y\" && confirm !== \"yes\") {\n console.log(chalk.dim(\"\\n Cancelled.\\n\"));\n return;\n }\n\n const pm = detectPackageManager();\n const installConfig = readInstallConfig();\n const installMode = installConfig.installMode || \"server\";\n const commands = [getGlobalInstallCommand(pm, PKG_NAME, \"remove\")];\n\n if (installMode === \"desktop\" && packageLooksInstalled(pm, DESKTOP_PKG_NAME)) {\n commands.push(getGlobalInstallCommand(pm, DESKTOP_PKG_NAME, \"remove\"));\n }\n\n console.log(chalk.dim(`\\n Detected package manager: ${pm}`));\n console.log(chalk.dim(` Install mode: ${installMode}\\n`));\n\n try {\n for (const cmd of commands) {\n console.log(chalk.green(` → ${cmd}\\n`));\n execSync(cmd, { stdio: \"inherit\" });\n }\n console.log(chalk.green(\"\\n ✓ ThreatCrush has been uninstalled.\\n\"));\n console.log(chalk.dim(\" We're sorry to see you go! 👋\\n\"));\n console.log(chalk.dim(\" Config files may remain at /etc/threatcrush/\"));\n console.log(chalk.dim(\" Logs may remain at /var/log/threatcrush/\"));\n console.log(chalk.dim(\" State may remain at /var/lib/threatcrush/\"));\n console.log(chalk.dim(` Local install metadata may remain at ${INSTALL_CONFIG_PATH}\\n`));\n } catch (err) {\n console.log(chalk.red(\"\\n ✗ Uninstall failed. Try manually:\\n\"));\n for (const cmd of commands) {\n console.log(chalk.dim(` ${cmd}`));\n }\n console.log();\n }\n });\n\nprogram\n .command(\"modules\")\n .description(\"Manage security modules\")\n .argument(\"[action]\", \"list | install | remove | available\")\n .argument(\"[name]\", \"Module name or path\")\n .action(async (action?: string, name?: string) => {\n await modulesCommand({ action, name });\n });\n\nconst storeCmd = program\n .command(\"store\")\n .description(\"Browse the module marketplace\")\n .action(async () => {\n console.log(LOGO);\n console.log(chalk.green(\" Module Marketplace\\n\"));\n console.log(chalk.dim(\" Loading available modules...\"));\n try {\n const res = await fetch(`${API_URL}/api/modules`);\n if (!res.ok) {\n console.log(chalk.red(` ✗ Failed to load modules: ${res.statusText}\\n`));\n return;\n }\n const data = await res.json() as { modules?: Array<{ slug: string; display_name: string; description: string; version: string; stars?: number }> };\n const mods = data.modules || [];\n if (mods.length === 0) {\n console.log(chalk.yellow(\" No modules available yet.\\n\"));\n return;\n }\n console.log();\n for (const mod of mods) {\n console.log(` ${chalk.green.bold(mod.display_name || mod.slug)} ${chalk.gray(`v${mod.version}`)}${mod.stars ? chalk.gray(` ⭐${mod.stars}`) : \"\"}`);\n console.log(` ${chalk.dim(mod.description)}\\n`);\n }\n } catch {\n console.log(chalk.dim(\" (Marketplace offline — browse at threatcrush.com/store)\\n\"));\n }\n });\n\nstoreCmd\n .command(\"search <query>\")\n .description(\"Search for modules in the store\")\n .action(async (query: string) => {\n console.log(LOGO);\n console.log(chalk.green(` Searching for \"${query}\"...\\n`));\n try {\n const res = await fetch(`${API_URL}/api/modules?q=${encodeURIComponent(query)}`);\n if (!res.ok) {\n console.log(chalk.red(` ✗ Search failed: ${res.statusText}\\n`));\n return;\n }\n const data = await res.json() as { modules?: Array<{ slug: string; display_name: string; description: string; version: string }> };\n const mods = data.modules || [];\n if (mods.length === 0) {\n console.log(chalk.yellow(` No modules matching \"${query}\"\\n`));\n return;\n }\n for (const mod of mods) {\n console.log(` ${chalk.green.bold(mod.display_name || mod.slug)} ${chalk.gray(`v${mod.version}`)}`);\n console.log(` ${chalk.dim(mod.description)}\\n`);\n }\n } catch {\n console.log(chalk.dim(` (Search offline — browse at threatcrush.com/store)\\n`));\n }\n });\n\nstoreCmd\n .command(\"publish <url>\")\n .description(\"Publish a module from a git URL or web URL\")\n .action(async (url: string) => {\n console.log(LOGO);\n\n // 1. Get email\n const configPath = join(homedir(), \".threatcrush\", \"config.json\");\n let email = \"\";\n try {\n const config = JSON.parse(readFileSync(configPath, \"utf-8\"));\n email = config.email || \"\";\n } catch {}\n\n if (!email) {\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n email = await new Promise<string>((resolve) => {\n rl.question(chalk.green(\" Enter your email: \"), (answer) => {\n rl.close();\n resolve(answer.trim());\n });\n });\n\n if (!email || !email.includes(\"@\")) {\n console.log(chalk.red(\"\\n Invalid email.\\n\"));\n return;\n }\n\n // Save email\n try {\n const dir = join(homedir(), \".threatcrush\");\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n writeFileSync(configPath, JSON.stringify({ email }, null, 2));\n console.log(chalk.dim(` Saved email to ${configPath}`));\n } catch {}\n }\n\n console.log(chalk.dim(`\\n Fetching metadata from ${url}...\\n`));\n\n // 2. Fetch metadata\n let meta: Record<string, unknown>;\n try {\n const res = await fetch(`${API_URL}/api/modules/fetch-meta`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ url, git_url: url }),\n });\n if (!res.ok) {\n const err = await res.json().catch(() => ({ error: res.statusText }));\n console.log(chalk.red(` ✗ Failed to fetch metadata: ${(err as Record<string, string>).error}\\n`));\n return;\n }\n meta = await res.json() as Record<string, unknown>;\n } catch (err) {\n console.log(chalk.red(` ✗ Failed to fetch metadata: ${err instanceof Error ? err.message : err}\\n`));\n return;\n }\n\n // 3. Preview\n console.log(chalk.green(\" ── Module Preview ──\\n\"));\n console.log(` ${chalk.bold(\"Name:\")} ${meta.name || chalk.dim(\"(none)\")}`);\n console.log(` ${chalk.bold(\"Display:\")} ${meta.display_name || chalk.dim(\"(none)\")}`);\n console.log(` ${chalk.bold(\"Description:\")} ${meta.description || chalk.dim(\"(none)\")}`);\n console.log(` ${chalk.bold(\"Version:\")} ${meta.version || \"0.1.0\"}`);\n console.log(` ${chalk.bold(\"License:\")} ${meta.license || \"MIT\"}`);\n console.log(` ${chalk.bold(\"Author:\")} ${meta.author_name || chalk.dim(\"(none)\")}`);\n console.log(` ${chalk.bold(\"Homepage:\")} ${meta.homepage_url || chalk.dim(\"(none)\")}`);\n console.log(` ${chalk.bold(\"Git:\")} ${meta.git_url || url}`);\n if (Array.isArray(meta.tags) && meta.tags.length > 0) {\n console.log(` ${chalk.bold(\"Tags:\")} ${(meta.tags as string[]).join(\", \")}`);\n }\n if (meta.stars) {\n console.log(` ${chalk.bold(\"Stars:\")} ⭐ ${meta.stars}`);\n }\n console.log();\n\n // 4. Confirm\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n const confirm = await new Promise<string>((resolve) => {\n rl.question(chalk.yellow(\" Publish this module? (y/N): \"), (answer) => {\n rl.close();\n resolve(answer.trim().toLowerCase());\n });\n });\n\n if (confirm !== \"y\" && confirm !== \"yes\") {\n console.log(chalk.dim(\"\\n Cancelled.\\n\"));\n return;\n }\n\n // 5. Publish\n console.log(chalk.dim(\"\\n Publishing...\"));\n try {\n const res = await fetch(`${API_URL}/api/modules`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n ...meta,\n author_email: email,\n git_url: (meta.git_url as string) || url,\n homepage_url: (meta.homepage_url as string) || url,\n }),\n });\n\n const result = await res.json() as Record<string, unknown>;\n\n if (!res.ok) {\n console.log(chalk.red(`\\n ✗ Publish failed: ${(result as Record<string, string>).error}\\n`));\n return;\n }\n\n const mod = result.module as Record<string, string>;\n const slug = mod?.slug || meta.name;\n console.log(chalk.green(`\\n ✓ Module published!`));\n console.log(chalk.dim(` ${API_URL}/store/${slug}\\n`));\n } catch (err) {\n console.log(chalk.red(`\\n ✗ Publish failed: ${err instanceof Error ? err.message : err}\\n`));\n }\n });\n\n// ─── Organization commands ───\n\nconst orgsCmd = program\n .command(\"orgs\")\n .alias(\"org\")\n .description(\"Manage organizations\")\n .action(async () => {\n await orgsCommand({});\n });\n\norgsCmd\n .command(\"list\")\n .alias(\"ls\")\n .description(\"List your organizations\")\n .action(async () => {\n await orgsCommand({ action: \"list\" });\n });\n\norgsCmd\n .command(\"create <name>\")\n .description(\"Create a new organization\")\n .action(async (name: string) => {\n await orgsCommand({ action: \"create\", name });\n });\n\norgsCmd\n .command(\"use <slug>\")\n .description(\"Switch to an organization\")\n .action(async (slug: string) => {\n await orgsCommand({ action: \"use\", name: slug });\n });\n\n// ─── Server commands ───\n\nconst serversCmd = program\n .command(\"servers\")\n .alias(\"server\")\n .alias(\"srv\")\n .description(\"Manage servers\")\n .action(async (opts) => {\n await serversCommand({ action: opts });\n });\n\nserversCmd\n .command(\"list\")\n .alias(\"ls\")\n .option(\"--org <slug>\", \"Filter by organization slug\")\n .description(\"List servers in current organization\")\n .action(async (opts) => {\n await serversCommand({ action: \"list\", org: opts.org });\n });\n\n// ─── Properties ───\n\nconst propsCmd = program\n .command(\"properties\")\n .alias(\"props\")\n .alias(\"targets\")\n .description(\"Manage scan/pentest targets (properties) in the current org\")\n .action(async () => {\n await propertiesListCommand({});\n });\n\npropsCmd\n .command(\"list\")\n .alias(\"ls\")\n .description(\"List properties in the current org\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"--kind <kind>\", \"Filter by kind (url|api|domain|ip|repo)\")\n .action(async (opts) => {\n await propertiesListCommand({ org: opts.org, kind: opts.kind });\n });\n\npropsCmd\n .command(\"add <name> <target>\")\n .description(\"Add a new property (url, api, domain, ip, or repo)\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-k, --kind <kind>\", \"url | api | domain | ip | repo (auto-detected if omitted)\")\n .option(\"-t, --tag <tags>\", \"Comma-separated tags\")\n .option(\"-d, --description <text>\", \"Description of the property\")\n .option(\"--disabled\", \"Create the property disabled\")\n .action(async (name: string, target: string, opts) => {\n await propertiesAddCommand(name, target, {\n org: opts.org,\n kind: opts.kind,\n tag: opts.tag,\n description: opts.description,\n disabled: opts.disabled,\n });\n });\n\npropsCmd\n .command(\"remove <nameOrId>\")\n .alias(\"rm\")\n .description(\"Delete a property\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-y, --yes\", \"Skip confirmation prompt\")\n .action(async (nameOrId: string, opts) => {\n await propertiesRemoveCommand(nameOrId, { org: opts.org, yes: opts.yes });\n });\n\npropsCmd\n .command(\"run\")\n .description(\"Run a scan or pentest against matching properties\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-t, --type <type>\", \"pentest | scan (default: pentest)\")\n .option(\"-k, --kind <kind>\", \"Limit to a single kind (url|api|domain|ip|repo)\")\n .option(\"-n, --name <name>\", \"Run only the property with this name\")\n .action(async (opts) => {\n await propertiesRunCommand({\n org: opts.org,\n type: opts.type,\n kind: opts.kind,\n name: opts.name,\n });\n });\n\npropsCmd\n .command(\"runs\")\n .alias(\"history\")\n .description(\"Show recent scan/pentest run history\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-p, --property <name>\", \"Show history for a single property\")\n .option(\"-l, --limit <n>\", \"Max runs per property\", \"10\")\n .action(async (opts) => {\n await propertiesRunsCommand({\n org: opts.org,\n property: opts.property,\n limit: parseInt(opts.limit, 10) || 10,\n });\n });\n\npropsCmd\n .command(\"import <file>\")\n .description(\"Bulk-import properties from a .json, .csv, or .tsv file\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-n, --dry-run\", \"Preview without writing\")\n .action(async (file: string, opts) => {\n await propertiesImportCommand(file, { org: opts.org, dryRun: opts.dryRun });\n });\n\n// ─── Connect command ───\n\nprogram\n .command(\"connect\")\n .description(\"Connect to a ThreatCrush server via SSH\")\n .argument(\"[target]\", \"Server name, user@hostname, or hostname\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-u, --user <user>\", \"SSH username\")\n .option(\"-p, --port <port>\", \"SSH port\", \"22\")\n .option(\"-i, --identity <path>\", \"SSH identity file\")\n .action(async (target, opts) => {\n await connectCommand({\n target,\n org: opts.org,\n user: opts.user,\n port: opts.port,\n identity: opts.identity,\n });\n });\n\nprogram\n .command(\"help\")\n .description(\"Show help for threatcrush or a specific command\")\n .argument(\"[command]\", \"Command to show help for\")\n .action((commandName?: string) => {\n if (!commandName) {\n console.log(LOGO);\n program.outputHelp();\n return;\n }\n const sub = program.commands.find(\n (c) => c.name() === commandName || c.aliases().includes(commandName),\n );\n if (!sub) {\n console.log(chalk.yellow(` Unknown command: ${commandName}\\n`));\n program.outputHelp();\n return;\n }\n sub.outputHelp();\n });\n\n// Default action (no command — smart welcome based on current state)\nprogram.action(() => {\n welcomeCommand();\n});\n\nprogram.parse();\n","import { existsSync, createReadStream, statSync } from 'node:fs';\nimport { createInterface } from 'node:readline';\nimport { watch } from 'node:fs';\nimport chalk from 'chalk';\nimport { formatEvent, logger, banner } from '../core/logger.js';\nimport { autoDetectParser, detectAttackPattern, parseAuthLog, parseNginxLog } from '../core/log-parser.js';\nimport { initStateDB, insertEvent } from '../core/state.js';\nimport type { ThreatEvent, EventSeverity, EventCategory } from '../types/events.js';\n\ninterface MonitorOptions {\n module?: string;\n tui?: boolean;\n}\n\ninterface LogWatcher {\n path: string;\n name: string;\n category: EventCategory;\n}\n\nconst LOG_SOURCES: LogWatcher[] = [\n { path: '/var/log/auth.log', name: 'ssh-guard', category: 'auth' },\n { path: '/var/log/secure', name: 'ssh-guard', category: 'auth' },\n { path: '/var/log/nginx/access.log', name: 'log-watcher', category: 'web' },\n { path: '/var/log/syslog', name: 'log-watcher', category: 'system' },\n];\n\nexport async function monitorCommand(options: MonitorOptions): Promise<void> {\n if (options.tui) {\n // Dynamic import to avoid loading blessed when not needed\n const { startDashboard } = await import('../tui/dashboard.js');\n await startDashboard();\n return;\n }\n\n banner();\n logger.info('Starting foreground monitor...');\n\n const moduleFilter = options.module?.split(',').map((m) => m.trim());\n\n // Find available log files\n const availableSources = LOG_SOURCES.filter((s) => {\n if (moduleFilter && !moduleFilter.includes(s.name)) return false;\n return existsSync(s.path);\n });\n\n if (availableSources.length === 0) {\n logger.warn('No log files found to monitor.');\n logger.info('Available log paths checked:');\n for (const s of LOG_SOURCES) {\n const exists = existsSync(s.path);\n console.log(` ${exists ? chalk.green('✓') : chalk.red('✗')} ${s.path}`);\n }\n console.log();\n logger.info('Starting demo mode with synthetic events...\\n');\n await runDemoMode();\n return;\n }\n\n try {\n initStateDB();\n } catch {\n // State DB optional for monitoring\n }\n\n logger.info(`Monitoring ${availableSources.length} log source(s):`);\n for (const src of availableSources) {\n console.log(` ${chalk.green('●')} ${chalk.white(src.name.padEnd(14))} → ${chalk.gray(src.path)}`);\n }\n console.log();\n console.log(chalk.gray(' Press Ctrl+C to stop\\n'));\n\n // Tail each log file\n for (const src of availableSources) {\n tailLog(src);\n }\n\n // Keep process alive\n await new Promise(() => {});\n}\n\nfunction tailLog(source: LogWatcher): void {\n const { path, name, category } = source;\n\n // Start reading from end of file\n const stat = statSync(path);\n let position = stat.size;\n\n const checkForNewData = () => {\n try {\n const currentStat = statSync(path);\n if (currentStat.size <= position) {\n if (currentStat.size < position) position = 0; // file rotated\n return;\n }\n\n const stream = createReadStream(path, { start: position, encoding: 'utf-8' });\n const rl = createInterface({ input: stream });\n\n rl.on('line', (line) => {\n if (!line.trim()) return;\n processLine(line, name, category);\n });\n\n rl.on('close', () => {\n position = currentStat.size;\n });\n } catch {\n // file may not be readable\n }\n };\n\n // Poll for changes (more reliable than fs.watch for log files)\n setInterval(checkForNewData, 1000);\n}\n\nfunction processLine(line: string, moduleName: string, category: EventCategory): void {\n const parsed = autoDetectParser(line);\n if (!parsed) return;\n\n let severity: EventSeverity = 'info';\n let message = line;\n\n if (parsed.source === 'auth') {\n const authEntry = parseAuthLog(line);\n if (!authEntry) return;\n\n if (/failed password/i.test(authEntry.fields.message)) {\n severity = 'high';\n message = `Failed SSH login for ${authEntry.fields.user || 'unknown'} from ${authEntry.fields.ip || 'unknown'}`;\n } else if (/accepted/i.test(authEntry.fields.message)) {\n severity = 'info';\n message = `SSH login accepted for ${authEntry.fields.user || 'unknown'}`;\n } else if (/invalid user/i.test(authEntry.fields.message)) {\n severity = 'high';\n message = `Invalid SSH user attempt: ${authEntry.fields.user || 'unknown'} from ${authEntry.fields.ip || 'unknown'}`;\n }\n } else if (parsed.source === 'nginx') {\n const nginxEntry = parseNginxLog(line);\n if (!nginxEntry) return;\n\n const status = parseInt(nginxEntry.fields.status);\n const attack = detectAttackPattern(nginxEntry.fields.path);\n\n if (attack) {\n severity = 'critical';\n message = `Attack detected [${attack.toUpperCase()}]: ${nginxEntry.fields.method} ${nginxEntry.fields.path}`;\n } else if (status >= 500) {\n severity = 'medium';\n message = `Server error ${status}: ${nginxEntry.fields.method} ${nginxEntry.fields.path}`;\n } else if (status >= 400) {\n severity = 'low';\n message = `Client error ${status}: ${nginxEntry.fields.method} ${nginxEntry.fields.path}`;\n } else {\n severity = 'info';\n message = `${nginxEntry.fields.method} ${nginxEntry.fields.path} → ${status}`;\n }\n }\n\n const event: ThreatEvent = {\n timestamp: new Date(),\n module: moduleName,\n category,\n severity,\n message,\n source_ip: parsed.fields.ip as string | undefined,\n };\n\n console.log(formatEvent(event.module, event.severity, event.message, event.source_ip));\n\n try {\n insertEvent(event);\n } catch {\n // State DB may not be available\n }\n}\n\nasync function runDemoMode(): Promise<void> {\n const demoEvents: Array<Omit<ThreatEvent, 'timestamp'>> = [\n { module: 'ssh-guard', category: 'auth', severity: 'info', message: 'SSH login accepted for ubuntu', source_ip: '10.0.0.1' },\n { module: 'log-watcher', category: 'web', severity: 'info', message: 'GET /api/health → 200', source_ip: '172.16.0.50' },\n { module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Failed SSH login for root', source_ip: '45.33.22.11' },\n { module: 'log-watcher', category: 'web', severity: 'low', message: 'GET /admin → 404', source_ip: '91.121.44.55' },\n { module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Failed SSH login for admin', source_ip: '45.33.22.11' },\n { module: 'log-watcher', category: 'web', severity: 'critical', message: 'Attack detected [SQLI]: GET /search?q=1%27+OR+1%3D1', source_ip: '185.220.101.44' },\n { module: 'log-watcher', category: 'web', severity: 'medium', message: 'Server error 502: GET /api/users', source_ip: '10.0.0.2' },\n { module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Invalid SSH user attempt: admin123', source_ip: '103.77.88.99' },\n { module: 'log-watcher', category: 'web', severity: 'critical', message: 'Attack detected [PATH_TRAVERSAL]: GET /../../etc/passwd', source_ip: '185.220.101.44' },\n { module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Brute force detected — 6 failures in 45s', source_ip: '45.33.22.11' },\n { module: 'log-watcher', category: 'system', severity: 'medium', message: 'Unusual outbound connection to 198.51.100.1:4444', source_ip: '198.51.100.1' },\n { module: 'log-watcher', category: 'web', severity: 'info', message: 'GET /index.html → 200', source_ip: '172.16.0.51' },\n ];\n\n let i = 0;\n const interval = setInterval(() => {\n const event = demoEvents[i % demoEvents.length];\n console.log(formatEvent(event.module, event.severity, event.message, event.source_ip));\n i++;\n }, 1500 + Math.random() * 2000);\n\n process.on('SIGINT', () => {\n clearInterval(interval);\n console.log(chalk.gray('\\n Monitor stopped.'));\n process.exit(0);\n });\n\n await new Promise(() => {});\n}\n","import chalk from 'chalk';\nimport type { EventSeverity } from '../types/events.js';\n\nconst SEVERITY_COLORS: Record<EventSeverity, (s: string) => string> = {\n info: chalk.green,\n low: chalk.cyan,\n medium: chalk.yellow,\n high: chalk.red,\n critical: chalk.bgRed.white.bold,\n};\n\nconst LEVEL_COLORS: Record<string, (s: string) => string> = {\n debug: chalk.gray,\n info: chalk.green,\n warn: chalk.yellow,\n error: chalk.red,\n};\n\nexport function severityColor(severity: EventSeverity, text: string): string {\n return (SEVERITY_COLORS[severity] || chalk.white)(text);\n}\n\nexport function formatTimestamp(date: Date = new Date()): string {\n return chalk.gray(date.toISOString().replace('T', ' ').slice(0, 19));\n}\n\nexport function formatEvent(\n module: string,\n severity: EventSeverity,\n message: string,\n ip?: string,\n): string {\n const ts = formatTimestamp();\n const sev = severityColor(severity, `[${severity.toUpperCase()}]`.padEnd(10));\n const mod = chalk.cyan(`[${module}]`.padEnd(14));\n const src = ip ? chalk.magenta(` (${ip})`) : '';\n return `${ts} ${sev} ${mod} ${message}${src}`;\n}\n\nexport const logger = {\n debug: (msg: string) => console.log(`${formatTimestamp()} ${LEVEL_COLORS.debug('[DEBUG]')} ${msg}`),\n info: (msg: string) => console.log(`${formatTimestamp()} ${LEVEL_COLORS.info('[INFO]')} ${msg}`),\n warn: (msg: string) => console.log(`${formatTimestamp()} ${LEVEL_COLORS.warn('[WARN]')} ${msg}`),\n error: (msg: string) => console.error(`${formatTimestamp()} ${LEVEL_COLORS.error('[ERROR]')} ${msg}`),\n success: (msg: string) => console.log(`${formatTimestamp()} ${chalk.green('[OK]')} ${msg}`),\n threat: (msg: string, ip?: string) => {\n const src = ip ? chalk.magenta(` from ${ip}`) : '';\n console.log(`${formatTimestamp()} ${chalk.red.bold('[THREAT]')} ${chalk.red(msg)}${src}`);\n },\n};\n\nexport function banner(): void {\n console.log(chalk.green.bold(`\n ████████╗██╗ ██╗██████╗ ███████╗ █████╗ ████████╗ ██████╗██████╗ ██╗ ██╗███████╗██╗ ██╗\n ╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗╚══██╔══╝██╔════╝██╔══██╗██║ ██║██╔════╝██║ ██║\n ██║ ███████║██████╔╝█████╗ ███████║ ██║ ██║ ██████╔╝██║ ██║███████╗███████║\n ██║ ██╔══██║██╔══██╗██╔══╝ ██╔══██║ ██║ ██║ ██╔══██╗██║ ██║╚════██║██╔══██║\n ██║ ██║ ██║██║ ██║███████╗██║ ██║ ██║ ╚██████╗██║ ██║╚██████╔╝███████║██║ ██║\n ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝\n `));\n console.log(chalk.gray(' All-in-one security agent daemon — v0.1.0\\n'));\n}\n","import type { ParsedLogLine, NginxLogEntry, AuthLogEntry, SyslogEntry } from '../types/events.js';\n\n// Nginx combined log format:\n// 127.0.0.1 - - [04/Apr/2026:12:00:00 +0000] \"GET /path HTTP/1.1\" 200 1234 \"-\" \"Mozilla/5.0\"\nconst NGINX_REGEX = /^(\\S+) \\S+ \\S+ \\[([^\\]]+)\\] \"(\\S+) (\\S+) \\S+\" (\\d{3}) (\\d+) \"[^\"]*\" \"([^\"]*)\"/;\n\n// Auth.log format:\n// Apr 4 12:00:00 hostname sshd[1234]: Failed password for user from 1.2.3.4 port 22 ssh2\nconst AUTH_REGEX = /^(\\w+\\s+\\d+\\s+[\\d:]+)\\s+\\S+\\s+(\\S+?)(?:\\[\\d+\\])?:\\s+(.*)/;\n\n// Syslog format:\n// Apr 4 12:00:00 hostname process[pid]: message\nconst SYSLOG_REGEX = /^(\\w+\\s+\\d+\\s+[\\d:]+)\\s+\\S+\\s+(\\S+?)(?:\\[\\d+\\])?:\\s+(.*)/;\n\n// Extract IP from auth messages\nconst IP_REGEX = /(?:from|FROM)\\s+(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})/;\nconst USER_REGEX = /(?:for|user)\\s+(\\S+?)(?:\\s+from|\\s*$)/;\n\n// Attack pattern signatures\nexport const ATTACK_PATTERNS = {\n sqli: [\n /(?:union\\s+(?:all\\s+)?select)/i,\n /(?:select\\s+.*\\s+from\\s+)/i,\n /(?:insert\\s+into\\s+)/i,\n /(?:drop\\s+(?:table|database))/i,\n /(?:or\\s+1\\s*=\\s*1)/i,\n /(?:'\\s*(?:or|and)\\s+')/i,\n /(?:--\\s*$|;\\s*--)/,\n /(?:\\/\\*.*\\*\\/)/,\n ],\n xss: [\n /<script[^>]*>/i,\n /javascript\\s*:/i,\n /on(?:load|error|click|mouseover)\\s*=/i,\n /eval\\s*\\(/i,\n /document\\.(?:cookie|write|location)/i,\n ],\n path_traversal: [\n /\\.\\.\\//,\n /\\.\\.\\\\/, \n /etc\\/(?:passwd|shadow|hosts)/,\n /proc\\/self/,\n /windows\\/system32/i,\n ],\n rfi: [\n /(?:https?|ftp):\\/\\/.*\\?/i,\n /php:\\/\\/(?:input|filter)/i,\n /data:\\/\\//i,\n ],\n};\n\nexport function parseNginxLog(line: string): NginxLogEntry | null {\n const match = line.match(NGINX_REGEX);\n if (!match) return null;\n\n return {\n timestamp: parseNginxTimestamp(match[2]),\n raw: line,\n source: 'nginx',\n fields: {\n ip: match[1],\n method: match[3],\n path: match[4],\n status: match[5],\n size: match[6],\n user_agent: match[7],\n },\n };\n}\n\nexport function parseAuthLog(line: string): AuthLogEntry | null {\n const match = line.match(AUTH_REGEX);\n if (!match) return null;\n\n const ipMatch = match[3].match(IP_REGEX);\n const userMatch = match[3].match(USER_REGEX);\n\n return {\n timestamp: parseSyslogTimestamp(match[1]),\n raw: line,\n source: 'auth',\n fields: {\n process: match[2],\n message: match[3],\n ip: ipMatch?.[1],\n user: userMatch?.[1],\n },\n };\n}\n\nexport function parseSyslog(line: string): SyslogEntry | null {\n const match = line.match(SYSLOG_REGEX);\n if (!match) return null;\n\n return {\n timestamp: parseSyslogTimestamp(match[1]),\n raw: line,\n source: 'syslog',\n fields: {\n facility: 'syslog',\n process: match[2],\n message: match[3],\n },\n };\n}\n\nexport function detectAttackPattern(path: string): string | null {\n for (const [type, patterns] of Object.entries(ATTACK_PATTERNS)) {\n for (const pattern of patterns) {\n if (pattern.test(path)) {\n return type;\n }\n }\n }\n return null;\n}\n\nexport function autoDetectParser(line: string): ParsedLogLine | null {\n // Try nginx first (most specific format)\n const nginx = parseNginxLog(line);\n if (nginx) return nginx;\n\n // Try auth log\n const auth = parseAuthLog(line);\n if (auth) return auth;\n\n // Fall back to generic syslog\n return parseSyslog(line);\n}\n\nfunction parseNginxTimestamp(s: string): Date {\n // \"04/Apr/2026:12:00:00 +0000\"\n try {\n const cleaned = s.replace(/(\\d{2})\\/(\\w{3})\\/(\\d{4}):/, '$2 $1, $3 ');\n return new Date(cleaned);\n } catch {\n return new Date();\n }\n}\n\nfunction parseSyslogTimestamp(s: string): Date {\n // \"Apr 4 12:00:00\" — no year, assume current\n try {\n const withYear = `${s} ${new Date().getFullYear()}`;\n return new Date(withYear);\n } catch {\n return new Date();\n }\n}\n","import { readdirSync, readFileSync, statSync } from 'node:fs';\nimport { join, relative, extname } from 'node:path';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { banner, logger } from '../core/logger.js';\nimport type { RunResult, StructuredFinding } from '../core/run-result.js';\nimport { summarize } from '../core/run-result.js';\n\ninterface ScanFinding {\n file: string;\n line: number;\n type: string;\n severity: 'low' | 'medium' | 'high' | 'critical';\n message: string;\n snippet: string;\n}\n\n// Secret patterns\nconst SECRET_PATTERNS: Array<{\n name: string;\n pattern: RegExp;\n severity: 'medium' | 'high' | 'critical';\n}> = [\n { name: 'AWS Access Key', pattern: /(?:AKIA[0-9A-Z]{16})/g, severity: 'critical' },\n { name: 'AWS Secret Key', pattern: /(?:aws_secret_access_key|AWS_SECRET)\\s*[=:]\\s*['\"]?([A-Za-z0-9/+=]{40})['\"]?/gi, severity: 'critical' },\n { name: 'GitHub Token', pattern: /(?:ghp_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{82})/g, severity: 'critical' },\n { name: 'Generic API Key', pattern: /(?:api[_-]?key|apikey)\\s*[=:]\\s*['\"]([A-Za-z0-9\\-_]{20,})['\"]?/gi, severity: 'high' },\n { name: 'Generic Secret', pattern: /(?:secret|password|passwd|pwd)\\s*[=:]\\s*['\"]([^'\"]{8,})['\"]?/gi, severity: 'high' },\n { name: 'Private Key', pattern: /-----BEGIN (?:RSA |EC |DSA )?PRIVATE KEY-----/g, severity: 'critical' },\n { name: 'JWT Token', pattern: /eyJ[A-Za-z0-9-_]+\\.eyJ[A-Za-z0-9-_]+\\.[A-Za-z0-9-_.+/=]*/g, severity: 'high' },\n { name: 'Slack Token', pattern: /xox[bpors]-[A-Za-z0-9-]{10,}/g, severity: 'critical' },\n { name: 'Stripe Key', pattern: /(?:sk_live_|pk_live_|sk_test_|pk_test_)[A-Za-z0-9]{20,}/g, severity: 'critical' },\n { name: 'Database URL', pattern: /(?:postgres|mysql|mongodb|redis):\\/\\/[^\\s'\"]+/gi, severity: 'high' },\n { name: 'Bearer Token', pattern: /Bearer\\s+[A-Za-z0-9\\-_\\.]{20,}/g, severity: 'medium' },\n { name: 'Hex Token (32+)', pattern: /(?:token|key|secret|auth)\\s*[=:]\\s*['\"]?([0-9a-f]{32,})['\"]?/gi, severity: 'medium' },\n];\n\n// File permission / misconfig checks\nconst MISCONFIG_FILES = [\n { pattern: '.env', message: '.env file found — may contain secrets' },\n { pattern: '.env.local', message: '.env.local file found — may contain secrets' },\n { pattern: '.env.production', message: '.env.production file found — may contain secrets' },\n { pattern: 'id_rsa', message: 'Private SSH key found' },\n { pattern: 'id_ed25519', message: 'Private SSH key found' },\n { pattern: '.pem', message: 'PEM certificate/key file found' },\n { pattern: '.p12', message: 'PKCS#12 keystore found' },\n { pattern: '.keystore', message: 'Keystore file found' },\n];\n\nconst SKIP_DIRS = new Set([\n 'node_modules', '.git', '.next', 'dist', 'build', '__pycache__',\n '.venv', 'vendor', '.terraform', 'coverage', '.cache',\n]);\n\nconst SCAN_EXTENSIONS = new Set([\n '.ts', '.js', '.tsx', '.jsx', '.py', '.rb', '.go', '.java',\n '.php', '.rs', '.c', '.cpp', '.h', '.yml', '.yaml', '.json',\n '.toml', '.ini', '.cfg', '.conf', '.env', '.sh', '.bash',\n '.tf', '.hcl', '.xml', '.properties', '.gradle',\n]);\n\nexport async function runScan(targetPath: string): Promise<RunResult> {\n const findings: ScanFinding[] = [];\n try {\n scanDirectory(targetPath, targetPath, findings, () => {});\n } catch (err) {\n return {\n type: 'scan',\n target: targetPath,\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: `Scan failed: ${(err as Error).message}`,\n error: (err as Error).message,\n };\n }\n\n const structured: StructuredFinding[] = findings.map((f) => ({\n type: f.type,\n severity: f.severity,\n message: f.message,\n location: `${f.file}:${f.line}`,\n details: { file: f.file, line: f.line, snippet: f.snippet },\n }));\n const summary = summarize(structured);\n\n return {\n type: 'scan',\n target: targetPath,\n findings: structured,\n severity_summary: summary,\n summary: findings.length === 0\n ? 'No security issues found'\n : `${findings.length} issue(s): ${summary.critical}C ${summary.high}H ${summary.medium}M ${summary.low}L`,\n };\n}\n\nexport async function scanCommand(targetPath: string): Promise<RunResult> {\n banner();\n logger.info(`Scanning ${chalk.white(targetPath)} for security issues...\\n`);\n\n const spinner = ora({ text: 'Scanning files...', color: 'green' }).start();\n const findings: ScanFinding[] = [];\n let filesScanned = 0;\n\n try {\n scanDirectory(targetPath, targetPath, findings, () => {\n filesScanned++;\n spinner.text = `Scanning files... (${filesScanned} files)`;\n });\n } catch (err) {\n spinner.fail(`Scan failed: ${(err as Error).message}`);\n return {\n type: 'scan',\n target: targetPath,\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: `Scan failed: ${(err as Error).message}`,\n error: (err as Error).message,\n };\n }\n\n spinner.succeed(`Scanned ${filesScanned} files\\n`);\n\n const structured: StructuredFinding[] = findings.map((f) => ({\n type: f.type,\n severity: f.severity,\n message: f.message,\n location: `${f.file}:${f.line}`,\n details: { file: f.file, line: f.line, snippet: f.snippet },\n }));\n const sevCounts = summarize(structured);\n\n // Print results\n if (findings.length === 0) {\n console.log(chalk.green.bold(' ✓ No security issues found!'));\n console.log();\n return {\n type: 'scan',\n target: targetPath,\n findings: [],\n severity_summary: sevCounts,\n summary: `No issues found across ${filesScanned} files`,\n };\n }\n\n // Group by severity\n const critical = findings.filter((f) => f.severity === 'critical');\n const high = findings.filter((f) => f.severity === 'high');\n const medium = findings.filter((f) => f.severity === 'medium');\n const low = findings.filter((f) => f.severity === 'low');\n\n console.log(chalk.white.bold(' Scan Results'));\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log(\n ` ${chalk.red.bold(critical.length + ' critical')} ` +\n `${chalk.red(high.length + ' high')} ` +\n `${chalk.yellow(medium.length + ' medium')} ` +\n `${chalk.gray(low.length + ' low')}`,\n );\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log();\n\n const allFindings = [...critical, ...high, ...medium, ...low];\n for (const finding of allFindings) {\n const sev =\n finding.severity === 'critical' ? chalk.bgRed.white.bold(` ${finding.severity.toUpperCase()} `) :\n finding.severity === 'high' ? chalk.red(`[${finding.severity.toUpperCase()}]`) :\n finding.severity === 'medium' ? chalk.yellow(`[${finding.severity.toUpperCase()}]`) :\n chalk.gray(`[${finding.severity.toUpperCase()}]`);\n\n console.log(` ${sev} ${chalk.white.bold(finding.type)}`);\n console.log(` ${chalk.gray('File:')} ${chalk.cyan(finding.file)}:${chalk.yellow(String(finding.line))}`);\n console.log(` ${chalk.gray('Info:')} ${finding.message}`);\n if (finding.snippet) {\n // Redact the actual secret value\n const redacted = finding.snippet.replace(\n /(['\"]?)([A-Za-z0-9+/=\\-_]{16,})(['\"]?)/g,\n '$1' + chalk.red('*'.repeat(16)) + '$3',\n );\n console.log(` ${chalk.gray('Code:')} ${redacted.trim()}`);\n }\n console.log();\n }\n\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log(` ${chalk.white.bold(`${findings.length} issue(s) found`)} across ${filesScanned} files`);\n console.log();\n\n return {\n type: 'scan',\n target: targetPath,\n findings: structured,\n severity_summary: sevCounts,\n summary: `${findings.length} issue(s): ${sevCounts.critical}C ${sevCounts.high}H ${sevCounts.medium}M ${sevCounts.low}L`,\n };\n}\n\nfunction scanDirectory(\n basePath: string,\n currentPath: string,\n findings: ScanFinding[],\n onFile: () => void,\n): void {\n let entries;\n try {\n entries = readdirSync(currentPath, { withFileTypes: true });\n } catch {\n return; // Permission denied or similar\n }\n\n for (const entry of entries) {\n const fullPath = join(currentPath, entry.name);\n\n if (entry.isDirectory()) {\n if (SKIP_DIRS.has(entry.name)) continue;\n scanDirectory(basePath, fullPath, findings, onFile);\n continue;\n }\n\n if (!entry.isFile()) continue;\n\n // Check for misconfig files\n for (const mc of MISCONFIG_FILES) {\n if (entry.name === mc.pattern || entry.name.endsWith(mc.pattern)) {\n findings.push({\n file: relative(basePath, fullPath),\n line: 0,\n type: 'Sensitive File',\n severity: 'high',\n message: mc.message,\n snippet: '',\n });\n }\n }\n\n // Only scan text files with known extensions\n const ext = extname(entry.name).toLowerCase();\n if (!SCAN_EXTENSIONS.has(ext) && !entry.name.startsWith('.env')) continue;\n\n // Skip large files\n try {\n const stat = statSync(fullPath);\n if (stat.size > 1024 * 1024) continue; // Skip >1MB\n } catch {\n continue;\n }\n\n onFile();\n\n // Scan file content\n let content: string;\n try {\n content = readFileSync(fullPath, 'utf-8');\n } catch {\n continue;\n }\n\n const lines = content.split('\\n');\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n // Skip comments\n if (line.trim().startsWith('//') && !line.includes('password') && !line.includes('secret')) continue;\n\n for (const pattern of SECRET_PATTERNS) {\n pattern.pattern.lastIndex = 0;\n if (pattern.pattern.test(line)) {\n findings.push({\n file: relative(basePath, fullPath),\n line: i + 1,\n type: pattern.name,\n severity: pattern.severity,\n message: `Possible ${pattern.name} detected`,\n snippet: line.length > 120 ? line.slice(0, 120) + '...' : line,\n });\n }\n }\n }\n }\n}\n","import process from 'node:process';\nimport chalk from 'chalk';\nimport cliCursor from 'cli-cursor';\nimport cliSpinners from 'cli-spinners';\nimport logSymbols from 'log-symbols';\nimport stripAnsi from 'strip-ansi';\nimport stringWidth from 'string-width';\nimport isInteractive from 'is-interactive';\nimport isUnicodeSupported from 'is-unicode-supported';\nimport stdinDiscarder from 'stdin-discarder';\n\nclass Ora {\n\t#linesToClear = 0;\n\t#isDiscardingStdin = false;\n\t#lineCount = 0;\n\t#frameIndex = -1;\n\t#lastSpinnerFrameTime = 0;\n\t#options;\n\t#spinner;\n\t#stream;\n\t#id;\n\t#initialInterval;\n\t#isEnabled;\n\t#isSilent;\n\t#indent;\n\t#text;\n\t#prefixText;\n\t#suffixText;\n\tcolor;\n\n\tconstructor(options) {\n\t\tif (typeof options === 'string') {\n\t\t\toptions = {\n\t\t\t\ttext: options,\n\t\t\t};\n\t\t}\n\n\t\tthis.#options = {\n\t\t\tcolor: 'cyan',\n\t\t\tstream: process.stderr,\n\t\t\tdiscardStdin: true,\n\t\t\thideCursor: true,\n\t\t\t...options,\n\t\t};\n\n\t\t// Public\n\t\tthis.color = this.#options.color;\n\n\t\t// It's important that these use the public setters.\n\t\tthis.spinner = this.#options.spinner;\n\n\t\tthis.#initialInterval = this.#options.interval;\n\t\tthis.#stream = this.#options.stream;\n\t\tthis.#isEnabled = typeof this.#options.isEnabled === 'boolean' ? this.#options.isEnabled : isInteractive({stream: this.#stream});\n\t\tthis.#isSilent = typeof this.#options.isSilent === 'boolean' ? this.#options.isSilent : false;\n\n\t\t// Set *after* `this.#stream`.\n\t\t// It's important that these use the public setters.\n\t\tthis.text = this.#options.text;\n\t\tthis.prefixText = this.#options.prefixText;\n\t\tthis.suffixText = this.#options.suffixText;\n\t\tthis.indent = this.#options.indent;\n\n\t\tif (process.env.NODE_ENV === 'test') {\n\t\t\tthis._stream = this.#stream;\n\t\t\tthis._isEnabled = this.#isEnabled;\n\n\t\t\tObject.defineProperty(this, '_linesToClear', {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#linesToClear;\n\t\t\t\t},\n\t\t\t\tset(newValue) {\n\t\t\t\t\tthis.#linesToClear = newValue;\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tObject.defineProperty(this, '_frameIndex', {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#frameIndex;\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tObject.defineProperty(this, '_lineCount', {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#lineCount;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\tget indent() {\n\t\treturn this.#indent;\n\t}\n\n\tset indent(indent = 0) {\n\t\tif (!(indent >= 0 && Number.isInteger(indent))) {\n\t\t\tthrow new Error('The `indent` option must be an integer from 0 and up');\n\t\t}\n\n\t\tthis.#indent = indent;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget interval() {\n\t\treturn this.#initialInterval ?? this.#spinner.interval ?? 100;\n\t}\n\n\tget spinner() {\n\t\treturn this.#spinner;\n\t}\n\n\tset spinner(spinner) {\n\t\tthis.#frameIndex = -1;\n\t\tthis.#initialInterval = undefined;\n\n\t\tif (typeof spinner === 'object') {\n\t\t\tif (spinner.frames === undefined) {\n\t\t\t\tthrow new Error('The given spinner must have a `frames` property');\n\t\t\t}\n\n\t\t\tthis.#spinner = spinner;\n\t\t} else if (!isUnicodeSupported()) {\n\t\t\tthis.#spinner = cliSpinners.line;\n\t\t} else if (spinner === undefined) {\n\t\t\t// Set default spinner\n\t\t\tthis.#spinner = cliSpinners.dots;\n\t\t} else if (spinner !== 'default' && cliSpinners[spinner]) {\n\t\t\tthis.#spinner = cliSpinners[spinner];\n\t\t} else {\n\t\t\tthrow new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);\n\t\t}\n\t}\n\n\tget text() {\n\t\treturn this.#text;\n\t}\n\n\tset text(value = '') {\n\t\tthis.#text = value;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget prefixText() {\n\t\treturn this.#prefixText;\n\t}\n\n\tset prefixText(value = '') {\n\t\tthis.#prefixText = value;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget suffixText() {\n\t\treturn this.#suffixText;\n\t}\n\n\tset suffixText(value = '') {\n\t\tthis.#suffixText = value;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget isSpinning() {\n\t\treturn this.#id !== undefined;\n\t}\n\n\t#getFullPrefixText(prefixText = this.#prefixText, postfix = ' ') {\n\t\tif (typeof prefixText === 'string' && prefixText !== '') {\n\t\t\treturn prefixText + postfix;\n\t\t}\n\n\t\tif (typeof prefixText === 'function') {\n\t\t\treturn prefixText() + postfix;\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t#getFullSuffixText(suffixText = this.#suffixText, prefix = ' ') {\n\t\tif (typeof suffixText === 'string' && suffixText !== '') {\n\t\t\treturn prefix + suffixText;\n\t\t}\n\n\t\tif (typeof suffixText === 'function') {\n\t\t\treturn prefix + suffixText();\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t#updateLineCount() {\n\t\tconst columns = this.#stream.columns ?? 80;\n\t\tconst fullPrefixText = this.#getFullPrefixText(this.#prefixText, '-');\n\t\tconst fullSuffixText = this.#getFullSuffixText(this.#suffixText, '-');\n\t\tconst fullText = ' '.repeat(this.#indent) + fullPrefixText + '--' + this.#text + '--' + fullSuffixText;\n\n\t\tthis.#lineCount = 0;\n\t\tfor (const line of stripAnsi(fullText).split('\\n')) {\n\t\t\tthis.#lineCount += Math.max(1, Math.ceil(stringWidth(line, {countAnsiEscapeCodes: true}) / columns));\n\t\t}\n\t}\n\n\tget isEnabled() {\n\t\treturn this.#isEnabled && !this.#isSilent;\n\t}\n\n\tset isEnabled(value) {\n\t\tif (typeof value !== 'boolean') {\n\t\t\tthrow new TypeError('The `isEnabled` option must be a boolean');\n\t\t}\n\n\t\tthis.#isEnabled = value;\n\t}\n\n\tget isSilent() {\n\t\treturn this.#isSilent;\n\t}\n\n\tset isSilent(value) {\n\t\tif (typeof value !== 'boolean') {\n\t\t\tthrow new TypeError('The `isSilent` option must be a boolean');\n\t\t}\n\n\t\tthis.#isSilent = value;\n\t}\n\n\tframe() {\n\t\t// Ensure we only update the spinner frame at the wanted interval,\n\t\t// even if the render method is called more often.\n\t\tconst now = Date.now();\n\t\tif (this.#frameIndex === -1 || now - this.#lastSpinnerFrameTime >= this.interval) {\n\t\t\tthis.#frameIndex = ++this.#frameIndex % this.#spinner.frames.length;\n\t\t\tthis.#lastSpinnerFrameTime = now;\n\t\t}\n\n\t\tconst {frames} = this.#spinner;\n\t\tlet frame = frames[this.#frameIndex];\n\n\t\tif (this.color) {\n\t\t\tframe = chalk[this.color](frame);\n\t\t}\n\n\t\tconst fullPrefixText = (typeof this.#prefixText === 'string' && this.#prefixText !== '') ? this.#prefixText + ' ' : '';\n\t\tconst fullText = typeof this.text === 'string' ? ' ' + this.text : '';\n\t\tconst fullSuffixText = (typeof this.#suffixText === 'string' && this.#suffixText !== '') ? ' ' + this.#suffixText : '';\n\n\t\treturn fullPrefixText + frame + fullText + fullSuffixText;\n\t}\n\n\tclear() {\n\t\tif (!this.#isEnabled || !this.#stream.isTTY) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.#stream.cursorTo(0);\n\n\t\tfor (let index = 0; index < this.#linesToClear; index++) {\n\t\t\tif (index > 0) {\n\t\t\t\tthis.#stream.moveCursor(0, -1);\n\t\t\t}\n\n\t\t\tthis.#stream.clearLine(1);\n\t\t}\n\n\t\tif (this.#indent || this.lastIndent !== this.#indent) {\n\t\t\tthis.#stream.cursorTo(this.#indent);\n\t\t}\n\n\t\tthis.lastIndent = this.#indent;\n\t\tthis.#linesToClear = 0;\n\n\t\treturn this;\n\t}\n\n\trender() {\n\t\tif (this.#isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.clear();\n\t\tthis.#stream.write(this.frame());\n\t\tthis.#linesToClear = this.#lineCount;\n\n\t\treturn this;\n\t}\n\n\tstart(text) {\n\t\tif (text) {\n\t\t\tthis.text = text;\n\t\t}\n\n\t\tif (this.#isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif (!this.#isEnabled) {\n\t\t\tif (this.text) {\n\t\t\t\tthis.#stream.write(`- ${this.text}\\n`);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this.isSpinning) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this.#options.hideCursor) {\n\t\t\tcliCursor.hide(this.#stream);\n\t\t}\n\n\t\tif (this.#options.discardStdin && process.stdin.isTTY) {\n\t\t\tthis.#isDiscardingStdin = true;\n\t\t\tstdinDiscarder.start();\n\t\t}\n\n\t\tthis.render();\n\t\tthis.#id = setInterval(this.render.bind(this), this.interval);\n\n\t\treturn this;\n\t}\n\n\tstop() {\n\t\tif (!this.#isEnabled) {\n\t\t\treturn this;\n\t\t}\n\n\t\tclearInterval(this.#id);\n\t\tthis.#id = undefined;\n\t\tthis.#frameIndex = 0;\n\t\tthis.clear();\n\t\tif (this.#options.hideCursor) {\n\t\t\tcliCursor.show(this.#stream);\n\t\t}\n\n\t\tif (this.#options.discardStdin && process.stdin.isTTY && this.#isDiscardingStdin) {\n\t\t\tstdinDiscarder.stop();\n\t\t\tthis.#isDiscardingStdin = false;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsucceed(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.success, text});\n\t}\n\n\tfail(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.error, text});\n\t}\n\n\twarn(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.warning, text});\n\t}\n\n\tinfo(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.info, text});\n\t}\n\n\tstopAndPersist(options = {}) {\n\t\tif (this.#isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst prefixText = options.prefixText ?? this.#prefixText;\n\t\tconst fullPrefixText = this.#getFullPrefixText(prefixText, ' ');\n\n\t\tconst symbolText = options.symbol ?? ' ';\n\n\t\tconst text = options.text ?? this.text;\n\t\tconst separatorText = symbolText ? ' ' : '';\n\t\tconst fullText = (typeof text === 'string') ? separatorText + text : '';\n\n\t\tconst suffixText = options.suffixText ?? this.#suffixText;\n\t\tconst fullSuffixText = this.#getFullSuffixText(suffixText, ' ');\n\n\t\tconst textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + '\\n';\n\n\t\tthis.stop();\n\t\tthis.#stream.write(textToWrite);\n\n\t\treturn this;\n\t}\n}\n\nexport default function ora(options) {\n\treturn new Ora(options);\n}\n\nexport async function oraPromise(action, options) {\n\tconst actionIsFunction = typeof action === 'function';\n\tconst actionIsPromise = typeof action.then === 'function';\n\n\tif (!actionIsFunction && !actionIsPromise) {\n\t\tthrow new TypeError('Parameter `action` must be a Function or a Promise');\n\t}\n\n\tconst {successText, failText} = typeof options === 'object'\n\t\t? options\n\t\t: {successText: undefined, failText: undefined};\n\n\tconst spinner = ora(options).start();\n\n\ttry {\n\t\tconst promise = actionIsFunction ? action(spinner) : action;\n\t\tconst result = await promise;\n\n\t\tspinner.succeed(\n\t\t\tsuccessText === undefined\n\t\t\t\t? undefined\n\t\t\t\t: (typeof successText === 'string' ? successText : successText(result)),\n\t\t);\n\n\t\treturn result;\n\t} catch (error) {\n\t\tspinner.fail(\n\t\t\tfailText === undefined\n\t\t\t\t? undefined\n\t\t\t\t: (typeof failText === 'string' ? failText : failText(error)),\n\t\t);\n\n\t\tthrow error;\n\t}\n}\n\nexport {default as spinners} from 'cli-spinners';\n","import process from 'node:process';\nimport restoreCursor from 'restore-cursor';\n\nlet isHidden = false;\n\nconst cliCursor = {};\n\ncliCursor.show = (writableStream = process.stderr) => {\n\tif (!writableStream.isTTY) {\n\t\treturn;\n\t}\n\n\tisHidden = false;\n\twritableStream.write('\\u001B[?25h');\n};\n\ncliCursor.hide = (writableStream = process.stderr) => {\n\tif (!writableStream.isTTY) {\n\t\treturn;\n\t}\n\n\trestoreCursor();\n\tisHidden = true;\n\twritableStream.write('\\u001B[?25l');\n};\n\ncliCursor.toggle = (force, writableStream) => {\n\tif (force !== undefined) {\n\t\tisHidden = force;\n\t}\n\n\tif (isHidden) {\n\t\tcliCursor.show(writableStream);\n\t} else {\n\t\tcliCursor.hide(writableStream);\n\t}\n};\n\nexport default cliCursor;\n","import process from 'node:process';\nimport onetime from 'onetime';\nimport {onExit} from 'signal-exit';\n\nconst terminal = process.stderr.isTTY\n\t? process.stderr\n\t: (process.stdout.isTTY ? process.stdout : undefined);\n\nconst restoreCursor = terminal ? onetime(() => {\n\tonExit(() => {\n\t\tterminal.write('\\u001B[?25h');\n\t}, {alwaysLast: true});\n}) : () => {};\n\nexport default restoreCursor;\n","const copyProperty = (to, from, property, ignoreNonConfigurable) => {\n\t// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.\n\t// `Function#prototype` is non-writable and non-configurable so can never be modified.\n\tif (property === 'length' || property === 'prototype') {\n\t\treturn;\n\t}\n\n\t// `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.\n\tif (property === 'arguments' || property === 'caller') {\n\t\treturn;\n\t}\n\n\tconst toDescriptor = Object.getOwnPropertyDescriptor(to, property);\n\tconst fromDescriptor = Object.getOwnPropertyDescriptor(from, property);\n\n\tif (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(to, property, fromDescriptor);\n};\n\n// `Object.defineProperty()` throws if the property exists, is not configurable and either:\n// - one its descriptors is changed\n// - it is non-writable and its value is changed\nconst canCopyProperty = function (toDescriptor, fromDescriptor) {\n\treturn toDescriptor === undefined || toDescriptor.configurable || (\n\t\ttoDescriptor.writable === fromDescriptor.writable\n\t\t&& toDescriptor.enumerable === fromDescriptor.enumerable\n\t\t&& toDescriptor.configurable === fromDescriptor.configurable\n\t\t&& (toDescriptor.writable || toDescriptor.value === fromDescriptor.value)\n\t);\n};\n\nconst changePrototype = (to, from) => {\n\tconst fromPrototype = Object.getPrototypeOf(from);\n\tif (fromPrototype === Object.getPrototypeOf(to)) {\n\t\treturn;\n\t}\n\n\tObject.setPrototypeOf(to, fromPrototype);\n};\n\nconst wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\\n${fromBody}`;\n\nconst toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');\nconst toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');\n\n// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.\n// We use `bind()` instead of a closure for the same reason.\n// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.\nconst changeToString = (to, from, name) => {\n\tconst withName = name === '' ? '' : `with ${name.trim()}() `;\n\tconst newToString = wrappedToString.bind(null, withName, from.toString());\n\t// Ensure `to.toString.toString` is non-enumerable and has the same `same`\n\tObject.defineProperty(newToString, 'name', toStringName);\n\tconst {writable, enumerable, configurable} = toStringDescriptor; // We destructue to avoid a potential `get` descriptor.\n\tObject.defineProperty(to, 'toString', {value: newToString, writable, enumerable, configurable});\n};\n\nexport default function mimicFunction(to, from, {ignoreNonConfigurable = false} = {}) {\n\tconst {name} = to;\n\n\tfor (const property of Reflect.ownKeys(from)) {\n\t\tcopyProperty(to, from, property, ignoreNonConfigurable);\n\t}\n\n\tchangePrototype(to, from);\n\tchangeToString(to, from, name);\n\n\treturn to;\n}\n","import mimicFunction from 'mimic-function';\n\nconst calledFunctions = new WeakMap();\n\nconst onetime = (function_, options = {}) => {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError('Expected a function');\n\t}\n\n\tlet returnValue;\n\tlet callCount = 0;\n\tconst functionName = function_.displayName || function_.name || '<anonymous>';\n\n\tconst onetime = function (...arguments_) {\n\t\tcalledFunctions.set(onetime, ++callCount);\n\n\t\tif (callCount === 1) {\n\t\t\treturnValue = function_.apply(this, arguments_);\n\t\t\tfunction_ = undefined;\n\t\t} else if (options.throw === true) {\n\t\t\tthrow new Error(`Function \\`${functionName}\\` can only be called once`);\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tmimicFunction(onetime, function_);\n\tcalledFunctions.set(onetime, callCount);\n\n\treturn onetime;\n};\n\nonetime.callCount = function_ => {\n\tif (!calledFunctions.has(function_)) {\n\t\tthrow new Error(`The given function \\`${function_.name}\\` is not wrapped by the \\`onetime\\` package`);\n\t}\n\n\treturn calledFunctions.get(function_);\n};\n\nexport default onetime;\n","/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals: NodeJS.Signals[] = []\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM')\n\nif (process.platform !== 'win32') {\n signals.push(\n 'SIGALRM',\n 'SIGABRT',\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT')\n}\n","// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js'\nexport { signals }\n\n// just a loosened process type so we can do some evil things\ntype ProcessRE = NodeJS.Process & {\n reallyExit: (code?: number | undefined | null) => any\n emit: (ev: string, ...a: any[]) => any\n}\n\nconst processOk = (process: any): process is ProcessRE =>\n !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n\nconst kExitEmitter = Symbol.for('signal-exit emitter')\nconst global: typeof globalThis & { [kExitEmitter]?: Emitter } = globalThis\nconst ObjectDefineProperty = Object.defineProperty.bind(Object)\n\n/**\n * A function that takes an exit code and signal as arguments\n *\n * In the case of signal exits *only*, a return value of true\n * will indicate that the signal is being handled, and we should\n * not synthetically exit with the signal we received. Regardless\n * of the handler return value, the handler is unloaded when an\n * otherwise fatal signal is received, so you get exactly 1 shot\n * at it, unless you add another onExit handler at that point.\n *\n * In the case of numeric code exits, we may already have committed\n * to exiting the process, for example via a fatal exception or\n * unhandled promise rejection, so it is impossible to stop safely.\n */\nexport type Handler = (\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n) => true | void\ntype ExitEvent = 'afterExit' | 'exit'\ntype Emitted = { [k in ExitEvent]: boolean }\ntype Listeners = { [k in ExitEvent]: Handler[] }\n\n// teeny special purpose ee\nclass Emitter {\n emitted: Emitted = {\n afterExit: false,\n exit: false,\n }\n\n listeners: Listeners = {\n afterExit: [],\n exit: [],\n }\n\n count: number = 0\n id: number = Math.random()\n\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter]\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n })\n }\n\n on(ev: ExitEvent, fn: Handler) {\n this.listeners[ev].push(fn)\n }\n\n removeListener(ev: ExitEvent, fn: Handler) {\n const list = this.listeners[ev]\n const i = list.indexOf(fn)\n /* c8 ignore start */\n if (i === -1) {\n return\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0\n } else {\n list.splice(i, 1)\n }\n }\n\n emit(\n ev: ExitEvent,\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n ): boolean {\n if (this.emitted[ev]) {\n return false\n }\n this.emitted[ev] = true\n let ret: boolean = false\n for (const fn of this.listeners[ev]) {\n ret = fn(code, signal) === true || ret\n }\n if (ev === 'exit') {\n ret = this.emit('afterExit', code, signal) || ret\n }\n return ret\n }\n}\n\nabstract class SignalExitBase {\n abstract onExit(cb: Handler, opts?: { alwaysLast?: boolean }): () => void\n abstract load(): void\n abstract unload(): void\n}\n\nconst signalExitWrap = <T extends SignalExitBase>(handler: T) => {\n return {\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n return handler.onExit(cb, opts)\n },\n load() {\n return handler.load()\n },\n unload() {\n return handler.unload()\n },\n }\n}\n\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => {}\n }\n load() {}\n unload() {}\n}\n\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'\n /* c8 ignore stop */\n #emitter = new Emitter()\n #process: ProcessRE\n #originalProcessEmit: ProcessRE['emit']\n #originalProcessReallyExit: ProcessRE['reallyExit']\n\n #sigListeners: { [k in NodeJS.Signals]?: () => void } = {}\n #loaded: boolean = false\n\n constructor(process: ProcessRE) {\n super()\n this.#process = process\n // { <signal>: <listener fn>, ... }\n this.#sigListeners = {}\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig)\n let { count } = this.#emitter\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit, and increment by the count of listeners it has\n // created.\n /* c8 ignore start */\n const p = process as unknown as {\n __signal_exit_emitter__?: { count: number }\n }\n if (\n typeof p.__signal_exit_emitter__ === 'object' &&\n typeof p.__signal_exit_emitter__.count === 'number'\n ) {\n count += p.__signal_exit_emitter__.count\n }\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload()\n const ret = this.#emitter.emit('exit', null, sig)\n /* c8 ignore start */\n const s = sig === 'SIGHUP' ? this.#hupSig : sig\n if (!ret) process.kill(process.pid, s)\n /* c8 ignore stop */\n }\n }\n }\n\n this.#originalProcessReallyExit = process.reallyExit\n this.#originalProcessEmit = process.emit\n }\n\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => {}\n }\n /* c8 ignore stop */\n\n if (this.#loaded === false) {\n this.load()\n }\n\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit'\n this.#emitter.on(ev, cb)\n return () => {\n this.#emitter.removeListener(ev, cb)\n if (\n this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0\n ) {\n this.unload()\n }\n }\n }\n\n load() {\n if (this.#loaded) {\n return\n }\n this.#loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1\n\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig]\n if (fn) this.#process.on(sig, fn)\n } catch (_) {}\n }\n\n this.#process.emit = (ev: string, ...a: any[]) => {\n return this.#processEmit(ev, ...a)\n }\n this.#process.reallyExit = (code?: number | null | undefined) => {\n return this.#processReallyExit(code)\n }\n }\n\n unload() {\n if (!this.#loaded) {\n return\n }\n this.#loaded = false\n\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig]\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig)\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n })\n this.#process.emit = this.#originalProcessEmit\n this.#process.reallyExit = this.#originalProcessReallyExit\n this.#emitter.count -= 1\n }\n\n #processReallyExit(code?: number | null | undefined) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0\n }\n this.#process.exitCode = code || 0\n /* c8 ignore stop */\n\n this.#emitter.emit('exit', this.#process.exitCode, null)\n return this.#originalProcessReallyExit.call(\n this.#process,\n this.#process.exitCode\n )\n }\n\n #processEmit(ev: string, ...args: any[]): any {\n const og = this.#originalProcessEmit\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0]\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args)\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null)\n /* c8 ignore stop */\n return ret\n } else {\n return og.call(this.#process, ev, ...args)\n }\n }\n}\n\nconst process = globalThis.process\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const {\n /**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\n onExit,\n\n /**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n load,\n\n /**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n unload,\n} = signalExitWrap(\n processOk(process) ? new SignalExit(process) : new SignalExitFallback()\n)\n","import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tif (process.platform !== 'win32') {\n\t\treturn process.env.TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(process.env.CI)\n\t\t|| Boolean(process.env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(process.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| process.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| process.env.TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| process.env.TERM_PROGRAM === 'vscode'\n\t\t|| process.env.TERM === 'xterm-256color'\n\t\t|| process.env.TERM === 'alacritty'\n\t\t|| process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n","import chalk from 'chalk';\nimport isUnicodeSupported from 'is-unicode-supported';\n\nconst main = {\n\tinfo: chalk.blue('ℹ'),\n\tsuccess: chalk.green('✔'),\n\twarning: chalk.yellow('⚠'),\n\terror: chalk.red('✖'),\n};\n\nconst fallback = {\n\tinfo: chalk.blue('i'),\n\tsuccess: chalk.green('√'),\n\twarning: chalk.yellow('‼'),\n\terror: chalk.red('×'),\n};\n\nconst logSymbols = isUnicodeSupported() ? main : fallback;\n\nexport default logSymbols;\n","export default function ansiRegex({onlyFirst = false} = {}) {\n\t// Valid string terminator sequences are BEL, ESC\\, and 0x9c\n\tconst ST = '(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)';\n\n\t// OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n\tconst osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n\t// CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n\tconst csi = '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]';\n\n\tconst pattern = `${osc}|${csi}`;\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Fast path: ANSI codes require ESC (7-bit) or CSI (8-bit) introducer\n\tif (!string.includes('\\u001B') && !string.includes('\\u009B')) {\n\t\treturn string;\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n","// Generated by scripts/build.js\n\n// prettier-ignore\nconst ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];\n\n// prettier-ignore\nconst fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];\n\n// prettier-ignore\nconst halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];\n\n// prettier-ignore\nconst narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];\n\n// prettier-ignore\nconst wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141];\n\nexport {ambiguousRanges, fullwidthRanges, halfwidthRanges, narrowRanges, wideRanges};\n","/**\nBinary search on a sorted flat array of [start, end] pairs.\n\n@param {number[]} ranges - Flat array of inclusive [start, end] range pairs, e.g. [0, 5, 10, 20].\n@param {number} codePoint - The value to search for.\n@returns {boolean} Whether the value falls within any of the ranges.\n*/\nexport const isInRange = (ranges, codePoint) => {\n\tlet low = 0;\n\tlet high = Math.floor(ranges.length / 2) - 1;\n\twhile (low <= high) {\n\t\tconst mid = Math.floor((low + high) / 2);\n\t\tconst i = mid * 2;\n\t\tif (codePoint < ranges[i]) {\n\t\t\thigh = mid - 1;\n\t\t} else if (codePoint > ranges[i + 1]) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n};\n","import {\n\tambiguousRanges,\n\tfullwidthRanges,\n\thalfwidthRanges,\n\tnarrowRanges,\n\twideRanges,\n} from './lookup-data.js';\nimport {isInRange} from './utilities.js';\n\nconst minimumAmbiguousCodePoint = ambiguousRanges[0];\nconst maximumAmbiguousCodePoint = ambiguousRanges.at(-1);\nconst minimumFullWidthCodePoint = fullwidthRanges[0];\nconst maximumFullWidthCodePoint = fullwidthRanges.at(-1);\nconst minimumHalfWidthCodePoint = halfwidthRanges[0];\nconst maximumHalfWidthCodePoint = halfwidthRanges.at(-1);\nconst minimumNarrowCodePoint = narrowRanges[0];\nconst maximumNarrowCodePoint = narrowRanges.at(-1);\nconst minimumWideCodePoint = wideRanges[0];\nconst maximumWideCodePoint = wideRanges.at(-1);\n\nconst commonCjkCodePoint = 0x4E_00;\nconst [wideFastPathStart, wideFastPathEnd] = findWideFastPathRange(wideRanges);\n\n// Use a hot-path range so common `isWide` calls can skip binary search.\n// The range containing U+4E00 covers common CJK ideographs;\n// fallback to the largest range for resilience to Unicode table changes.\nfunction findWideFastPathRange(ranges) {\n\tlet fastPathStart = ranges[0];\n\tlet fastPathEnd = ranges[1];\n\n\tfor (let index = 0; index < ranges.length; index += 2) {\n\t\tconst start = ranges[index];\n\t\tconst end = ranges[index + 1];\n\n\t\tif (\n\t\t\tcommonCjkCodePoint >= start\n\t\t\t&& commonCjkCodePoint <= end\n\t\t) {\n\t\t\treturn [start, end];\n\t\t}\n\n\t\tif ((end - start) > (fastPathEnd - fastPathStart)) {\n\t\t\tfastPathStart = start;\n\t\t\tfastPathEnd = end;\n\t\t}\n\t}\n\n\treturn [fastPathStart, fastPathEnd];\n}\n\nexport const isAmbiguous = codePoint => {\n\tif (\n\t\tcodePoint < minimumAmbiguousCodePoint\n\t\t|| codePoint > maximumAmbiguousCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(ambiguousRanges, codePoint);\n};\n\nexport const isFullWidth = codePoint => {\n\tif (\n\t\tcodePoint < minimumFullWidthCodePoint\n\t\t|| codePoint > maximumFullWidthCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(fullwidthRanges, codePoint);\n};\n\nconst isHalfWidth = codePoint => {\n\tif (\n\t\tcodePoint < minimumHalfWidthCodePoint\n\t\t|| codePoint > maximumHalfWidthCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(halfwidthRanges, codePoint);\n};\n\nconst isNarrow = codePoint => {\n\tif (\n\t\tcodePoint < minimumNarrowCodePoint\n\t\t|| codePoint > maximumNarrowCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(narrowRanges, codePoint);\n};\n\nexport const isWide = codePoint => {\n\tif (\n\t\tcodePoint >= wideFastPathStart\n\t\t&& codePoint <= wideFastPathEnd\n\t) {\n\t\treturn true;\n\t}\n\n\tif (\n\t\tcodePoint < minimumWideCodePoint\n\t\t|| codePoint > maximumWideCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(wideRanges, codePoint);\n};\n\nexport function getCategory(codePoint) {\n\tif (isAmbiguous(codePoint)) {\n\t\treturn 'ambiguous';\n\t}\n\n\tif (isFullWidth(codePoint)) {\n\t\treturn 'fullwidth';\n\t}\n\n\tif (isHalfWidth(codePoint)) {\n\t\treturn 'halfwidth';\n\t}\n\n\tif (isNarrow(codePoint)) {\n\t\treturn 'narrow';\n\t}\n\n\tif (isWide(codePoint)) {\n\t\treturn 'wide';\n\t}\n\n\treturn 'neutral';\n}\n","import {getCategory, isAmbiguous, isFullWidth, isWide} from './lookup.js';\n\nfunction validate(codePoint) {\n\tif (!Number.isSafeInteger(codePoint)) {\n\t\tthrow new TypeError(`Expected a code point, got \\`${typeof codePoint}\\`.`);\n\t}\n}\n\nexport function eastAsianWidthType(codePoint) {\n\tvalidate(codePoint);\n\n\treturn getCategory(codePoint);\n}\n\nexport function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {\n\tvalidate(codePoint);\n\n\tif (\n\t\tisFullWidth(codePoint)\n\t\t|| isWide(codePoint)\n\t\t|| (ambiguousAsWide && isAmbiguous(codePoint))\n\t) {\n\t\treturn 2;\n\t}\n\n\treturn 1;\n}\n\n// Private exports for https://github.com/sindresorhus/is-fullwidth-code-point\nexport {isFullWidth as _isFullWidth, isWide as _isWide} from './lookup.js';\n","export default () => {\n\t// https://mths.be/emoji\n\treturn /[#*0-9]\\uFE0F?\\u20E3|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26AA\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C8\\u26CF\\u26D1\\u26E9\\u26F0-\\u26F5\\u26F7\\u26F8\\u26FA\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B55\\u3030\\u303D\\u3297\\u3299]\\uFE0F?|[\\u261D\\u270C\\u270D](?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?|[\\u270A\\u270B](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\u23E9-\\u23EC\\u23F0\\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F0]|\\uDC08(?:\\u200D\\u2B1B)?|\\uDC15(?:\\u200D\\uD83E\\uDDBA)?|\\uDC26(?:\\u200D(?:\\u2B1B|\\uD83D\\uDD25))?|\\uDC3B(?:\\u200D\\u2744\\uFE0F?)?|\\uDC41\\uFE0F?(?:\\u200D\\uD83D\\uDDE8\\uFE0F?)?|\\uDC68(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDC68\\uDC69]\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFC-\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFC-\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFD-\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFD\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFE])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFE]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?))?|\\uDC69(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?[\\uDC68\\uDC69]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?|\\uDC69\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?))|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFC-\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFC-\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFC-\\uDFFF])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFD-\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFD\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB-\\uDFFE])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFE]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB-\\uDFFE])))?))?|\\uDD75(?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uDE2E(?:\\u200D\\uD83D\\uDCA8)?|\\uDE35(?:\\u200D\\uD83D\\uDCAB)?|\\uDE36(?:\\u200D\\uD83C\\uDF2B\\uFE0F?)?|\\uDE42(?:\\u200D[\\u2194\\u2195]\\uFE0F?)?|\\uDEB6(?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D(?:[\\u2640\\u2642]\\uFE0F?(?:\\u200D\\u27A1\\uFE0F?)?|\\u27A1\\uFE0F?))?)|\\uD83E(?:[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5\\uDEC3-\\uDEC5\\uDEF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DFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFE])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3\\uDE70]|\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF]|\\uDEEF\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFE])))?))?|\\uDEF1(?:\\uD83C(?:\\uDFFB(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFC-\\uDFFF])?|\\uDFFC(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])?|\\uDFFD(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])?|\\uDFFE(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])?|\\uDFFF(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB-\\uDFFE])?))?)/g;\n};\n","import stripAnsi from 'strip-ansi';\nimport {eastAsianWidth} from 'get-east-asian-width';\nimport emojiRegex from 'emoji-regex';\n\nconst segmenter = new Intl.Segmenter();\n\nconst defaultIgnorableCodePointRegex = /^\\p{Default_Ignorable_Code_Point}$/u;\n\nexport default function stringWidth(string, options = {}) {\n\tif (typeof string !== 'string' || string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tconst {\n\t\tambiguousIsNarrow = true,\n\t\tcountAnsiEscapeCodes = false,\n\t} = options;\n\n\tif (!countAnsiEscapeCodes) {\n\t\tstring = stripAnsi(string);\n\t}\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tlet width = 0;\n\tconst eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};\n\n\tfor (const {segment: character} of segmenter.segment(string)) {\n\t\tconst codePoint = character.codePointAt(0);\n\n\t\t// Ignore control characters\n\t\tif (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore zero-width characters\n\t\tif (\n\t\t\t(codePoint >= 0x20_0B && codePoint <= 0x20_0F) // Zero-width space, non-joiner, joiner, left-to-right mark, right-to-left mark\n\t\t\t|| codePoint === 0xFE_FF // Zero-width no-break space\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore combining characters\n\t\tif (\n\t\t\t(codePoint >= 0x3_00 && codePoint <= 0x3_6F) // Combining diacritical marks\n\t\t\t|| (codePoint >= 0x1A_B0 && codePoint <= 0x1A_FF) // Combining diacritical marks extended\n\t\t\t|| (codePoint >= 0x1D_C0 && codePoint <= 0x1D_FF) // Combining diacritical marks supplement\n\t\t\t|| (codePoint >= 0x20_D0 && codePoint <= 0x20_FF) // Combining diacritical marks for symbols\n\t\t\t|| (codePoint >= 0xFE_20 && codePoint <= 0xFE_2F) // Combining half marks\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore surrogate pairs\n\t\tif (codePoint >= 0xD8_00 && codePoint <= 0xDF_FF) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore variation selectors\n\t\tif (codePoint >= 0xFE_00 && codePoint <= 0xFE_0F) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// This covers some of the above cases, but we still keep them for performance reasons.\n\t\tif (defaultIgnorableCodePointRegex.test(character)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// TODO: Use `/\\p{RGI_Emoji}/v` when targeting Node.js 20.\n\t\tif (emojiRegex().test(character)) {\n\t\t\twidth += 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\twidth += eastAsianWidth(codePoint, eastAsianWidthOptions);\n\t}\n\n\treturn width;\n}\n","export default function isInteractive({stream = process.stdout} = {}) {\n\treturn Boolean(\n\t\tstream && stream.isTTY &&\n\t\tprocess.env.TERM !== 'dumb' &&\n\t\t!('CI' in process.env)\n\t);\n}\n","import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tconst {env} = process;\n\tconst {TERM, TERM_PROGRAM} = env;\n\n\tif (process.platform !== 'win32') {\n\t\treturn TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| TERM_PROGRAM === 'vscode'\n\t\t|| TERM === 'xterm-256color'\n\t\t|| TERM === 'alacritty'\n\t\t|| TERM === 'rxvt-unicode'\n\t\t|| TERM === 'rxvt-unicode-256color'\n\t\t|| env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n","import process from 'node:process';\n\nconst ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code\n\nclass StdinDiscarder {\n\t#activeCount = 0;\n\n\tstart() {\n\t\tthis.#activeCount++;\n\n\t\tif (this.#activeCount === 1) {\n\t\t\tthis.#realStart();\n\t\t}\n\t}\n\n\tstop() {\n\t\tif (this.#activeCount <= 0) {\n\t\t\tthrow new Error('`stop` called more times than `start`');\n\t\t}\n\n\t\tthis.#activeCount--;\n\n\t\tif (this.#activeCount === 0) {\n\t\t\tthis.#realStop();\n\t\t}\n\t}\n\n\t#realStart() {\n\t\t// No known way to make it work reliably on Windows.\n\t\tif (process.platform === 'win32' || !process.stdin.isTTY) {\n\t\t\treturn;\n\t\t}\n\n\t\tprocess.stdin.setRawMode(true);\n\t\tprocess.stdin.on('data', this.#handleInput);\n\t\tprocess.stdin.resume();\n\t}\n\n\t#realStop() {\n\t\tif (!process.stdin.isTTY) {\n\t\t\treturn;\n\t\t}\n\n\t\tprocess.stdin.off('data', this.#handleInput);\n\t\tprocess.stdin.pause();\n\t\tprocess.stdin.setRawMode(false);\n\t}\n\n\t#handleInput(chunk) {\n\t\t// Allow Ctrl+C to gracefully exit.\n\t\tif (chunk[0] === ASCII_ETX_CODE) {\n\t\t\tprocess.emit('SIGINT');\n\t\t}\n\t}\n}\n\nconst stdinDiscarder = new StdinDiscarder();\n\nexport default stdinDiscarder;\n","import os from 'node:os';\n\nexport type Severity = 'critical' | 'high' | 'medium' | 'low' | 'info';\n\nexport interface StructuredFinding {\n type: string;\n severity: Severity;\n message: string;\n location?: string;\n details?: Record<string, unknown>;\n}\n\nexport interface RunResult {\n type: 'scan' | 'pentest';\n target: string;\n findings: StructuredFinding[];\n severity_summary: Record<Severity, number>;\n summary: string;\n error?: string;\n}\n\nexport function emptyCounts(): Record<Severity, number> {\n return { critical: 0, high: 0, medium: 0, low: 0, info: 0 };\n}\n\nexport function summarize(findings: StructuredFinding[]): Record<Severity, number> {\n const counts = emptyCounts();\n for (const f of findings) counts[f.severity] = (counts[f.severity] || 0) + 1;\n return counts;\n}\n\nexport function workerId(): string {\n return `${os.hostname()}/${process.pid}`;\n}\n","import { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { execSync } from 'node:child_process';\nimport readline from 'node:readline';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { generateDefaultConfig, generateModuleConfig } from '../core/config.js';\nimport { banner, logger } from '../core/logger.js';\nimport { isLoggedIn, readCliConfig } from '../core/cli-config.js';\nimport { login } from './login.js';\n\ninterface DetectedService {\n name: string;\n binary: string;\n running: boolean;\n logPath?: string;\n}\n\nconst SERVICES_TO_DETECT: Array<{\n name: string;\n binaries: string[];\n logPaths: string[];\n moduleConfig: Record<string, unknown>;\n}> = [\n {\n name: 'sshd',\n binaries: ['sshd'],\n logPaths: ['/var/log/auth.log', '/var/log/secure'],\n moduleConfig: { log_path: '/var/log/auth.log', max_failed_attempts: 5, ban_duration_minutes: 30 },\n },\n {\n name: 'nginx',\n binaries: ['nginx'],\n logPaths: ['/var/log/nginx/access.log', '/var/log/nginx/error.log'],\n moduleConfig: { access_log: '/var/log/nginx/access.log', error_log: '/var/log/nginx/error.log' },\n },\n {\n name: 'apache',\n binaries: ['apache2', 'httpd'],\n logPaths: ['/var/log/apache2/access.log', '/var/log/httpd/access_log'],\n moduleConfig: { access_log: '/var/log/apache2/access.log' },\n },\n {\n name: 'postgresql',\n binaries: ['postgres', 'postgresql'],\n logPaths: ['/var/log/postgresql/postgresql-main.log'],\n moduleConfig: { log_path: '/var/log/postgresql/' },\n },\n {\n name: 'mysql',\n binaries: ['mysqld', 'mariadbd'],\n logPaths: ['/var/log/mysql/error.log', '/var/log/mariadb/mariadb.log'],\n moduleConfig: { log_path: '/var/log/mysql/' },\n },\n {\n name: 'redis',\n binaries: ['redis-server'],\n logPaths: ['/var/log/redis/redis-server.log'],\n moduleConfig: { log_path: '/var/log/redis/' },\n },\n {\n name: 'bind',\n binaries: ['named', 'bind9'],\n logPaths: ['/var/log/named/', '/var/log/bind/'],\n moduleConfig: { log_path: '/var/log/named/' },\n },\n];\n\nfunction isProcessRunning(name: string): boolean {\n try {\n execSync(`pgrep -x ${name}`, { stdio: 'pipe' });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction binaryExists(name: string): boolean {\n try {\n execSync(`which ${name}`, { stdio: 'pipe' });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction findLogPath(paths: string[]): string | undefined {\n return paths.find((p) => existsSync(p));\n}\n\nasync function promptYesNo(question: string, fallback: boolean): Promise<boolean> {\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n const hint = fallback ? '(Y/n)' : '(y/N)';\n return new Promise((resolve) => rl.question(`${question} ${hint}: `, (answer) => {\n rl.close();\n const trimmed = answer.trim().toLowerCase();\n if (!trimmed) return resolve(fallback);\n resolve(trimmed === 'y' || trimmed === 'yes');\n }));\n}\n\nasync function ensureLoggedIn(): Promise<void> {\n if (isLoggedIn()) {\n const cfg = readCliConfig();\n console.log(chalk.green(` ✓ Signed in as ${chalk.white(cfg.email || cfg.user_id || 'unknown')}\\n`));\n return;\n }\n\n console.log(chalk.green.bold(' Step 1 — Sign in to threatcrush.com'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(chalk.dim(\" Your license, organizations, and module store access live on\"));\n console.log(chalk.dim(' threatcrush.com. You can skip this and sign in later with'));\n console.log(chalk.dim(` ${chalk.white('threatcrush login')}.\\n`));\n\n const wantsLogin = await promptYesNo(chalk.green(' Sign in now?'), true);\n if (!wantsLogin) {\n console.log(chalk.yellow('\\n Skipped login — running setup in offline mode.\\n'));\n return;\n }\n\n let attempts = 0;\n while (attempts < 3) {\n const result = await login();\n if (result.ok) {\n console.log(chalk.green(`\\n ✓ Logged in as ${chalk.white(result.email)}\\n`));\n return;\n }\n attempts++;\n console.log(chalk.red(`\\n ✗ ${result.error}`));\n if (attempts < 3) {\n const retry = await promptYesNo(chalk.yellow(' Try again?'), true);\n if (!retry) break;\n }\n }\n\n console.log(chalk.yellow('\\n Continuing setup without authentication — you can run'));\n console.log(chalk.dim(` ${chalk.white('threatcrush login')} at any time.\\n`));\n}\n\nexport async function initCommand(): Promise<void> {\n banner();\n logger.info('Initializing ThreatCrush...\\n');\n\n await ensureLoggedIn();\n\n console.log(chalk.green.bold(' Step 2 — Detect services and write config'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n const spinner = ora({ text: 'Detecting services...', color: 'green' }).start();\n const detected: DetectedService[] = [];\n\n for (const svc of SERVICES_TO_DETECT) {\n const foundBinary = svc.binaries.find((b) => binaryExists(b));\n if (foundBinary) {\n const running = svc.binaries.some((b) => isProcessRunning(b));\n const logPath = findLogPath(svc.logPaths);\n detected.push({\n name: svc.name,\n binary: foundBinary,\n running,\n logPath,\n });\n }\n }\n\n spinner.succeed(`Found ${detected.length} service(s)\\n`);\n\n // Print findings\n if (detected.length === 0) {\n console.log(chalk.yellow(' No monitored services detected on this system.'));\n console.log(chalk.gray(' ThreatCrush will still work with manual configuration.\\n'));\n } else {\n console.log(chalk.green.bold(' Detected Services:'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n for (const svc of detected) {\n const status = svc.running\n ? chalk.green('● running')\n : chalk.yellow('○ installed');\n const log = svc.logPath\n ? chalk.gray(` → ${svc.logPath}`)\n : chalk.gray(' → no log found');\n console.log(` ${status} ${chalk.white.bold(svc.name.padEnd(14))}${log}`);\n }\n console.log();\n }\n\n // Generate config files\n const configDir = '/etc/threatcrush';\n const confDDir = `${configDir}/threatcrushd.conf.d`;\n\n const canWrite = checkWriteAccess(configDir);\n\n if (!canWrite) {\n console.log(chalk.yellow(' ⚠ Cannot write to /etc/threatcrush/ (run with sudo for full setup)'));\n console.log(chalk.gray(' Printing generated configs instead:\\n'));\n\n // Print main config\n console.log(chalk.green.bold(' Main config (/etc/threatcrush/threatcrushd.conf):'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n const mainConfig = generateDefaultConfig(detected.map((d) => d.name));\n for (const line of mainConfig.split('\\n')) {\n console.log(chalk.gray(' ') + chalk.white(line));\n }\n console.log();\n\n // Print module configs\n for (const svc of detected) {\n const svcDef = SERVICES_TO_DETECT.find((s) => s.name === svc.name);\n if (!svcDef) continue;\n const modName = svc.name === 'sshd' ? 'ssh-guard' : 'log-watcher';\n console.log(chalk.green.bold(` Module config (${confDDir}/${modName}.conf):`));\n const modConfig = generateModuleConfig(modName, {\n ...svcDef.moduleConfig,\n log_path: svc.logPath || svcDef.logPaths[0],\n });\n for (const line of modConfig.split('\\n')) {\n console.log(chalk.gray(' ') + chalk.white(line));\n }\n console.log();\n }\n } else {\n const spinner2 = ora({ text: 'Writing configuration files...', color: 'green' }).start();\n\n mkdirSync(confDDir, { recursive: true });\n mkdirSync('/var/log/threatcrush', { recursive: true });\n mkdirSync('/var/lib/threatcrush', { recursive: true });\n\n // Write main config\n const mainConfig = generateDefaultConfig(detected.map((d) => d.name));\n writeFileSync(`${configDir}/threatcrushd.conf`, mainConfig);\n\n // Write module configs\n for (const svc of detected) {\n const svcDef = SERVICES_TO_DETECT.find((s) => s.name === svc.name);\n if (!svcDef) continue;\n const modName = svc.name === 'sshd' ? 'ssh-guard' : 'log-watcher';\n const modConfig = generateModuleConfig(modName, {\n ...svcDef.moduleConfig,\n log_path: svc.logPath || svcDef.logPaths[0],\n });\n writeFileSync(`${confDDir}/${modName}.conf`, modConfig);\n }\n\n spinner2.succeed('Configuration written successfully');\n console.log();\n console.log(chalk.green(' ✓ Main config: ') + chalk.white(`${configDir}/threatcrushd.conf`));\n console.log(chalk.green(' ✓ Module dir: ') + chalk.white(confDDir));\n console.log(chalk.green(' ✓ Log dir: ') + chalk.white('/var/log/threatcrush/'));\n console.log(chalk.green(' ✓ State dir: ') + chalk.white('/var/lib/threatcrush/'));\n }\n\n console.log();\n console.log(chalk.green(' Next steps:'));\n console.log(chalk.gray(' 1. Review and edit the config files'));\n console.log(chalk.gray(' 2. Run ') + chalk.white('threatcrush monitor') + chalk.gray(' to start monitoring'));\n console.log(chalk.gray(' 3. Run ') + chalk.white('threatcrush monitor --tui') + chalk.gray(' for the dashboard'));\n console.log();\n}\n\nfunction checkWriteAccess(dir: string): boolean {\n try {\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n return true;\n } catch {\n return false;\n }\n}\n","import { readFileSync, existsSync, readdirSync } from 'node:fs';\nimport { join } from 'node:path';\nimport TOML from '@iarna/toml';\nimport type { ThreatCrushConfig, ModuleConfig } from '../types/config.js';\n\nconst DEFAULT_CONFIG_PATH = '/etc/threatcrush/threatcrushd.conf';\nconst DEFAULT_CONFDIR = '/etc/threatcrush/threatcrushd.conf.d';\n\nconst DEFAULT_CONFIG: ThreatCrushConfig = {\n daemon: {\n pid_file: '/var/run/threatcrush/threatcrushd.pid',\n log_level: 'info',\n log_file: '/var/log/threatcrush/threatcrushd.log',\n state_db: '/var/lib/threatcrush/state.db',\n },\n api: {\n enabled: true,\n bind: '127.0.0.1:9393',\n tls: false,\n },\n alerts: {},\n modules: {\n auto_update: true,\n update_interval: '24h',\n module_dir: '/etc/threatcrush/modules',\n config_dir: DEFAULT_CONFDIR,\n },\n};\n\nexport function loadConfig(configPath?: string): ThreatCrushConfig {\n const path = configPath || DEFAULT_CONFIG_PATH;\n if (!existsSync(path)) {\n return { ...DEFAULT_CONFIG };\n }\n\n try {\n const raw = readFileSync(path, 'utf-8');\n const parsed = TOML.parse(raw) as unknown as Partial<ThreatCrushConfig>;\n return {\n daemon: { ...DEFAULT_CONFIG.daemon, ...parsed.daemon },\n api: { ...DEFAULT_CONFIG.api, ...parsed.api },\n alerts: parsed.alerts || {},\n modules: { ...DEFAULT_CONFIG.modules, ...parsed.modules },\n license: parsed.license,\n };\n } catch {\n return { ...DEFAULT_CONFIG };\n }\n}\n\nexport function loadModuleConfigs(confDir?: string): Map<string, ModuleConfig> {\n const dir = confDir || DEFAULT_CONFDIR;\n const configs = new Map<string, ModuleConfig>();\n\n if (!existsSync(dir)) {\n return configs;\n }\n\n const files = readdirSync(dir).filter((f) => f.endsWith('.conf'));\n for (const file of files) {\n try {\n const raw = readFileSync(join(dir, file), 'utf-8');\n const parsed = TOML.parse(raw) as Record<string, unknown>;\n for (const [name, config] of Object.entries(parsed)) {\n configs.set(name, config as ModuleConfig);\n }\n } catch {\n // skip bad configs\n }\n }\n\n return configs;\n}\n\nexport function generateDefaultConfig(detectedServices: string[]): string {\n const config: Record<string, unknown> = {\n daemon: DEFAULT_CONFIG.daemon,\n api: DEFAULT_CONFIG.api,\n modules: DEFAULT_CONFIG.modules,\n };\n\n return TOML.stringify(config as any);\n}\n\nexport function generateModuleConfig(\n moduleName: string,\n defaults: Record<string, unknown> = {},\n): string {\n const config: Record<string, unknown> = {\n [moduleName]: {\n enabled: true,\n ...defaults,\n },\n };\n return TOML.stringify(config as any);\n}\n","import { existsSync, mkdirSync, readFileSync, writeFileSync, chmodSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { homedir } from 'node:os';\n\nexport const CLI_CONFIG_DIR = join(homedir(), '.threatcrush');\nexport const CLI_CONFIG_PATH = join(CLI_CONFIG_DIR, 'config.json');\n\nexport interface CliConfig {\n email?: string;\n user_id?: string;\n token?: string;\n refresh_token?: string;\n expires_at?: number;\n display_name?: string;\n current_org_id?: string;\n current_org_slug?: string;\n}\n\nexport function readCliConfig(): CliConfig {\n try {\n return JSON.parse(readFileSync(CLI_CONFIG_PATH, 'utf-8')) as CliConfig;\n } catch {\n return {};\n }\n}\n\nexport function writeCliConfig(config: CliConfig): void {\n if (!existsSync(CLI_CONFIG_DIR)) mkdirSync(CLI_CONFIG_DIR, { recursive: true });\n writeFileSync(CLI_CONFIG_PATH, JSON.stringify(config, null, 2), 'utf-8');\n try { chmodSync(CLI_CONFIG_PATH, 0o600); } catch { /* non-posix */ }\n}\n\nexport function updateCliConfig(patch: Partial<CliConfig>): CliConfig {\n const current = readCliConfig();\n const next = { ...current, ...patch };\n writeCliConfig(next);\n return next;\n}\n\nexport function clearCliConfig(keys?: Array<keyof CliConfig>): void {\n const current = readCliConfig();\n if (!keys) {\n writeCliConfig({});\n return;\n }\n for (const key of keys) delete current[key];\n writeCliConfig(current);\n}\n\nexport function isLoggedIn(): boolean {\n const cfg = readCliConfig();\n if (!cfg.token) return false;\n if (cfg.expires_at && cfg.expires_at * 1000 < Date.now()) return false;\n return true;\n}\n\nexport function authHeaders(): Record<string, string> {\n const cfg = readCliConfig();\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\n if (cfg.token) headers['Authorization'] = `Bearer ${cfg.token}`;\n return headers;\n}\n","import readline from 'node:readline';\nimport { Writable } from 'node:stream';\nimport chalk from 'chalk';\nimport { banner } from '../core/logger.js';\nimport {\n authHeaders,\n clearCliConfig,\n isLoggedIn,\n readCliConfig,\n updateCliConfig,\n CLI_CONFIG_PATH,\n} from '../core/cli-config.js';\n\nconst API_URL = process.env.THREATCRUSH_API_URL || 'https://threatcrush.com';\n\nfunction prompt(question: string): Promise<string> {\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n return new Promise((resolve) => rl.question(question, (answer) => {\n rl.close();\n resolve(answer.trim());\n }));\n}\n\nfunction promptPassword(question: string): Promise<string> {\n return new Promise((resolve) => {\n const muted = new Writable({\n write(_chunk, _enc, cb) { cb(); },\n });\n const rl = readline.createInterface({ input: process.stdin, output: muted, terminal: true });\n process.stdout.write(question);\n rl.question('', (answer) => {\n rl.close();\n process.stdout.write('\\n');\n resolve(answer);\n });\n });\n}\n\nexport interface LoginOptions {\n email?: string;\n password?: string;\n silent?: boolean;\n}\n\ninterface LoginSuccess {\n ok: true;\n email: string;\n userId: string;\n displayName?: string;\n}\ninterface LoginFailure {\n ok: false;\n error: string;\n}\n\nexport async function login(options: LoginOptions = {}): Promise<LoginSuccess | LoginFailure> {\n const email = options.email || (await prompt(chalk.green(' Email: ')));\n if (!email || !email.includes('@')) {\n return { ok: false, error: 'A valid email is required.' };\n }\n\n const password = options.password || (await promptPassword(chalk.green(' Password: ')));\n if (!password) {\n return { ok: false, error: 'Password is required.' };\n }\n\n let res: Response;\n try {\n res = await fetch(`${API_URL}/api/auth/login`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ email, password }),\n });\n } catch (err) {\n return { ok: false, error: `Network error: ${(err as Error).message}` };\n }\n\n const data = await res.json().catch(() => ({})) as {\n user?: { id?: string; email?: string };\n session?: { access_token?: string; refresh_token?: string; expires_at?: number };\n error?: string;\n };\n\n if (!res.ok || !data.session?.access_token || !data.user?.id) {\n return { ok: false, error: data.error || `Login failed (${res.status})` };\n }\n\n updateCliConfig({\n email: data.user.email || email,\n user_id: data.user.id,\n token: data.session.access_token,\n refresh_token: data.session.refresh_token,\n expires_at: data.session.expires_at,\n });\n\n return {\n ok: true,\n email: data.user.email || email,\n userId: data.user.id,\n };\n}\n\nexport async function loginCommand(opts: { email?: string } = {}): Promise<void> {\n banner();\n\n if (isLoggedIn()) {\n const cfg = readCliConfig();\n console.log(chalk.green(` ✓ Already logged in as ${chalk.white(cfg.email || cfg.user_id || 'unknown')}`));\n console.log(chalk.dim(` Run ${chalk.white('threatcrush logout')} to sign out.\\n`));\n return;\n }\n\n console.log(chalk.green(' Log in to threatcrush.com'));\n console.log(chalk.gray(' ' + '─'.repeat(40)));\n\n const result = await login({ email: opts.email });\n if (!result.ok) {\n console.log(chalk.red(`\\n ✗ ${result.error}\\n`));\n console.log(chalk.dim(` Forgot password? ${API_URL}/auth/forgot-password`));\n console.log(chalk.dim(` No account yet? ${API_URL}/auth/signup\\n`));\n return;\n }\n\n console.log(chalk.green(`\\n ✓ Logged in as ${chalk.white(result.email)}`));\n console.log(chalk.dim(` Credentials saved to ${CLI_CONFIG_PATH}\\n`));\n\n // Pre-fetch current org for convenience.\n try {\n const res = await fetch(`${API_URL}/api/orgs`, { headers: authHeaders() });\n if (res.ok) {\n const data = await res.json() as { organizations?: Array<{ id: string; slug: string; name: string }> };\n const orgs = data.organizations || [];\n if (orgs.length > 0) {\n updateCliConfig({ current_org_id: orgs[0].id, current_org_slug: orgs[0].slug });\n console.log(chalk.dim(` Current org: ${chalk.white(orgs[0].name)} (${orgs[0].slug})\\n`));\n } else {\n console.log(chalk.dim(` Tip: create an organization with ${chalk.white('threatcrush orgs create <name>')}\\n`));\n }\n }\n } catch {\n // optional — skip silently\n }\n}\n\nexport async function logoutCommand(): Promise<void> {\n banner();\n\n if (!isLoggedIn()) {\n console.log(chalk.dim(' Not logged in.\\n'));\n return;\n }\n\n clearCliConfig(['token', 'refresh_token', 'expires_at', 'current_org_id', 'current_org_slug']);\n console.log(chalk.green(' ✓ Logged out.\\n'));\n console.log(chalk.dim(' Re-authenticate with `threatcrush login`.\\n'));\n}\n\nexport async function whoamiCommand(): Promise<void> {\n banner();\n const cfg = readCliConfig();\n\n if (!cfg.token) {\n console.log(chalk.yellow(' Not logged in.'));\n console.log(chalk.dim(` Log in with ${chalk.white('threatcrush login')}.\\n`));\n return;\n }\n\n try {\n const res = await fetch(`${API_URL}/api/auth/me`, { headers: authHeaders() });\n if (res.status === 401) {\n console.log(chalk.yellow(' Session expired. Please log in again.\\n'));\n clearCliConfig(['token', 'refresh_token', 'expires_at']);\n return;\n }\n const data = await res.json() as { profile?: Record<string, unknown>; error?: string };\n if (!res.ok || !data.profile) {\n console.log(chalk.red(` ✗ ${data.error || 'Failed to fetch profile'}\\n`));\n return;\n }\n\n const p = data.profile;\n console.log(chalk.green.bold(' Logged in as'));\n console.log(chalk.gray(' ' + '─'.repeat(50)));\n console.log(` Email: ${chalk.white(String(p.email || cfg.email || '—'))}`);\n if (p.display_name) console.log(` Display name: ${chalk.white(String(p.display_name))}`);\n if (p.phone) console.log(` Phone: ${chalk.white(String(p.phone))}`);\n if (cfg.current_org_slug) console.log(` Current org: ${chalk.white(cfg.current_org_slug)}`);\n console.log();\n } catch (err) {\n console.log(chalk.red(` ✗ Could not reach ${API_URL}: ${(err as Error).message}\\n`));\n }\n}\n","import { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport TOML from '@iarna/toml';\nimport type { LoadedModule } from '../types/module.js';\nimport type { ModuleManifest } from '../types/config.js';\nimport { loadModuleConfigs } from './config.js';\nimport { PATHS } from '../daemon/paths.js';\n\nexport function discoverModules(\n moduleDir?: string,\n confDir?: string,\n): LoadedModule[] {\n const modules: LoadedModule[] = [];\n const configs = loadModuleConfigs(confDir || PATHS.confD);\n\n // Search paths: configured module dir + local ./modules/\n const searchPaths = [\n moduleDir || PATHS.moduleDir,\n resolve(process.cwd(), 'modules'),\n ];\n\n // Also check for built-in modules relative to this package\n const builtinDir = resolve(__dirname || '.', '..', 'modules');\n if (existsSync(builtinDir)) {\n searchPaths.push(builtinDir);\n }\n\n for (const basePath of searchPaths) {\n if (!existsSync(basePath)) continue;\n\n const entries = readdirSync(basePath, { withFileTypes: true });\n for (const entry of entries) {\n if (!entry.isDirectory()) continue;\n\n const modPath = join(basePath, entry.name);\n const manifestPath = join(modPath, 'mod.toml');\n\n if (!existsSync(manifestPath)) continue;\n\n try {\n const raw = readFileSync(manifestPath, 'utf-8');\n const manifest = TOML.parse(raw) as unknown as ModuleManifest;\n const config = configs.get(manifest.module.name) || { enabled: true };\n\n modules.push({\n manifest: {\n name: manifest.module.name,\n version: manifest.module.version,\n description: manifest.module.description,\n author: manifest.module.author,\n },\n config,\n status: 'loaded',\n eventCount: 0,\n path: modPath,\n });\n } catch {\n // skip bad modules\n }\n }\n }\n\n return modules;\n}\n\nexport function getBuiltinModulePaths(): string[] {\n return [\n resolve(__dirname || '.', '..', 'modules', 'log-watcher'),\n resolve(__dirname || '.', '..', 'modules', 'ssh-guard'),\n ];\n}\n","import chalk from 'chalk';\nimport { banner, logger } from '../core/logger.js';\nimport { discoverModules } from '../core/module-loader.js';\nimport { initStateDB, getEventCount, getThreatCount, getRecentEvents } from '../core/state.js';\nimport { IpcClient } from '../core/ipc-client.js';\nimport { findRunningDaemon } from '../daemon/pidfile.js';\nimport { PATHS } from '../daemon/paths.js';\n\nexport async function statusCommand(): Promise<void> {\n banner();\n\n const pid = findRunningDaemon();\n const client = new IpcClient();\n let live: Awaited<ReturnType<IpcClient['status']>> | null = null;\n if (pid) {\n try {\n await client.connect();\n live = await client.status();\n } catch {\n // daemon PID present but IPC unreachable\n } finally {\n client.close();\n }\n }\n\n console.log(chalk.green.bold(' Daemon Status'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n\n if (live) {\n console.log(` Status: ${chalk.green.bold('● RUNNING')}`);\n console.log(` PID: ${chalk.white(String(live.pid))}`);\n console.log(` Started: ${chalk.white(live.startedAt)}`);\n console.log(` Uptime: ${chalk.white(formatUptime(live.uptimeSeconds))}`);\n console.log(` Version: ${chalk.white(live.version)}`);\n console.log(` Mode: ${chalk.white(live.mode)}`);\n console.log(` Socket: ${chalk.gray(live.paths.socket)}`);\n } else if (pid) {\n console.log(` Status: ${chalk.yellow.bold('● RUNNING (IPC unreachable)')}`);\n console.log(` PID: ${chalk.white(String(pid))}`);\n console.log(` Socket: ${chalk.gray(PATHS.socket)}`);\n } else {\n console.log(` Status: ${chalk.gray('○ NOT RUNNING')}`);\n console.log(` Start it: ${chalk.white('threatcrush start')}`);\n }\n console.log();\n\n // Modules\n console.log(chalk.green.bold(' Modules'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n if (live && live.modules.length > 0) {\n for (const mod of live.modules) {\n const dot =\n mod.status === 'running' ? chalk.green('●') :\n mod.status === 'loaded' ? chalk.cyan('○') :\n mod.status === 'error' ? chalk.red('✗') : chalk.gray('○');\n console.log(` ${dot} ${chalk.white.bold(mod.name.padEnd(18))} ${chalk.gray(mod.status.padEnd(10))} ${chalk.dim(`${mod.events} events`)}`);\n }\n } else {\n const modules = discoverModules();\n if (modules.length === 0) {\n console.log(chalk.gray(' No modules discovered. Run `threatcrush init`.'));\n } else {\n for (const mod of modules) {\n const enabled = mod.config.enabled !== false;\n const status = enabled ? chalk.green('● enabled ') : chalk.gray('○ disabled');\n console.log(` ${status} ${chalk.white.bold(mod.manifest.name.padEnd(18))} ${chalk.gray('v' + mod.manifest.version)}`);\n }\n }\n }\n console.log();\n\n // Event stats\n try {\n if (!live) initStateDB(PATHS.stateDb);\n const total = live ? live.counters.events : getEventCount();\n const threats = live ? live.counters.threats : getThreatCount();\n const last24h = getEventCount(new Date(Date.now() - 86400000));\n const threats24h = getThreatCount(new Date(Date.now() - 86400000));\n\n console.log(chalk.green.bold(' Event Statistics'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(` Total events: ${chalk.white(total.toString())}`);\n console.log(` Total threats: ${chalk.red(threats.toString())}`);\n console.log(` Events (24h): ${chalk.white(last24h.toString())}`);\n console.log(` Threats (24h): ${chalk.red(threats24h.toString())}`);\n console.log();\n\n const recent = getRecentEvents(5);\n if (recent.length > 0) {\n console.log(chalk.green.bold(' Recent Events'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n for (const evt of recent) {\n const sev = evt.severity === 'critical' || evt.severity === 'high'\n ? chalk.red(`[${evt.severity.toUpperCase()}]`)\n : evt.severity === 'medium'\n ? chalk.yellow(`[${evt.severity.toUpperCase()}]`)\n : chalk.green(`[${evt.severity.toUpperCase()}]`);\n console.log(` ${chalk.gray(evt.timestamp.toISOString().slice(0, 19))} ${sev.padEnd(20)} ${evt.message}`);\n }\n }\n } catch {\n logger.info('No event data available yet.');\n }\n console.log();\n}\n\nfunction formatUptime(seconds: number): string {\n if (seconds < 60) return `${seconds}s`;\n const m = Math.floor(seconds / 60);\n if (m < 60) return `${m}m ${seconds % 60}s`;\n const h = Math.floor(m / 60);\n if (h < 24) return `${h}h ${m % 60}m`;\n const d = Math.floor(h / 24);\n return `${d}d ${h % 24}h`;\n}\n","import { execSync } from 'node:child_process';\nimport { existsSync, mkdirSync, writeFileSync, cpSync, rmSync, readFileSync } from 'node:fs';\nimport { basename, join, resolve } from 'node:path';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport TOML from '@iarna/toml';\nimport { banner, logger } from '../core/logger.js';\nimport { discoverModules } from '../core/module-loader.js';\nimport { PATHS, ensureRuntimeDirs } from '../daemon/paths.js';\nimport { findRunningDaemon } from '../daemon/pidfile.js';\n\nconst API_URL = process.env.THREATCRUSH_API_URL || 'https://threatcrush.com';\n\nfunction modulesDir(): string {\n ensureRuntimeDirs();\n return PATHS.moduleDir;\n}\n\nfunction validateManifest(modPath: string): { ok: boolean; error?: string; name?: string; version?: string } {\n const manifestPath = join(modPath, 'mod.toml');\n if (!existsSync(manifestPath)) {\n return { ok: false, error: `mod.toml not found at ${manifestPath}` };\n }\n try {\n const raw = readFileSync(manifestPath, 'utf-8');\n const parsed = TOML.parse(raw) as { module?: { name?: string; version?: string } };\n const name = parsed.module?.name;\n const version = parsed.module?.version;\n if (!name) return { ok: false, error: 'mod.toml is missing [module] name' };\n if (!version) return { ok: false, error: 'mod.toml is missing [module] version' };\n return { ok: true, name, version };\n } catch (err) {\n return { ok: false, error: `Invalid mod.toml: ${(err as Error).message}` };\n }\n}\n\nfunction notifyDaemonIfRunning(): void {\n if (!findRunningDaemon()) return;\n console.log(chalk.dim(` ℹ threatcrushd is running — restart it to load/unload modules:`));\n console.log(chalk.dim(` ${chalk.white('threatcrush stop && threatcrush start')}`));\n}\n\nexport async function modulesListCommand(): Promise<void> {\n banner();\n\n const modules = discoverModules();\n\n console.log(chalk.green.bold(' Installed Modules'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(chalk.dim(` module dir: ${PATHS.moduleDir}\\n`));\n\n if (modules.length === 0) {\n console.log(chalk.gray(' No modules installed.'));\n console.log();\n console.log(chalk.gray(' Browse available modules:'));\n console.log(chalk.white(' threatcrush store'));\n console.log();\n console.log(chalk.gray(' Or install from the marketplace:'));\n console.log(chalk.white(' threatcrush modules install <name>'));\n console.log();\n return;\n }\n\n console.log(\n chalk.gray(' ') +\n chalk.white.bold('Name'.padEnd(22)) +\n chalk.white.bold('Version'.padEnd(12)) +\n chalk.white.bold('Status'.padEnd(12)) +\n chalk.white.bold('Description'),\n );\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n\n for (const mod of modules) {\n const enabled = mod.config.enabled !== false;\n const status = enabled ? chalk.green('enabled') : chalk.gray('disabled');\n console.log(\n chalk.gray(' ') +\n chalk.white(mod.manifest.name.padEnd(22)) +\n chalk.gray(mod.manifest.version.padEnd(12)) +\n status.padEnd(21) +\n chalk.gray(mod.manifest.description || '—'),\n );\n }\n console.log();\n}\n\nexport async function modulesInstallCommand(source: string): Promise<void> {\n banner();\n\n console.log(chalk.green.bold(' Module Installation'));\n console.log(chalk.gray(' ' + '─'.repeat(50)));\n console.log();\n\n const dir = modulesDir();\n\n // ── Local path ──\n if (source.startsWith('./') || source.startsWith('/') || source.startsWith('~')) {\n const absPath = resolve(source.startsWith('~') ? source.replace('~', process.env.HOME || '') : source);\n if (!existsSync(absPath)) {\n console.log(chalk.red(` ✗ Path not found: ${absPath}\\n`));\n return;\n }\n const check = validateManifest(absPath);\n if (!check.ok) {\n console.log(chalk.red(` ✗ ${check.error}\\n`));\n return;\n }\n const dest = join(dir, check.name!);\n if (existsSync(dest)) {\n console.log(chalk.yellow(` ! ${check.name} is already installed at ${dest}`));\n console.log(chalk.dim(` Run ${chalk.white(`threatcrush modules remove ${check.name}`)} first.\\n`));\n return;\n }\n const spinner = ora({ text: `Copying module files...`, color: 'green' }).start();\n try {\n cpSync(absPath, dest, { recursive: true, dereference: true });\n spinner.succeed(`Installed ${chalk.white(check.name!)} v${check.version} → ${dest}`);\n } catch (err) {\n spinner.fail(`Copy failed: ${(err as Error).message}`);\n return;\n }\n notifyDaemonIfRunning();\n console.log();\n return;\n }\n\n // ── Git URL (github:user/repo or full https://) ──\n if (source.startsWith('github:') || source.startsWith('https://') || source.startsWith('git@') || source.endsWith('.git')) {\n const gitUrl = source.startsWith('github:')\n ? `https://github.com/${source.slice('github:'.length)}.git`\n : source;\n\n const name = basename(gitUrl.replace(/\\.git$/, ''));\n const dest = join(dir, name);\n if (existsSync(dest)) {\n console.log(chalk.yellow(` ! ${name} is already installed at ${dest}`));\n console.log(chalk.dim(` Run ${chalk.white(`threatcrush modules remove ${name}`)} first.\\n`));\n return;\n }\n const spinner = ora({ text: `Cloning ${gitUrl}...`, color: 'green' }).start();\n try {\n execSync(`git clone --depth 1 ${gitUrl} ${dest}`, { stdio: 'pipe' });\n } catch (err) {\n spinner.fail(`Clone failed: ${(err as Error).message}`);\n return;\n }\n const check = validateManifest(dest);\n if (!check.ok) {\n spinner.fail(check.error!);\n try { rmSync(dest, { recursive: true, force: true }); } catch {}\n return;\n }\n spinner.succeed(`Installed ${chalk.white(check.name!)} v${check.version} → ${dest}`);\n notifyDaemonIfRunning();\n console.log();\n return;\n }\n\n // ── Marketplace lookup ──\n const spinner = ora({ text: `Fetching module: ${source}...`, color: 'green' }).start();\n let data: {\n success?: boolean;\n downloads?: number;\n module?: {\n name: string;\n slug: string;\n version: string;\n license: string;\n os_support?: string[];\n install: {\n npm_package?: string;\n git_url?: string;\n tarball_url?: string;\n };\n };\n };\n\n try {\n const res = await fetch(`${API_URL}/api/modules/${source}/install`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ platform: 'linux-cli' }),\n });\n if (!res.ok) {\n const err = await res.json().catch(() => ({ error: res.statusText }));\n spinner.fail(`Module not found: ${(err as Record<string, string>).error || source}`);\n console.log(chalk.gray(` Browse: ${API_URL}/store\\n`));\n return;\n }\n data = await res.json();\n } catch (err) {\n spinner.fail(`Network error: ${(err as Error).message}`);\n return;\n }\n\n const mod = data.module;\n if (!mod) {\n spinner.fail('Malformed response from marketplace');\n return;\n }\n spinner.succeed(`Found ${mod.name} v${mod.version}`);\n\n const install = mod.install;\n const dest = join(dir, mod.slug);\n if (existsSync(dest)) {\n console.log(chalk.yellow(` ! ${mod.slug} is already installed at ${dest}\\n`));\n return;\n }\n\n if (install.git_url) {\n const cloneSpinner = ora({ text: 'Cloning module repository...', color: 'green' }).start();\n try {\n execSync(`git clone --depth 1 ${install.git_url} ${dest}`, { stdio: 'pipe' });\n } catch (err) {\n cloneSpinner.fail(`Clone failed: ${(err as Error).message}`);\n return;\n }\n const check = validateManifest(dest);\n if (!check.ok) {\n cloneSpinner.fail(check.error!);\n try { rmSync(dest, { recursive: true, force: true }); } catch {}\n return;\n }\n cloneSpinner.succeed(`Installed ${mod.name} v${mod.version} → ${dest}`);\n } else if (install.npm_package) {\n const npmSpinner = ora({ text: `Installing ${install.npm_package}...`, color: 'green' }).start();\n try {\n execSync(`npm install -g ${install.npm_package}`, { stdio: 'pipe' });\n npmSpinner.succeed(`Package ${install.npm_package} installed globally`);\n } catch (err) {\n npmSpinner.fail(`npm install failed: ${(err as Error).message}`);\n return;\n }\n } else if (install.tarball_url) {\n const dlSpinner = ora({ text: 'Downloading module tarball...', color: 'green' }).start();\n try {\n const res = await fetch(install.tarball_url);\n if (!res.ok) { dlSpinner.fail(`HTTP ${res.status}`); return; }\n const tar = join(dir, `${mod.slug}.tar.gz`);\n writeFileSync(tar, Buffer.from(await res.arrayBuffer()));\n execSync(`tar -xzf ${tar} -C ${dir}`, { stdio: 'pipe' });\n rmSync(tar, { force: true });\n const check = validateManifest(dest);\n if (!check.ok) {\n dlSpinner.fail(check.error!);\n return;\n }\n dlSpinner.succeed(`Installed ${mod.name} v${mod.version} → ${dest}`);\n } catch (err) {\n dlSpinner.fail(`Download failed: ${(err as Error).message}`);\n return;\n }\n } else {\n logger.info('No installable artifact provided for this module.');\n return;\n }\n\n notifyDaemonIfRunning();\n console.log();\n}\n\nexport async function modulesRemoveCommand(name: string): Promise<void> {\n banner();\n\n console.log(chalk.green.bold(' Module Removal'));\n console.log(chalk.gray(' ' + '─'.repeat(50)));\n\n const dir = modulesDir();\n const target = join(dir, name);\n if (!existsSync(target)) {\n console.log(chalk.yellow(` ! No module named \"${name}\" in ${dir}\\n`));\n return;\n }\n\n const check = validateManifest(target);\n if (check.ok && check.name !== name) {\n console.log(chalk.yellow(` ! Directory name \"${name}\" does not match manifest name \"${check.name}\"`));\n }\n\n try {\n rmSync(target, { recursive: true, force: true });\n console.log(chalk.green(` ✓ Removed ${name} from ${dir}\\n`));\n } catch (err) {\n console.log(chalk.red(` ✗ Failed to remove: ${(err as Error).message}\\n`));\n return;\n }\n\n notifyDaemonIfRunning();\n}\n\nexport async function modulesCommand(opts: { action?: string; name?: string }): Promise<void> {\n const action = opts.action || 'list';\n\n switch (action) {\n case 'list':\n case 'available':\n case 'ls':\n await modulesListCommand();\n break;\n case 'install':\n case 'add':\n if (!opts.name) {\n banner();\n console.log(chalk.red(' Module name required.'));\n console.log(chalk.gray(' Usage:'));\n console.log(chalk.gray(' threatcrush modules install <marketplace-name>'));\n console.log(chalk.gray(' threatcrush modules install ./local-path'));\n console.log(chalk.gray(' threatcrush modules install github:user/repo'));\n console.log(chalk.gray(' threatcrush modules install https://github.com/user/repo.git\\n'));\n return;\n }\n await modulesInstallCommand(opts.name);\n break;\n case 'remove':\n case 'rm':\n case 'uninstall':\n if (!opts.name) {\n banner();\n console.log(chalk.red(' Module name required.'));\n console.log(chalk.gray(' Usage: threatcrush modules remove <name>\\n'));\n return;\n }\n await modulesRemoveCommand(opts.name);\n break;\n default:\n banner();\n console.log(chalk.yellow(` Unknown action: ${action}`));\n console.log(chalk.gray(' Available actions: list, install, remove\\n'));\n await modulesListCommand();\n break;\n }\n}\n","import { execSync } from 'node:child_process';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { banner, logger } from '../core/logger.js';\nimport type { RunResult, StructuredFinding } from '../core/run-result.js';\nimport { summarize } from '../core/run-result.js';\n\ninterface PentestResult {\n url: string;\n type: string;\n severity: 'low' | 'medium' | 'high' | 'critical';\n message: string;\n details?: string;\n}\n\n// Basic vulnerability tests\nconst PENTEST_CHECKS = [\n {\n name: 'XSS Reflected',\n test: (html: string) => /<script>alert\\(1\\)<\\/script>|<img\\s+src=x\\s+onerror=alert/i.test(html),\n severity: 'critical' as const,\n message: 'Reflected XSS payload rendered in response',\n },\n {\n name: 'Open Redirect',\n test: (url: string, body: string) => body.includes('location.href') || body.includes('window.location'),\n severity: 'medium' as const,\n message: 'Potential open redirect detected',\n },\n {\n name: 'Missing Security Headers',\n test: (_url: string, _body: string, headers: Record<string, string>) => {\n const required = ['x-content-type-options', 'x-frame-options', 'strict-transport-security'];\n const missing = required.filter(h => !headers[h.toLowerCase()]);\n return missing.length > 2;\n },\n severity: 'low' as const,\n message: 'Missing critical security headers (X-Content-Type-Options, X-Frame-Options, HSTS)',\n },\n {\n name: 'Server Version Disclosure',\n test: (_url: string, _body: string, headers: Record<string, string>) => {\n return !!(headers['server'] && /apache|nginx|iis|tomcat/i.test(headers['server']));\n },\n severity: 'low' as const,\n message: 'Server version disclosed in response header',\n },\n {\n name: 'Directory Listing',\n test: (html: string) => /Index of\\s*\\/|<title>Directory Listing/i.test(html),\n severity: 'medium' as const,\n message: 'Directory listing enabled',\n },\n {\n name: 'Error Page Information Disclosure',\n test: (html: string) => /stack trace|traceback|exception|at\\s+\\w+\\.\\w+\\(/i.test(html),\n severity: 'medium' as const,\n message: 'Error page reveals internal information',\n },\n];\n\nexport async function runPentest(rawUrl: string): Promise<RunResult> {\n const targetUrl = rawUrl.startsWith('http') ? rawUrl : `https://${rawUrl}`;\n const results = await collectPentestResults(targetUrl);\n const structured: StructuredFinding[] = results.map((r) => ({\n type: r.type,\n severity: r.severity === 'low' ? 'low' : (r.severity as StructuredFinding['severity']),\n message: r.message,\n location: r.url,\n details: r.details ? { detail: r.details } : undefined,\n }));\n const counts = summarize(structured);\n return {\n type: 'pentest',\n target: targetUrl,\n findings: structured,\n severity_summary: counts,\n summary: structured.length === 0\n ? 'No vulnerabilities detected'\n : `${structured.length} issue(s): ${counts.critical}C ${counts.high}H ${counts.medium}M ${counts.low}L`,\n };\n}\n\nasync function collectPentestResults(targetUrl: string): Promise<PentestResult[]> {\n const results: PentestResult[] = [];\n try {\n const resp = await fetch(targetUrl, { redirect: 'manual' });\n const headers: Record<string, string> = {};\n resp.headers.forEach((v, k) => { headers[k] = v; });\n const body = await resp.text();\n for (const check of PENTEST_CHECKS) {\n try {\n if (check.test(body, body, headers)) {\n results.push({ url: targetUrl, type: check.name, severity: check.severity, message: check.message });\n }\n } catch { /* skip */ }\n }\n } catch {\n return results;\n }\n\n const sqliPayloads = [\"' OR 1=1--\", \"1' UNION SELECT NULL--\", \"' AND '1'='1\"];\n for (const payload of sqliPayloads) {\n try {\n const testUrl = `${targetUrl}?id=${encodeURIComponent(payload)}`;\n const resp = await fetch(testUrl, { redirect: 'manual', signal: AbortSignal.timeout(5000) });\n const body = await resp.text();\n if (/sql\\s+(syntax|error|exception)|mysql|postgres|ORA-\\d+/i.test(body)) {\n results.push({ url: testUrl, type: 'SQL Injection', severity: 'critical', message: `SQL error with payload: ${payload}` });\n }\n } catch { /* skip */ }\n }\n\n const traversalPaths = ['../../etc/passwd', '..%2F..%2Fetc%2Fpasswd', '....//....//etc/passwd'];\n for (const path of traversalPaths) {\n try {\n const testUrl = `${targetUrl}/${path}`;\n const resp = await fetch(testUrl, { redirect: 'manual', signal: AbortSignal.timeout(5000) });\n const body = await resp.text();\n if (/root:.*:0:0:|daemon:.*:1:1:|nobody:.*:65534/i.test(body)) {\n results.push({ url: testUrl, type: 'Path Traversal', severity: 'critical', message: `Possible /etc/passwd disclosure: ${path}` });\n }\n } catch { /* skip */ }\n }\n\n const methods = ['OPTIONS', 'TRACE', 'DELETE', 'PUT'];\n for (const method of methods) {\n try {\n const resp = await fetch(targetUrl, { method, signal: AbortSignal.timeout(5000) });\n if (resp.status < 400 && method !== 'OPTIONS') {\n results.push({ url: targetUrl, type: `Unsafe HTTP Method: ${method}`, severity: 'medium', message: `${method} allowed (status ${resp.status})` });\n }\n if (method === 'OPTIONS') {\n const allow = resp.headers.get('allow');\n if (allow && /DELETE|PUT|TRACE/i.test(allow)) {\n results.push({ url: targetUrl, type: 'HTTP Methods', severity: 'low', message: `Allowed methods: ${allow}` });\n }\n }\n } catch { /* skip */ }\n }\n\n return results;\n}\n\nexport async function pentestCommand(targetUrl: string): Promise<RunResult> {\n banner();\n\n // Ensure URL has protocol\n if (!targetUrl.startsWith('http')) {\n targetUrl = `https://${targetUrl}`;\n }\n\n logger.info(`Penetration testing ${chalk.white(targetUrl)}...\\n`);\n\n const results: PentestResult[] = [];\n\n // Test 1: Basic response analysis\n const spinner = ora({ text: 'Fetching target...', color: 'green' }).start();\n try {\n const resp = await fetch(targetUrl, { redirect: 'manual' });\n const headers: Record<string, string> = {};\n resp.headers.forEach((v, k) => { headers[k] = v; });\n const body = await resp.text();\n\n spinner.succeed(`Got ${resp.status} response\\n`);\n\n // Run all checks\n for (const check of PENTEST_CHECKS) {\n try {\n if (check.test(body, body, headers)) {\n results.push({\n url: targetUrl,\n type: check.name,\n severity: check.severity,\n message: check.message,\n });\n }\n } catch {\n // Skip check on error\n }\n }\n } catch (err) {\n spinner.fail(`Failed to reach target: ${(err as Error).message}`);\n console.log(chalk.gray(' Check the URL and try again.\\n'));\n return {\n type: 'pentest',\n target: targetUrl,\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: `Failed to reach target: ${(err as Error).message}`,\n error: (err as Error).message,\n };\n }\n\n // Test 2: SQL injection probe\n const sqliSpinner = ora({ text: 'Testing SQL injection vectors...', color: 'green' }).start();\n const sqliPayloads = [\"' OR 1=1--\", \"1' UNION SELECT NULL--\", \"' AND '1'='1\"];\n for (const payload of sqliPayloads) {\n try {\n const testUrl = `${targetUrl}?id=${encodeURIComponent(payload)}`;\n const resp = await fetch(testUrl, { redirect: 'manual', signal: AbortSignal.timeout(5000) });\n const body = await resp.text();\n if (/sql\\s+(syntax|error|exception)|mysql|postgres|ORA-\\d+/i.test(body)) {\n results.push({\n url: testUrl,\n type: 'SQL Injection',\n severity: 'critical',\n message: `SQL error response detected with payload: ${payload}`,\n });\n }\n } catch {\n // Skip on timeout/network error\n }\n }\n sqliSpinner.succeed('SQL injection tests complete\\n');\n\n // Test 3: Path traversal probe\n const pathSpinner = ora({ text: 'Testing path traversal...', color: 'green' }).start();\n const traversalPaths = ['../../etc/passwd', '..%2F..%2Fetc%2Fpasswd', '....//....//etc/passwd'];\n for (const path of traversalPaths) {\n try {\n const testUrl = `${targetUrl}/${path}`;\n const resp = await fetch(testUrl, { redirect: 'manual', signal: AbortSignal.timeout(5000) });\n const body = await resp.text();\n if (/root:.*:0:0:|daemon:.*:1:1:|nobody:.*:65534/i.test(body)) {\n results.push({\n url: testUrl,\n type: 'Path Traversal',\n severity: 'critical',\n message: `Possible /etc/passwd disclosure via: ${path}`,\n });\n }\n } catch {\n // Skip on timeout/network error\n }\n }\n pathSpinner.succeed('Path traversal tests complete\\n');\n\n // Test 4: HTTP methods\n const methodSpinner = ora({ text: 'Testing HTTP methods...', color: 'green' }).start();\n const methods = ['OPTIONS', 'TRACE', 'DELETE', 'PUT'];\n for (const method of methods) {\n try {\n const resp = await fetch(targetUrl, { method, signal: AbortSignal.timeout(5000) });\n if (resp.status < 400 && method !== 'OPTIONS') {\n results.push({\n url: targetUrl,\n type: `Unsafe HTTP Method: ${method}`,\n severity: 'medium',\n message: `${method} method is allowed (status ${resp.status})`,\n });\n }\n if (method === 'OPTIONS') {\n const allow = resp.headers.get('allow');\n if (allow && /DELETE|PUT|TRACE/i.test(allow)) {\n results.push({\n url: targetUrl,\n type: 'HTTP Methods',\n severity: 'low',\n message: `Allowed methods: ${allow}`,\n });\n }\n }\n } catch {\n // Skip on error\n }\n }\n methodSpinner.succeed('HTTP method tests complete\\n');\n\n const structured: StructuredFinding[] = results.map((r) => ({\n type: r.type,\n severity: r.severity as StructuredFinding['severity'],\n message: r.message,\n location: r.url,\n details: r.details ? { detail: r.details } : undefined,\n }));\n const sevCounts = summarize(structured);\n\n // Print results\n if (results.length === 0) {\n console.log(chalk.green.bold(' ✓ No vulnerabilities detected in basic scan!'));\n console.log(chalk.dim(' Note: This is a basic scan. Full pentest requires manual review.\\n'));\n return {\n type: 'pentest',\n target: targetUrl,\n findings: [],\n severity_summary: sevCounts,\n summary: 'No vulnerabilities detected',\n };\n }\n\n const critical = results.filter(r => r.severity === 'critical');\n const high = results.filter(r => r.severity === 'high');\n const medium = results.filter(r => r.severity === 'medium');\n const low = results.filter(r => r.severity === 'low');\n\n console.log(chalk.white.bold(' Penetration Test Results'));\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log(\n ` ${chalk.red.bold(critical.length + ' critical')} ` +\n `${chalk.red(high.length + ' high')} ` +\n `${chalk.yellow(medium.length + ' medium')} ` +\n `${chalk.gray(low.length + ' low')}`,\n );\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log();\n\n const sorted = [...critical, ...high, ...medium, ...low];\n for (const r of sorted) {\n const sev =\n r.severity === 'critical' ? chalk.bgRed.white.bold(` ${r.severity.toUpperCase()} `) :\n r.severity === 'high' ? chalk.red(`[${r.severity.toUpperCase()}]`) :\n r.severity === 'medium' ? chalk.yellow(`[${r.severity.toUpperCase()}]`) :\n chalk.gray(`[${r.severity.toUpperCase()}]`);\n\n console.log(` ${sev} ${chalk.white.bold(r.type)}`);\n console.log(` ${chalk.gray('URL:')} ${chalk.cyan(r.url)}`);\n console.log(` ${chalk.gray('Info:')} ${r.message}`);\n if (r.details) console.log(` ${chalk.gray('Details:')} ${r.details}`);\n console.log();\n }\n\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log(` ${chalk.white.bold(`${results.length} issue(s) found`)}`);\n console.log(chalk.dim(' Note: This is an automated basic scan. Manual review recommended.\\n'));\n\n return {\n type: 'pentest',\n target: targetUrl,\n findings: structured,\n severity_summary: sevCounts,\n summary: `${results.length} issue(s): ${sevCounts.critical}C ${sevCounts.high}H ${sevCounts.medium}M ${sevCounts.low}L`,\n };\n}\n","import chalk from \"chalk\";\nimport { homedir } from \"node:os\";\nimport { readFileSync, writeFileSync, mkdirSync, existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nconst API_URL = process.env.THREATCRUSH_API_URL || \"https://threatcrush.com\";\nconst CONFIG_PATH = join(homedir(), \".threatcrush\", \"config.json\");\n\ninterface CliConfig {\n email?: string;\n token?: string;\n current_org_id?: string;\n current_org_slug?: string;\n}\n\nfunction readConfig(): CliConfig {\n try {\n return JSON.parse(readFileSync(CONFIG_PATH, \"utf-8\"));\n } catch {\n return {};\n }\n}\n\nfunction writeConfig(config: CliConfig) {\n const dir = join(homedir(), \".threatcrush\");\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2));\n}\n\nfunction getAuthHeaders(): Record<string, string> {\n const config = readConfig();\n const headers: Record<string, string> = { \"Content-Type\": \"application/json\" };\n if (config.token) headers[\"Authorization\"] = `Bearer ${config.token}`;\n return headers;\n}\n\n// ─── Organizations ───\n\nexport async function orgsCommand(options: { action?: string; name?: string }): Promise<void> {\n const { action, name } = options;\n\n if (action === \"create\") {\n if (!name) {\n console.log(chalk.red(\" Usage: threatcrush orgs create <name>\\n\"));\n return;\n }\n await createOrganization(name);\n return;\n }\n\n if (action === \"use\") {\n if (!name) {\n console.log(chalk.red(\" Usage: threatcrush orgs use <slug>\\n\"));\n return;\n }\n await useOrganization(name);\n return;\n }\n\n if (action === \"list\" || !action) {\n await listOrganizations();\n return;\n }\n\n console.log(chalk.red(` Unknown action: ${action}`));\n console.log(chalk.dim(\" Available: list, create, use\\n\"));\n}\n\nasync function listOrganizations(): Promise<void> {\n console.log(chalk.green(\" Your Organizations\\n\"));\n\n try {\n const res = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!res.ok) {\n if (res.status === 401) {\n console.log(chalk.red(\" Not authenticated. Run: threatcrush login\\n\"));\n return;\n }\n console.log(chalk.red(` Failed to list organizations: ${res.statusText}\\n`));\n return;\n }\n\n const data = await res.json() as { organizations?: Array<Record<string, unknown>> };\n const orgs = data.organizations || [];\n\n if (orgs.length === 0) {\n console.log(chalk.yellow(\" No organizations found.\"));\n console.log(chalk.dim(\" Create one: threatcrush orgs create <name>\\n\"));\n return;\n }\n\n const config = readConfig();\n for (const org of orgs) {\n const isCurrent = org.id === config.current_org_id;\n const role = org.user_role as string;\n const slug = org.slug as string;\n const name = org.name as string;\n\n console.log(` ${isCurrent ? chalk.green(\"●\") : chalk.gray(\"○\")} ${chalk.bold(name)} ${chalk.gray(`(/${slug})`)}`);\n console.log(` ${chalk.dim(`Role: ${role}`)}`);\n console.log();\n }\n\n console.log(chalk.dim(\" Switch org: threatcrush orgs use <slug>\"));\n console.log(chalk.dim(\" Create org: threatcrush orgs create <name>\\n\"));\n } catch (err) {\n console.log(chalk.red(` Failed to list organizations: ${err instanceof Error ? err.message : err}\\n`));\n }\n}\n\nasync function createOrganization(name: string): Promise<void> {\n console.log(chalk.green(` Creating organization \"${name}\"...\\n`));\n\n try {\n const res = await fetch(`${API_URL}/api/orgs`, {\n method: \"POST\",\n headers: getAuthHeaders(),\n body: JSON.stringify({ name }),\n });\n\n if (!res.ok) {\n const err = await res.json().catch(() => ({ error: res.statusText }));\n console.log(chalk.red(` Failed: ${(err as Record<string, string>).error}\\n`));\n return;\n }\n\n const data = await res.json() as { organization: Record<string, unknown> };\n const org = data.organization;\n\n console.log(chalk.green(\" ✓ Organization created!\"));\n console.log(chalk.dim(` Name: ${org.name}`));\n console.log(chalk.dim(` Slug: /${org.slug}\\n`));\n\n // Auto-switch to new org\n const config = readConfig();\n config.current_org_id = org.id as string;\n config.current_org_slug = org.slug as string;\n writeConfig(config);\n\n console.log(chalk.dim(\" Now using this organization.\\n\"));\n } catch (err) {\n console.log(chalk.red(` Failed: ${err instanceof Error ? err.message : err}\\n`));\n }\n}\n\nasync function useOrganization(slug: string): Promise<void> {\n console.log(chalk.green(` Switching to organization \"${slug}\"...\\n`));\n\n try {\n const res = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!res.ok) {\n console.log(chalk.red(` Failed to list organizations: ${res.statusText}\\n`));\n return;\n }\n\n const data = await res.json() as { organizations?: Array<Record<string, unknown>> };\n const orgs = data.organizations || [];\n const org = orgs.find((o) => o.slug === slug);\n\n if (!org) {\n console.log(chalk.red(` Organization \"/${slug}\" not found.\\n`));\n return;\n }\n\n const config = readConfig();\n config.current_org_id = org.id as string;\n config.current_org_slug = org.slug as string;\n writeConfig(config);\n\n console.log(chalk.green(\" ✓ Now using:\"));\n console.log(chalk.dim(` Name: ${org.name}`));\n console.log(chalk.dim(` Slug: /${org.slug}`));\n console.log(chalk.dim(` Role: ${org.user_role}\\n`));\n } catch (err) {\n console.log(chalk.red(` Failed: ${err instanceof Error ? err.message : err}\\n`));\n }\n}\n","import chalk from \"chalk\";\nimport { homedir } from \"node:os\";\nimport { readFileSync, existsSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nconst API_URL = process.env.THREATCRUSH_API_URL || \"https://threatcrush.com\";\nconst CONFIG_PATH = join(homedir(), \".threatcrush\", \"config.json\");\n\ninterface CliConfig {\n email?: string;\n token?: string;\n current_org_id?: string;\n current_org_slug?: string;\n}\n\nfunction readConfig(): CliConfig {\n try {\n return JSON.parse(readFileSync(CONFIG_PATH, \"utf-8\"));\n } catch {\n return {};\n }\n}\n\nfunction getAuthHeaders(): Record<string, string> {\n const config = readConfig();\n const headers: Record<string, string> = { \"Content-Type\": \"application/json\" };\n if (config.token) headers[\"Authorization\"] = `Bearer ${config.token}`;\n return headers;\n}\n\ninterface Server {\n id: string;\n name: string;\n hostname: string | null;\n ip_address: string | null;\n port: number;\n ssh_username: string | null;\n status: string;\n last_seen: string | null;\n threatcrushd_version: string | null;\n}\n\n// ─── Servers ───\n\nexport async function serversCommand(options: { action?: string; name?: string; org?: string }): Promise<void> {\n const { action, name, org } = options;\n\n if (action === \"list\" || !action) {\n await listServers(org);\n return;\n }\n\n if (action === \"add\") {\n console.log(chalk.red(\" Interactive server add is not yet implemented.\"));\n console.log(chalk.dim(\" Use the web dashboard to add servers: https://threatcrush.com/dashboard\\n\"));\n return;\n }\n\n console.log(chalk.red(` Unknown action: ${action}`));\n console.log(chalk.dim(\" Available: list\\n\"));\n}\n\nasync function listServers(orgSlug?: string): Promise<void> {\n const config = readConfig();\n\n if (!config.current_org_id && !orgSlug) {\n console.log(chalk.yellow(\" No current organization set.\"));\n console.log(chalk.dim(\" Set one with: threatcrush orgs use <slug>\\n\"));\n return;\n }\n\n console.log(chalk.green(\" Servers\\n\"));\n\n try {\n // First get orgs to resolve the ID if only slug is given\n let orgId = config.current_org_id;\n\n if (orgSlug) {\n const orgsRes = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!orgsRes.ok) {\n console.log(chalk.red(` Failed to fetch organizations: ${orgsRes.statusText}\\n`));\n return;\n }\n const orgsData = await orgsRes.json() as { organizations?: Array<Record<string, unknown>> };\n const org = (orgsData.organizations || []).find((o) => o.slug === orgSlug);\n if (!org) {\n console.log(chalk.red(` Organization \"/${orgSlug}\" not found.\\n`));\n return;\n }\n orgId = org.id as string;\n }\n\n if (!orgId) {\n console.log(chalk.red(\" Could not resolve organization.\\n\"));\n return;\n }\n\n const res = await fetch(`${API_URL}/api/orgs/${orgId}/servers`, { headers: getAuthHeaders() });\n if (!res.ok) {\n console.log(chalk.red(` Failed to list servers: ${res.statusText}\\n`));\n return;\n }\n\n const data = await res.json() as { servers?: Server[] };\n const servers = data.servers || [];\n\n if (servers.length === 0) {\n console.log(chalk.yellow(\" No servers registered.\"));\n console.log(chalk.dim(\" Add servers via the web dashboard.\\n\"));\n return;\n }\n\n for (const server of servers) {\n const statusColor = server.status === \"online\" ? chalk.green : server.status === \"unreachable\" ? chalk.red : chalk.gray;\n const statusDot = server.status === \"online\" ? \"●\" : \"○\";\n\n console.log(` ${statusColor(statusDot)} ${chalk.bold(server.name)}`);\n console.log(` ${chalk.dim(`${server.hostname || server.ip_address}:${server.port}`)}`);\n console.log(` Status: ${statusColor(server.status)}`);\n if (server.last_seen) {\n console.log(` Last seen: ${chalk.dim(timeAgo(server.last_seen))}`);\n }\n if (server.threatcrushd_version) {\n console.log(` Version: ${chalk.dim(server.threatcrushd_version)}`);\n }\n if (server.ssh_username) {\n console.log(` SSH user: ${chalk.dim(server.ssh_username)}`);\n }\n console.log();\n }\n\n console.log(chalk.dim(\" Connect: threatcrush connect <server-name>\\n\"));\n } catch (err) {\n console.log(chalk.red(` Failed: ${err instanceof Error ? err.message : err}\\n`));\n }\n}\n\nfunction timeAgo(dateStr: string): string {\n const date = new Date(dateStr);\n const now = new Date();\n const seconds = Math.floor((now.getTime() - date.getTime()) / 1000);\n\n if (seconds < 60) return \"just now\";\n if (seconds < 3600) return `${Math.floor(seconds / 60)}m ago`;\n if (seconds < 86400) return `${Math.floor(seconds / 3600)}h ago`;\n return `${Math.floor(seconds / 86400)}d ago`;\n}\n","import chalk from \"chalk\";\nimport { homedir } from \"node:os\";\nimport { readFileSync, existsSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { execSync, spawn } from \"node:child_process\";\n\nconst API_URL = process.env.THREATCRUSH_API_URL || \"https://threatcrush.com\";\nconst CONFIG_PATH = join(homedir(), \".threatcrush\", \"config.json\");\n\ninterface CliConfig {\n email?: string;\n token?: string;\n current_org_id?: string;\n current_org_slug?: string;\n}\n\ninterface Server {\n id: string;\n name: string;\n hostname: string | null;\n ip_address: string | null;\n port: number;\n ssh_username: string | null;\n}\n\nfunction readConfig(): CliConfig {\n try {\n return JSON.parse(readFileSync(CONFIG_PATH, \"utf-8\"));\n } catch {\n return {};\n }\n}\n\nfunction getAuthHeaders(): Record<string, string> {\n const config = readConfig();\n const headers: Record<string, string> = { \"Content-Type\": \"application/json\" };\n if (config.token) headers[\"Authorization\"] = `Bearer ${config.token}`;\n return headers;\n}\n\nexport async function connectCommand(options: {\n target?: string;\n org?: string;\n user?: string;\n port?: string;\n identity?: string;\n}): Promise<void> {\n const { target, org, user, port, identity } = options;\n\n if (!target) {\n // Interactive mode — list available servers\n await interactiveConnect(org);\n return;\n }\n\n // Check if target is a server name (resolve via API)\n const server = await resolveServer(target, org);\n\n if (server) {\n // Connect via SSH using server metadata\n await sshConnect({\n hostname: server.hostname || server.ip_address,\n port: server.port,\n username: user || server.ssh_username || null,\n identity,\n });\n } else if (target.includes(\"@\") || target.includes(\".\")) {\n // Treat as direct hostname\n await sshConnect({\n hostname: target.includes(\"@\") ? target.split(\"@\")[1] : target,\n port: parseInt(port || \"22\", 10),\n username: target.includes(\"@\") ? target.split(\"@\")[0] : (user || null),\n identity,\n });\n } else {\n console.log(chalk.red(` Server \"${target}\" not found in your organizations.\\n`));\n console.log(chalk.dim(\" List available servers: threatcrush servers list\"));\n console.log(chalk.dim(\" Or connect directly: threatcrush connect user@hostname\\n\"));\n }\n}\n\nasync function interactiveConnect(orgSlug?: string): Promise<void> {\n const config = readConfig();\n\n try {\n // Get orgs\n const orgsRes = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!orgsRes.ok) {\n console.log(chalk.red(\" Failed to fetch organizations. Are you logged in?\\n\"));\n return;\n }\n const orgsData = await orgsRes.json() as { organizations?: Array<Record<string, unknown>> };\n let orgs = orgsData.organizations || [];\n\n if (orgSlug) {\n orgs = orgs.filter((o) => o.slug === orgSlug);\n }\n\n if (orgs.length === 0) {\n console.log(chalk.yellow(\" No organizations found.\"));\n console.log(chalk.dim(\" Create one: threatcrush orgs create <name>\\n\"));\n return;\n }\n\n // If multiple orgs, pick current\n let orgId = config.current_org_id;\n if (orgs.length > 1 && !orgId) {\n orgId = orgs[0].id as string;\n }\n if (!orgId) {\n orgId = orgs[0].id as string;\n }\n\n // Get servers for org\n const serversRes = await fetch(`${API_URL}/api/orgs/${orgId}/servers`, { headers: getAuthHeaders() });\n if (!serversRes.ok) {\n console.log(chalk.red(\" Failed to fetch servers.\\n\"));\n return;\n }\n const serversData = await serversRes.json() as { servers?: Server[] };\n const servers = serversData.servers || [];\n\n if (servers.length === 0) {\n console.log(chalk.yellow(\" No servers in this organization.\"));\n console.log(chalk.dim(\" Add servers via the web dashboard.\\n\"));\n return;\n }\n\n console.log(chalk.green(\" Available Servers\\n\"));\n\n for (const server of servers) {\n const s = server as unknown as Record<string, unknown>;\n const status = s.status as string;\n const statusColor = status === \"online\" ? chalk.green : chalk.gray;\n const statusDot = status === \"online\" ? \"●\" : \"○\";\n console.log(` ${chalk.bold((s.name as string).padEnd(20))} ${statusColor(statusDot)} ${chalk.dim(`${s.hostname || s.ip_address}:${s.port}`)}`);\n }\n\n console.log();\n console.log(chalk.dim(\" Connect: threatcrush connect <server-name>\"));\n console.log(chalk.dim(\" Or: threatcrush connect user@hostname\\n\"));\n } catch (err) {\n console.log(chalk.red(` Failed: ${err instanceof Error ? err.message : err}\\n`));\n }\n}\n\nasync function resolveServer(nameOrSlug: string, orgSlug?: string): Promise<Server | null> {\n const config = readConfig();\n\n try {\n // Get orgs\n let orgId = config.current_org_id;\n\n if (orgSlug) {\n const orgsRes = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!orgsRes.ok) return null;\n const orgsData = await orgsRes.json() as { organizations?: Array<Record<string, unknown>> };\n const org = (orgsData.organizations || []).find((o) => o.slug === orgSlug);\n if (!org) return null;\n orgId = org.id as string;\n }\n\n if (!orgId) {\n // Try first org\n const orgsRes = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!orgsRes.ok) return null;\n const orgsData = await orgsRes.json() as { organizations?: Array<Record<string, unknown>> };\n orgId = (orgsData.organizations || [])[0]?.id as string;\n if (!orgId) return null;\n }\n\n // Get servers\n const serversRes = await fetch(`${API_URL}/api/orgs/${orgId}/servers`, { headers: getAuthHeaders() });\n if (!serversRes.ok) return null;\n const serversData = await serversRes.json() as { servers?: Server[] };\n const servers = serversData.servers || [];\n\n // Match by name\n const server = servers.find((s) => s.name.toLowerCase() === nameOrSlug.toLowerCase());\n return server || null;\n } catch {\n return null;\n }\n}\n\nasync function sshConnect(options: {\n hostname: string | null;\n port: number;\n username: string | null;\n identity?: string;\n}): Promise<void> {\n const { hostname, port, username, identity } = options;\n\n if (!hostname) {\n console.log(chalk.red(\" No hostname available for this server.\\n\"));\n return;\n }\n\n const user = username || \"root\";\n\n console.log(chalk.green(` Connecting to ${user}@${hostname}:${port}...\\n`));\n console.log(chalk.dim(\" (Spawning SSH session — exit with Ctrl+D or type 'exit')\\n\"));\n\n const sshArgs = [\"-p\", String(port)];\n if (identity) {\n sshArgs.push(\"-i\", identity);\n }\n sshArgs.push(`${user}@${hostname}`);\n\n // Spawn SSH as a direct child process, inheriting stdio\n const ssh = spawn(\"ssh\", sshArgs, { stdio: \"inherit\" });\n\n ssh.on(\"error\", (err) => {\n console.log(chalk.red(`\\n SSH error: ${err.message}\\n`));\n });\n\n ssh.on(\"exit\", (code) => {\n if (code === 0) {\n console.log(chalk.dim(\"\\n SSH session ended.\\n\"));\n } else if (code !== null) {\n console.log(chalk.yellow(`\\n SSH exited with code ${code}\\n`));\n }\n });\n}\n","import { spawn } from 'node:child_process';\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { openSync } from 'node:fs';\nimport chalk from 'chalk';\nimport { runDaemon } from '../daemon/index.js';\nimport { PATHS, ensureRuntimeDirs } from '../daemon/paths.js';\nimport { findRunningDaemon, removePidFile } from '../daemon/pidfile.js';\nimport { IpcClient } from '../core/ipc-client.js';\n\nconst DAEMON_ENTRY = join(__dirname, 'daemon.js');\n\nexport async function daemonForeground(): Promise<void> {\n await runDaemon();\n}\n\nexport async function daemonStart(): Promise<void> {\n const pid = findRunningDaemon();\n if (pid) {\n console.log(chalk.yellow(` threatcrushd already running (pid ${pid}).`));\n return;\n }\n\n ensureRuntimeDirs();\n\n if (!existsSync(DAEMON_ENTRY)) {\n console.log(chalk.red(` Daemon entry not found at ${DAEMON_ENTRY}.`));\n console.log(chalk.dim(' Reinstall with `threatcrush update` or `pnpm run build` in the cli package.'));\n return;\n }\n\n const out = openSync(PATHS.logFile, 'a');\n const err = openSync(PATHS.logFile, 'a');\n\n const child = spawn(process.execPath, [DAEMON_ENTRY], {\n detached: true,\n stdio: ['ignore', out, err],\n env: { ...process.env, THREATCRUSH_DAEMON: '1' },\n });\n child.unref();\n\n // Wait briefly for the socket to come up\n const deadline = Date.now() + 3000;\n while (Date.now() < deadline) {\n if (IpcClient.isDaemonRunning()) break;\n await new Promise((r) => setTimeout(r, 100));\n }\n\n if (IpcClient.isDaemonRunning()) {\n console.log(chalk.green(` ✓ threatcrushd started (pid ${child.pid})`));\n console.log(chalk.dim(` socket: ${PATHS.socket}`));\n console.log(chalk.dim(` log: ${PATHS.logFile}\\n`));\n } else {\n console.log(chalk.red(` ✗ threatcrushd did not come up within 3s.`));\n console.log(chalk.dim(` check log: ${PATHS.logFile}\\n`));\n }\n}\n\nexport async function daemonStop(): Promise<void> {\n const pid = findRunningDaemon();\n if (!pid) {\n console.log(chalk.dim(' No running daemon found.'));\n return;\n }\n\n try {\n const client = new IpcClient();\n await client.connect();\n await client.shutdown().catch(() => {});\n client.close();\n } catch {\n try { process.kill(pid, 'SIGTERM'); } catch {}\n }\n\n const deadline = Date.now() + 3000;\n while (Date.now() < deadline) {\n try { process.kill(pid, 0); } catch { break; }\n await new Promise((r) => setTimeout(r, 100));\n }\n\n try { process.kill(pid, 0); } catch {\n removePidFile();\n console.log(chalk.green(` ✓ threatcrushd stopped.`));\n return;\n }\n\n try { process.kill(pid, 'SIGKILL'); } catch {}\n removePidFile();\n console.log(chalk.yellow(` ! threatcrushd was killed (SIGKILL).`));\n}\n","import { appendFileSync, existsSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { PATHS, ensureRuntimeDirs } from './paths.js';\nimport { findRunningDaemon, removePidFile, writePidFile } from './pidfile.js';\nimport { IpcServer } from './ipc-server.js';\nimport { ModuleHost } from './module-host.js';\nimport { AlertDispatcher } from './alerts/index.js';\nimport { RunsWorker } from './workers/runs-worker.js';\nimport { bus } from './event-bus.js';\nimport { initStateDB, closeDB } from '../core/state.js';\nimport { loadConfig } from '../core/config.js';\nimport { captureException, flushTelemetry, initTelemetry } from '../core/telemetry.js';\nimport type { ThreatEvent } from '../types/events.js';\n\nfunction readVersion(): string {\n try {\n const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8'));\n return pkg.version || '0.0.0';\n } catch {\n return '0.0.0';\n }\n}\n\nfunction logLine(line: string): void {\n try {\n appendFileSync(PATHS.logFile, `${new Date().toISOString()} ${line}\\n`);\n } catch {\n // best-effort\n }\n}\n\nexport async function runDaemon(): Promise<void> {\n if (findRunningDaemon()) {\n console.error(`threatcrushd already running (pid file at ${PATHS.pidFile}).`);\n process.exit(1);\n }\n\n ensureRuntimeDirs();\n writePidFile();\n\n await initTelemetry('daemon');\n process.on('uncaughtException', (err) => {\n logLine(`[daemon] uncaughtException: ${err.message}`);\n captureException(err);\n });\n process.on('unhandledRejection', (reason) => {\n logLine(`[daemon] unhandledRejection: ${String(reason)}`);\n captureException(reason);\n });\n\n const version = readVersion();\n logLine(`[daemon] starting threatcrushd v${version} mode=${PATHS.mode}`);\n\n try {\n initStateDB(PATHS.stateDb);\n } catch (err) {\n logLine(`[daemon] state db unavailable: ${(err as Error).message}`);\n }\n\n const config = loadConfig(existsSync(PATHS.configFile) ? PATHS.configFile : undefined);\n\n bus.on('event', (event: ThreatEvent) => {\n logLine(`[event] ${event.severity} ${event.module} ${event.message}`);\n });\n\n const moduleHost = new ModuleHost(bus);\n await moduleHost.start();\n\n new AlertDispatcher(bus, config);\n\n const runsWorker = new RunsWorker(bus);\n try {\n await runsWorker.start();\n } catch (err) {\n logLine(`[daemon] runs-worker failed to start: ${(err as Error).message}`);\n }\n\n const ipc = new IpcServer(version, moduleHost);\n await ipc.start();\n logLine(`[daemon] ipc listening on ${PATHS.socket}`);\n\n const shutdown = async (signal: string) => {\n logLine(`[daemon] received ${signal}, shutting down`);\n try { runsWorker.stop(); } catch {}\n try { await moduleHost.stop(); } catch {}\n try { await ipc.stop(); } catch {}\n try { closeDB(); } catch {}\n try { await flushTelemetry(); } catch {}\n removePidFile();\n process.exit(0);\n };\n\n process.on('SIGINT', () => { void shutdown('SIGINT'); });\n process.on('SIGTERM', () => { void shutdown('SIGTERM'); });\n process.on('SIGHUP', () => { void shutdown('SIGHUP'); });\n\n // keep-alive\n setInterval(() => {}, 1 << 30);\n}\n\n// Note: auto-boot is handled by `src/daemon-entry.ts` so that importing this\n// module from the CLI bundle never accidentally starts a daemon.\n","import { createServer, Server, Socket } from 'node:net';\nimport { existsSync, unlinkSync } from 'node:fs';\nimport type { ThreatEvent } from '../types/events.js';\nimport { PATHS } from './paths.js';\nimport { bus } from './event-bus.js';\nimport { getRecentEvents, getTopSources, getEventCount, getThreatCount } from '../core/state.js';\nimport type {\n IpcRequest,\n IpcResponse,\n IpcPush,\n DaemonStatusReply,\n} from './ipc-protocol.js';\nimport type { ModuleHost } from './module-host.js';\n\ninterface ClientState {\n id: number;\n socket: Socket;\n buffer: string;\n subscriptions: Set<'event' | 'module'>;\n}\n\nexport class IpcServer {\n private server: Server | null = null;\n private clients = new Map<number, ClientState>();\n private nextClientId = 1;\n private startedAt = new Date();\n private counters = { events: 0, threats: 0, alerts: 0 };\n\n constructor(\n private version: string,\n private moduleHost: ModuleHost,\n ) {\n bus.on('event', (event: ThreatEvent) => {\n this.counters.events++;\n if (event.severity === 'medium' || event.severity === 'high' || event.severity === 'critical') {\n this.counters.threats++;\n }\n this.broadcast({ push: 'event', payload: event }, 'event');\n });\n bus.on('alert', () => {\n this.counters.alerts++;\n });\n bus.on('module', (info) => {\n this.broadcast({ push: 'module', payload: info }, 'module');\n });\n }\n\n async start(): Promise<void> {\n if (existsSync(PATHS.socket)) {\n try { unlinkSync(PATHS.socket); } catch {}\n }\n return new Promise((resolve, reject) => {\n this.server = createServer((sock) => this.handleClient(sock));\n this.server.on('error', reject);\n this.server.listen(PATHS.socket, () => {\n try { require('node:fs').chmodSync(PATHS.socket, 0o660); } catch {}\n resolve();\n });\n });\n }\n\n async stop(): Promise<void> {\n for (const c of this.clients.values()) {\n try { c.socket.destroy(); } catch {}\n }\n this.clients.clear();\n return new Promise((resolve) => {\n if (!this.server) {\n try { if (existsSync(PATHS.socket)) unlinkSync(PATHS.socket); } catch {}\n return resolve();\n }\n this.server.close(() => {\n try { if (existsSync(PATHS.socket)) unlinkSync(PATHS.socket); } catch {}\n resolve();\n });\n });\n }\n\n private handleClient(socket: Socket): void {\n const id = this.nextClientId++;\n const state: ClientState = { id, socket, buffer: '', subscriptions: new Set() };\n this.clients.set(id, state);\n\n socket.setEncoding('utf-8');\n socket.on('data', (chunk) => {\n state.buffer += chunk.toString();\n let idx;\n while ((idx = state.buffer.indexOf('\\n')) >= 0) {\n const line = state.buffer.slice(0, idx);\n state.buffer = state.buffer.slice(idx + 1);\n if (!line.trim()) continue;\n this.handleLine(state, line).catch((err) => {\n this.send(state, { id: 0, ok: false, error: String(err?.message || err) });\n });\n }\n });\n\n socket.on('close', () => { this.clients.delete(id); });\n socket.on('error', () => { this.clients.delete(id); });\n }\n\n private async handleLine(client: ClientState, line: string): Promise<void> {\n let req: IpcRequest;\n try {\n req = JSON.parse(line) as IpcRequest;\n } catch {\n return this.send(client, { id: 0, ok: false, error: 'invalid json' });\n }\n\n switch (req.method) {\n case 'ping':\n return this.send(client, { id: req.id, ok: true, result: 'pong' });\n\n case 'status': {\n const status: DaemonStatusReply = {\n pid: process.pid,\n startedAt: this.startedAt.toISOString(),\n uptimeSeconds: Math.floor((Date.now() - this.startedAt.getTime()) / 1000),\n version: this.version,\n mode: PATHS.mode,\n paths: {\n config: PATHS.configFile,\n log: PATHS.logFile,\n state: PATHS.stateDb,\n socket: PATHS.socket,\n },\n modules: this.moduleHost.summary(),\n counters: { ...this.counters },\n };\n return this.send(client, { id: req.id, ok: true, result: status });\n }\n\n case 'recent_events': {\n const limit = req.params?.limit ?? 50;\n const events = getRecentEvents(limit);\n return this.send(client, { id: req.id, ok: true, result: events });\n }\n\n case 'top_sources': {\n const limit = req.params?.limit ?? 10;\n return this.send(client, { id: req.id, ok: true, result: getTopSources(limit) });\n }\n\n case 'counters': {\n return this.send(client, {\n id: req.id,\n ok: true,\n result: {\n total: getEventCount(),\n threats: getThreatCount(),\n last24h: getEventCount(new Date(Date.now() - 86400000)),\n threats24h: getThreatCount(new Date(Date.now() - 86400000)),\n },\n });\n }\n\n case 'module_list':\n return this.send(client, { id: req.id, ok: true, result: this.moduleHost.summary() });\n\n case 'subscribe':\n for (const ch of req.params.channels) client.subscriptions.add(ch);\n return this.send(client, { id: req.id, ok: true, result: { subscribed: [...client.subscriptions] } });\n\n case 'shutdown':\n this.send(client, { id: req.id, ok: true, result: 'shutting down' });\n setTimeout(() => process.emit('SIGTERM' as NodeJS.Signals), 50);\n return;\n }\n }\n\n private send(client: ClientState, msg: IpcResponse | IpcPush): void {\n try {\n client.socket.write(JSON.stringify(msg) + '\\n');\n } catch {\n // client gone\n }\n }\n\n private broadcast(msg: IpcPush, channel: 'event' | 'module'): void {\n for (const client of this.clients.values()) {\n if (!client.subscriptions.has(channel)) continue;\n this.send(client, msg);\n }\n }\n}\n","import { EventEmitter } from 'node:events';\nimport type { ThreatEvent } from '../types/events.js';\n\nexport interface DaemonEvents {\n event: (event: ThreatEvent) => void;\n alert: (event: ThreatEvent) => void;\n module: (info: { name: string; status: string; detail?: string }) => void;\n}\n\nexport class EventBus extends EventEmitter {\n publish(event: ThreatEvent): void {\n this.emit('event', event);\n if (event.severity === 'high' || event.severity === 'critical') {\n this.emit('alert', event);\n }\n }\n\n announceModule(name: string, status: string, detail?: string): void {\n this.emit('module', { name, status, detail });\n }\n}\n\nexport const bus = new EventBus();\nbus.setMaxListeners(50);\n","import { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport TOML from '@iarna/toml';\nimport type { EventBus } from './event-bus.js';\nimport { PATHS } from './paths.js';\nimport { LogWatcher } from './watchers/log-watcher.js';\nimport { JournalWatcher } from './watchers/journal-watcher.js';\nimport { loadModuleConfigs } from '../core/config.js';\nimport { getModuleState, setModuleState } from '../core/state.js';\nimport type { ModuleConfig, ModuleManifest } from '../types/config.js';\nimport type { ThreatEvent } from '../types/events.js';\nimport type { ModuleAlert, ThreatCrushModule } from '../types/module.js';\n\ninterface HostedModule {\n name: string;\n version: string;\n source: 'builtin' | 'installed';\n status: 'running' | 'loaded' | 'error' | 'disabled';\n events: number;\n detail?: string;\n path?: string;\n config?: ModuleConfig;\n instance?: ThreatCrushModule;\n}\n\nexport class ModuleHost {\n private modules = new Map<string, HostedModule>();\n private logWatcher: LogWatcher | null = null;\n private journalWatcher: JournalWatcher | null = null;\n\n constructor(private bus: EventBus) {\n bus.on('event', (event) => {\n const mod = this.modules.get(event.module);\n if (mod) mod.events++;\n for (const hosted of this.modules.values()) {\n if (hosted.status !== 'running' || !hosted.instance?.onEvent) continue;\n void hosted.instance.onEvent(event).catch((err) => {\n hosted.status = 'error';\n hosted.detail = `onEvent failed: ${String((err as Error).message || err)}`;\n this.bus.announceModule(hosted.name, 'error', hosted.detail);\n });\n }\n });\n }\n\n async start(): Promise<void> {\n this.registerBuiltins();\n await this.discoverAndStartInstalled();\n\n this.logWatcher = new LogWatcher(this.bus);\n const watched = this.logWatcher.start();\n\n for (const modName of this.logWatcher.activeModules()) {\n const mod = this.modules.get(modName);\n if (mod) {\n mod.status = 'running';\n mod.detail = `watching ${watched.length} log source(s)`;\n this.bus.announceModule(modName, 'running', mod.detail);\n }\n }\n\n this.journalWatcher = new JournalWatcher(this.bus);\n if (this.journalWatcher.start()) {\n const mod = this.modules.get('user-journal');\n if (mod) {\n mod.status = 'running';\n mod.detail = 'tailing journalctl --user';\n this.bus.announceModule('user-journal', 'running', mod.detail);\n }\n }\n }\n\n async stop(): Promise<void> {\n this.logWatcher?.stop();\n this.journalWatcher?.stop();\n for (const mod of this.modules.values()) {\n try {\n if (mod.instance && mod.status === 'running') {\n await mod.instance.stop();\n }\n } catch (err) {\n mod.status = 'error';\n mod.detail = `stop failed: ${String((err as Error).message || err)}`;\n this.bus.announceModule(mod.name, 'error', mod.detail);\n continue;\n }\n mod.status = 'loaded';\n this.bus.announceModule(mod.name, 'stopped');\n }\n }\n\n summary(): Array<{ name: string; status: string; events: number; detail?: string }> {\n return [...this.modules.values()].map((m) => ({\n name: m.name,\n status: m.status,\n events: m.events,\n detail: m.detail,\n }));\n }\n\n private registerBuiltins(): void {\n const builtins: HostedModule[] = [\n { name: 'log-watcher', version: '0.1.0', source: 'builtin', status: 'loaded', events: 0 },\n { name: 'ssh-guard', version: '0.1.0', source: 'builtin', status: 'loaded', events: 0 },\n { name: 'user-journal', version: '0.1.0', source: 'builtin', status: 'loaded', events: 0 },\n ];\n for (const m of builtins) this.modules.set(m.name, m);\n }\n\n private async discoverAndStartInstalled(): Promise<void> {\n if (!existsSync(PATHS.moduleDir)) return;\n const configs = loadModuleConfigs(PATHS.confD);\n const entries = readdirSync(PATHS.moduleDir, { withFileTypes: true });\n for (const entry of entries) {\n if (!entry.isDirectory()) continue;\n const manifestPath = join(PATHS.moduleDir, entry.name, 'mod.toml');\n if (!existsSync(manifestPath)) continue;\n try {\n const manifest = TOML.parse(readFileSync(manifestPath, 'utf-8')) as unknown as ModuleManifest;\n const name = manifest.module?.name || entry.name;\n const defaults = manifest.module?.config?.defaults || {};\n const config = {\n enabled: true,\n ...defaults,\n ...(configs.get(name) || {}),\n } as ModuleConfig;\n const hosted: HostedModule = {\n name,\n version: manifest.module?.version || '0.0.0',\n source: 'installed',\n status: config.enabled === false ? 'disabled' : 'loaded',\n events: 0,\n path: join(PATHS.moduleDir, entry.name),\n config,\n };\n this.modules.set(name, hosted);\n if (config.enabled === false) continue;\n await this.startInstalled(hosted);\n } catch (err) {\n const name = entry.name;\n this.modules.set(name, {\n name,\n version: '0.0.0',\n source: 'installed',\n status: 'error',\n events: 0,\n detail: `manifest load failed: ${String((err as Error).message || err)}`,\n path: join(PATHS.moduleDir, entry.name),\n });\n }\n }\n }\n\n private async startInstalled(hosted: HostedModule): Promise<void> {\n const entrypoint = this.installedEntrypoint(hosted.path!);\n if (!entrypoint) {\n hosted.status = 'loaded';\n hosted.detail = 'no built entrypoint found; run npm install && npm run build in the module directory';\n return;\n }\n\n try {\n const imported = await import(pathToFileURL(entrypoint).href);\n const exported = imported.default || imported.module || imported;\n const instance = typeof exported === 'function' ? new exported() : exported;\n if (!this.isThreatCrushModule(instance)) {\n throw new Error('entrypoint does not export a ThreatCrush module');\n }\n\n hosted.instance = instance;\n await instance.init(this.contextFor(hosted));\n await instance.start();\n hosted.status = 'running';\n hosted.detail = `started from ${entrypoint}`;\n this.bus.announceModule(hosted.name, 'running', hosted.detail);\n } catch (err) {\n hosted.status = 'error';\n hosted.detail = String((err as Error).message || err);\n this.bus.announceModule(hosted.name, 'error', hosted.detail);\n }\n }\n\n private installedEntrypoint(modulePath: string): string | null {\n const packageJson = join(modulePath, 'package.json');\n const candidates: string[] = [];\n if (existsSync(packageJson)) {\n try {\n const pkg = JSON.parse(readFileSync(packageJson, 'utf-8')) as { main?: string };\n if (pkg.main) candidates.push(join(modulePath, pkg.main));\n } catch {\n // fall through to conventional paths\n }\n }\n candidates.push(join(modulePath, 'dist', 'index.js'), join(modulePath, 'index.js'));\n return candidates.find((candidate) => existsSync(candidate)) || null;\n }\n\n private isThreatCrushModule(value: unknown): value is ThreatCrushModule {\n return Boolean(\n value &&\n typeof value === 'object' &&\n typeof (value as ThreatCrushModule).init === 'function' &&\n typeof (value as ThreatCrushModule).start === 'function' &&\n typeof (value as ThreatCrushModule).stop === 'function',\n );\n }\n\n private contextFor(hosted: HostedModule) {\n return {\n config: hosted.config || { enabled: true },\n logger: this.loggerFor(hosted.name),\n emit: (event: ThreatEvent) => this.bus.publish(event),\n subscribe: (eventType: string, handler: (event: ThreatEvent) => void) => {\n this.bus.on('event', (event) => {\n if (event.category === eventType || event.module === eventType) handler(event);\n });\n },\n alert: (alert: ModuleAlert) => {\n this.bus.emit('alert', alert.event || {\n timestamp: new Date(),\n module: hosted.name,\n category: 'system',\n severity: alert.severity,\n message: alert.title,\n details: alert.body ? { body: alert.body } : undefined,\n });\n },\n getState: (key: string) => getModuleState(hosted.name, key),\n setState: (key: string, value: unknown) => setModuleState(hosted.name, key, value),\n };\n }\n\n private loggerFor(moduleName: string) {\n return {\n debug: (msg: string, ...args: unknown[]) => console.debug(`[${moduleName}] ${msg}`, ...args),\n info: (msg: string, ...args: unknown[]) => console.info(`[${moduleName}] ${msg}`, ...args),\n warn: (msg: string, ...args: unknown[]) => console.warn(`[${moduleName}] ${msg}`, ...args),\n error: (msg: string, ...args: unknown[]) => console.error(`[${moduleName}] ${msg}`, ...args),\n };\n }\n}\n","import { existsSync, statSync, createReadStream, accessSync, constants } from 'node:fs';\nimport { createInterface } from 'node:readline';\nimport type { EventBus } from '../event-bus.js';\nimport { autoDetectParser, detectAttackPattern, parseAuthLog, parseNginxLog } from '../../core/log-parser.js';\nimport { insertEvent } from '../../core/state.js';\nimport type { ThreatEvent, EventCategory, EventSeverity } from '../../types/events.js';\n\nexport interface LogSource {\n path: string;\n module: string;\n category: EventCategory;\n}\n\nexport const DEFAULT_SOURCES: LogSource[] = [\n { path: '/var/log/auth.log', module: 'ssh-guard', category: 'auth' },\n { path: '/var/log/secure', module: 'ssh-guard', category: 'auth' },\n { path: '/var/log/nginx/access.log', module: 'log-watcher', category: 'web' },\n { path: '/var/log/syslog', module: 'log-watcher', category: 'system' },\n];\n\nexport class LogWatcher {\n private timers = new Map<string, NodeJS.Timeout>();\n private positions = new Map<string, number>();\n private active = new Set<string>();\n\n constructor(private bus: EventBus, private sources: LogSource[] = DEFAULT_SOURCES) {}\n\n start(): string[] {\n const started: string[] = [];\n for (const src of this.sources) {\n if (!existsSync(src.path)) continue;\n try { accessSync(src.path, constants.R_OK); }\n catch { continue; }\n this.tail(src);\n started.push(src.path);\n }\n return started;\n }\n\n stop(): void {\n for (const t of this.timers.values()) clearInterval(t);\n this.timers.clear();\n this.positions.clear();\n this.active.clear();\n }\n\n activeModules(): string[] {\n return [...this.active];\n }\n\n private tail(src: LogSource): void {\n try {\n this.positions.set(src.path, statSync(src.path).size);\n } catch {\n this.positions.set(src.path, 0);\n }\n\n const timer = setInterval(() => this.poll(src), 1000);\n this.timers.set(src.path, timer);\n this.active.add(src.module);\n }\n\n private poll(src: LogSource): void {\n let stat;\n try { stat = statSync(src.path); } catch { return; }\n const prev = this.positions.get(src.path) ?? 0;\n\n if (stat.size < prev) {\n this.positions.set(src.path, 0); // rotated\n return;\n }\n if (stat.size === prev) return;\n\n const stream = createReadStream(src.path, { start: prev, encoding: 'utf-8' });\n stream.on('error', () => this.positions.set(src.path, stat.size));\n const rl = createInterface({ input: stream });\n rl.on('error', () => {});\n rl.on('line', (line) => {\n if (!line.trim()) return;\n this.process(line, src);\n });\n rl.on('close', () => this.positions.set(src.path, stat.size));\n }\n\n private process(line: string, src: LogSource): void {\n const parsed = autoDetectParser(line);\n if (!parsed) return;\n\n let severity: EventSeverity = 'info';\n let message = line;\n let sourceIp: string | undefined;\n\n if (parsed.source === 'auth') {\n const entry = parseAuthLog(line);\n if (!entry) return;\n sourceIp = entry.fields.ip;\n const msg = entry.fields.message;\n if (/failed password/i.test(msg)) {\n severity = 'high';\n message = `Failed SSH login for ${entry.fields.user || 'unknown'} from ${entry.fields.ip || 'unknown'}`;\n } else if (/invalid user/i.test(msg)) {\n severity = 'high';\n message = `Invalid SSH user: ${entry.fields.user || 'unknown'} from ${entry.fields.ip || 'unknown'}`;\n } else if (/accepted/i.test(msg)) {\n severity = 'info';\n message = `SSH login accepted for ${entry.fields.user || 'unknown'}`;\n } else {\n return;\n }\n } else if (parsed.source === 'nginx') {\n const entry = parseNginxLog(line);\n if (!entry) return;\n sourceIp = entry.fields.ip;\n const status = parseInt(entry.fields.status, 10);\n const attack = detectAttackPattern(entry.fields.path);\n if (attack) {\n severity = 'critical';\n message = `Attack [${attack.toUpperCase()}]: ${entry.fields.method} ${entry.fields.path}`;\n } else if (status >= 500) {\n severity = 'medium';\n message = `Server error ${status}: ${entry.fields.method} ${entry.fields.path}`;\n } else if (status >= 400) {\n severity = 'low';\n message = `Client error ${status}: ${entry.fields.method} ${entry.fields.path}`;\n } else {\n return;\n }\n } else {\n return;\n }\n\n const event: ThreatEvent = {\n timestamp: new Date(),\n module: src.module,\n category: src.category,\n severity,\n message,\n source_ip: sourceIp,\n };\n\n try { insertEvent(event); } catch { /* db optional */ }\n this.bus.publish(event);\n }\n}\n","import { spawn, type ChildProcess, spawnSync } from 'node:child_process';\nimport type { EventBus } from '../event-bus.js';\nimport { insertEvent } from '../../core/state.js';\nimport type { ThreatEvent, EventSeverity } from '../../types/events.js';\n\n// Wraps `journalctl --user -o json -f` so threatcrushd can pick up user-session\n// events without needing to belong to the `adm` or `systemd-journal` group.\n// On systems without journalctl this watcher is a no-op.\nexport class JournalWatcher {\n private proc: ChildProcess | null = null;\n private buffer = '';\n private moduleName = 'user-journal';\n private active = false;\n\n constructor(private bus: EventBus) {}\n\n static isAvailable(): boolean {\n const probe = spawnSync('journalctl', ['--user', '-n', '0', '--no-pager'], {\n stdio: ['ignore', 'ignore', 'ignore'],\n });\n return probe.status === 0;\n }\n\n start(): boolean {\n if (!JournalWatcher.isAvailable()) return false;\n\n const child = spawn(\n 'journalctl',\n ['--user', '-o', 'json', '-f', '--since', 'now'],\n { stdio: ['ignore', 'pipe', 'pipe'] },\n );\n if (!child.stdout) return false;\n child.stdout.setEncoding('utf-8');\n child.stdout.on('data', (chunk: string) => this.onData(chunk));\n child.on('exit', () => {\n this.proc = null;\n this.active = false;\n });\n this.proc = child;\n\n this.active = true;\n return true;\n }\n\n stop(): void {\n if (this.proc) {\n try { this.proc.kill('SIGTERM'); } catch {}\n this.proc = null;\n }\n this.active = false;\n }\n\n isActive(): boolean {\n return this.active;\n }\n\n moduleNameValue(): string {\n return this.moduleName;\n }\n\n private onData(chunk: string): void {\n this.buffer += chunk;\n let idx;\n while ((idx = this.buffer.indexOf('\\n')) >= 0) {\n const line = this.buffer.slice(0, idx);\n this.buffer = this.buffer.slice(idx + 1);\n if (!line.trim()) continue;\n this.handleLine(line);\n }\n }\n\n private handleLine(line: string): void {\n let entry: Record<string, string>;\n try {\n entry = JSON.parse(line) as Record<string, string>;\n } catch {\n return;\n }\n\n const message = entry.MESSAGE;\n if (!message) return;\n\n const priority = parseInt(entry.PRIORITY ?? '6', 10);\n const severity = priorityToSeverity(priority);\n\n // Surface a couple of common suspicious-looking sources at a higher\n // severity even if the kernel disagrees with us.\n const ident = entry.SYSLOG_IDENTIFIER || entry._COMM || 'journal';\n const bumpedSeverity = bumpForIdent(ident, message, severity);\n\n const event: ThreatEvent = {\n timestamp: realtimeToDate(entry.__REALTIME_TIMESTAMP) || new Date(),\n module: this.moduleName,\n category: 'system',\n severity: bumpedSeverity,\n message: `[${ident}] ${message}`.slice(0, 500),\n };\n\n try { insertEvent(event); } catch { /* db optional */ }\n this.bus.publish(event);\n }\n}\n\nfunction priorityToSeverity(priority: number): EventSeverity {\n // syslog priorities: 0 emerg, 1 alert, 2 crit, 3 err, 4 warning, 5 notice, 6 info, 7 debug\n if (priority <= 2) return 'critical';\n if (priority === 3) return 'high';\n if (priority === 4) return 'medium';\n if (priority === 5) return 'low';\n return 'info';\n}\n\nfunction bumpForIdent(ident: string, message: string, base: EventSeverity): EventSeverity {\n if (/sudo/i.test(ident) && /authentication failure|incorrect password|FAILED/i.test(message)) {\n return 'high';\n }\n if (/sshd/i.test(ident) && /failed|invalid user|break-in/i.test(message)) {\n return 'high';\n }\n return base;\n}\n\nfunction realtimeToDate(rt: string | undefined): Date | null {\n if (!rt) return null;\n const us = parseInt(rt, 10);\n if (!Number.isFinite(us)) return null;\n return new Date(Math.floor(us / 1000));\n}\n","import type { ThreatEvent } from '../../types/events.js';\n\ntype Mailer = {\n sendMail: (opts: Record<string, unknown>) => Promise<unknown>;\n};\n\nlet transporter: Mailer | null = null;\n// Lazy-load nodemailer so the CLI build doesn't pull it in when alerts are off.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet nodemailer: any = null;\n\nexport interface SmtpConfig {\n host?: string;\n port?: number;\n secure?: boolean;\n user?: string;\n pass?: string;\n from?: string;\n to?: string[] | string;\n min_severity?: 'low' | 'medium' | 'high' | 'critical';\n}\n\nconst SEVERITY_RANK: Record<string, number> = {\n info: 0,\n low: 1,\n medium: 2,\n high: 3,\n critical: 4,\n};\n\nasync function ensureTransporter(config: SmtpConfig): Promise<Mailer | null> {\n if (!config.host || !config.from) return null;\n if (transporter) return transporter;\n\n if (!nodemailer) {\n try {\n nodemailer = await import('nodemailer');\n } catch {\n return null;\n }\n }\n\n transporter = nodemailer.createTransport({\n host: config.host,\n port: config.port ?? 587,\n secure: config.secure ?? false,\n auth: config.user && config.pass ? { user: config.user, pass: config.pass } : undefined,\n });\n return transporter;\n}\n\nfunction meetsSeverity(event: ThreatEvent, min?: SmtpConfig['min_severity']): boolean {\n if (!min) return true;\n return (SEVERITY_RANK[event.severity] ?? 0) >= (SEVERITY_RANK[min] ?? 0);\n}\n\nfunction renderBody(event: ThreatEvent): { text: string; html: string } {\n const ts = event.timestamp.toISOString();\n const ip = event.source_ip ? `\\nSource IP: ${event.source_ip}` : '';\n const text =\n `[${event.severity.toUpperCase()}] ${event.module}\\n\\n` +\n `${event.message}${ip}\\n\\n` +\n `When: ${ts}\\nCategory: ${event.category}`;\n const html =\n `<div style=\"font-family:system-ui,sans-serif;line-height:1.5\">` +\n `<h2 style=\"margin:0 0 8px\">⚠ ${event.severity.toUpperCase()} — ${event.module}</h2>` +\n `<p>${event.message}</p>` +\n (event.source_ip ? `<p><strong>Source IP:</strong> <code>${event.source_ip}</code></p>` : '') +\n `<p style=\"color:#888;margin-top:16px\"><small>${ts} · ${event.category}</small></p>` +\n `</div>`;\n return { text, html };\n}\n\nexport function smtpChannel(config: SmtpConfig): (event: ThreatEvent) => Promise<void> {\n return async (event) => {\n if (!meetsSeverity(event, config.min_severity)) return;\n const t = await ensureTransporter(config);\n if (!t) return;\n\n const to = Array.isArray(config.to) ? config.to.join(', ') : config.to;\n if (!to) return;\n\n const { text, html } = renderBody(event);\n await t.sendMail({\n from: config.from,\n to,\n subject: `[ThreatCrush ${event.severity}] ${event.module} — ${event.message.slice(0, 60)}`,\n text,\n html,\n });\n };\n}\n","import type { ThreatCrushConfig, AlertChannelConfig } from '../../types/config.js';\nimport type { ThreatEvent } from '../../types/events.js';\nimport type { EventBus } from '../event-bus.js';\nimport { smtpChannel, type SmtpConfig } from './smtp.js';\n\ntype Channel = (event: ThreatEvent) => Promise<void>;\n\nexport class AlertDispatcher {\n private channels: Channel[] = [];\n\n constructor(private bus: EventBus, private config: ThreatCrushConfig) {\n this.bindChannels();\n bus.on('alert', (event) => { void this.dispatch(event); });\n }\n\n private bindChannels(): void {\n const alerts = this.config.alerts || {};\n for (const [name, raw] of Object.entries(alerts)) {\n const cfg = raw as AlertChannelConfig;\n if (!cfg.enabled) continue;\n if (name === 'webhook' && typeof cfg.url === 'string') {\n this.channels.push(webhookChannel(cfg.url, cfg.secret as string | undefined));\n }\n if (name === 'slack' && typeof cfg.webhook_url === 'string') {\n this.channels.push(slackChannel(cfg.webhook_url));\n }\n if (name === 'email' && typeof cfg.host === 'string' && typeof cfg.from === 'string') {\n this.channels.push(smtpChannel(cfg as unknown as SmtpConfig));\n }\n }\n }\n\n private async dispatch(event: ThreatEvent): Promise<void> {\n await Promise.all(this.channels.map((ch) => ch(event).catch(() => {})));\n }\n}\n\nfunction webhookChannel(url: string, secret?: string): Channel {\n return async (event) => {\n const body = JSON.stringify({ event });\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\n if (secret) headers['X-Threatcrush-Signature'] = secret;\n await fetch(url, { method: 'POST', headers, body });\n };\n}\n\nfunction slackChannel(webhookUrl: string): Channel {\n return async (event) => {\n const emoji = event.severity === 'critical' ? ':rotating_light:' : ':warning:';\n const text = `${emoji} *[${event.severity.toUpperCase()}]* \\`${event.module}\\` — ${event.message}${event.source_ip ? ` (from ${event.source_ip})` : ''}`;\n await fetch(webhookUrl, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ text }),\n });\n };\n}\n","import type { EventBus } from '../event-bus.js';\nimport { readCliConfig, authHeaders, isLoggedIn } from '../../core/cli-config.js';\nimport { runScan } from '../../commands/scan.js';\nimport { runPentest } from '../../commands/pentest.js';\nimport { workerId, type RunResult } from '../../core/run-result.js';\n\nconst API_URL = process.env.THREATCRUSH_API_URL || 'https://threatcrush.com';\nconst POLL_INTERVAL_MS = 30_000;\nconst SCHEDULE_INTERVAL_MS = 120_000;\n\ninterface ClaimedRun {\n id: string;\n org_id: string;\n property_id: string;\n type: 'scan' | 'pentest';\n property: { id: string; name: string; kind: string; target: string } | null;\n}\n\n/**\n * Polls the server for queued property runs belonging to orgs the logged-in\n * user is a member of, claims them atomically, executes them locally, and\n * posts the result back.\n *\n * No-op unless `~/.threatcrush/config.json` contains a valid bearer token.\n */\nexport class RunsWorker {\n private pollTimer: NodeJS.Timeout | null = null;\n private scheduleTimer: NodeJS.Timeout | null = null;\n private running = false;\n private orgIds: string[] = [];\n\n constructor(private bus: EventBus) {}\n\n async start(): Promise<void> {\n if (!isLoggedIn()) return;\n\n try {\n await this.refreshOrgs();\n } catch {\n // First fetch may fail if the network is down; the tick loop will retry.\n }\n\n this.bus.announceModule('runs-worker', 'running', `poll ${POLL_INTERVAL_MS / 1000}s`);\n this.tick();\n this.scheduleTick();\n this.pollTimer = setInterval(() => this.tick(), POLL_INTERVAL_MS);\n this.scheduleTimer = setInterval(() => this.scheduleTick(), SCHEDULE_INTERVAL_MS);\n }\n\n stop(): void {\n if (this.pollTimer) clearInterval(this.pollTimer);\n if (this.scheduleTimer) clearInterval(this.scheduleTimer);\n this.pollTimer = null;\n this.scheduleTimer = null;\n this.bus.announceModule('runs-worker', 'stopped');\n }\n\n private async scheduleTick(): Promise<void> {\n if (!isLoggedIn()) return;\n try {\n if (this.orgIds.length === 0) await this.refreshOrgs();\n for (const orgId of this.orgIds) {\n try {\n await fetch(`${API_URL}/api/orgs/${orgId}/schedules/tick`, {\n method: 'POST',\n headers: authHeaders(),\n });\n } catch {\n // ignore transient network errors\n }\n }\n } catch {\n // swallow — retry next interval\n }\n }\n\n private async tick(): Promise<void> {\n if (this.running) return;\n if (!isLoggedIn()) return;\n\n this.running = true;\n try {\n if (this.orgIds.length === 0) await this.refreshOrgs();\n for (const orgId of this.orgIds) {\n const claimed = await this.claimOne(orgId);\n if (!claimed) continue;\n\n const result = await this.execute(claimed);\n await this.finalize(orgId, claimed, result);\n }\n } catch {\n // swallow — we'll try again on the next tick\n } finally {\n this.running = false;\n }\n }\n\n private async refreshOrgs(): Promise<void> {\n const res = await fetch(`${API_URL}/api/orgs`, { headers: authHeaders() });\n if (!res.ok) return;\n const data = await res.json() as { organizations?: Array<{ id: string }> };\n this.orgIds = (data.organizations || []).map((o) => o.id);\n }\n\n private async claimOne(orgId: string): Promise<ClaimedRun | null> {\n try {\n const res = await fetch(`${API_URL}/api/orgs/${orgId}/runs/pending`, {\n method: 'POST',\n headers: authHeaders(),\n body: JSON.stringify({ worker_id: workerId() }),\n });\n if (!res.ok) return null;\n const data = await res.json() as { run?: ClaimedRun | null };\n return data.run ?? null;\n } catch {\n return null;\n }\n }\n\n private async execute(run: ClaimedRun): Promise<RunResult> {\n const target = run.property?.target;\n if (!target) {\n return {\n type: run.type,\n target: '',\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: 'property target missing',\n error: 'property target missing',\n };\n }\n\n this.bus.announceModule('runs-worker', 'running', `${run.type} ${run.property?.name || target}`);\n\n try {\n if (run.type === 'scan') return await runScan(target);\n return await runPentest(target);\n } catch (err) {\n return {\n type: run.type,\n target,\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: `failed: ${(err as Error).message}`,\n error: (err as Error).message,\n };\n }\n }\n\n private async finalize(orgId: string, claimed: ClaimedRun, result: RunResult): Promise<void> {\n try {\n await fetch(\n `${API_URL}/api/orgs/${orgId}/properties/${claimed.property_id}/runs/${claimed.id}`,\n {\n method: 'PATCH',\n headers: authHeaders(),\n body: JSON.stringify({\n status: result.error ? 'failed' : 'succeeded',\n findings_count: result.findings.length,\n severity_summary: result.severity_summary,\n summary: result.summary,\n findings: result.findings,\n error: result.error,\n source: 'daemon',\n worker_id: workerId(),\n }),\n },\n );\n } catch {\n // best-effort\n } finally {\n this.bus.announceModule('runs-worker', 'idle');\n }\n }\n}\n","/**\n * Opt-in error reporting for the CLI + daemon.\n *\n * Enabled only when `SENTRY_DSN` is set in the environment. Safe to call\n * from both short-lived CLI invocations and the long-running daemon.\n */\n\nlet ready = false;\n// Keep the import lazy so the CLI doesn't pay the Sentry bundle cost when\n// reporting is disabled.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet sentry: any = null;\n\nasync function loadSentry(): Promise<void> {\n if (sentry) return;\n try {\n sentry = await import('@sentry/node');\n } catch {\n sentry = null;\n }\n}\n\nexport async function initTelemetry(context: 'cli' | 'daemon'): Promise<void> {\n if (ready) return;\n const dsn = process.env.SENTRY_DSN;\n if (!dsn) return;\n\n await loadSentry();\n if (!sentry) return;\n\n sentry.init({\n dsn,\n environment: process.env.NODE_ENV || 'production',\n release: process.env.SENTRY_RELEASE,\n serverName: context,\n tracesSampleRate: 0,\n beforeSend(event: Record<string, unknown>) {\n const req = (event as { request?: { headers?: Record<string, string> } }).request;\n if (req?.headers) {\n delete req.headers.authorization;\n delete req.headers.cookie;\n }\n return event;\n },\n });\n\n ready = true;\n}\n\nexport function captureException(err: unknown): void {\n if (!ready || !sentry) return;\n sentry.captureException(err);\n}\n\nexport async function flushTelemetry(timeoutMs = 2000): Promise<void> {\n if (!ready || !sentry) return;\n try { await sentry.flush(timeoutMs); } catch { /* ignore */ }\n}\n","import { execSync } from 'node:child_process';\nimport { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport chalk from 'chalk';\nimport { banner } from '../core/logger.js';\n\nconst UNIT_PATH = '/etc/systemd/system/threatcrushd.service';\n\nfunction resolveTemplate(): string {\n const templatePath = join(__dirname, 'systemd', 'threatcrushd.service');\n if (!existsSync(templatePath)) {\n throw new Error(`systemd unit template not found at ${templatePath}`);\n }\n return readFileSync(templatePath, 'utf-8');\n}\n\nfunction resolveBinPath(): string {\n // When installed globally the script path is the CLI bin.\n const arg = process.argv[1];\n if (arg && existsSync(arg)) return arg;\n try {\n return execSync('command -v threatcrush', { encoding: 'utf-8' }).trim();\n } catch {\n return 'threatcrush';\n }\n}\n\nfunction isRoot(): boolean {\n return typeof process.getuid === 'function' && process.getuid() === 0;\n}\n\nexport async function installServiceCommand(): Promise<void> {\n banner();\n\n if (process.platform !== 'linux') {\n console.log(chalk.yellow(' systemd install is only supported on Linux.'));\n return;\n }\n\n if (!isRoot()) {\n console.log(chalk.red(' Must run as root (try `sudo threatcrush install-service`).'));\n return;\n }\n\n const unit = resolveTemplate().replace('{{BIN_PATH}}', resolveBinPath());\n writeFileSync(UNIT_PATH, unit, { mode: 0o644 });\n console.log(chalk.green(` ✓ Installed unit file: ${UNIT_PATH}`));\n\n try {\n execSync('systemctl daemon-reload', { stdio: 'inherit' });\n execSync('systemctl enable threatcrushd.service', { stdio: 'inherit' });\n console.log(chalk.green(' ✓ Service enabled on boot.'));\n console.log(chalk.dim(' Start now with: systemctl start threatcrushd'));\n console.log(chalk.dim(' View logs with: journalctl -u threatcrushd -f'));\n } catch (err) {\n console.log(chalk.yellow(` ! systemctl error: ${(err as Error).message}`));\n }\n}\n\nexport async function uninstallServiceCommand(): Promise<void> {\n banner();\n\n if (process.platform !== 'linux') {\n console.log(chalk.yellow(' systemd uninstall is only supported on Linux.'));\n return;\n }\n if (!isRoot()) {\n console.log(chalk.red(' Must run as root (try `sudo threatcrush uninstall-service`).'));\n return;\n }\n\n try { execSync('systemctl stop threatcrushd.service', { stdio: 'inherit' }); } catch {}\n try { execSync('systemctl disable threatcrushd.service', { stdio: 'inherit' }); } catch {}\n try {\n if (existsSync(UNIT_PATH)) {\n execSync(`rm -f ${UNIT_PATH}`);\n console.log(chalk.green(` ✓ Removed unit file: ${UNIT_PATH}`));\n }\n } catch {}\n try { execSync('systemctl daemon-reload', { stdio: 'inherit' }); } catch {}\n\n console.log(chalk.green(' ✓ threatcrushd service removed.'));\n}\n","import chalk from 'chalk';\nimport { isLoggedIn, readCliConfig } from '../core/cli-config.js';\nimport { findRunningDaemon } from '../daemon/pidfile.js';\nimport { PATHS } from '../daemon/paths.js';\n\nconst LOGO = chalk.green(`\n ████████╗██╗ ██╗██████╗ ███████╗ █████╗ ████████╗\n ╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗╚══██╔══╝\n ██║ ███████║██████╔╝█████╗ ███████║ ██║\n ██║ ██╔══██║██╔══██╗██╔══╝ ██╔══██║ ██║\n ██║ ██║ ██║██║ ██║███████╗██║ ██║ ██║\n ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝`) + chalk.dim(`\n C R U S H\n`);\n\ninterface Step {\n heading: string;\n hint?: string;\n cmd: string;\n}\n\nfunction nextSteps(): Step[] {\n const steps: Step[] = [];\n const loggedIn = isLoggedIn();\n const daemonRunning = !!findRunningDaemon();\n\n if (!loggedIn) {\n steps.push({\n heading: 'Sign in to threatcrush.com',\n hint: 'Stores your license, orgs, and property list.',\n cmd: 'threatcrush login',\n });\n }\n\n if (!daemonRunning) {\n steps.push({\n heading: 'Start the daemon',\n hint: `Runs in background, exposes an IPC socket at ${PATHS.socket}.`,\n cmd: 'threatcrush start',\n });\n }\n\n if (loggedIn) {\n steps.push({\n heading: 'Add a target to scan or pentest',\n hint: 'A URL, API, domain, IP, or repo that ThreatCrush will watch.',\n cmd: 'threatcrush properties add <name> <target>',\n });\n steps.push({\n heading: 'Run it now',\n hint: 'Auto-detects scan vs pentest based on the property kind.',\n cmd: 'threatcrush properties run',\n });\n } else {\n steps.push({\n heading: 'Scan a local codebase',\n hint: 'Fast static analysis for secrets and common vulnerabilities.',\n cmd: 'threatcrush scan .',\n });\n steps.push({\n heading: 'Pentest a URL',\n hint: 'Basic automated checks (SQLi / XSS / traversal / headers).',\n cmd: 'threatcrush pentest https://example.com',\n });\n }\n\n steps.push({\n heading: 'Open the live dashboard',\n hint: 'react-blessed TUI — subscribes to events from the daemon.',\n cmd: 'threatcrush tui',\n });\n\n return steps;\n}\n\nexport function welcomeCommand(): void {\n console.log(LOGO);\n\n const cfg = readCliConfig();\n const loggedIn = isLoggedIn();\n const daemonRunning = !!findRunningDaemon();\n\n const signedInLine = loggedIn\n ? `${chalk.green('● signed in')} ${chalk.dim('as')} ${chalk.white(cfg.email || cfg.user_id || 'unknown')}`\n : `${chalk.gray('○ not signed in')}`;\n const daemonLine = daemonRunning\n ? `${chalk.green('● daemon running')} ${chalk.dim('at')} ${chalk.gray(PATHS.socket)}`\n : `${chalk.gray('○ daemon stopped')}`;\n\n console.log(` ${signedInLine}`);\n console.log(` ${daemonLine}\\n`);\n\n console.log(chalk.green.bold(' Suggested next steps'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n\n const steps = nextSteps();\n steps.forEach((step, i) => {\n const num = chalk.green(` ${i + 1}.`);\n console.log(`${num} ${chalk.white.bold(step.heading)}`);\n if (step.hint) console.log(` ${chalk.dim(step.hint)}`);\n console.log(` ${chalk.green('$')} ${chalk.white(step.cmd)}\\n`);\n });\n\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(chalk.dim(' Run ') + chalk.white('threatcrush help') + chalk.dim(' to see every command.'));\n console.log(chalk.dim(' Docs: ') + chalk.white('https://threatcrush.com\\n'));\n}\n","import { readFileSync } from 'node:fs';\nimport { extname } from 'node:path';\nimport readline from 'node:readline';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { banner } from '../core/logger.js';\nimport { authHeaders, isLoggedIn, readCliConfig } from '../core/cli-config.js';\nimport { runScan } from './scan.js';\nimport { runPentest } from './pentest.js';\nimport { workerId, type RunResult } from '../core/run-result.js';\n\nconst API_URL = process.env.THREATCRUSH_API_URL || 'https://threatcrush.com';\n\nconst KINDS = ['url', 'api', 'domain', 'ip', 'repo'] as const;\ntype Kind = typeof KINDS[number];\n\ninterface Property {\n id: string;\n name: string;\n kind: Kind;\n target: string;\n description: string | null;\n tags: string[];\n enabled: boolean;\n last_run_at: string | null;\n last_run_status: string | null;\n created_at: string;\n}\n\ninterface Org {\n id: string;\n slug: string;\n name: string;\n}\n\nfunction prompt(question: string): Promise<string> {\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n return new Promise((resolve) => rl.question(question, (answer) => {\n rl.close();\n resolve(answer.trim());\n }));\n}\n\nasync function requireAuth(): Promise<boolean> {\n if (isLoggedIn()) return true;\n console.log(chalk.red(' You must be logged in.'));\n console.log(chalk.dim(` Run ${chalk.white('threatcrush login')}\\n`));\n return false;\n}\n\nasync function resolveOrgId(orgFlag?: string): Promise<{ org: Org } | null> {\n const cfg = readCliConfig();\n\n if (!orgFlag && cfg.current_org_id && cfg.current_org_slug) {\n return { org: { id: cfg.current_org_id, slug: cfg.current_org_slug, name: cfg.current_org_slug } };\n }\n\n let orgs: Org[] = [];\n try {\n const res = await fetch(`${API_URL}/api/orgs`, { headers: authHeaders() });\n if (!res.ok) {\n console.log(chalk.red(` Failed to list organizations (${res.status})\\n`));\n return null;\n }\n const data = await res.json() as { organizations?: Org[] };\n orgs = data.organizations || [];\n } catch (err) {\n console.log(chalk.red(` ${(err as Error).message}\\n`));\n return null;\n }\n\n if (orgs.length === 0) {\n console.log(chalk.yellow(' You are not a member of any organization yet.'));\n console.log(chalk.dim(` Create one: ${chalk.white('threatcrush orgs create <name>')}\\n`));\n return null;\n }\n\n const slug = orgFlag || cfg.current_org_slug;\n const org = slug ? orgs.find((o) => o.slug === slug) : orgs[0];\n if (!org) {\n console.log(chalk.red(` Organization not found: ${slug}\\n`));\n return null;\n }\n return { org };\n}\n\nasync function fetchProperties(orgId: string, kind?: Kind): Promise<Property[] | null> {\n const qs = kind ? `?kind=${kind}` : '';\n const res = await fetch(`${API_URL}/api/orgs/${orgId}/properties${qs}`, { headers: authHeaders() });\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: res.statusText }));\n console.log(chalk.red(` ${body.error || 'Failed to load properties'}\\n`));\n return null;\n }\n const data = await res.json() as { properties?: Property[] };\n return data.properties || [];\n}\n\nconst KIND_COLOR: Record<Kind, (s: string) => string> = {\n url: chalk.blue,\n api: chalk.magenta,\n domain: chalk.cyan,\n ip: chalk.yellow,\n repo: chalk.hex('#f78cc6'),\n};\n\nfunction printList(props: Property[], org: Org): void {\n console.log(chalk.green.bold(` Properties in ${chalk.white(org.slug)}`));\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n if (props.length === 0) {\n console.log(chalk.gray(' No properties yet.'));\n console.log();\n console.log(chalk.dim(` Add one with: ${chalk.white('threatcrush properties add <name> <target> --kind url')}`));\n console.log();\n return;\n }\n console.log(\n chalk.gray(' ') +\n chalk.white.bold('Name'.padEnd(20)) +\n chalk.white.bold('Kind'.padEnd(8)) +\n chalk.white.bold('Status'.padEnd(10)) +\n chalk.white.bold('Target'),\n );\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n for (const p of props) {\n const color = KIND_COLOR[p.kind] || chalk.white;\n const status = p.enabled ? chalk.green('● enabled ') : chalk.gray('○ disabled');\n console.log(\n chalk.gray(' ') +\n chalk.white(p.name.padEnd(20)) +\n color(p.kind.padEnd(8)) +\n status.padEnd(19) +\n chalk.dim(p.target),\n );\n if (p.tags.length > 0) {\n console.log(chalk.gray(' ' + ' '.repeat(28)) + chalk.gray('tags: ' + p.tags.join(', ')));\n }\n }\n console.log();\n}\n\nexport async function propertiesListCommand(opts: { org?: string; kind?: Kind }): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n const props = await fetchProperties(resolved.org.id, opts.kind);\n if (props === null) return;\n printList(props, resolved.org);\n}\n\nexport async function propertiesAddCommand(\n name: string,\n target: string,\n opts: { org?: string; kind?: Kind; tag?: string; description?: string; disabled?: boolean },\n): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n\n let kind = opts.kind;\n if (kind && !KINDS.includes(kind)) {\n console.log(chalk.red(` Invalid kind: ${kind}. Must be one of: ${KINDS.join(', ')}\\n`));\n return;\n }\n if (!kind) {\n // infer from target\n if (target.startsWith('http://') || target.startsWith('https://')) kind = 'url';\n else if (target.includes('/') && !target.startsWith('/') && !target.match(/^\\d/)) kind = 'repo';\n else if (/^\\d{1,3}(\\.\\d{1,3}){3}(\\/\\d{1,2})?$/.test(target)) kind = 'ip';\n else kind = 'domain';\n console.log(chalk.dim(` (auto-detected kind: ${kind})`));\n }\n\n const tags = opts.tag\n ? opts.tag.split(',').map((t) => t.trim()).filter(Boolean)\n : [];\n\n const body = {\n name,\n kind,\n target,\n description: opts.description,\n tags,\n enabled: !opts.disabled,\n };\n\n const spinner = ora({ text: `Creating property ${chalk.white(name)}...`, color: 'green' }).start();\n try {\n const res = await fetch(`${API_URL}/api/orgs/${resolved.org.id}/properties`, {\n method: 'POST',\n headers: authHeaders(),\n body: JSON.stringify(body),\n });\n const data = await res.json().catch(() => ({ error: res.statusText })) as {\n property?: Property;\n error?: string;\n };\n if (!res.ok || !data.property) {\n spinner.fail(`${data.error || 'Failed to create property'}`);\n return;\n }\n spinner.succeed(`Added ${chalk.white(data.property.name)} (${data.property.kind}) → ${data.property.target}`);\n console.log();\n } catch (err) {\n spinner.fail((err as Error).message);\n }\n}\n\nexport async function propertiesRemoveCommand(nameOrId: string, opts: { org?: string; yes?: boolean }): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n\n const props = await fetchProperties(resolved.org.id);\n if (props === null) return;\n const match = props.find((p) => p.id === nameOrId || p.name === nameOrId);\n if (!match) {\n console.log(chalk.red(` No property named \"${nameOrId}\" in ${resolved.org.slug}\\n`));\n return;\n }\n\n if (!opts.yes) {\n const answer = (await prompt(chalk.yellow(` Delete property \"${match.name}\"? (y/N): `))).toLowerCase();\n if (answer !== 'y' && answer !== 'yes') {\n console.log(chalk.dim(' Cancelled.\\n'));\n return;\n }\n }\n\n const res = await fetch(`${API_URL}/api/orgs/${resolved.org.id}/properties/${match.id}`, {\n method: 'DELETE',\n headers: authHeaders(),\n });\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: res.statusText }));\n console.log(chalk.red(` ${body.error || 'Failed to delete'}\\n`));\n return;\n }\n console.log(chalk.green(` ✓ Deleted ${chalk.white(match.name)}\\n`));\n}\n\ntype RunType = 'scan' | 'pentest';\n\nasync function enqueueRun(orgId: string, propertyId: string, type: RunType, trigger: 'cli' | 'manual' = 'cli'): Promise<string | null> {\n try {\n const res = await fetch(`${API_URL}/api/orgs/${orgId}/properties/${propertyId}/runs`, {\n method: 'POST',\n headers: authHeaders(),\n body: JSON.stringify({ type, trigger }),\n });\n const data = await res.json().catch(() => ({})) as { run?: { id: string } };\n return data.run?.id || null;\n } catch {\n return null;\n }\n}\n\nasync function finalizeRun(\n orgId: string,\n propertyId: string,\n runId: string,\n result: RunResult,\n): Promise<void> {\n try {\n await fetch(`${API_URL}/api/orgs/${orgId}/properties/${propertyId}/runs/${runId}`, {\n method: 'PATCH',\n headers: authHeaders(),\n body: JSON.stringify({\n status: result.error ? 'failed' : 'succeeded',\n findings_count: result.findings.length,\n severity_summary: result.severity_summary,\n summary: result.summary,\n findings: result.findings,\n error: result.error,\n source: 'local',\n worker_id: workerId(),\n }),\n });\n } catch {\n // best-effort\n }\n}\n\nexport async function propertiesRunCommand(\n opts: { org?: string; type?: RunType; kind?: Kind; name?: string },\n): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n\n const type: RunType = opts.type || 'pentest';\n const allProps = await fetchProperties(resolved.org.id);\n if (allProps === null) return;\n\n let targets = allProps.filter((p) => p.enabled);\n if (opts.kind) targets = targets.filter((p) => p.kind === opts.kind);\n if (opts.name) targets = targets.filter((p) => p.name === opts.name);\n\n if (!opts.kind && !opts.name) {\n if (type === 'pentest') targets = targets.filter((p) => p.kind === 'url' || p.kind === 'api');\n else if (type === 'scan') targets = targets.filter((p) => p.kind === 'repo');\n }\n\n if (targets.length === 0) {\n console.log(chalk.yellow(' No enabled properties match the filter.\\n'));\n console.log(chalk.dim(` List them: ${chalk.white('threatcrush properties list')}\\n`));\n return;\n }\n\n console.log(chalk.green.bold(` Running ${type} against ${targets.length} property(s) in ${resolved.org.slug}`));\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n for (const t of targets) {\n console.log(` ${KIND_COLOR[t.kind](`[${t.kind}]`)} ${chalk.white(t.name)} ${chalk.dim(t.target)}`);\n }\n console.log();\n\n let failures = 0;\n for (const t of targets) {\n console.log(chalk.green(`→ ${type} ${t.name} (${t.target})\\n`));\n const runId = await enqueueRun(resolved.org.id, t.id, type);\n let result: RunResult;\n try {\n result = type === 'pentest' ? await runPentest(t.target) : await runScan(t.target);\n } catch (err) {\n result = {\n type,\n target: t.target,\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: `Execution failed: ${(err as Error).message}`,\n error: (err as Error).message,\n };\n }\n\n const c = result.severity_summary;\n const line = ` ${result.error ? chalk.red('✗ failed') : chalk.green('✓ done')} ${chalk.white(t.name)} — ${result.summary}`;\n console.log(line);\n if (!result.error && result.findings.length > 0) {\n console.log(chalk.gray(` critical:${c.critical} high:${c.high} medium:${c.medium} low:${c.low}`));\n }\n if (result.error) failures++;\n\n if (runId) await finalizeRun(resolved.org.id, t.id, runId, result);\n }\n\n console.log();\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n if (failures === 0) {\n console.log(chalk.green(` ✓ Completed ${targets.length} run(s)\\n`));\n } else {\n console.log(chalk.yellow(` Completed with ${failures} failure(s) out of ${targets.length} run(s)\\n`));\n }\n}\n\ninterface PropertyRun {\n id: string;\n property_id: string;\n type: RunType;\n status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';\n trigger: string;\n source: string | null;\n queued_at: string;\n started_at: string | null;\n completed_at: string | null;\n findings_count: number;\n severity_summary: Record<string, number> | null;\n summary: string | null;\n error: string | null;\n}\n\nexport async function propertiesRunsCommand(opts: { org?: string; property?: string; limit?: number }): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n\n const props = await fetchProperties(resolved.org.id);\n if (props === null) return;\n\n let propsToShow = props;\n if (opts.property) {\n const match = props.find((p) => p.name === opts.property || p.id === opts.property);\n if (!match) {\n console.log(chalk.red(` Property \"${opts.property}\" not found.\\n`));\n return;\n }\n propsToShow = [match];\n }\n\n const limit = opts.limit || 10;\n console.log(chalk.green.bold(` Recent runs in ${chalk.white(resolved.org.slug)}`));\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n\n let total = 0;\n for (const prop of propsToShow) {\n const res = await fetch(\n `${API_URL}/api/orgs/${resolved.org.id}/properties/${prop.id}/runs?limit=${limit}`,\n { headers: authHeaders() },\n );\n if (!res.ok) continue;\n const data = await res.json() as { runs?: PropertyRun[] };\n const runs = data.runs || [];\n if (runs.length === 0) continue;\n\n console.log(` ${chalk.white.bold(prop.name)} ${KIND_COLOR[prop.kind](`[${prop.kind}]`)}`);\n for (const run of runs) {\n const statusColor =\n run.status === 'succeeded' ? chalk.green :\n run.status === 'failed' ? chalk.red :\n run.status === 'running' ? chalk.yellow :\n run.status === 'cancelled' ? chalk.gray :\n chalk.cyan;\n const when = (run.completed_at || run.started_at || run.queued_at).slice(0, 19).replace('T', ' ');\n const sev = run.severity_summary as Record<string, number> | null;\n const sevStr = sev\n ? chalk.dim(`[${sev.critical || 0}C/${sev.high || 0}H/${sev.medium || 0}M/${sev.low || 0}L]`)\n : chalk.dim('[–]');\n console.log(` ${chalk.gray(when)} ${statusColor(run.status.padEnd(10))} ${chalk.dim(run.type.padEnd(8))} ${sevStr} ${chalk.gray(run.summary || '')}`);\n total++;\n }\n console.log();\n }\n\n if (total === 0) {\n console.log(chalk.gray(' No runs recorded yet.'));\n console.log(chalk.dim(` Kick one off with: ${chalk.white('threatcrush properties run')}\\n`));\n }\n}\n\ninterface ImportRecord {\n name: string;\n target: string;\n kind?: Kind;\n description?: string;\n tags?: string[] | string;\n enabled?: boolean;\n}\n\nfunction parseImportFile(path: string): ImportRecord[] {\n const ext = extname(path).toLowerCase();\n const raw = readFileSync(path, 'utf-8');\n if (ext === '.json') {\n const parsed = JSON.parse(raw);\n if (!Array.isArray(parsed)) throw new Error('JSON must be an array of objects');\n return parsed as ImportRecord[];\n }\n if (ext === '.csv' || ext === '.tsv') {\n const delim = ext === '.tsv' ? '\\t' : ',';\n const lines = raw.split(/\\r?\\n/).filter((l) => l.trim().length > 0);\n if (lines.length < 1) return [];\n const header = lines[0].split(delim).map((h) => h.trim().toLowerCase());\n const idx = {\n name: header.indexOf('name'),\n target: header.indexOf('target'),\n kind: header.indexOf('kind'),\n description: header.indexOf('description'),\n tags: header.indexOf('tags'),\n enabled: header.indexOf('enabled'),\n };\n if (idx.name < 0 || idx.target < 0) {\n throw new Error('CSV must have at least \"name\" and \"target\" columns');\n }\n return lines.slice(1).map((line) => {\n const cols = line.split(delim).map((c) => c.trim());\n const rec: ImportRecord = {\n name: cols[idx.name] || '',\n target: cols[idx.target] || '',\n };\n if (idx.kind >= 0 && cols[idx.kind]) rec.kind = cols[idx.kind] as Kind;\n if (idx.description >= 0 && cols[idx.description]) rec.description = cols[idx.description];\n if (idx.tags >= 0 && cols[idx.tags]) rec.tags = cols[idx.tags].split('|').map((t) => t.trim()).filter(Boolean);\n if (idx.enabled >= 0 && cols[idx.enabled]) rec.enabled = /^(true|1|yes)$/i.test(cols[idx.enabled]);\n return rec;\n });\n }\n throw new Error(`Unsupported file type: ${ext}. Use .json, .csv, or .tsv.`);\n}\n\nfunction inferKind(target: string): Kind {\n if (/^https?:\\/\\//.test(target)) return 'url';\n if (/^\\d{1,3}(\\.\\d{1,3}){3}(\\/\\d{1,2})?$/.test(target)) return 'ip';\n if (target.includes('/') && !target.startsWith('/')) return 'repo';\n return 'domain';\n}\n\nexport async function propertiesImportCommand(filePath: string, opts: { org?: string; dryRun?: boolean }): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n\n let records: ImportRecord[];\n try {\n records = parseImportFile(filePath);\n } catch (err) {\n console.log(chalk.red(` ✗ ${(err as Error).message}\\n`));\n return;\n }\n\n if (records.length === 0) {\n console.log(chalk.yellow(' No records to import.\\n'));\n return;\n }\n\n console.log(chalk.green.bold(` Importing ${records.length} property(s) into ${resolved.org.slug}`));\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n\n let created = 0;\n let skipped = 0;\n let failed = 0;\n\n for (const rec of records) {\n if (!rec.name || !rec.target) {\n console.log(chalk.yellow(` ! skipped (missing name or target): ${JSON.stringify(rec)}`));\n skipped++;\n continue;\n }\n const kind = (rec.kind && KINDS.includes(rec.kind)) ? rec.kind : inferKind(rec.target);\n const tags = Array.isArray(rec.tags) ? rec.tags : (typeof rec.tags === 'string' ? rec.tags.split(',').map((t) => t.trim()).filter(Boolean) : []);\n\n if (opts.dryRun) {\n console.log(` ${chalk.dim('[dry-run]')} ${chalk.white(rec.name.padEnd(24))} ${KIND_COLOR[kind](`[${kind}]`)} ${chalk.dim(rec.target)}`);\n continue;\n }\n\n try {\n const res = await fetch(`${API_URL}/api/orgs/${resolved.org.id}/properties`, {\n method: 'POST',\n headers: authHeaders(),\n body: JSON.stringify({\n name: rec.name,\n target: rec.target,\n kind,\n description: rec.description,\n tags,\n enabled: rec.enabled !== false,\n }),\n });\n if (res.status === 409) {\n console.log(` ${chalk.yellow('!')} ${chalk.white(rec.name.padEnd(24))} already exists — skipped`);\n skipped++;\n continue;\n }\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: res.statusText }));\n console.log(` ${chalk.red('✗')} ${chalk.white(rec.name.padEnd(24))} ${chalk.red(body.error || 'failed')}`);\n failed++;\n continue;\n }\n console.log(` ${chalk.green('✓')} ${chalk.white(rec.name.padEnd(24))} ${KIND_COLOR[kind](`[${kind}]`)} ${chalk.dim(rec.target)}`);\n created++;\n } catch (err) {\n console.log(` ${chalk.red('✗')} ${chalk.white(rec.name.padEnd(24))} ${chalk.red((err as Error).message)}`);\n failed++;\n }\n }\n\n console.log();\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n console.log(` ${chalk.green(`${created} created`)} ${chalk.yellow(`${skipped} skipped`)} ${chalk.red(`${failed} failed`)}\\n`);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,kFAAAA,UAAA;AAAA;AAGA,QAAMC,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,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AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,QAAU;AAAA,QACT,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,QAAU;AAAA,QACT,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,UAAY;AAAA,QACX,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAA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,CAAC;AAIHA,SACG,QAAQ,SAAS,EACjB,YAAY,yCAAyC,EACrD,SAAS,YAAY,yCAAyC,EAC9D,OAAO,gBAAgB,mBAAmB,EAC1C,OAAO,qBAAqB,cAAc,EAC1C,OAAO,qBAAqB,YAAY,IAAI,EAC5C,OAAO,yBAAyB,mBAAmB,EACnD,OAAO,OAAO,QAAQ,SAAS;AAC9B,QAAM,eAAe;AAAA,IACnB;AAAA,IACA,KAAK,KAAK;AAAA,IACV,MAAM,KAAK;AAAA,IACX,MAAM,KAAK;AAAA,IACX,UAAU,KAAK;AAAA,EACjB,CAAC;AACH,CAAC;AAEHA,SACG,QAAQ,MAAM,EACd,YAAY,iDAAiD,EAC7D,SAAS,aAAa,0BAA0B,EAChD,OAAO,CAAC,gBAAyB;AAChC,MAAI,CAAC,aAAa;AAChB,YAAQ,IAAIC,KAAI;AAChB,IAAAD,SAAQ,WAAW;AACnB;AAAA,EACF;AACA,QAAM,MAAMA,SAAQ,SAAS;AAAA,IAC3B,CAAC,MAAM,EAAE,KAAK,MAAM,eAAe,EAAE,QAAQ,EAAE,SAAS,WAAW;AAAA,EACrE;AACA,MAAI,CAAC,KAAK;AACR,YAAQ,IAAI,eAAM,OAAO,sBAAsB,WAAW;AAAA,CAAI,CAAC;AAC/D,IAAAA,SAAQ,WAAW;AACnB;AAAA,EACF;AACA,MAAI,WAAW;AACjB,CAAC;AAGHA,SAAQ,OAAO,MAAM;AACnB,iBAAe;AACjB,CAAC;AAEDA,SAAQ,MAAM;","names":["exports","CommanderError","InvalidArgumentError","exports","InvalidArgumentError","Argument","exports","Help","cmd","exports","InvalidArgumentError","Option","str","exports","exports","EventEmitter","process","Argument","CommanderError","Help","Option","Command","regex","signals","option","path","exports","Argument","Command","CommanderError","InvalidArgumentError","Help","Option","Database","module","severityColor","onExit","React","import_node_os","import_node_fs","resolve","import_node_fs","blessed","React","import_react","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","Date","exports","module","exports","module","exports","module","exports","module","resolve","index","blocksize","exports","module","resolve","exports","module","exports","module","tomlType","str","exports","commander","process","os","tty","styles","chalk","styles","import_node_child_process","import_node_fs","import_node_path","import_node_os","import_node_fs","module","startDashboard","import_node_fs","import_node_path","import_node_process","import_node_process","import_node_process","onetime","process","global","process","process","import_node_process","process","import_node_process","isUnicodeSupported","env","process","import_node_process","process","import_cli_spinners","process","isUnicodeSupported","cliSpinners","import_node_os","os","import_node_fs","import_node_readline","import_node_fs","import_node_path","TOML","import_node_fs","import_node_path","import_node_os","import_node_readline","readline","resolve","fallback","readline","resolve","import_node_fs","import_node_path","import_toml","TOML","import_node_child_process","import_node_fs","import_node_path","import_toml","API_URL","TOML","dest","spinner","import_node_os","import_node_fs","import_node_path","API_URL","import_node_os","import_node_fs","import_node_path","API_URL","CONFIG_PATH","readConfig","getAuthHeaders","import_node_os","import_node_fs","import_node_path","import_node_child_process","API_URL","CONFIG_PATH","readConfig","getAuthHeaders","import_node_child_process","import_node_fs","import_node_path","import_node_fs","import_node_path","import_node_net","import_node_fs","resolve","import_node_fs","import_node_path","import_toml","import_node_fs","import_node_readline","bus","import_node_child_process","bus","bus","TOML","bus","API_URL","bus","import_node_child_process","import_node_fs","import_node_path","import_node_fs","import_node_path","import_node_readline","API_URL","prompt","readline","resolve","LOGO","API_URL","program","LOGO","readline","resolve","API_URL","pm","commands","rl"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/error.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/argument.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/help.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/option.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/suggestSimilar.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/command.js","../../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/index.js","../src/core/state.ts","../src/tui/app.tsx","../src/daemon/paths.ts","../src/core/ipc-client.ts","../src/daemon/pidfile.ts","../src/tui/dashboard.ts","../../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json","../../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/parser.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/create-datetime.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/format-num.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/create-datetime-float.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/create-date.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/create-time.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/lib/toml-parser.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/parse-pretty-error.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/parse-string.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/parse-async.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/parse-stream.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/parse.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/stringify.js","../../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/toml.js","../../../node_modules/.pnpm/commander@13.1.0/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/index.ts","../src/commands/monitor.ts","../src/core/logger.ts","../src/core/log-parser.ts","../src/commands/scan.ts","../../../node_modules/.pnpm/ora@8.2.0/node_modules/ora/index.js","../../../node_modules/.pnpm/cli-cursor@5.0.0/node_modules/cli-cursor/index.js","../../../node_modules/.pnpm/restore-cursor@5.1.0/node_modules/restore-cursor/index.js","../../../node_modules/.pnpm/mimic-function@5.0.1/node_modules/mimic-function/index.js","../../../node_modules/.pnpm/onetime@7.0.0/node_modules/onetime/index.js","../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/src/signals.ts","../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/src/index.ts","../../../node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js","../../../node_modules/.pnpm/log-symbols@6.0.0/node_modules/log-symbols/index.js","../../../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js","../../../node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js","../../../node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup-data.js","../../../node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/utilities.js","../../../node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/lookup.js","../../../node_modules/.pnpm/get-east-asian-width@1.5.0/node_modules/get-east-asian-width/index.js","../../../node_modules/.pnpm/emoji-regex@10.6.0/node_modules/emoji-regex/index.mjs","../../../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js","../../../node_modules/.pnpm/is-interactive@2.0.0/node_modules/is-interactive/index.js","../../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js","../../../node_modules/.pnpm/stdin-discarder@0.2.2/node_modules/stdin-discarder/index.js","../src/core/run-result.ts","../src/scan/dependencies.ts","../src/scan/engine.ts","../src/scan/types.ts","../src/scan/code-rules.ts","../src/scan/manifest-rules.ts","../src/scan/secret-rules.ts","../src/scan/sarif.ts","../src/commands/init.ts","../src/core/config.ts","../src/core/cli-config.ts","../src/commands/login.ts","../src/core/module-loader.ts","../src/commands/status.ts","../src/commands/modules.ts","../src/commands/pentest.ts","../src/commands/orgs.ts","../src/commands/servers.ts","../src/commands/connect.ts","../src/commands/daemon.ts","../src/daemon/index.ts","../src/daemon/ipc-server.ts","../src/daemon/event-bus.ts","../src/daemon/module-host.ts","../src/daemon/watchers/log-watcher.ts","../src/daemon/watchers/journal-watcher.ts","../src/modules/network-monitor/index.ts","../src/modules/dns-monitor/index.ts","../src/daemon/alerts/smtp.ts","../src/daemon/alerts/discord.ts","../src/daemon/alerts/pagerduty.ts","../src/daemon/alerts/index.ts","../src/daemon/workers/runs-worker.ts","../src/daemon/rules/engine.ts","../src/daemon/rules/loader.ts","../src/daemon/rules/default-rules.ts","../src/daemon/firewall/adapters.ts","../src/daemon/firewall/remediation.ts","../src/core/telemetry.ts","../src/commands/service.ts","../src/commands/welcome.ts","../src/commands/properties.ts","../src/commands/rules.ts","../src/commands/harden.ts","../src/commands/firewall.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.length > 3 && this._name.slice(-3) === '...') {\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 _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\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._concatValue(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 return `${option.description} (${extraInfo.join(', ')})`;\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 * 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 if (argumentList.length > 0) {\n output = output.concat([\n helper.styleTitle('Arguments:'),\n ...argumentList,\n '',\n ]);\n }\n\n // Options\n const optionList = helper.visibleOptions(cmd).map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n if (optionList.length > 0) {\n output = output.concat([\n helper.styleTitle('Options:'),\n ...optionList,\n '',\n ]);\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 if (globalOptionList.length > 0) {\n output = output.concat([\n helper.styleTitle('Global Options:'),\n ...globalOptionList,\n '',\n ]);\n }\n }\n\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(cmd)),\n helper.styleSubcommandDescription(helper.subcommandDescription(cmd)),\n );\n });\n if (commandList.length > 0) {\n output = output.concat([\n helper.styleTitle('Commands:'),\n ...commandList,\n '',\n ]);\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 }\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 _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\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._concatValue(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 * 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 }\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 Object.assign(this._outputConfiguration, configuration);\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|*)} [fn] - custom argument processing function\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, fn, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof fn === 'function') {\n argument.default(defaultValue).argParser(fn);\n } else {\n argument.default(fn);\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 && 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 return this;\n }\n\n enableOrNameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = enableOrNameAndArgs.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\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 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.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.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._concatValue(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 && 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 && 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[]} argv\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(argv) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n const args = argv.slice();\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n // parse options\n let activeVariadicOption = null;\n while (args.length) {\n const arg = args.shift();\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args);\n break;\n }\n\n if (activeVariadicOption && !maybeOption(arg)) {\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.shift();\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 (args.length > 0 && !maybeOption(args[0])) {\n value = args.shift();\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, emit and put back remainder of arg for further processing\n this.emit(`option:${option.name()}`);\n args.unshift(`-${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 if (maybeOption(arg)) {\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 if (args.length > 0) unknown.push(...args);\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg);\n if (args.length > 0) operands.push(...args);\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg);\n if (args.length > 0) dest.push(...args);\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 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 disabling built-in help option.\n if (typeof flags === 'boolean') {\n // true is not an expected value. Do something sensible but no unit-test.\n // istanbul ignore if\n if (flags) {\n this._helpOption = this._helpOption ?? undefined; // preserve existing option\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n flags = flags ?? '-h, --help';\n description = description ?? 'display help for command';\n this._helpOption = this.createOption(flags, description);\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 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","import Database from 'better-sqlite3';\nimport type { ThreatEvent } from '../types/events.js';\n\nlet db: Database.Database | null = null;\nlet dbUnavailable = false;\n\nexport function isStateDbAvailable(): boolean {\n return db !== null;\n}\n\nexport function initStateDB(dbPath: string = '/var/lib/threatcrush/state.db'): Database.Database {\n if (db) return db;\n if (dbUnavailable) {\n throw new Error('state db unavailable (previous init failed)');\n }\n\n try {\n try {\n db = new Database(dbPath);\n } catch {\n // Fall back to in-memory if we can't write to the path\n db = new Database(':memory:');\n }\n } catch (err) {\n // Native binding missing or unloadable — mark DB unavailable so callers\n // can degrade gracefully instead of throwing on every IPC request.\n dbUnavailable = true;\n throw err;\n }\n\n db.pragma('journal_mode = WAL');\n\n db.exec(`\n CREATE TABLE IF NOT EXISTS events (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n timestamp TEXT NOT NULL,\n module TEXT NOT NULL,\n category TEXT NOT NULL,\n severity TEXT NOT NULL,\n message TEXT NOT NULL,\n source_ip TEXT,\n details TEXT\n );\n\n CREATE TABLE IF NOT EXISTS module_state (\n module TEXT NOT NULL,\n key TEXT NOT NULL,\n value TEXT,\n PRIMARY KEY (module, key)\n );\n\n CREATE TABLE IF NOT EXISTS stats (\n key TEXT PRIMARY KEY,\n value TEXT NOT NULL,\n updated_at TEXT NOT NULL\n );\n\n CREATE INDEX IF NOT EXISTS idx_events_timestamp ON events(timestamp);\n CREATE INDEX IF NOT EXISTS idx_events_module ON events(module);\n CREATE INDEX IF NOT EXISTS idx_events_severity ON events(severity);\n CREATE INDEX IF NOT EXISTS idx_events_source_ip ON events(source_ip);\n `);\n\n return db;\n}\n\nexport function insertEvent(event: ThreatEvent): number {\n const database = tryDb();\n if (!database) return -1;\n const stmt = database.prepare(`\n INSERT INTO events (timestamp, module, category, severity, message, source_ip, details)\n VALUES (?, ?, ?, ?, ?, ?, ?)\n `);\n const result = stmt.run(\n event.timestamp.toISOString(),\n event.module,\n event.category,\n event.severity,\n event.message,\n event.source_ip || null,\n event.details ? JSON.stringify(event.details) : null,\n );\n return result.lastInsertRowid as number;\n}\n\nfunction tryDb(): Database.Database | null {\n if (db) return db;\n if (dbUnavailable) return null;\n try {\n return initStateDB();\n } catch {\n return null;\n }\n}\n\nexport function getRecentEvents(limit: number = 50): ThreatEvent[] {\n const database = tryDb();\n if (!database) return [];\n const rows = database.prepare(`\n SELECT * FROM events ORDER BY timestamp DESC LIMIT ?\n `).all(limit) as any[];\n return rows.map(rowToEvent);\n}\n\nexport function getEventCount(since?: Date): number {\n const database = tryDb();\n if (!database) return 0;\n if (since) {\n return (database.prepare(`SELECT COUNT(*) as count FROM events WHERE timestamp >= ?`)\n .get(since.toISOString()) as any).count;\n }\n return (database.prepare(`SELECT COUNT(*) as count FROM events`).get() as any).count;\n}\n\nexport function getThreatCount(since?: Date): number {\n const database = tryDb();\n if (!database) return 0;\n const severities = \"('medium','high','critical')\";\n if (since) {\n return (database.prepare(\n `SELECT COUNT(*) as count FROM events WHERE severity IN ${severities} AND timestamp >= ?`\n ).get(since.toISOString()) as any).count;\n }\n return (database.prepare(\n `SELECT COUNT(*) as count FROM events WHERE severity IN ${severities}`\n ).get() as any).count;\n}\n\nexport function getTopSources(limit: number = 10): Array<{ ip: string; count: number }> {\n const database = tryDb();\n if (!database) return [];\n return database.prepare(`\n SELECT source_ip as ip, COUNT(*) as count FROM events\n WHERE source_ip IS NOT NULL\n GROUP BY source_ip ORDER BY count DESC LIMIT ?\n `).all(limit) as any[];\n}\n\nexport function getModuleState(module: string, key: string): unknown {\n const database = db || initStateDB();\n const row = database.prepare(`SELECT value FROM module_state WHERE module = ? AND key = ?`)\n .get(module, key) as any;\n if (!row) return undefined;\n try {\n return JSON.parse(row.value);\n } catch {\n return row.value;\n }\n}\n\nexport function setModuleState(module: string, key: string, value: unknown): void {\n const database = db || initStateDB();\n database.prepare(`\n INSERT OR REPLACE INTO module_state (module, key, value) VALUES (?, ?, ?)\n `).run(module, key, JSON.stringify(value));\n}\n\nfunction rowToEvent(row: any): ThreatEvent {\n return {\n id: row.id,\n timestamp: new Date(row.timestamp),\n module: row.module,\n category: row.category,\n severity: row.severity,\n message: row.message,\n source_ip: row.source_ip,\n details: row.details ? JSON.parse(row.details) : undefined,\n };\n}\n\nexport function closeDB(): void {\n if (db) {\n db.close();\n db = null;\n }\n}\n","import React, { useEffect, useReducer, useRef } from 'react';\nimport type { ThreatEvent, EventSeverity } from '../types/events.js';\nimport type { DaemonStatusReply } from '../daemon/ipc-protocol.js';\nimport { IpcClient } from '../core/ipc-client.js';\n\ninterface ModuleRow { name: string; status: string; events: number; detail?: string }\n\ninterface State {\n connected: boolean;\n connectionLabel: string;\n events: ThreatEvent[];\n counters: { events: number; threats: number; modules: number };\n severity: Record<EventSeverity, number>;\n modules: ModuleRow[];\n topSources: Array<{ ip: string; count: number }>;\n timeline: number[];\n daemonStatus: DaemonStatusReply | null;\n paused: boolean;\n}\n\ntype Action =\n | { type: 'connected'; label: string; status: DaemonStatusReply }\n | { type: 'connection_lost'; label: string }\n | { type: 'event'; event: ThreatEvent }\n | { type: 'tick' }\n | { type: 'modules'; modules: ModuleRow[] }\n | { type: 'top'; top: Array<{ ip: string; count: number }> }\n | { type: 'counters'; counters: { events: number; threats: number } }\n | { type: 'pause' }\n | { type: 'reset' };\n\nconst DEMO: ThreatEvent[] = [\n { timestamp: new Date(), module: 'ssh-guard', category: 'auth', severity: 'info', message: 'SSH login accepted for ubuntu', source_ip: '10.0.0.1' },\n { timestamp: new Date(), module: 'log-watcher', category: 'web', severity: 'info', message: 'GET /api/health → 200', source_ip: '172.16.0.50' },\n { timestamp: new Date(), module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Failed SSH login for root', source_ip: '45.33.22.11' },\n { timestamp: new Date(), module: 'log-watcher', category: 'web', severity: 'critical', message: 'Attack [SQLI]: GET /search?q=1%27+OR+1%3D1', source_ip: '185.220.101.44' },\n { timestamp: new Date(), module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Brute force — 6 failures in 45s', source_ip: '45.33.22.11' },\n { timestamp: new Date(), module: 'log-watcher', category: 'web', severity: 'critical', message: 'Attack [PATH_TRAVERSAL]: GET /../../etc/passwd', source_ip: '185.220.101.44' },\n { timestamp: new Date(), module: 'log-watcher', category: 'web', severity: 'medium', message: 'Server error 502: GET /api/users', source_ip: '10.0.0.2' },\n { timestamp: new Date(), module: 'dns-monitor', category: 'network', severity: 'medium', message: 'DNS tunneling suspected: TXT queries', source_ip: '103.44.8.2' },\n];\n\nconst initialState: State = {\n connected: false,\n connectionLabel: 'connecting...',\n events: [],\n counters: { events: 0, threats: 0, modules: 0 },\n severity: { info: 0, low: 0, medium: 0, high: 0, critical: 0 },\n modules: [],\n topSources: [],\n timeline: Array(30).fill(0),\n daemonStatus: null,\n paused: false,\n};\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case 'connected':\n return {\n ...state,\n connected: true,\n connectionLabel: action.label,\n daemonStatus: action.status,\n modules: action.status.modules,\n counters: {\n events: action.status.counters.events,\n threats: action.status.counters.threats,\n modules: action.status.modules.length,\n },\n };\n case 'connection_lost':\n return { ...state, connected: false, connectionLabel: action.label };\n case 'event': {\n if (state.paused) return state;\n const events = [...state.events, action.event].slice(-300);\n const severity = { ...state.severity, [action.event.severity]: state.severity[action.event.severity] + 1 };\n const isThreat = action.event.severity === 'medium' || action.event.severity === 'high' || action.event.severity === 'critical';\n return {\n ...state,\n events,\n severity,\n counters: {\n ...state.counters,\n events: state.counters.events + 1,\n threats: state.counters.threats + (isThreat ? 1 : 0),\n },\n };\n }\n case 'tick':\n return { ...state, timeline: [...state.timeline.slice(1), state.events.length] };\n case 'modules':\n return { ...state, modules: action.modules, counters: { ...state.counters, modules: action.modules.length } };\n case 'top':\n return { ...state, topSources: action.top };\n case 'counters':\n return { ...state, counters: { ...state.counters, events: action.counters.events, threats: action.counters.threats } };\n case 'pause':\n return { ...state, paused: !state.paused };\n case 'reset':\n return { ...initialState, connected: state.connected, connectionLabel: state.connectionLabel, daemonStatus: state.daemonStatus, modules: state.modules };\n }\n}\n\nconst severityColor: Record<EventSeverity, string> = {\n info: 'green',\n low: 'cyan',\n medium: 'yellow',\n high: 'red',\n critical: 'magenta',\n};\n\nfunction fmtTime(d: Date): string {\n return d.toISOString().slice(11, 19);\n}\n\nfunction eventLine(event: ThreatEvent): string {\n const color = severityColor[event.severity];\n const ts = fmtTime(event.timestamp);\n const ip = event.source_ip ? ` (${event.source_ip})` : '';\n const sev = `[${event.severity.toUpperCase()}]`.padEnd(10);\n const mod = `[${event.module}]`.padEnd(14);\n return `{${color}-bold}${ts}{/${color}-bold} {cyan-fg}${mod}{/cyan-fg} {${color}-fg}${sev}{/${color}-fg} ${event.message}${ip}`;\n}\n\nfunction sparklineRow(values: number[], width: number): string {\n const bars = ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'];\n const max = Math.max(1, ...values);\n const slice = values.slice(-width);\n return slice.map((v) => bars[Math.min(bars.length - 1, Math.floor((v / max) * (bars.length - 1)))]).join('');\n}\n\nfunction severityBarRow(label: string, count: number, total: number, color: string): string {\n const pct = total > 0 ? Math.round((count / total) * 100) : 0;\n const width = 20;\n const filled = Math.round((pct / 100) * width);\n const bar = `{${color}-fg}${'█'.repeat(filled)}{/}${'·'.repeat(Math.max(0, width - filled))}`;\n return ` {bold}${label.padEnd(8)}{/bold} ${bar} {${color}-fg}${String(count).padStart(4)}{/} ${String(pct).padStart(3)}%`;\n}\n\ninterface AppProps {\n client: IpcClient | null;\n onExit: () => void;\n}\n\nexport function App({ client, onExit }: AppProps): React.ReactElement {\n const [state, dispatch] = useReducer(reducer, initialState);\n const screenRef = useRef<{ focus: () => void } | null>(null);\n\n useEffect(() => {\n if (!client) {\n dispatch({ type: 'connection_lost', label: 'demo mode — no daemon' });\n let i = 0;\n const timer = setInterval(() => {\n const base = DEMO[i % DEMO.length];\n dispatch({ type: 'event', event: { ...base, timestamp: new Date() } });\n i++;\n }, 1800);\n return () => clearInterval(timer);\n }\n\n let mounted = true;\n\n // Route pushed IPC events directly into our reducer.\n (client as unknown as { opts: { onEvent?: (e: ThreatEvent) => void } }).opts.onEvent = (event) => {\n if (!mounted) return;\n dispatch({ type: 'event', event });\n };\n\n client.status()\n .then((status) => { if (mounted) dispatch({ type: 'connected', label: `daemon pid ${status.pid} · v${status.version}`, status }); })\n .catch(() => dispatch({ type: 'connection_lost', label: 'daemon ipc error' }));\n\n client.subscribe(['event', 'module']).catch(() => {});\n\n const refresh = setInterval(async () => {\n try {\n const [mods, top, counters] = await Promise.all([\n client.request<ModuleRow[]>('module_list'),\n client.topSources(8),\n client.counters(),\n ]);\n dispatch({ type: 'modules', modules: mods });\n dispatch({ type: 'top', top });\n dispatch({ type: 'counters', counters: { events: counters.total, threats: counters.threats } });\n } catch {\n dispatch({ type: 'connection_lost', label: 'daemon disconnected' });\n }\n }, 2000);\n\n return () => {\n mounted = false;\n clearInterval(refresh);\n };\n }, [client]);\n\n useEffect(() => {\n const tick = setInterval(() => dispatch({ type: 'tick' }), 1000);\n return () => clearInterval(tick);\n }, []);\n\n const totalSeverity = Object.values(state.severity).reduce((a, b) => a + b, 0);\n const feedLines = state.events.slice(-60).map(eventLine).join('\\n');\n const spark = sparklineRow(state.timeline, 28);\n const modRows = state.modules.length === 0\n ? ' {gray-fg}(no modules reported){/gray-fg}'\n : state.modules.map((m) => ` ${m.status === 'running' ? '{green-fg}●{/}' : '{cyan-fg}○{/}'} {bold}${m.name.padEnd(16)}{/} {gray-fg}${m.status.padEnd(10)} ${m.events} evt{/}`).join('\\n');\n const topRows = state.topSources.length === 0\n ? ' {gray-fg}(no sources yet){/gray-fg}'\n : state.topSources.map((s) => ` {magenta-fg}${s.ip.padEnd(18)}{/} {bold}${String(s.count).padStart(5)}{/}`).join('\\n');\n\n const statusColor = state.connected ? 'green' : 'yellow';\n const statusGlyph = state.connected ? '●' : '○';\n\n return (\n <element keyable={true} ref={(ref: unknown) => { screenRef.current = ref as { focus: () => void }; }}\n onKey-q={onExit} onKey-escape={onExit} onKey-C-c={onExit}\n onKey-p={() => dispatch({ type: 'pause' })}\n onKey-r={() => dispatch({ type: 'reset' })}\n >\n <box top={0} left={0} width=\"100%\" height={3}\n border={{ type: 'line' }}\n style={{ border: { fg: 'green' } }}\n tags={true}\n content={` {green-fg}⚡ ThreatCrush{/} — Interactive Security Dashboard {gray-fg}|{/} {${statusColor}-fg}${statusGlyph} ${state.connectionLabel}{/}${state.paused ? ' {yellow-fg}· PAUSED{/}' : ''}`}\n />\n\n <box top={3} left={0} width=\"25%\" height={3} border={{ type: 'line' }} style={{ border: { fg: 'green' } }} label=\" Events \" tags={true}\n content={` {green-fg}{bold}${state.counters.events}{/bold}{/}`} />\n <box top={3} left=\"25%\" width=\"25%\" height={3} border={{ type: 'line' }} style={{ border: { fg: 'red' } }} label=\" Threats \" tags={true}\n content={` {red-fg}{bold}${state.counters.threats}{/bold}{/}`} />\n <box top={3} left=\"50%\" width=\"25%\" height={3} border={{ type: 'line' }} style={{ border: { fg: 'cyan' } }} label=\" Modules \" tags={true}\n content={` {cyan-fg}{bold}${state.counters.modules}{/bold}{/}`} />\n <box top={3} left=\"75%\" width=\"25%\" height={3} border={{ type: 'line' }} style={{ border: { fg: statusColor } }} label=\" Status \" tags={true}\n content={` {${statusColor}-fg}${statusGlyph} ${state.connected ? 'MONITORING' : 'DEMO'}{/}`} />\n\n <box top={6} left={0} width=\"40%\" height={10} border={{ type: 'line' }} style={{ border: { fg: 'yellow' } }} label=\" Severity \" tags={true}\n content={[\n severityBarRow('Info', state.severity.info, totalSeverity, 'green'),\n severityBarRow('Low', state.severity.low, totalSeverity, 'cyan'),\n severityBarRow('Medium', state.severity.medium, totalSeverity, 'yellow'),\n severityBarRow('High', state.severity.high, totalSeverity, 'red'),\n severityBarRow('Critical', state.severity.critical, totalSeverity, 'magenta'),\n ].join('\\n')} />\n\n <box top={6} left=\"40%\" width=\"30%\" height={10} border={{ type: 'line' }} style={{ border: { fg: 'magenta' } }} label=\" Top Sources \" tags={true}\n content={topRows} />\n\n <box top={6} left=\"70%\" width=\"30%\" height={10} border={{ type: 'line' }} style={{ border: { fg: 'blue' } }} label=\" Events / sec \" tags={true}\n content={`\\n {blue-fg}${spark}{/}\\n\\n {gray-fg}last ${state.timeline.length}s{/}`} />\n\n <scrollabletext top={16} left={0} width=\"70%\" height=\"100%-18\"\n border={{ type: 'line' }}\n style={{ border: { fg: 'green' } }}\n label=\" Live Event Feed \"\n tags={true}\n scrollable={true}\n alwaysScroll={true}\n scrollbar={{ ch: ' ', style: { bg: 'green' } }}\n content={feedLines || ' {gray-fg}(no events yet — waiting for the daemon...){/gray-fg}'} />\n\n <box top={16} left=\"70%\" width=\"30%\" height=\"100%-18\"\n border={{ type: 'line' }}\n style={{ border: { fg: 'cyan' } }}\n label=\" Modules \"\n tags={true}\n content={modRows} />\n\n <box bottom={0} left={0} width=\"100%\" height={3}\n border={{ type: 'line' }}\n style={{ border: { fg: 'green' } }}\n tags={true}\n content=\" {green-fg}q{/}:quit {green-fg}p{/}:pause {green-fg}r{/}:reset {gray-fg}| Ctrl-C exits | daemon over IPC{/}\" />\n </element>\n );\n}\n","import { existsSync, mkdirSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\n\nfunction isRoot(): boolean {\n return (\n process.platform === 'linux' &&\n typeof process.getuid === 'function' &&\n process.getuid() === 0\n );\n}\n\nconst userBase = join(homedir(), '.threatcrush');\n\nconst SYSTEM_PATHS = {\n mode: 'system' as const,\n configDir: '/etc/threatcrush',\n configFile: '/etc/threatcrush/threatcrushd.conf',\n confD: '/etc/threatcrush/threatcrushd.conf.d',\n moduleDir: '/etc/threatcrush/modules',\n logDir: '/var/log/threatcrush',\n logFile: '/var/log/threatcrush/threatcrushd.log',\n stateDir: '/var/lib/threatcrush',\n stateDb: '/var/lib/threatcrush/state.db',\n runDir: '/var/run/threatcrush',\n pidFile: '/var/run/threatcrush/threatcrushd.pid',\n socket: '/var/run/threatcrush/threatcrushd.sock',\n};\n\nconst USER_PATHS = {\n mode: 'user' as const,\n configDir: userBase,\n configFile: join(userBase, 'threatcrushd.conf'),\n confD: join(userBase, 'threatcrushd.conf.d'),\n moduleDir: join(userBase, 'modules'),\n logDir: join(userBase, 'logs'),\n logFile: join(userBase, 'logs', 'threatcrushd.log'),\n stateDir: join(userBase, 'state'),\n stateDb: join(userBase, 'state', 'state.db'),\n runDir: join(userBase, 'run'),\n pidFile: join(userBase, 'run', 'threatcrushd.pid'),\n socket: join(userBase, 'run', 'threatcrushd.sock'),\n};\n\n// System paths (config/log/state/run under /etc and /var) are root-owned, so we\n// only run in system mode when actually root. Choosing system mode because\n// /etc/threatcrush happened to be writable, or because a stale system socket\n// existed, made `threatcrush start` as a normal user crash with EACCES trying\n// to open /var/log/threatcrush/threatcrushd.log. A non-root user always runs a\n// self-contained daemon under ~/.threatcrush instead.\nexport const PATHS = isRoot() ? SYSTEM_PATHS : USER_PATHS;\n\n// A non-root client command (status/stop/logs/tail) should still be able to\n// reach a daemon that root started. Prefer this process's own socket, but fall\n// back to the other mode's socket when only that one is present.\nexport function resolveClientSocket(): string {\n if (existsSync(PATHS.socket)) return PATHS.socket;\n const other = PATHS.mode === 'system' ? USER_PATHS.socket : SYSTEM_PATHS.socket;\n if (existsSync(other)) return other;\n return PATHS.socket;\n}\n\nexport function ensureRuntimeDirs(): void {\n for (const dir of [PATHS.configDir, PATHS.confD, PATHS.moduleDir, PATHS.logDir, PATHS.stateDir, PATHS.runDir]) {\n try {\n mkdirSync(dir, { recursive: true });\n } catch {\n // best-effort\n }\n }\n}\n","import { createConnection, Socket } from 'node:net';\nimport { existsSync } from 'node:fs';\nimport { resolveClientSocket } from '../daemon/paths.js';\nimport type {\n IpcRequest,\n IpcResponse,\n IpcPush,\n DaemonStatusReply,\n} from '../daemon/ipc-protocol.js';\nimport type { ThreatEvent } from '../types/events.js';\n\nexport interface IpcClientOptions {\n socketPath?: string;\n onEvent?: (event: ThreatEvent) => void;\n onModule?: (info: { name: string; status: string; detail?: string }) => void;\n}\n\ntype Pending = {\n resolve: (value: unknown) => void;\n reject: (err: Error) => void;\n};\n\nexport class IpcClient {\n private socket: Socket | null = null;\n private buffer = '';\n private nextId = 1;\n private pending = new Map<number, Pending>();\n private socketPath: string;\n\n constructor(private opts: IpcClientOptions = {}) {\n this.socketPath = opts.socketPath || resolveClientSocket();\n }\n\n static isDaemonRunning(socketPath = resolveClientSocket()): boolean {\n return existsSync(socketPath);\n }\n\n async connect(timeoutMs = 2000): Promise<void> {\n if (!existsSync(this.socketPath)) {\n throw new Error(`threatcrushd socket not found at ${this.socketPath}`);\n }\n\n return new Promise((resolve, reject) => {\n const sock = createConnection(this.socketPath);\n const timer = setTimeout(() => {\n sock.destroy();\n reject(new Error('ipc connect timeout'));\n }, timeoutMs);\n\n sock.once('connect', () => {\n clearTimeout(timer);\n this.socket = sock;\n sock.setEncoding('utf-8');\n sock.on('data', (chunk) => this.onData(chunk.toString()));\n sock.on('close', () => this.onClose());\n sock.on('error', () => this.onClose());\n resolve();\n });\n\n sock.once('error', (err) => {\n clearTimeout(timer);\n reject(err);\n });\n });\n }\n\n close(): void {\n this.socket?.destroy();\n this.socket = null;\n }\n\n async request<T>(method: IpcRequest['method'], params?: Record<string, unknown>): Promise<T> {\n if (!this.socket) throw new Error('not connected');\n const id = this.nextId++;\n const frame: IpcRequest = params\n ? ({ id, method, params } as IpcRequest)\n : ({ id, method } as IpcRequest);\n\n return new Promise<T>((resolve, reject) => {\n this.pending.set(id, { resolve: resolve as (v: unknown) => void, reject });\n this.socket!.write(JSON.stringify(frame) + '\\n', (err) => {\n if (err) {\n this.pending.delete(id);\n reject(err);\n }\n });\n });\n }\n\n async ping(): Promise<'pong'> {\n return this.request<'pong'>('ping');\n }\n\n async status(): Promise<DaemonStatusReply> {\n return this.request<DaemonStatusReply>('status');\n }\n\n async recentEvents(limit = 50): Promise<ThreatEvent[]> {\n return this.request<ThreatEvent[]>('recent_events', { limit });\n }\n\n async topSources(limit = 10): Promise<Array<{ ip: string; count: number }>> {\n return this.request('top_sources', { limit });\n }\n\n async counters() {\n return this.request<{ total: number; threats: number; last24h: number; threats24h: number }>('counters');\n }\n\n async subscribe(channels: Array<'event' | 'module'>): Promise<void> {\n await this.request('subscribe', { channels });\n }\n\n async shutdown(): Promise<void> {\n await this.request('shutdown');\n }\n\n private onData(chunk: string): void {\n this.buffer += chunk;\n let idx;\n while ((idx = this.buffer.indexOf('\\n')) >= 0) {\n const line = this.buffer.slice(0, idx);\n this.buffer = this.buffer.slice(idx + 1);\n if (!line.trim()) continue;\n try {\n const msg = JSON.parse(line) as IpcResponse | IpcPush;\n if ('push' in msg) {\n if (msg.push === 'event' && this.opts.onEvent) {\n const raw = msg.payload as ThreatEvent & { timestamp: string | Date };\n this.opts.onEvent({ ...raw, timestamp: new Date(raw.timestamp) });\n } else if (msg.push === 'module' && this.opts.onModule) {\n this.opts.onModule(msg.payload as { name: string; status: string; detail?: string });\n }\n continue;\n }\n const pending = this.pending.get(msg.id);\n if (!pending) continue;\n this.pending.delete(msg.id);\n if (msg.ok) pending.resolve(msg.result);\n else pending.reject(new Error(msg.error || 'ipc error'));\n } catch {\n // skip malformed frame\n }\n }\n }\n\n private onClose(): void {\n for (const { reject } of this.pending.values()) {\n reject(new Error('daemon connection closed'));\n }\n this.pending.clear();\n this.socket = null;\n }\n}\n","import { existsSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs';\nimport { PATHS, ensureRuntimeDirs } from './paths.js';\n\nexport function writePidFile(): void {\n ensureRuntimeDirs();\n writeFileSync(PATHS.pidFile, String(process.pid), 'utf-8');\n}\n\nexport function readPidFile(): number | null {\n if (!existsSync(PATHS.pidFile)) return null;\n const raw = readFileSync(PATHS.pidFile, 'utf-8').trim();\n const pid = parseInt(raw, 10);\n return Number.isFinite(pid) ? pid : null;\n}\n\nexport function removePidFile(): void {\n try {\n if (existsSync(PATHS.pidFile)) unlinkSync(PATHS.pidFile);\n } catch {\n // ignore\n }\n}\n\nexport function isProcessAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (err) {\n // EPERM means the process exists but the current user can't signal it\n // (common: a non-root client checking on a system-mode daemon running as\n // root). Only ESRCH means the process is actually gone.\n const code = (err as NodeJS.ErrnoException).code;\n return code === 'EPERM';\n }\n}\n\nexport function findRunningDaemon(): number | null {\n const pid = readPidFile();\n if (pid && isProcessAlive(pid)) return pid;\n if (pid) removePidFile();\n return null;\n}\n","import blessed from 'blessed';\nimport React from 'react';\nimport { render } from 'react-blessed';\nimport { App } from './app.js';\nimport { IpcClient } from '../core/ipc-client.js';\nimport { findRunningDaemon } from '../daemon/pidfile.js';\nimport { closeDB } from '../core/state.js';\n\nexport async function startDashboard(): Promise<void> {\n const screen = blessed.screen({\n smartCSR: true,\n fullUnicode: true,\n title: 'ThreatCrush TUI Dashboard',\n });\n\n let client: IpcClient | null = null;\n if (findRunningDaemon()) {\n client = new IpcClient();\n try {\n await client.connect();\n } catch {\n client = null;\n }\n }\n\n const exit = () => {\n try { client?.close(); } catch {}\n try { closeDB(); } catch {}\n screen.destroy();\n process.exit(0);\n };\n\n render(React.createElement(App, { client, onExit: exit }), screen);\n\n screen.key(['C-c', 'q', 'escape'], exit);\n}\n","{\n\t\"dots\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠋\",\n\t\t\t\"⠙\",\n\t\t\t\"⠹\",\n\t\t\t\"⠸\",\n\t\t\t\"⠼\",\n\t\t\t\"⠴\",\n\t\t\t\"⠦\",\n\t\t\t\"⠧\",\n\t\t\t\"⠇\",\n\t\t\t\"⠏\"\n\t\t]\n\t},\n\t\"dots2\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⣾\",\n\t\t\t\"⣽\",\n\t\t\t\"⣻\",\n\t\t\t\"⢿\",\n\t\t\t\"⡿\",\n\t\t\t\"⣟\",\n\t\t\t\"⣯\",\n\t\t\t\"⣷\"\n\t\t]\n\t},\n\t\"dots3\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠋\",\n\t\t\t\"⠙\",\n\t\t\t\"⠚\",\n\t\t\t\"⠞\",\n\t\t\t\"⠖\",\n\t\t\t\"⠦\",\n\t\t\t\"⠴\",\n\t\t\t\"⠲\",\n\t\t\t\"⠳\",\n\t\t\t\"⠓\"\n\t\t]\n\t},\n\t\"dots4\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠄\",\n\t\t\t\"⠆\",\n\t\t\t\"⠇\",\n\t\t\t\"⠋\",\n\t\t\t\"⠙\",\n\t\t\t\"⠸\",\n\t\t\t\"⠰\",\n\t\t\t\"⠠\",\n\t\t\t\"⠰\",\n\t\t\t\"⠸\",\n\t\t\t\"⠙\",\n\t\t\t\"⠋\",\n\t\t\t\"⠇\",\n\t\t\t\"⠆\"\n\t\t]\n\t},\n\t\"dots5\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠋\",\n\t\t\t\"⠙\",\n\t\t\t\"⠚\",\n\t\t\t\"⠒\",\n\t\t\t\"⠂\",\n\t\t\t\"⠂\",\n\t\t\t\"⠒\",\n\t\t\t\"⠲\",\n\t\t\t\"⠴\",\n\t\t\t\"⠦\",\n\t\t\t\"⠖\",\n\t\t\t\"⠒\",\n\t\t\t\"⠐\",\n\t\t\t\"⠐\",\n\t\t\t\"⠒\",\n\t\t\t\"⠓\",\n\t\t\t\"⠋\"\n\t\t]\n\t},\n\t\"dots6\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠁\",\n\t\t\t\"⠉\",\n\t\t\t\"⠙\",\n\t\t\t\"⠚\",\n\t\t\t\"⠒\",\n\t\t\t\"⠂\",\n\t\t\t\"⠂\",\n\t\t\t\"⠒\",\n\t\t\t\"⠲\",\n\t\t\t\"⠴\",\n\t\t\t\"⠤\",\n\t\t\t\"⠄\",\n\t\t\t\"⠄\",\n\t\t\t\"⠤\",\n\t\t\t\"⠴\",\n\t\t\t\"⠲\",\n\t\t\t\"⠒\",\n\t\t\t\"⠂\",\n\t\t\t\"⠂\",\n\t\t\t\"⠒\",\n\t\t\t\"⠚\",\n\t\t\t\"⠙\",\n\t\t\t\"⠉\",\n\t\t\t\"⠁\"\n\t\t]\n\t},\n\t\"dots7\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠈\",\n\t\t\t\"⠉\",\n\t\t\t\"⠋\",\n\t\t\t\"⠓\",\n\t\t\t\"⠒\",\n\t\t\t\"⠐\",\n\t\t\t\"⠐\",\n\t\t\t\"⠒\",\n\t\t\t\"⠖\",\n\t\t\t\"⠦\",\n\t\t\t\"⠤\",\n\t\t\t\"⠠\",\n\t\t\t\"⠠\",\n\t\t\t\"⠤\",\n\t\t\t\"⠦\",\n\t\t\t\"⠖\",\n\t\t\t\"⠒\",\n\t\t\t\"⠐\",\n\t\t\t\"⠐\",\n\t\t\t\"⠒\",\n\t\t\t\"⠓\",\n\t\t\t\"⠋\",\n\t\t\t\"⠉\",\n\t\t\t\"⠈\"\n\t\t]\n\t},\n\t\"dots8\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⠁\",\n\t\t\t\"⠁\",\n\t\t\t\"⠉\",\n\t\t\t\"⠙\",\n\t\t\t\"⠚\",\n\t\t\t\"⠒\",\n\t\t\t\"⠂\",\n\t\t\t\"⠂\",\n\t\t\t\"⠒\",\n\t\t\t\"⠲\",\n\t\t\t\"⠴\",\n\t\t\t\"⠤\",\n\t\t\t\"⠄\",\n\t\t\t\"⠄\",\n\t\t\t\"⠤\",\n\t\t\t\"⠠\",\n\t\t\t\"⠠\",\n\t\t\t\"⠤\",\n\t\t\t\"⠦\",\n\t\t\t\"⠖\",\n\t\t\t\"⠒\",\n\t\t\t\"⠐\",\n\t\t\t\"⠐\",\n\t\t\t\"⠒\",\n\t\t\t\"⠓\",\n\t\t\t\"⠋\",\n\t\t\t\"⠉\",\n\t\t\t\"⠈\",\n\t\t\t\"⠈\"\n\t\t]\n\t},\n\t\"dots9\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⢹\",\n\t\t\t\"⢺\",\n\t\t\t\"⢼\",\n\t\t\t\"⣸\",\n\t\t\t\"⣇\",\n\t\t\t\"⡧\",\n\t\t\t\"⡗\",\n\t\t\t\"⡏\"\n\t\t]\n\t},\n\t\"dots10\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⢄\",\n\t\t\t\"⢂\",\n\t\t\t\"⢁\",\n\t\t\t\"⡁\",\n\t\t\t\"⡈\",\n\t\t\t\"⡐\",\n\t\t\t\"⡠\"\n\t\t]\n\t},\n\t\"dots11\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"⠁\",\n\t\t\t\"⠂\",\n\t\t\t\"⠄\",\n\t\t\t\"⡀\",\n\t\t\t\"⢀\",\n\t\t\t\"⠠\",\n\t\t\t\"⠐\",\n\t\t\t\"⠈\"\n\t\t]\n\t},\n\t\"dots12\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⢀⠀\",\n\t\t\t\"⡀⠀\",\n\t\t\t\"⠄⠀\",\n\t\t\t\"⢂⠀\",\n\t\t\t\"⡂⠀\",\n\t\t\t\"⠅⠀\",\n\t\t\t\"⢃⠀\",\n\t\t\t\"⡃⠀\",\n\t\t\t\"⠍⠀\",\n\t\t\t\"⢋⠀\",\n\t\t\t\"⡋⠀\",\n\t\t\t\"⠍⠁\",\n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\t\t\t\"⣥\",\n\t\t\t\"⣦\",\n\t\t\t\"⣮\",\n\t\t\t\"⣶\",\n\t\t\t\"⣷\",\n\t\t\t\"⣿\",\n\t\t\t\"⡿\",\n\t\t\t\"⠿\",\n\t\t\t\"⢟\",\n\t\t\t\"⠟\",\n\t\t\t\"⡛\",\n\t\t\t\"⠛\",\n\t\t\t\"⠫\",\n\t\t\t\"⢋\",\n\t\t\t\"⠋\",\n\t\t\t\"⠍\",\n\t\t\t\"⡉\",\n\t\t\t\"⠉\",\n\t\t\t\"⠑\",\n\t\t\t\"⠡\",\n\t\t\t\"⢁\"\n\t\t]\n\t},\n\t\"line\": {\n\t\t\"interval\": 130,\n\t\t\"frames\": [\n\t\t\t\"-\",\n\t\t\t\"\\\\\",\n\t\t\t\"|\",\n\t\t\t\"/\"\n\t\t]\n\t},\n\t\"line2\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"⠂\",\n\t\t\t\"-\",\n\t\t\t\"–\",\n\t\t\t\"—\",\n\t\t\t\"–\",\n\t\t\t\"-\"\n\t\t]\n\t},\n\t\"pipe\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"┤\",\n\t\t\t\"┘\",\n\t\t\t\"┴\",\n\t\t\t\"└\",\n\t\t\t\"├\",\n\t\t\t\"┌\",\n\t\t\t\"┬\",\n\t\t\t\"┐\"\n\t\t]\n\t},\n\t\"simpleDots\": {\n\t\t\"interval\": 400,\n\t\t\"frames\": [\n\t\t\t\". \",\n\t\t\t\".. \",\n\t\t\t\"...\",\n\t\t\t\" \"\n\t\t]\n\t},\n\t\"simpleDotsScrolling\": {\n\t\t\"interval\": 200,\n\t\t\"frames\": [\n\t\t\t\". \",\n\t\t\t\".. \",\n\t\t\t\"...\",\n\t\t\t\" ..\",\n\t\t\t\" .\",\n\t\t\t\" \"\n\t\t]\n\t},\n\t\"star\": {\n\t\t\"interval\": 70,\n\t\t\"frames\": [\n\t\t\t\"✶\",\n\t\t\t\"✸\",\n\t\t\t\"✹\",\n\t\t\t\"✺\",\n\t\t\t\"✹\",\n\t\t\t\"✷\"\n\t\t]\n\t},\n\t\"star2\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"+\",\n\t\t\t\"x\",\n\t\t\t\"*\"\n\t\t]\n\t},\n\t\"flip\": {\n\t\t\"interval\": 70,\n\t\t\"frames\": [\n\t\t\t\"_\",\n\t\t\t\"_\",\n\t\t\t\"_\",\n\t\t\t\"-\",\n\t\t\t\"`\",\n\t\t\t\"`\",\n\t\t\t\"'\",\n\t\t\t\"´\",\n\t\t\t\"-\",\n\t\t\t\"_\",\n\t\t\t\"_\",\n\t\t\t\"_\"\n\t\t]\n\t},\n\t\"hamburger\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"☱\",\n\t\t\t\"☲\",\n\t\t\t\"☴\"\n\t\t]\n\t},\n\t\"growVertical\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"▁\",\n\t\t\t\"▃\",\n\t\t\t\"▄\",\n\t\t\t\"▅\",\n\t\t\t\"▆\",\n\t\t\t\"▇\",\n\t\t\t\"▆\",\n\t\t\t\"▅\",\n\t\t\t\"▄\",\n\t\t\t\"▃\"\n\t\t]\n\t},\n\t\"growHorizontal\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"▏\",\n\t\t\t\"▎\",\n\t\t\t\"▍\",\n\t\t\t\"▌\",\n\t\t\t\"▋\",\n\t\t\t\"▊\",\n\t\t\t\"▉\",\n\t\t\t\"▊\",\n\t\t\t\"▋\",\n\t\t\t\"▌\",\n\t\t\t\"▍\",\n\t\t\t\"▎\"\n\t\t]\n\t},\n\t\"balloon\": {\n\t\t\"interval\": 140,\n\t\t\"frames\": [\n\t\t\t\" \",\n\t\t\t\".\",\n\t\t\t\"o\",\n\t\t\t\"O\",\n\t\t\t\"@\",\n\t\t\t\"*\",\n\t\t\t\" \"\n\t\t]\n\t},\n\t\"balloon2\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\".\",\n\t\t\t\"o\",\n\t\t\t\"O\",\n\t\t\t\"°\",\n\t\t\t\"O\",\n\t\t\t\"o\",\n\t\t\t\".\"\n\t\t]\n\t},\n\t\"noise\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"▓\",\n\t\t\t\"▒\",\n\t\t\t\"░\"\n\t\t]\n\t},\n\t\"bounce\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"⠁\",\n\t\t\t\"⠂\",\n\t\t\t\"⠄\",\n\t\t\t\"⠂\"\n\t\t]\n\t},\n\t\"boxBounce\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"▖\",\n\t\t\t\"▘\",\n\t\t\t\"▝\",\n\t\t\t\"▗\"\n\t\t]\n\t},\n\t\"boxBounce2\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"▌\",\n\t\t\t\"▀\",\n\t\t\t\"▐\",\n\t\t\t\"▄\"\n\t\t]\n\t},\n\t\"triangle\": {\n\t\t\"interval\": 50,\n\t\t\"frames\": [\n\t\t\t\"◢\",\n\t\t\t\"◣\",\n\t\t\t\"◤\",\n\t\t\t\"◥\"\n\t\t]\n\t},\n\t\"binary\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"010010\",\n \"001100\",\n \"100101\",\n \"111010\",\n \"111101\",\n \"010111\",\n\t\t\t\"101011\",\n\t\t\t\"111000\",\n\t\t\t\"110011\",\n\t\t\t\"110101\"\n\t\t]\n\t},\n\t\"arc\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"◜\",\n\t\t\t\"◠\",\n\t\t\t\"◝\",\n\t\t\t\"◞\",\n\t\t\t\"◡\",\n\t\t\t\"◟\"\n\t\t]\n\t},\n\t\"circle\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"◡\",\n\t\t\t\"⊙\",\n\t\t\t\"◠\"\n\t\t]\n\t},\n\t\"squareCorners\": {\n\t\t\"interval\": 180,\n\t\t\"frames\": [\n\t\t\t\"◰\",\n\t\t\t\"◳\",\n\t\t\t\"◲\",\n\t\t\t\"◱\"\n\t\t]\n\t},\n\t\"circleQuarters\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"◴\",\n\t\t\t\"◷\",\n\t\t\t\"◶\",\n\t\t\t\"◵\"\n\t\t]\n\t},\n\t\"circleHalves\": {\n\t\t\"interval\": 50,\n\t\t\"frames\": [\n\t\t\t\"◐\",\n\t\t\t\"◓\",\n\t\t\t\"◑\",\n\t\t\t\"◒\"\n\t\t]\n\t},\n\t\"squish\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"╫\",\n\t\t\t\"╪\"\n\t\t]\n\t},\n\t\"toggle\": {\n\t\t\"interval\": 250,\n\t\t\"frames\": [\n\t\t\t\"⊶\",\n\t\t\t\"⊷\"\n\t\t]\n\t},\n\t\"toggle2\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"▫\",\n\t\t\t\"▪\"\n\t\t]\n\t},\n\t\"toggle3\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"□\",\n\t\t\t\"■\"\n\t\t]\n\t},\n\t\"toggle4\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"■\",\n\t\t\t\"□\",\n\t\t\t\"▪\",\n\t\t\t\"▫\"\n\t\t]\n\t},\n\t\"toggle5\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"▮\",\n\t\t\t\"▯\"\n\t\t]\n\t},\n\t\"toggle6\": {\n\t\t\"interval\": 300,\n\t\t\"frames\": [\n\t\t\t\"ဝ\",\n\t\t\t\"၀\"\n\t\t]\n\t},\n\t\"toggle7\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⦾\",\n\t\t\t\"⦿\"\n\t\t]\n\t},\n\t\"toggle8\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"◍\",\n\t\t\t\"◌\"\n\t\t]\n\t},\n\t\"toggle9\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"◉\",\n\t\t\t\"◎\"\n\t\t]\n\t},\n\t\"toggle10\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"㊂\",\n\t\t\t\"㊀\",\n\t\t\t\"㊁\"\n\t\t]\n\t},\n\t\"toggle11\": {\n\t\t\"interval\": 50,\n\t\t\"frames\": [\n\t\t\t\"⧇\",\n\t\t\t\"⧆\"\n\t\t]\n\t},\n\t\"toggle12\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"☗\",\n\t\t\t\"☖\"\n\t\t]\n\t},\n\t\"toggle13\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"=\",\n\t\t\t\"*\",\n\t\t\t\"-\"\n\t\t]\n\t},\n\t\"arrow\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"←\",\n\t\t\t\"↖\",\n\t\t\t\"↑\",\n\t\t\t\"↗\",\n\t\t\t\"→\",\n\t\t\t\"↘\",\n\t\t\t\"↓\",\n\t\t\t\"↙\"\n\t\t]\n\t},\n\t\"arrow2\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"⬆️ \",\n\t\t\t\"↗️ \",\n\t\t\t\"➡️ \",\n\t\t\t\"↘️ \",\n\t\t\t\"⬇️ \",\n\t\t\t\"↙️ \",\n\t\t\t\"⬅️ \",\n\t\t\t\"↖️ \"\n\t\t]\n\t},\n\t\"arrow3\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"▹▹▹▹▹\",\n\t\t\t\"▸▹▹▹▹\",\n\t\t\t\"▹▸▹▹▹\",\n\t\t\t\"▹▹▸▹▹\",\n\t\t\t\"▹▹▹▸▹\",\n\t\t\t\"▹▹▹▹▸\"\n\t\t]\n\t},\n\t\"bouncingBar\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"[ ]\",\n\t\t\t\"[= ]\",\n\t\t\t\"[== ]\",\n\t\t\t\"[=== ]\",\n\t\t\t\"[====]\",\n\t\t\t\"[ ===]\",\n\t\t\t\"[ ==]\",\n\t\t\t\"[ =]\",\n\t\t\t\"[ ]\",\n\t\t\t\"[ =]\",\n\t\t\t\"[ ==]\",\n\t\t\t\"[ ===]\",\n\t\t\t\"[====]\",\n\t\t\t\"[=== ]\",\n\t\t\t\"[== ]\",\n\t\t\t\"[= ]\"\n\t\t]\n\t},\n\t\"bouncingBall\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ●)\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"( ● )\",\n\t\t\t\"(● )\"\n\t\t]\n\t},\n\t\"smiley\": {\n\t\t\"interval\": 200,\n\t\t\"frames\": [\n\t\t\t\"😄 \",\n\t\t\t\"😝 \"\n\t\t]\n\t},\n\t\"monkey\": {\n\t\t\"interval\": 300,\n\t\t\"frames\": [\n\t\t\t\"🙈 \",\n\t\t\t\"🙈 \",\n\t\t\t\"🙉 \",\n\t\t\t\"🙊 \"\n\t\t]\n\t},\n\t\"hearts\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"💛 \",\n\t\t\t\"💙 \",\n\t\t\t\"💜 \",\n\t\t\t\"💚 \",\n\t\t\t\"❤️ \"\n\t\t]\n\t},\n\t\"clock\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"🕛 \",\n\t\t\t\"🕐 \",\n\t\t\t\"🕑 \",\n\t\t\t\"🕒 \",\n\t\t\t\"🕓 \",\n\t\t\t\"🕔 \",\n\t\t\t\"🕕 \",\n\t\t\t\"🕖 \",\n\t\t\t\"🕗 \",\n\t\t\t\"🕘 \",\n\t\t\t\"🕙 \",\n\t\t\t\"🕚 \"\n\t\t]\n\t},\n\t\"earth\": {\n\t\t\"interval\": 180,\n\t\t\"frames\": [\n\t\t\t\"🌍 \",\n\t\t\t\"🌎 \",\n\t\t\t\"🌏 \"\n\t\t]\n\t},\n\t\"material\": {\n\t\t\"interval\": 17,\n\t\t\"frames\": [\n\t\t\t\"█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"███████▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"████████▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"██████████▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"███████████▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████████▁▁▁▁▁▁▁\",\n\t\t\t\"██████████████▁▁▁▁▁▁\",\n\t\t\t\"██████████████▁▁▁▁▁▁\",\n\t\t\t\"▁██████████████▁▁▁▁▁\",\n\t\t\t\"▁██████████████▁▁▁▁▁\",\n\t\t\t\"▁██████████████▁▁▁▁▁\",\n\t\t\t\"▁▁██████████████▁▁▁▁\",\n\t\t\t\"▁▁▁██████████████▁▁▁\",\n\t\t\t\"▁▁▁▁█████████████▁▁▁\",\n\t\t\t\"▁▁▁▁██████████████▁▁\",\n\t\t\t\"▁▁▁▁██████████████▁▁\",\n\t\t\t\"▁▁▁▁▁██████████████▁\",\n\t\t\t\"▁▁▁▁▁██████████████▁\",\n\t\t\t\"▁▁▁▁▁██████████████▁\",\n\t\t\t\"▁▁▁▁▁▁██████████████\",\n\t\t\t\"▁▁▁▁▁▁██████████████\",\n\t\t\t\"▁▁▁▁▁▁▁█████████████\",\n\t\t\t\"▁▁▁▁▁▁▁█████████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁████████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁████████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁███████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁███████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁██████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁██████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁████████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁███████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████\",\n\t\t\t\"█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\n\t\t\t\"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\n\t\t\t\"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\n\t\t\t\"███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\n\t\t\t\"████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\n\t\t\t\"█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"██████▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"████████▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"█████████▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"███████████▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"████████████▁▁▁▁▁▁▁▁\",\n\t\t\t\"████████████▁▁▁▁▁▁▁▁\",\n\t\t\t\"██████████████▁▁▁▁▁▁\",\n\t\t\t\"██████████████▁▁▁▁▁▁\",\n\t\t\t\"▁██████████████▁▁▁▁▁\",\n\t\t\t\"▁██████████████▁▁▁▁▁\",\n\t\t\t\"▁▁▁█████████████▁▁▁▁\",\n\t\t\t\"▁▁▁▁▁████████████▁▁▁\",\n\t\t\t\"▁▁▁▁▁████████████▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁███████████▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁█████████▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁█████████▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁█████████▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁█████████▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁█████████▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁████████▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁████████▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁███████▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁███████▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁███████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁███████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\",\n\t\t\t\"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\"\n\t\t]\n\t},\n\t\"moon\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"🌑 \",\n\t\t\t\"🌒 \",\n\t\t\t\"🌓 \",\n\t\t\t\"🌔 \",\n\t\t\t\"🌕 \",\n\t\t\t\"🌖 \",\n\t\t\t\"🌗 \",\n\t\t\t\"🌘 \"\n\t\t]\n\t},\n\t\"runner\": {\n\t\t\"interval\": 140,\n\t\t\"frames\": [\n\t\t\t\"🚶 \",\n\t\t\t\"🏃 \"\n\t\t]\n\t},\n\t\"pong\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"▐⠂ ▌\",\n\t\t\t\"▐⠈ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⡀ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠈ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⡀ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠈ ▌\",\n\t\t\t\"▐ ⠂▌\",\n\t\t\t\"▐ ⠠▌\",\n\t\t\t\"▐ ⡀▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠈ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⡀ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠈ ▌\",\n\t\t\t\"▐ ⠂ ▌\",\n\t\t\t\"▐ ⠠ ▌\",\n\t\t\t\"▐ ⡀ ▌\",\n\t\t\t\"▐⠠ ▌\"\n\t\t]\n\t},\n\t\"shark\": {\n\t\t\"interval\": 120,\n\t\t\"frames\": [\n\t\t\t\"▐|\\\\____________▌\",\n\t\t\t\"▐_|\\\\___________▌\",\n\t\t\t\"▐__|\\\\__________▌\",\n\t\t\t\"▐___|\\\\_________▌\",\n\t\t\t\"▐____|\\\\________▌\",\n\t\t\t\"▐_____|\\\\_______▌\",\n\t\t\t\"▐______|\\\\______▌\",\n\t\t\t\"▐_______|\\\\_____▌\",\n\t\t\t\"▐________|\\\\____▌\",\n\t\t\t\"▐_________|\\\\___▌\",\n\t\t\t\"▐__________|\\\\__▌\",\n\t\t\t\"▐___________|\\\\_▌\",\n\t\t\t\"▐____________|\\\\▌\",\n\t\t\t\"▐____________/|▌\",\n\t\t\t\"▐___________/|_▌\",\n\t\t\t\"▐__________/|__▌\",\n\t\t\t\"▐_________/|___▌\",\n\t\t\t\"▐________/|____▌\",\n\t\t\t\"▐_______/|_____▌\",\n\t\t\t\"▐______/|______▌\",\n\t\t\t\"▐_____/|_______▌\",\n\t\t\t\"▐____/|________▌\",\n\t\t\t\"▐___/|_________▌\",\n\t\t\t\"▐__/|__________▌\",\n\t\t\t\"▐_/|___________▌\",\n\t\t\t\"▐/|____________▌\"\n\t\t]\n\t},\n\t\"dqpb\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"d\",\n\t\t\t\"q\",\n\t\t\t\"p\",\n\t\t\t\"b\"\n\t\t]\n\t},\n\t\"weather\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"☀️ \",\n\t\t\t\"☀️ \",\n\t\t\t\"☀️ \",\n\t\t\t\"🌤 \",\n\t\t\t\"⛅️ \",\n\t\t\t\"🌥 \",\n\t\t\t\"☁️ \",\n\t\t\t\"🌧 \",\n\t\t\t\"🌨 \",\n\t\t\t\"🌧 \",\n\t\t\t\"🌨 \",\n\t\t\t\"🌧 \",\n\t\t\t\"🌨 \",\n\t\t\t\"⛈ \",\n\t\t\t\"🌨 \",\n\t\t\t\"🌧 \",\n\t\t\t\"🌨 \",\n\t\t\t\"☁️ \",\n\t\t\t\"🌥 \",\n\t\t\t\"⛅️ \",\n\t\t\t\"🌤 \",\n\t\t\t\"☀️ \",\n\t\t\t\"☀️ \"\n\t\t]\n\t},\n\t\"christmas\": {\n\t\t\"interval\": 400,\n\t\t\"frames\": [\n\t\t\t\"🌲\",\n\t\t\t\"🎄\"\n\t\t]\n\t},\n\t\"grenade\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"، \",\n\t\t\t\"′ \",\n\t\t\t\" ´ \",\n\t\t\t\" ‾ \",\n\t\t\t\" ⸌\",\n\t\t\t\" ⸊\",\n\t\t\t\" |\",\n\t\t\t\" ⁎\",\n\t\t\t\" ⁕\",\n\t\t\t\" ෴ \",\n\t\t\t\" ⁓\",\n\t\t\t\" \",\n\t\t\t\" \",\n\t\t\t\" \"\n\t\t]\n\t},\n\t\"point\": {\n\t\t\"interval\": 125,\n\t\t\"frames\": [\n\t\t\t\"∙∙∙\",\n\t\t\t\"●∙∙\",\n\t\t\t\"∙●∙\",\n\t\t\t\"∙∙●\",\n\t\t\t\"∙∙∙\"\n\t\t]\n\t},\n\t\"layer\": {\n\t\t\"interval\": 150,\n\t\t\"frames\": [\n\t\t\t\"-\",\n\t\t\t\"=\",\n\t\t\t\"≡\"\n\t\t]\n\t},\n\t\"betaWave\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"ρββββββ\",\n\t\t\t\"βρβββββ\",\n\t\t\t\"ββρββββ\",\n\t\t\t\"βββρβββ\",\n\t\t\t\"ββββρββ\",\n\t\t\t\"βββββρβ\",\n\t\t\t\"ββββββρ\"\n\t\t]\n\t},\n\t\"fingerDance\": {\n\t\t\"interval\": 160,\n\t\t\"frames\": [\n\t\t\t\"🤘 \",\n\t\t\t\"🤟 \",\n\t\t\t\"🖖 \",\n\t\t\t\"✋ \",\n\t\t\t\"🤚 \",\n\t\t\t\"👆 \"\n\t\t]\n\t},\n\t\"fistBump\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"🤜\\u3000\\u3000\\u3000\\u3000🤛 \",\n\t\t\t\"🤜\\u3000\\u3000\\u3000\\u3000🤛 \",\n\t\t\t\"🤜\\u3000\\u3000\\u3000\\u3000🤛 \",\n\t\t\t\"\\u3000🤜\\u3000\\u3000🤛\\u3000 \",\n\t\t\t\"\\u3000\\u3000🤜🤛\\u3000\\u3000 \",\n\t\t\t\"\\u3000🤜✨🤛\\u3000\\u3000 \",\n\t\t\t\"🤜\\u3000✨\\u3000🤛\\u3000 \"\n\t\t]\n\t},\n\t\"soccerHeader\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\" 🧑⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \",\n\t\t\t\"🧑 ⚽️ 🧑 \"\n\t\t]\n\t},\n\t\"mindblown\": {\n\t\t\"interval\": 160,\n\t\t\"frames\": [\n\t\t\t\"😐 \",\n\t\t\t\"😐 \",\n\t\t\t\"😮 \",\n\t\t\t\"😮 \",\n\t\t\t\"😦 \",\n\t\t\t\"😦 \",\n\t\t\t\"😧 \",\n\t\t\t\"😧 \",\n\t\t\t\"🤯 \",\n\t\t\t\"💥 \",\n\t\t\t\"✨ \",\n\t\t\t\"\\u3000 \",\n\t\t\t\"\\u3000 \",\n\t\t\t\"\\u3000 \"\n\t\t]\n\t},\n\t\"speaker\": {\n\t\t\"interval\": 160,\n\t\t\"frames\": [\n\t\t\t\"🔈 \",\n\t\t\t\"🔉 \",\n\t\t\t\"🔊 \",\n\t\t\t\"🔉 \"\n\t\t]\n\t},\n\t\"orangePulse\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"🔸 \",\n\t\t\t\"🔶 \",\n\t\t\t\"🟠 \",\n\t\t\t\"🟠 \",\n\t\t\t\"🔶 \"\n\t\t]\n\t},\n\t\"bluePulse\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"🔹 \",\n\t\t\t\"🔷 \",\n\t\t\t\"🔵 \",\n\t\t\t\"🔵 \",\n\t\t\t\"🔷 \"\n\t\t]\n\t},\n\t\"orangeBluePulse\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"🔸 \",\n\t\t\t\"🔶 \",\n\t\t\t\"🟠 \",\n\t\t\t\"🟠 \",\n\t\t\t\"🔶 \",\n\t\t\t\"🔹 \",\n\t\t\t\"🔷 \",\n\t\t\t\"🔵 \",\n\t\t\t\"🔵 \",\n\t\t\t\"🔷 \"\n\t\t]\n\t},\n\t\"timeTravel\": {\n\t\t\"interval\": 100,\n\t\t\"frames\": [\n\t\t\t\"🕛 \",\n\t\t\t\"🕚 \",\n\t\t\t\"🕙 \",\n\t\t\t\"🕘 \",\n\t\t\t\"🕗 \",\n\t\t\t\"🕖 \",\n\t\t\t\"🕕 \",\n\t\t\t\"🕔 \",\n\t\t\t\"🕓 \",\n\t\t\t\"🕒 \",\n\t\t\t\"🕑 \",\n\t\t\t\"🕐 \"\n\t\t]\n\t},\n\t\"aesthetic\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\"▰▱▱▱▱▱▱\",\n\t\t\t\"▰▰▱▱▱▱▱\",\n\t\t\t\"▰▰▰▱▱▱▱\",\n\t\t\t\"▰▰▰▰▱▱▱\",\n\t\t\t\"▰▰▰▰▰▱▱\",\n\t\t\t\"▰▰▰▰▰▰▱\",\n\t\t\t\"▰▰▰▰▰▰▰\",\n\t\t\t\"▰▱▱▱▱▱▱\"\n\t\t]\n\t},\n\t\"dwarfFortress\": {\n\t\t\"interval\": 80,\n\t\t\"frames\": [\n\t\t\t\" ██████£££ \",\n\t\t\t\"☺██████£££ \",\n\t\t\t\"☺██████£££ \",\n\t\t\t\"☺▓█████£££ \",\n\t\t\t\"☺▓█████£££ \",\n\t\t\t\"☺▒█████£££ \",\n\t\t\t\"☺▒█████£££ \",\n\t\t\t\"☺░█████£££ \",\n\t\t\t\"☺░█████£££ \",\n\t\t\t\"☺ █████£££ \",\n\t\t\t\" ☺█████£££ \",\n\t\t\t\" ☺█████£££ \",\n\t\t\t\" ☺▓████£££ \",\n\t\t\t\" ☺▓████£££ \",\n\t\t\t\" ☺▒████£££ \",\n\t\t\t\" ☺▒████£££ \",\n\t\t\t\" ☺░████£££ \",\n\t\t\t\" ☺░████£££ \",\n\t\t\t\" ☺ ████£££ \",\n\t\t\t\" ☺████£££ \",\n\t\t\t\" ☺████£££ \",\n\t\t\t\" ☺▓███£££ \",\n\t\t\t\" ☺▓███£££ \",\n\t\t\t\" ☺▒███£££ \",\n\t\t\t\" ☺▒███£££ \",\n\t\t\t\" ☺░███£££ \",\n\t\t\t\" ☺░███£££ \",\n\t\t\t\" ☺ ███£££ \",\n\t\t\t\" ☺███£££ \",\n\t\t\t\" ☺███£££ \",\n\t\t\t\" ☺▓██£££ \",\n\t\t\t\" ☺▓██£££ \",\n\t\t\t\" ☺▒██£££ \",\n\t\t\t\" ☺▒██£££ \",\n\t\t\t\" ☺░██£££ \",\n\t\t\t\" ☺░██£££ \",\n\t\t\t\" ☺ ██£££ \",\n\t\t\t\" ☺██£££ \",\n\t\t\t\" ☺██£££ \",\n\t\t\t\" ☺▓█£££ \",\n\t\t\t\" ☺▓█£££ \",\n\t\t\t\" ☺▒█£££ \",\n\t\t\t\" ☺▒█£££ \",\n\t\t\t\" ☺░█£££ \",\n\t\t\t\" ☺░█£££ \",\n\t\t\t\" ☺ █£££ \",\n\t\t\t\" ☺█£££ \",\n\t\t\t\" ☺█£££ \",\n\t\t\t\" ☺▓£££ \",\n\t\t\t\" ☺▓£££ \",\n\t\t\t\" ☺▒£££ \",\n\t\t\t\" ☺▒£££ \",\n\t\t\t\" ☺░£££ \",\n\t\t\t\" ☺░£££ \",\n\t\t\t\" ☺ £££ \",\n\t\t\t\" ☺£££ \",\n\t\t\t\" ☺£££ \",\n\t\t\t\" ☺▓££ \",\n\t\t\t\" ☺▓££ \",\n\t\t\t\" ☺▒££ \",\n\t\t\t\" ☺▒££ \",\n\t\t\t\" ☺░££ \",\n\t\t\t\" ☺░££ \",\n\t\t\t\" ☺ ££ \",\n\t\t\t\" ☺££ \",\n\t\t\t\" ☺££ \",\n\t\t\t\" ☺▓£ \",\n\t\t\t\" ☺▓£ \",\n\t\t\t\" ☺▒£ \",\n\t\t\t\" ☺▒£ \",\n\t\t\t\" ☺░£ \",\n\t\t\t\" ☺░£ \",\n\t\t\t\" ☺ £ \",\n\t\t\t\" ☺£ \",\n\t\t\t\" ☺£ \",\n\t\t\t\" ☺▓ \",\n\t\t\t\" ☺▓ \",\n\t\t\t\" ☺▒ \",\n\t\t\t\" ☺▒ \",\n\t\t\t\" ☺░ \",\n\t\t\t\" ☺░ \",\n\t\t\t\" ☺ \",\n\t\t\t\" ☺ &\",\n\t\t\t\" ☺ ☼&\",\n\t\t\t\" ☺ ☼ &\",\n\t\t\t\" ☺☼ &\",\n\t\t\t\" ☺☼ & \",\n\t\t\t\" ‼ & \",\n\t\t\t\" ☺ & \",\n\t\t\t\" ‼ & \",\n\t\t\t\" ☺ & \",\n\t\t\t\" ‼ & \",\n\t\t\t\" ☺ & \",\n\t\t\t\"‼ & \",\n\t\t\t\" & \",\n\t\t\t\" & \",\n\t\t\t\" & ░ \",\n\t\t\t\" & ▒ \",\n\t\t\t\" & ▓ \",\n\t\t\t\" & £ \",\n\t\t\t\" & ░£ \",\n\t\t\t\" & ▒£ \",\n\t\t\t\" & ▓£ \",\n\t\t\t\" & ££ \",\n\t\t\t\" & ░££ \",\n\t\t\t\" & ▒££ \",\n\t\t\t\"& ▓££ \",\n\t\t\t\"& £££ \",\n\t\t\t\" ░£££ \",\n\t\t\t\" ▒£££ \",\n\t\t\t\" ▓£££ \",\n\t\t\t\" █£££ \",\n\t\t\t\" ░█£££ \",\n\t\t\t\" ▒█£££ \",\n\t\t\t\" ▓█£££ \",\n\t\t\t\" ██£££ \",\n\t\t\t\" ░██£££ \",\n\t\t\t\" ▒██£££ \",\n\t\t\t\" ▓██£££ \",\n\t\t\t\" ███£££ \",\n\t\t\t\" ░███£££ \",\n\t\t\t\" ▒███£££ \",\n\t\t\t\" ▓███£££ \",\n\t\t\t\" ████£££ \",\n\t\t\t\" ░████£££ \",\n\t\t\t\" ▒████£££ \",\n\t\t\t\" ▓████£££ \",\n\t\t\t\" █████£££ \",\n\t\t\t\" ░█████£££ \",\n\t\t\t\" ▒█████£££ \",\n\t\t\t\" ▓█████£££ \",\n\t\t\t\" ██████£££ \",\n\t\t\t\" ██████£££ \"\n\t\t]\n\t}\n}\n","'use strict';\n\nconst spinners = Object.assign({}, require('./spinners.json')); // eslint-disable-line import/extensions\n\nconst spinnersList = Object.keys(spinners);\n\nObject.defineProperty(spinners, 'random', {\n\tget() {\n\t\tconst randomIndex = Math.floor(Math.random() * spinnersList.length);\n\t\tconst spinnerName = spinnersList[randomIndex];\n\t\treturn spinners[spinnerName];\n\t}\n});\n\nmodule.exports = spinners;\n","'use strict'\nconst ParserEND = 0x110000\nclass ParserError extends Error {\n /* istanbul ignore next */\n constructor (msg, filename, linenumber) {\n super('[ParserError] ' + msg, filename, linenumber)\n this.name = 'ParserError'\n this.code = 'ParserError'\n if (Error.captureStackTrace) Error.captureStackTrace(this, ParserError)\n }\n}\nclass State {\n constructor (parser) {\n this.parser = parser\n this.buf = ''\n this.returned = null\n this.result = null\n this.resultTable = null\n this.resultArr = null\n }\n}\nclass Parser {\n constructor () {\n this.pos = 0\n this.col = 0\n this.line = 0\n this.obj = {}\n this.ctx = this.obj\n this.stack = []\n this._buf = ''\n this.char = null\n this.ii = 0\n this.state = new State(this.parseStart)\n }\n\n parse (str) {\n /* istanbul ignore next */\n if (str.length === 0 || str.length == null) return\n\n this._buf = String(str)\n this.ii = -1\n this.char = -1\n let getNext\n while (getNext === false || this.nextChar()) {\n getNext = this.runOne()\n }\n this._buf = null\n }\n nextChar () {\n if (this.char === 0x0A) {\n ++this.line\n this.col = -1\n }\n ++this.ii\n this.char = this._buf.codePointAt(this.ii)\n ++this.pos\n ++this.col\n return this.haveBuffer()\n }\n haveBuffer () {\n return this.ii < this._buf.length\n }\n runOne () {\n return this.state.parser.call(this, this.state.returned)\n }\n finish () {\n this.char = ParserEND\n let last\n do {\n last = this.state.parser\n this.runOne()\n } while (this.state.parser !== last)\n\n this.ctx = null\n this.state = null\n this._buf = null\n\n return this.obj\n }\n next (fn) {\n /* istanbul ignore next */\n if (typeof fn !== 'function') throw new ParserError('Tried to set state to non-existent state: ' + JSON.stringify(fn))\n this.state.parser = fn\n }\n goto (fn) {\n this.next(fn)\n return this.runOne()\n }\n call (fn, returnWith) {\n if (returnWith) this.next(returnWith)\n this.stack.push(this.state)\n this.state = new State(fn)\n }\n callNow (fn, returnWith) {\n this.call(fn, returnWith)\n return this.runOne()\n }\n return (value) {\n /* istanbul ignore next */\n if (this.stack.length === 0) throw this.error(new ParserError('Stack underflow'))\n if (value === undefined) value = this.state.buf\n this.state = this.stack.pop()\n this.state.returned = value\n }\n returnNow (value) {\n this.return(value)\n return this.runOne()\n }\n consume () {\n /* istanbul ignore next */\n if (this.char === ParserEND) throw this.error(new ParserError('Unexpected end-of-buffer'))\n this.state.buf += this._buf[this.ii]\n }\n error (err) {\n err.line = this.line\n err.col = this.col\n err.pos = this.pos\n return err\n }\n /* istanbul ignore next */\n parseStart () {\n throw new ParserError('Must declare a parseStart method')\n }\n}\nParser.END = ParserEND\nParser.Error = ParserError\nmodule.exports = Parser\n","'use strict'\nmodule.exports = value => {\n const date = new Date(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nmodule.exports = (d, num) => {\n num = String(num)\n while (num.length < d) num = '0' + num\n return num\n}\n","'use strict'\nconst f = require('./format-num.js')\n\nclass FloatingDateTime extends Date {\n constructor (value) {\n super(value + 'Z')\n this.isFloating = true\n }\n toISOString () {\n const date = `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`\n const time = `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`\n return `${date}T${time}`\n }\n}\n\nmodule.exports = value => {\n const date = new FloatingDateTime(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nconst f = require('./format-num.js')\nconst DateTime = global.Date\n\nclass Date extends DateTime {\n constructor (value) {\n super(value)\n this.isDate = true\n }\n toISOString () {\n return `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`\n }\n}\n\nmodule.exports = value => {\n const date = new Date(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\nconst f = require('./format-num.js')\n\nclass Time extends Date {\n constructor (value) {\n super(`0000-01-01T${value}Z`)\n this.isTime = true\n }\n toISOString () {\n return `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`\n }\n}\n\nmodule.exports = value => {\n const date = new Time(value)\n /* istanbul ignore if */\n if (isNaN(date)) {\n throw new TypeError('Invalid Datetime')\n } else {\n return date\n }\n}\n","'use strict'\n/* eslint-disable no-new-wrappers, no-eval, camelcase, operator-linebreak */\nmodule.exports = makeParserClass(require('./parser.js'))\nmodule.exports.makeParserClass = makeParserClass\n\nclass TomlError extends Error {\n constructor (msg) {\n super(msg)\n this.name = 'TomlError'\n /* istanbul ignore next */\n if (Error.captureStackTrace) Error.captureStackTrace(this, TomlError)\n this.fromTOML = true\n this.wrapped = null\n }\n}\nTomlError.wrap = err => {\n const terr = new TomlError(err.message)\n terr.code = err.code\n terr.wrapped = err\n return terr\n}\nmodule.exports.TomlError = TomlError\n\nconst createDateTime = require('./create-datetime.js')\nconst createDateTimeFloat = require('./create-datetime-float.js')\nconst createDate = require('./create-date.js')\nconst createTime = require('./create-time.js')\n\nconst CTRL_I = 0x09\nconst CTRL_J = 0x0A\nconst CTRL_M = 0x0D\nconst CTRL_CHAR_BOUNDARY = 0x1F // the last non-character in the latin1 region of unicode, except DEL\nconst CHAR_SP = 0x20\nconst CHAR_QUOT = 0x22\nconst CHAR_NUM = 0x23\nconst CHAR_APOS = 0x27\nconst CHAR_PLUS = 0x2B\nconst CHAR_COMMA = 0x2C\nconst CHAR_HYPHEN = 0x2D\nconst CHAR_PERIOD = 0x2E\nconst CHAR_0 = 0x30\nconst CHAR_1 = 0x31\nconst CHAR_7 = 0x37\nconst CHAR_9 = 0x39\nconst CHAR_COLON = 0x3A\nconst CHAR_EQUALS = 0x3D\nconst CHAR_A = 0x41\nconst CHAR_E = 0x45\nconst CHAR_F = 0x46\nconst CHAR_T = 0x54\nconst CHAR_U = 0x55\nconst CHAR_Z = 0x5A\nconst CHAR_LOWBAR = 0x5F\nconst CHAR_a = 0x61\nconst CHAR_b = 0x62\nconst CHAR_e = 0x65\nconst CHAR_f = 0x66\nconst CHAR_i = 0x69\nconst CHAR_l = 0x6C\nconst CHAR_n = 0x6E\nconst CHAR_o = 0x6F\nconst CHAR_r = 0x72\nconst CHAR_s = 0x73\nconst CHAR_t = 0x74\nconst CHAR_u = 0x75\nconst CHAR_x = 0x78\nconst CHAR_z = 0x7A\nconst CHAR_LCUB = 0x7B\nconst CHAR_RCUB = 0x7D\nconst CHAR_LSQB = 0x5B\nconst CHAR_BSOL = 0x5C\nconst CHAR_RSQB = 0x5D\nconst CHAR_DEL = 0x7F\nconst SURROGATE_FIRST = 0xD800\nconst SURROGATE_LAST = 0xDFFF\n\nconst escapes = {\n [CHAR_b]: '\\u0008',\n [CHAR_t]: '\\u0009',\n [CHAR_n]: '\\u000A',\n [CHAR_f]: '\\u000C',\n [CHAR_r]: '\\u000D',\n [CHAR_QUOT]: '\\u0022',\n [CHAR_BSOL]: '\\u005C'\n}\n\nfunction isDigit (cp) {\n return cp >= CHAR_0 && cp <= CHAR_9\n}\nfunction isHexit (cp) {\n return (cp >= CHAR_A && cp <= CHAR_F) || (cp >= CHAR_a && cp <= CHAR_f) || (cp >= CHAR_0 && cp <= CHAR_9)\n}\nfunction isBit (cp) {\n return cp === CHAR_1 || cp === CHAR_0\n}\nfunction isOctit (cp) {\n return (cp >= CHAR_0 && cp <= CHAR_7)\n}\nfunction isAlphaNumQuoteHyphen (cp) {\n return (cp >= CHAR_A && cp <= CHAR_Z)\n || (cp >= CHAR_a && cp <= CHAR_z)\n || (cp >= CHAR_0 && cp <= CHAR_9)\n || cp === CHAR_APOS\n || cp === CHAR_QUOT\n || cp === CHAR_LOWBAR\n || cp === CHAR_HYPHEN\n}\nfunction isAlphaNumHyphen (cp) {\n return (cp >= CHAR_A && cp <= CHAR_Z)\n || (cp >= CHAR_a && cp <= CHAR_z)\n || (cp >= CHAR_0 && cp <= CHAR_9)\n || cp === CHAR_LOWBAR\n || cp === CHAR_HYPHEN\n}\nconst _type = Symbol('type')\nconst _declared = Symbol('declared')\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst defineProperty = Object.defineProperty\nconst descriptor = {configurable: true, enumerable: true, writable: true, value: undefined}\n\nfunction hasKey (obj, key) {\n if (hasOwnProperty.call(obj, key)) return true\n if (key === '__proto__') defineProperty(obj, '__proto__', descriptor)\n return false\n}\n\nconst INLINE_TABLE = Symbol('inline-table')\nfunction InlineTable () {\n return Object.defineProperties({}, {\n [_type]: {value: INLINE_TABLE}\n })\n}\nfunction isInlineTable (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INLINE_TABLE\n}\n\nconst TABLE = Symbol('table')\nfunction Table () {\n return Object.defineProperties({}, {\n [_type]: {value: TABLE},\n [_declared]: {value: false, writable: true}\n })\n}\nfunction isTable (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === TABLE\n}\n\nconst _contentType = Symbol('content-type')\nconst INLINE_LIST = Symbol('inline-list')\nfunction InlineList (type) {\n return Object.defineProperties([], {\n [_type]: {value: INLINE_LIST},\n [_contentType]: {value: type}\n })\n}\nfunction isInlineList (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INLINE_LIST\n}\n\nconst LIST = Symbol('list')\nfunction List () {\n return Object.defineProperties([], {\n [_type]: {value: LIST}\n })\n}\nfunction isList (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === LIST\n}\n\n// in an eval, to let bundlers not slurp in a util proxy\nlet _custom\ntry {\n const utilInspect = eval(\"require('util').inspect\")\n _custom = utilInspect.custom\n} catch (_) {\n /* eval require not available in transpiled bundle */\n}\n/* istanbul ignore next */\nconst _inspect = _custom || 'inspect'\n\nclass BoxedBigInt {\n constructor (value) {\n try {\n this.value = global.BigInt.asIntN(64, value)\n } catch (_) {\n /* istanbul ignore next */\n this.value = null\n }\n Object.defineProperty(this, _type, {value: INTEGER})\n }\n isNaN () {\n return this.value === null\n }\n /* istanbul ignore next */\n toString () {\n return String(this.value)\n }\n /* istanbul ignore next */\n [_inspect] () {\n return `[BigInt: ${this.toString()}]}`\n }\n valueOf () {\n return this.value\n }\n}\n\nconst INTEGER = Symbol('integer')\nfunction Integer (value) {\n let num = Number(value)\n // -0 is a float thing, not an int thing\n if (Object.is(num, -0)) num = 0\n /* istanbul ignore else */\n if (global.BigInt && !Number.isSafeInteger(num)) {\n return new BoxedBigInt(value)\n } else {\n /* istanbul ignore next */\n return Object.defineProperties(new Number(num), {\n isNaN: {value: function () { return isNaN(this) }},\n [_type]: {value: INTEGER},\n [_inspect]: {value: () => `[Integer: ${value}]`}\n })\n }\n}\nfunction isInteger (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === INTEGER\n}\n\nconst FLOAT = Symbol('float')\nfunction Float (value) {\n /* istanbul ignore next */\n return Object.defineProperties(new Number(value), {\n [_type]: {value: FLOAT},\n [_inspect]: {value: () => `[Float: ${value}]`}\n })\n}\nfunction isFloat (obj) {\n if (obj === null || typeof (obj) !== 'object') return false\n return obj[_type] === FLOAT\n}\n\nfunction tomlType (value) {\n const type = typeof value\n if (type === 'object') {\n /* istanbul ignore if */\n if (value === null) return 'null'\n if (value instanceof Date) return 'datetime'\n /* istanbul ignore else */\n if (_type in value) {\n switch (value[_type]) {\n case INLINE_TABLE: return 'inline-table'\n case INLINE_LIST: return 'inline-list'\n /* istanbul ignore next */\n case TABLE: return 'table'\n /* istanbul ignore next */\n case LIST: return 'list'\n case FLOAT: return 'float'\n case INTEGER: return 'integer'\n }\n }\n }\n return type\n}\n\nfunction makeParserClass (Parser) {\n class TOMLParser extends Parser {\n constructor () {\n super()\n this.ctx = this.obj = Table()\n }\n\n /* MATCH HELPER */\n atEndOfWord () {\n return this.char === CHAR_NUM || this.char === CTRL_I || this.char === CHAR_SP || this.atEndOfLine()\n }\n atEndOfLine () {\n return this.char === Parser.END || this.char === CTRL_J || this.char === CTRL_M\n }\n\n parseStart () {\n if (this.char === Parser.END) {\n return null\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseTableOrList)\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else if (isAlphaNumQuoteHyphen(this.char)) {\n return this.callNow(this.parseAssignStatement)\n } else {\n throw this.error(new TomlError(`Unknown character \"${this.char}\"`))\n }\n }\n\n // HELPER, this strips any whitespace and comments to the end of the line\n // then RETURNS. Last state in a production.\n parseWhitespaceToEOL () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else if (this.char === CHAR_NUM) {\n return this.goto(this.parseComment)\n } else if (this.char === Parser.END || this.char === CTRL_J) {\n return this.return()\n } else {\n throw this.error(new TomlError('Unexpected character, expected only whitespace or comments till end of line'))\n }\n }\n\n /* ASSIGNMENT: key = value */\n parseAssignStatement () {\n return this.callNow(this.parseAssign, this.recordAssignStatement)\n }\n recordAssignStatement (kv) {\n let target = this.ctx\n let finalKey = kv.key.pop()\n for (let kw of kv.key) {\n if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n target = target[kw] = target[kw] || Table()\n }\n if (hasKey(target, finalKey)) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n // unbox our numbers\n if (isInteger(kv.value) || isFloat(kv.value)) {\n target[finalKey] = kv.value.valueOf()\n } else {\n target[finalKey] = kv.value\n }\n return this.goto(this.parseWhitespaceToEOL)\n }\n\n /* ASSSIGNMENT expression, key = value possibly inside an inline table */\n parseAssign () {\n return this.callNow(this.parseKeyword, this.recordAssignKeyword)\n }\n recordAssignKeyword (key) {\n if (this.state.resultTable) {\n this.state.resultTable.push(key)\n } else {\n this.state.resultTable = [key]\n }\n return this.goto(this.parseAssignKeywordPreDot)\n }\n parseAssignKeywordPreDot () {\n if (this.char === CHAR_PERIOD) {\n return this.next(this.parseAssignKeywordPostDot)\n } else if (this.char !== CHAR_SP && this.char !== CTRL_I) {\n return this.goto(this.parseAssignEqual)\n }\n }\n parseAssignKeywordPostDot () {\n if (this.char !== CHAR_SP && this.char !== CTRL_I) {\n return this.callNow(this.parseKeyword, this.recordAssignKeyword)\n }\n }\n\n parseAssignEqual () {\n if (this.char === CHAR_EQUALS) {\n return this.next(this.parseAssignPreValue)\n } else {\n throw this.error(new TomlError('Invalid character, expected \"=\"'))\n }\n }\n parseAssignPreValue () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseValue, this.recordAssignValue)\n }\n }\n recordAssignValue (value) {\n return this.returnNow({key: this.state.resultTable, value: value})\n }\n\n /* COMMENTS: #...eol */\n parseComment () {\n do {\n if (this.char === Parser.END || this.char === CTRL_J) {\n return this.return()\n }\n } while (this.nextChar())\n }\n\n /* TABLES AND LISTS, [foo] and [[foo]] */\n parseTableOrList () {\n if (this.char === CHAR_LSQB) {\n this.next(this.parseList)\n } else {\n return this.goto(this.parseTable)\n }\n }\n\n /* TABLE [foo.bar.baz] */\n parseTable () {\n this.ctx = this.obj\n return this.goto(this.parseTableNext)\n }\n parseTableNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseKeyword, this.parseTableMore)\n }\n }\n parseTableMore (keyword) {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CHAR_RSQB) {\n if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n } else {\n this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table()\n this.ctx[_declared] = true\n }\n return this.next(this.parseWhitespaceToEOL)\n } else if (this.char === CHAR_PERIOD) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx = this.ctx[keyword] = Table()\n } else if (isTable(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword]\n } else if (isList(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1]\n } else {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n return this.next(this.parseTableNext)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n\n /* LIST [[a.b.c]] */\n parseList () {\n this.ctx = this.obj\n return this.goto(this.parseListNext)\n }\n parseListNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else {\n return this.callNow(this.parseKeyword, this.parseListMore)\n }\n }\n parseListMore (keyword) {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CHAR_RSQB) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx[keyword] = List()\n }\n if (isInlineList(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline array\"))\n } else if (isList(this.ctx[keyword])) {\n const next = Table()\n this.ctx[keyword].push(next)\n this.ctx = next\n } else {\n throw this.error(new TomlError(\"Can't redefine an existing key\"))\n }\n return this.next(this.parseListEnd)\n } else if (this.char === CHAR_PERIOD) {\n if (!hasKey(this.ctx, keyword)) {\n this.ctx = this.ctx[keyword] = Table()\n } else if (isInlineList(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline array\"))\n } else if (isInlineTable(this.ctx[keyword])) {\n throw this.error(new TomlError(\"Can't extend an inline table\"))\n } else if (isList(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1]\n } else if (isTable(this.ctx[keyword])) {\n this.ctx = this.ctx[keyword]\n } else {\n throw this.error(new TomlError(\"Can't redefine an existing key\"))\n }\n return this.next(this.parseListNext)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n parseListEnd (keyword) {\n if (this.char === CHAR_RSQB) {\n return this.next(this.parseWhitespaceToEOL)\n } else {\n throw this.error(new TomlError('Unexpected character, expected whitespace, . or ]'))\n }\n }\n\n /* VALUE string, number, boolean, inline list, inline object */\n parseValue () {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key without value'))\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseDoubleString)\n } if (this.char === CHAR_APOS) {\n return this.next(this.parseSingleString)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n return this.goto(this.parseNumberSign)\n } else if (this.char === CHAR_i) {\n return this.next(this.parseInf)\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan)\n } else if (isDigit(this.char)) {\n return this.goto(this.parseNumberOrDateTime)\n } else if (this.char === CHAR_t || this.char === CHAR_f) {\n return this.goto(this.parseBoolean)\n } else if (this.char === CHAR_LSQB) {\n return this.call(this.parseInlineList, this.recordValue)\n } else if (this.char === CHAR_LCUB) {\n return this.call(this.parseInlineTable, this.recordValue)\n } else {\n throw this.error(new TomlError('Unexpected character, expecting string, number, datetime, boolean, inline array or inline table'))\n }\n }\n recordValue (value) {\n return this.returnNow(value)\n }\n\n parseInf () {\n if (this.char === CHAR_n) {\n return this.next(this.parseInf2)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"inf\", \"+inf\" or \"-inf\"'))\n }\n }\n parseInf2 () {\n if (this.char === CHAR_f) {\n if (this.state.buf === '-') {\n return this.return(-Infinity)\n } else {\n return this.return(Infinity)\n }\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"inf\", \"+inf\" or \"-inf\"'))\n }\n }\n\n parseNan () {\n if (this.char === CHAR_a) {\n return this.next(this.parseNan2)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"nan\"'))\n }\n }\n parseNan2 () {\n if (this.char === CHAR_n) {\n return this.return(NaN)\n } else {\n throw this.error(new TomlError('Unexpected character, expected \"nan\"'))\n }\n }\n\n /* KEYS, barewords or basic, literal, or dotted */\n parseKeyword () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseBasicString)\n } else if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralString)\n } else {\n return this.goto(this.parseBareKey)\n }\n }\n\n /* KEYS: barewords */\n parseBareKey () {\n do {\n if (this.char === Parser.END) {\n throw this.error(new TomlError('Key ended without value'))\n } else if (isAlphaNumHyphen(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 0) {\n throw this.error(new TomlError('Empty bare keys are not allowed'))\n } else {\n return this.returnNow()\n }\n } while (this.nextChar())\n }\n\n /* STRINGS, single quoted (literal) */\n parseSingleString () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiStringMaybe)\n } else {\n return this.goto(this.parseLiteralString)\n }\n }\n parseLiteralString () {\n do {\n if (this.char === CHAR_APOS) {\n return this.return()\n } else if (this.atEndOfLine()) {\n throw this.error(new TomlError('Unterminated string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I)) {\n throw this.errorControlCharInString()\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n parseLiteralMultiStringMaybe () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiString)\n } else {\n return this.returnNow()\n }\n }\n parseLiteralMultiString () {\n if (this.char === CTRL_M) {\n return null\n } else if (this.char === CTRL_J) {\n return this.next(this.parseLiteralMultiStringContent)\n } else {\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n parseLiteralMultiStringContent () {\n do {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiEnd)\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated multi-line string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M)) {\n throw this.errorControlCharInString()\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n parseLiteralMultiEnd () {\n if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralMultiEnd2)\n } else {\n this.state.buf += \"'\"\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n parseLiteralMultiEnd2 () {\n if (this.char === CHAR_APOS) {\n return this.return()\n } else {\n this.state.buf += \"''\"\n return this.goto(this.parseLiteralMultiStringContent)\n }\n }\n\n /* STRINGS double quoted */\n parseDoubleString () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiStringMaybe)\n } else {\n return this.goto(this.parseBasicString)\n }\n }\n parseBasicString () {\n do {\n if (this.char === CHAR_BSOL) {\n return this.call(this.parseEscape, this.recordEscapeReplacement)\n } else if (this.char === CHAR_QUOT) {\n return this.return()\n } else if (this.atEndOfLine()) {\n throw this.error(new TomlError('Unterminated string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I)) {\n throw this.errorControlCharInString()\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n recordEscapeReplacement (replacement) {\n this.state.buf += replacement\n return this.goto(this.parseBasicString)\n }\n parseMultiStringMaybe () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiString)\n } else {\n return this.returnNow()\n }\n }\n parseMultiString () {\n if (this.char === CTRL_M) {\n return null\n } else if (this.char === CTRL_J) {\n return this.next(this.parseMultiStringContent)\n } else {\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiStringContent () {\n do {\n if (this.char === CHAR_BSOL) {\n return this.call(this.parseMultiEscape, this.recordMultiEscapeReplacement)\n } else if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiEnd)\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated multi-line string'))\n } else if (this.char === CHAR_DEL || (this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M)) {\n throw this.errorControlCharInString()\n } else {\n this.consume()\n }\n } while (this.nextChar())\n }\n errorControlCharInString () {\n let displayCode = '\\\\u00'\n if (this.char < 16) {\n displayCode += '0'\n }\n displayCode += this.char.toString(16)\n\n return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${displayCode} instead`))\n }\n recordMultiEscapeReplacement (replacement) {\n this.state.buf += replacement\n return this.goto(this.parseMultiStringContent)\n }\n parseMultiEnd () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseMultiEnd2)\n } else {\n this.state.buf += '\"'\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiEnd2 () {\n if (this.char === CHAR_QUOT) {\n return this.return()\n } else {\n this.state.buf += '\"\"'\n return this.goto(this.parseMultiStringContent)\n }\n }\n parseMultiEscape () {\n if (this.char === CTRL_M || this.char === CTRL_J) {\n return this.next(this.parseMultiTrim)\n } else if (this.char === CHAR_SP || this.char === CTRL_I) {\n return this.next(this.parsePreMultiTrim)\n } else {\n return this.goto(this.parseEscape)\n }\n }\n parsePreMultiTrim () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === CTRL_M || this.char === CTRL_J) {\n return this.next(this.parseMultiTrim)\n } else {\n throw this.error(new TomlError(\"Can't escape whitespace\"))\n }\n }\n parseMultiTrim () {\n // explicitly whitespace here, END should follow the same path as chars\n if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null\n } else {\n return this.returnNow()\n }\n }\n parseEscape () {\n if (this.char in escapes) {\n return this.return(escapes[this.char])\n } else if (this.char === CHAR_u) {\n return this.call(this.parseSmallUnicode, this.parseUnicodeReturn)\n } else if (this.char === CHAR_U) {\n return this.call(this.parseLargeUnicode, this.parseUnicodeReturn)\n } else {\n throw this.error(new TomlError('Unknown escape character: ' + this.char))\n }\n }\n parseUnicodeReturn (char) {\n try {\n const codePoint = parseInt(char, 16)\n if (codePoint >= SURROGATE_FIRST && codePoint <= SURROGATE_LAST) {\n throw this.error(new TomlError('Invalid unicode, character in range 0xD800 - 0xDFFF is reserved'))\n }\n return this.returnNow(String.fromCodePoint(codePoint))\n } catch (err) {\n throw this.error(TomlError.wrap(err))\n }\n }\n parseSmallUnicode () {\n if (!isHexit(this.char)) {\n throw this.error(new TomlError('Invalid character in unicode sequence, expected hex'))\n } else {\n this.consume()\n if (this.state.buf.length >= 4) return this.return()\n }\n }\n parseLargeUnicode () {\n if (!isHexit(this.char)) {\n throw this.error(new TomlError('Invalid character in unicode sequence, expected hex'))\n } else {\n this.consume()\n if (this.state.buf.length >= 8) return this.return()\n }\n }\n\n /* NUMBERS */\n parseNumberSign () {\n this.consume()\n return this.next(this.parseMaybeSignedInfOrNan)\n }\n parseMaybeSignedInfOrNan () {\n if (this.char === CHAR_i) {\n return this.next(this.parseInf)\n } else if (this.char === CHAR_n) {\n return this.next(this.parseNan)\n } else {\n return this.callNow(this.parseNoUnder, this.parseNumberIntegerStart)\n }\n }\n parseNumberIntegerStart () {\n if (this.char === CHAR_0) {\n this.consume()\n return this.next(this.parseNumberIntegerExponentOrDecimal)\n } else {\n return this.goto(this.parseNumberInteger)\n }\n }\n parseNumberIntegerExponentOrDecimal () {\n if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseNumberInteger () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseNoUnder () {\n if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD || this.char === CHAR_E || this.char === CHAR_e) {\n throw this.error(new TomlError('Unexpected character, expected digit'))\n } else if (this.atEndOfWord()) {\n throw this.error(new TomlError('Incomplete number'))\n }\n return this.returnNow()\n }\n parseNoUnderHexOctBinLiteral () {\n if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD) {\n throw this.error(new TomlError('Unexpected character, expected digit'))\n } else if (this.atEndOfWord()) {\n throw this.error(new TomlError('Incomplete number'))\n }\n return this.returnNow()\n }\n parseNumberFloat () {\n if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else {\n return this.returnNow(Float(this.state.buf))\n }\n }\n parseNumberExponentSign () {\n if (isDigit(this.char)) {\n return this.goto(this.parseNumberExponent)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.call(this.parseNoUnder, this.parseNumberExponent)\n } else {\n throw this.error(new TomlError('Unexpected character, expected -, + or digit'))\n }\n }\n parseNumberExponent () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder)\n } else {\n return this.returnNow(Float(this.state.buf))\n }\n }\n\n /* NUMBERS or DATETIMES */\n parseNumberOrDateTime () {\n if (this.char === CHAR_0) {\n this.consume()\n return this.next(this.parseNumberBaseOrDateTime)\n } else {\n return this.goto(this.parseNumberOrDateTimeOnly)\n }\n }\n parseNumberOrDateTimeOnly () {\n // note, if two zeros are in a row then it MUST be a date\n if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnder, this.parseNumberInteger)\n } else if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length > 4) this.next(this.parseNumberInteger)\n } else if (this.char === CHAR_E || this.char === CHAR_e) {\n this.consume()\n return this.next(this.parseNumberExponentSign)\n } else if (this.char === CHAR_PERIOD) {\n this.consume()\n return this.call(this.parseNoUnder, this.parseNumberFloat)\n } else if (this.char === CHAR_HYPHEN) {\n return this.goto(this.parseDateTime)\n } else if (this.char === CHAR_COLON) {\n return this.goto(this.parseOnlyTimeHour)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseDateTimeOnly () {\n if (this.state.buf.length < 4) {\n if (isDigit(this.char)) {\n return this.consume()\n } else if (this.char === CHAR_COLON) {\n return this.goto(this.parseOnlyTimeHour)\n } else {\n throw this.error(new TomlError('Expected digit while parsing year part of a date'))\n }\n } else {\n if (this.char === CHAR_HYPHEN) {\n return this.goto(this.parseDateTime)\n } else {\n throw this.error(new TomlError('Expected hyphen (-) while parsing year part of date'))\n }\n }\n }\n parseNumberBaseOrDateTime () {\n if (this.char === CHAR_b) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerBin)\n } else if (this.char === CHAR_o) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerOct)\n } else if (this.char === CHAR_x) {\n this.consume()\n return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerHex)\n } else if (this.char === CHAR_PERIOD) {\n return this.goto(this.parseNumberInteger)\n } else if (isDigit(this.char)) {\n return this.goto(this.parseDateTimeOnly)\n } else {\n return this.returnNow(Integer(this.state.buf))\n }\n }\n parseIntegerHex () {\n if (isHexit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseIntegerOct () {\n if (isOctit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n parseIntegerBin () {\n if (isBit(this.char)) {\n this.consume()\n } else if (this.char === CHAR_LOWBAR) {\n return this.call(this.parseNoUnderHexOctBinLiteral)\n } else {\n const result = Integer(this.state.buf)\n /* istanbul ignore if */\n if (result.isNaN()) {\n throw this.error(new TomlError('Invalid number'))\n } else {\n return this.returnNow(result)\n }\n }\n }\n\n /* DATETIME */\n parseDateTime () {\n // we enter here having just consumed the year and about to consume the hyphen\n if (this.state.buf.length < 4) {\n throw this.error(new TomlError('Years less than 1000 must be zero padded to four characters'))\n }\n this.state.result = this.state.buf\n this.state.buf = ''\n return this.next(this.parseDateMonth)\n }\n parseDateMonth () {\n if (this.char === CHAR_HYPHEN) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Months less than 10 must be zero padded to two characters'))\n }\n this.state.result += '-' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseDateDay)\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseDateDay () {\n if (this.char === CHAR_T || this.char === CHAR_SP) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Days less than 10 must be zero padded to two characters'))\n }\n this.state.result += '-' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseStartTimeHour)\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDate(this.state.result + '-' + this.state.buf))\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseStartTimeHour () {\n if (this.atEndOfWord()) {\n return this.returnNow(createDate(this.state.result))\n } else {\n return this.goto(this.parseTimeHour)\n }\n }\n parseTimeHour () {\n if (this.char === CHAR_COLON) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Hours less than 10 must be zero padded to two characters'))\n }\n this.state.result += 'T' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeMin)\n } else if (isDigit(this.char)) {\n this.consume()\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseTimeMin () {\n if (this.state.buf.length < 2 && isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeSec)\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n parseTimeSec () {\n if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length === 2) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseTimeZoneOrFraction)\n }\n } else {\n throw this.error(new TomlError('Incomplete datetime'))\n }\n }\n\n parseOnlyTimeHour () {\n /* istanbul ignore else */\n if (this.char === CHAR_COLON) {\n if (this.state.buf.length < 2) {\n throw this.error(new TomlError('Hours less than 10 must be zero padded to two characters'))\n }\n this.state.result = this.state.buf\n this.state.buf = ''\n return this.next(this.parseOnlyTimeMin)\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeMin () {\n if (this.state.buf.length < 2 && isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {\n this.state.result += ':' + this.state.buf\n this.state.buf = ''\n return this.next(this.parseOnlyTimeSec)\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeSec () {\n if (isDigit(this.char)) {\n this.consume()\n if (this.state.buf.length === 2) {\n return this.next(this.parseOnlyTimeFractionMaybe)\n }\n } else {\n throw this.error(new TomlError('Incomplete time'))\n }\n }\n parseOnlyTimeFractionMaybe () {\n this.state.result += ':' + this.state.buf\n if (this.char === CHAR_PERIOD) {\n this.state.buf = ''\n this.next(this.parseOnlyTimeFraction)\n } else {\n return this.return(createTime(this.state.result))\n }\n }\n parseOnlyTimeFraction () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.atEndOfWord()) {\n if (this.state.buf.length === 0) throw this.error(new TomlError('Expected digit in milliseconds'))\n return this.returnNow(createTime(this.state.result + '.' + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n\n parseTimeZoneOrFraction () {\n if (this.char === CHAR_PERIOD) {\n this.consume()\n this.next(this.parseDateTimeFraction)\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.next(this.parseTimeZoneHour)\n } else if (this.char === CHAR_Z) {\n this.consume()\n return this.return(createDateTime(this.state.result + this.state.buf))\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n parseDateTimeFraction () {\n if (isDigit(this.char)) {\n this.consume()\n } else if (this.state.buf.length === 1) {\n throw this.error(new TomlError('Expected digit in milliseconds'))\n } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {\n this.consume()\n this.next(this.parseTimeZoneHour)\n } else if (this.char === CHAR_Z) {\n this.consume()\n return this.return(createDateTime(this.state.result + this.state.buf))\n } else if (this.atEndOfWord()) {\n return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z'))\n }\n }\n parseTimeZoneHour () {\n if (isDigit(this.char)) {\n this.consume()\n // FIXME: No more regexps\n if (/\\d\\d$/.test(this.state.buf)) return this.next(this.parseTimeZoneSep)\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected digit'))\n }\n }\n parseTimeZoneSep () {\n if (this.char === CHAR_COLON) {\n this.consume()\n this.next(this.parseTimeZoneMin)\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected colon'))\n }\n }\n parseTimeZoneMin () {\n if (isDigit(this.char)) {\n this.consume()\n if (/\\d\\d$/.test(this.state.buf)) return this.return(createDateTime(this.state.result + this.state.buf))\n } else {\n throw this.error(new TomlError('Unexpected character in datetime, expected digit'))\n }\n }\n\n /* BOOLEAN */\n parseBoolean () {\n /* istanbul ignore else */\n if (this.char === CHAR_t) {\n this.consume()\n return this.next(this.parseTrue_r)\n } else if (this.char === CHAR_f) {\n this.consume()\n return this.next(this.parseFalse_a)\n }\n }\n parseTrue_r () {\n if (this.char === CHAR_r) {\n this.consume()\n return this.next(this.parseTrue_u)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n parseTrue_u () {\n if (this.char === CHAR_u) {\n this.consume()\n return this.next(this.parseTrue_e)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n parseTrue_e () {\n if (this.char === CHAR_e) {\n return this.return(true)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_a () {\n if (this.char === CHAR_a) {\n this.consume()\n return this.next(this.parseFalse_l)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_l () {\n if (this.char === CHAR_l) {\n this.consume()\n return this.next(this.parseFalse_s)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_s () {\n if (this.char === CHAR_s) {\n this.consume()\n return this.next(this.parseFalse_e)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n parseFalse_e () {\n if (this.char === CHAR_e) {\n return this.return(false)\n } else {\n throw this.error(new TomlError('Invalid boolean, expected true or false'))\n }\n }\n\n /* INLINE LISTS */\n parseInlineList () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {\n return null\n } else if (this.char === Parser.END) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CHAR_RSQB) {\n return this.return(this.state.resultArr || InlineList())\n } else {\n return this.callNow(this.parseValue, this.recordInlineListValue)\n }\n }\n recordInlineListValue (value) {\n if (this.state.resultArr) {\n const listType = this.state.resultArr[_contentType]\n const valueType = tomlType(value)\n if (listType !== valueType) {\n throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${listType} and ${valueType}`))\n }\n } else {\n this.state.resultArr = InlineList(tomlType(value))\n }\n if (isFloat(value) || isInteger(value)) {\n // unbox now that we've verified they're ok\n this.state.resultArr.push(value.valueOf())\n } else {\n this.state.resultArr.push(value)\n }\n return this.goto(this.parseInlineListNext)\n }\n parseInlineListNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {\n return null\n } else if (this.char === CHAR_NUM) {\n return this.call(this.parseComment)\n } else if (this.char === CHAR_COMMA) {\n return this.next(this.parseInlineList)\n } else if (this.char === CHAR_RSQB) {\n return this.goto(this.parseInlineList)\n } else {\n throw this.error(new TomlError('Invalid character, expected whitespace, comma (,) or close bracket (])'))\n }\n }\n\n /* INLINE TABLE */\n parseInlineTable () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_RCUB) {\n return this.return(this.state.resultTable || InlineTable())\n } else {\n if (!this.state.resultTable) this.state.resultTable = InlineTable()\n return this.callNow(this.parseAssign, this.recordInlineTableValue)\n }\n }\n recordInlineTableValue (kv) {\n let target = this.state.resultTable\n let finalKey = kv.key.pop()\n for (let kw of kv.key) {\n if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n target = target[kw] = target[kw] || Table()\n }\n if (hasKey(target, finalKey)) {\n throw this.error(new TomlError(\"Can't redefine existing key\"))\n }\n if (isInteger(kv.value) || isFloat(kv.value)) {\n target[finalKey] = kv.value.valueOf()\n } else {\n target[finalKey] = kv.value\n }\n return this.goto(this.parseInlineTableNext)\n }\n parseInlineTableNext () {\n if (this.char === CHAR_SP || this.char === CTRL_I) {\n return null\n } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {\n throw this.error(new TomlError('Unterminated inline array'))\n } else if (this.char === CHAR_COMMA) {\n return this.next(this.parseInlineTable)\n } else if (this.char === CHAR_RCUB) {\n return this.goto(this.parseInlineTable)\n } else {\n throw this.error(new TomlError('Invalid character, expected whitespace, comma (,) or close bracket (])'))\n }\n }\n }\n return TOMLParser\n}\n","'use strict'\nmodule.exports = prettyError\n\nfunction prettyError (err, buf) {\n /* istanbul ignore if */\n if (err.pos == null || err.line == null) return err\n let msg = err.message\n msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:\\n`\n\n /* istanbul ignore else */\n if (buf && buf.split) {\n const lines = buf.split(/\\n/)\n const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length\n let linePadding = ' '\n while (linePadding.length < lineNumWidth) linePadding += ' '\n for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {\n let lineNum = String(ii + 1)\n if (lineNum.length < lineNumWidth) lineNum = ' ' + lineNum\n if (err.line === ii) {\n msg += lineNum + '> ' + lines[ii] + '\\n'\n msg += linePadding + ' '\n for (let hh = 0; hh < err.col; ++hh) {\n msg += ' '\n }\n msg += '^\\n'\n } else {\n msg += lineNum + ': ' + lines[ii] + '\\n'\n }\n }\n }\n err.message = msg + '\\n'\n return err\n}\n","'use strict'\nmodule.exports = parseString\n\nconst TOMLParser = require('./lib/toml-parser.js')\nconst prettyError = require('./parse-pretty-error.js')\n\nfunction parseString (str) {\n if (global.Buffer && global.Buffer.isBuffer(str)) {\n str = str.toString('utf8')\n }\n const parser = new TOMLParser()\n try {\n parser.parse(str)\n return parser.finish()\n } catch (err) {\n throw prettyError(err, str)\n }\n}\n","'use strict'\nmodule.exports = parseAsync\n\nconst TOMLParser = require('./lib/toml-parser.js')\nconst prettyError = require('./parse-pretty-error.js')\n\nfunction parseAsync (str, opts) {\n if (!opts) opts = {}\n const index = 0\n const blocksize = opts.blocksize || 40960\n const parser = new TOMLParser()\n return new Promise((resolve, reject) => {\n setImmediate(parseAsyncNext, index, blocksize, resolve, reject)\n })\n function parseAsyncNext (index, blocksize, resolve, reject) {\n if (index >= str.length) {\n try {\n return resolve(parser.finish())\n } catch (err) {\n return reject(prettyError(err, str))\n }\n }\n try {\n parser.parse(str.slice(index, index + blocksize))\n setImmediate(parseAsyncNext, index + blocksize, blocksize, resolve, reject)\n } catch (err) {\n reject(prettyError(err, str))\n }\n }\n}\n","'use strict'\nmodule.exports = parseStream\n\nconst stream = require('stream')\nconst TOMLParser = require('./lib/toml-parser.js')\n\nfunction parseStream (stm) {\n if (stm) {\n return parseReadable(stm)\n } else {\n return parseTransform(stm)\n }\n}\n\nfunction parseReadable (stm) {\n const parser = new TOMLParser()\n stm.setEncoding('utf8')\n return new Promise((resolve, reject) => {\n let readable\n let ended = false\n let errored = false\n function finish () {\n ended = true\n if (readable) return\n try {\n resolve(parser.finish())\n } catch (err) {\n reject(err)\n }\n }\n function error (err) {\n errored = true\n reject(err)\n }\n stm.once('end', finish)\n stm.once('error', error)\n readNext()\n\n function readNext () {\n readable = true\n let data\n while ((data = stm.read()) !== null) {\n try {\n parser.parse(data)\n } catch (err) {\n return error(err)\n }\n }\n readable = false\n /* istanbul ignore if */\n if (ended) return finish()\n /* istanbul ignore if */\n if (errored) return\n stm.once('readable', readNext)\n }\n })\n}\n\nfunction parseTransform () {\n const parser = new TOMLParser()\n return new stream.Transform({\n objectMode: true,\n transform (chunk, encoding, cb) {\n try {\n parser.parse(chunk.toString(encoding))\n } catch (err) {\n this.emit('error', err)\n }\n cb()\n },\n flush (cb) {\n try {\n this.push(parser.finish())\n } catch (err) {\n this.emit('error', err)\n }\n cb()\n }\n })\n}\n","'use strict'\nmodule.exports = require('./parse-string.js')\nmodule.exports.async = require('./parse-async.js')\nmodule.exports.stream = require('./parse-stream.js')\nmodule.exports.prettyError = require('./parse-pretty-error.js')\n","'use strict'\nmodule.exports = stringify\nmodule.exports.value = stringifyInline\n\nfunction stringify (obj) {\n if (obj === null) throw typeError('null')\n if (obj === void (0)) throw typeError('undefined')\n if (typeof obj !== 'object') throw typeError(typeof obj)\n\n if (typeof obj.toJSON === 'function') obj = obj.toJSON()\n if (obj == null) return null\n const type = tomlType(obj)\n if (type !== 'table') throw typeError(type)\n return stringifyObject('', '', obj)\n}\n\nfunction typeError (type) {\n return new Error('Can only stringify objects, not ' + type)\n}\n\nfunction arrayOneTypeError () {\n return new Error(\"Array values can't have mixed types\")\n}\n\nfunction getInlineKeys (obj) {\n return Object.keys(obj).filter(key => isInline(obj[key]))\n}\nfunction getComplexKeys (obj) {\n return Object.keys(obj).filter(key => !isInline(obj[key]))\n}\n\nfunction toJSON (obj) {\n let nobj = Array.isArray(obj) ? [] : Object.prototype.hasOwnProperty.call(obj, '__proto__') ? {['__proto__']: undefined} : {}\n for (let prop of Object.keys(obj)) {\n if (obj[prop] && typeof obj[prop].toJSON === 'function' && !('toISOString' in obj[prop])) {\n nobj[prop] = obj[prop].toJSON()\n } else {\n nobj[prop] = obj[prop]\n }\n }\n return nobj\n}\n\nfunction stringifyObject (prefix, indent, obj) {\n obj = toJSON(obj)\n var inlineKeys\n var complexKeys\n inlineKeys = getInlineKeys(obj)\n complexKeys = getComplexKeys(obj)\n var result = []\n var inlineIndent = indent || ''\n inlineKeys.forEach(key => {\n var type = tomlType(obj[key])\n if (type !== 'undefined' && type !== 'null') {\n result.push(inlineIndent + stringifyKey(key) + ' = ' + stringifyAnyInline(obj[key], true))\n }\n })\n if (result.length > 0) result.push('')\n var complexIndent = prefix && inlineKeys.length > 0 ? indent + ' ' : ''\n complexKeys.forEach(key => {\n result.push(stringifyComplex(prefix, complexIndent, key, obj[key]))\n })\n return result.join('\\n')\n}\n\nfunction isInline (value) {\n switch (tomlType(value)) {\n case 'undefined':\n case 'null':\n case 'integer':\n case 'nan':\n case 'float':\n case 'boolean':\n case 'string':\n case 'datetime':\n return true\n case 'array':\n return value.length === 0 || tomlType(value[0]) !== 'table'\n case 'table':\n return Object.keys(value).length === 0\n /* istanbul ignore next */\n default:\n return false\n }\n}\n\nfunction tomlType (value) {\n if (value === undefined) {\n return 'undefined'\n } else if (value === null) {\n return 'null'\n /* eslint-disable valid-typeof */\n } else if (typeof value === 'bigint' || (Number.isInteger(value) && !Object.is(value, -0))) {\n return 'integer'\n } else if (typeof value === 'number') {\n return 'float'\n } else if (typeof value === 'boolean') {\n return 'boolean'\n } else if (typeof value === 'string') {\n return 'string'\n } else if ('toISOString' in value) {\n return isNaN(value) ? 'undefined' : 'datetime'\n } else if (Array.isArray(value)) {\n return 'array'\n } else {\n return 'table'\n }\n}\n\nfunction stringifyKey (key) {\n var keyStr = String(key)\n if (/^[-A-Za-z0-9_]+$/.test(keyStr)) {\n return keyStr\n } else {\n return stringifyBasicString(keyStr)\n }\n}\n\nfunction stringifyBasicString (str) {\n return '\"' + escapeString(str).replace(/\"/g, '\\\\\"') + '\"'\n}\n\nfunction stringifyLiteralString (str) {\n return \"'\" + str + \"'\"\n}\n\nfunction numpad (num, str) {\n while (str.length < num) str = '0' + str\n return str\n}\n\nfunction escapeString (str) {\n return str.replace(/\\\\/g, '\\\\\\\\')\n .replace(/[\\b]/g, '\\\\b')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\f/g, '\\\\f')\n .replace(/\\r/g, '\\\\r')\n /* eslint-disable no-control-regex */\n .replace(/([\\u0000-\\u001f\\u007f])/, c => '\\\\u' + numpad(4, c.codePointAt(0).toString(16)))\n /* eslint-enable no-control-regex */\n}\n\nfunction stringifyMultilineString (str) {\n let escaped = str.split(/\\n/).map(str => {\n return escapeString(str).replace(/\"(?=\"\")/g, '\\\\\"')\n }).join('\\n')\n if (escaped.slice(-1) === '\"') escaped += '\\\\\\n'\n return '\"\"\"\\n' + escaped + '\"\"\"'\n}\n\nfunction stringifyAnyInline (value, multilineOk) {\n let type = tomlType(value)\n if (type === 'string') {\n if (multilineOk && /\\n/.test(value)) {\n type = 'string-multiline'\n } else if (!/[\\b\\t\\n\\f\\r']/.test(value) && /\"/.test(value)) {\n type = 'string-literal'\n }\n }\n return stringifyInline(value, type)\n}\n\nfunction stringifyInline (value, type) {\n /* istanbul ignore if */\n if (!type) type = tomlType(value)\n switch (type) {\n case 'string-multiline':\n return stringifyMultilineString(value)\n case 'string':\n return stringifyBasicString(value)\n case 'string-literal':\n return stringifyLiteralString(value)\n case 'integer':\n return stringifyInteger(value)\n case 'float':\n return stringifyFloat(value)\n case 'boolean':\n return stringifyBoolean(value)\n case 'datetime':\n return stringifyDatetime(value)\n case 'array':\n return stringifyInlineArray(value.filter(_ => tomlType(_) !== 'null' && tomlType(_) !== 'undefined' && tomlType(_) !== 'nan'))\n case 'table':\n return stringifyInlineTable(value)\n /* istanbul ignore next */\n default:\n throw typeError(type)\n }\n}\n\nfunction stringifyInteger (value) {\n /* eslint-disable security/detect-unsafe-regex */\n return String(value).replace(/\\B(?=(\\d{3})+(?!\\d))/g, '_')\n}\n\nfunction stringifyFloat (value) {\n if (value === Infinity) {\n return 'inf'\n } else if (value === -Infinity) {\n return '-inf'\n } else if (Object.is(value, NaN)) {\n return 'nan'\n } else if (Object.is(value, -0)) {\n return '-0.0'\n }\n var chunks = String(value).split('.')\n var int = chunks[0]\n var dec = chunks[1] || 0\n return stringifyInteger(int) + '.' + dec\n}\n\nfunction stringifyBoolean (value) {\n return String(value)\n}\n\nfunction stringifyDatetime (value) {\n return value.toISOString()\n}\n\nfunction isNumber (type) {\n return type === 'float' || type === 'integer'\n}\nfunction arrayType (values) {\n var contentType = tomlType(values[0])\n if (values.every(_ => tomlType(_) === contentType)) return contentType\n // mixed integer/float, emit as floats\n if (values.every(_ => isNumber(tomlType(_)))) return 'float'\n return 'mixed'\n}\nfunction validateArray (values) {\n const type = arrayType(values)\n if (type === 'mixed') {\n throw arrayOneTypeError()\n }\n return type\n}\n\nfunction stringifyInlineArray (values) {\n values = toJSON(values)\n const type = validateArray(values)\n var result = '['\n var stringified = values.map(_ => stringifyInline(_, type))\n if (stringified.join(', ').length > 60 || /\\n/.test(stringified)) {\n result += '\\n ' + stringified.join(',\\n ') + '\\n'\n } else {\n result += ' ' + stringified.join(', ') + (stringified.length > 0 ? ' ' : '')\n }\n return result + ']'\n}\n\nfunction stringifyInlineTable (value) {\n value = toJSON(value)\n var result = []\n Object.keys(value).forEach(key => {\n result.push(stringifyKey(key) + ' = ' + stringifyAnyInline(value[key], false))\n })\n return '{ ' + result.join(', ') + (result.length > 0 ? ' ' : '') + '}'\n}\n\nfunction stringifyComplex (prefix, indent, key, value) {\n var valueType = tomlType(value)\n /* istanbul ignore else */\n if (valueType === 'array') {\n return stringifyArrayOfTables(prefix, indent, key, value)\n } else if (valueType === 'table') {\n return stringifyComplexTable(prefix, indent, key, value)\n } else {\n throw typeError(valueType)\n }\n}\n\nfunction stringifyArrayOfTables (prefix, indent, key, values) {\n values = toJSON(values)\n validateArray(values)\n var firstValueType = tomlType(values[0])\n /* istanbul ignore if */\n if (firstValueType !== 'table') throw typeError(firstValueType)\n var fullKey = prefix + stringifyKey(key)\n var result = ''\n values.forEach(table => {\n if (result.length > 0) result += '\\n'\n result += indent + '[[' + fullKey + ']]\\n'\n result += stringifyObject(fullKey + '.', indent, table)\n })\n return result\n}\n\nfunction stringifyComplexTable (prefix, indent, key, value) {\n var fullKey = prefix + stringifyKey(key)\n var result = ''\n if (getInlineKeys(value).length > 0) {\n result += indent + '[' + fullKey + ']\\n'\n }\n return result + stringifyObject(fullKey + '.', indent, value)\n}\n","'use strict'\nexports.parse = require('./parse.js')\nexports.stringify = require('./stringify.js')\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","#!/usr/bin/env node\n\nimport { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport readline from \"readline\";\nimport { execSync } from \"node:child_process\";\nimport { readFileSync, writeFileSync, mkdirSync, existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { homedir } from \"node:os\";\nimport { monitorCommand } from \"./commands/monitor.js\";\nimport { parseFailOn, scanCommand, type ScanFormat } from \"./commands/scan.js\";\nimport { initCommand } from \"./commands/init.js\";\nimport { statusCommand } from \"./commands/status.js\";\nimport { modulesCommand } from \"./commands/modules.js\";\nimport { pentestCommand } from \"./commands/pentest.js\";\nimport { orgsCommand } from \"./commands/orgs.js\";\nimport { serversCommand } from \"./commands/servers.js\";\nimport { connectCommand } from \"./commands/connect.js\";\nimport { daemonForeground, daemonStart, daemonStop } from \"./commands/daemon.js\";\nimport { installServiceCommand, uninstallServiceCommand } from \"./commands/service.js\";\nimport { loginCommand, logoutCommand, whoamiCommand } from \"./commands/login.js\";\nimport { welcomeCommand } from \"./commands/welcome.js\";\nimport {\n propertiesAddCommand,\n propertiesImportCommand,\n propertiesListCommand,\n propertiesRemoveCommand,\n propertiesRunCommand,\n propertiesRunsCommand,\n} from \"./commands/properties.js\";\nimport { rulesCommand } from \"./commands/rules.js\";\nimport { hardenCommand } from \"./commands/harden.js\";\nimport { blockCommand, unblockCommand, blocklistCommand, allowlistCommand } from \"./commands/firewall.js\";\nimport { PATHS } from \"./daemon/paths.js\";\n\nlet PKG_VERSION = \"0.1.8\";\ntry {\n const pkg = JSON.parse(readFileSync(join(__dirname, \"..\", \"package.json\"), \"utf-8\"));\n PKG_VERSION = pkg.version;\n} catch {}\n\nconst LOGO = `\n${chalk.green(\" ████████╗██╗ ██╗██████╗ ███████╗ █████╗ ████████╗\")}\n${chalk.green(\" ╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗╚══██╔══╝\")}\n${chalk.green(\" ██║ ███████║██████╔╝█████╗ ███████║ ██║ \")}\n${chalk.green(\" ██║ ██╔══██║██╔══██╗██╔══╝ ██╔══██║ ██║ \")}\n${chalk.green(\" ██║ ██║ ██║██║ ██║███████╗██║ ██║ ██║ \")}\n${chalk.green(\" ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝\")}\n${chalk.dim(\" C R U S H\")}\n`;\n\nconst API_URL = process.env.THREATCRUSH_API_URL || \"https://threatcrush.com\";\nconst PKG_NAME = \"@profullstack/threatcrush\";\nconst DESKTOP_PKG_NAME = \"@profullstack/threatcrush-desktop\";\nconst INSTALL_CONFIG_PATH = join(homedir(), \".threatcrush\", \"install.json\");\n\n// ─── Helpers ───\n\nasync function joinWaitlist(email: string): Promise<{ referral_code?: string } | null> {\n try {\n const res = await fetch(`${API_URL}/api/waitlist`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ email }),\n });\n return await res.json();\n } catch {\n return null;\n }\n}\n\nfunction detectPackageManager(): string {\n // Check what installed us\n try {\n const npmGlobal = execSync(\"npm ls -g --depth=0 --json 2>/dev/null\", { encoding: \"utf-8\" });\n if (npmGlobal.includes(PKG_NAME)) return \"npm\";\n } catch {}\n try {\n execSync(\"pnpm --version\", { stdio: \"pipe\" });\n return \"pnpm\";\n } catch {}\n try {\n execSync(\"yarn --version\", { stdio: \"pipe\" });\n return \"yarn\";\n } catch {}\n try {\n execSync(\"bun --version\", { stdio: \"pipe\" });\n return \"bun\";\n } catch {}\n return \"npm\";\n}\n\nfunction readInstallConfig(): { installMode?: string; packageManager?: string; installMethod?: string } {\n try {\n return JSON.parse(readFileSync(INSTALL_CONFIG_PATH, \"utf-8\"));\n } catch {\n return {};\n }\n}\n\nfunction getGlobalInstallCommand(pm: string, pkgName: string, action: \"install\" | \"update\" | \"remove\"): string {\n const commands: Record<string, Record<string, string>> = {\n npm: {\n install: `npm i -g ${pkgName}`,\n update: `npm update -g ${pkgName}`,\n remove: `npm uninstall -g ${pkgName}`,\n },\n pnpm: {\n install: `pnpm add -g ${pkgName}`,\n update: `pnpm update -g ${pkgName}`,\n remove: `pnpm remove -g ${pkgName}`,\n },\n yarn: {\n install: `yarn global add ${pkgName}`,\n update: `yarn global upgrade ${pkgName}`,\n remove: `yarn global remove ${pkgName}`,\n },\n bun: {\n install: `bun add -g ${pkgName}`,\n update: `bun update -g ${pkgName}`,\n remove: `bun remove -g ${pkgName}`,\n },\n };\n\n return commands[pm]?.[action] || commands.npm[action];\n}\n\nfunction packageLooksInstalled(pm: string, pkgName: string): boolean {\n try {\n const listCommands: Record<string, string> = {\n npm: `npm ls -g ${pkgName} --depth=0`,\n pnpm: `pnpm list -g ${pkgName} --depth=0`,\n yarn: `yarn global list --pattern ${pkgName}`,\n bun: `bun pm ls -g`,\n };\n\n const output = execSync(listCommands[pm] || listCommands.npm, {\n encoding: \"utf-8\",\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n });\n\n return output.includes(pkgName);\n } catch {\n return false;\n }\n}\n\n// ─── Program ───\n\nconst program = new Command();\n\nprogram\n .name(\"threatcrush\")\n .description(\n `${chalk.green(\"⚡ ThreatCrush\")} — All-in-one security agent\n\n Monitor every connection on every port. Detect live attacks,\n scan your code, pentest your APIs, and alert you in real-time.\n\n ${chalk.dim(\"Website:\")} ${chalk.green(\"https://threatcrush.com\")}\n ${chalk.dim(\"GitHub:\")} ${chalk.green(\"https://github.com/profullstack/threatcrush\")}\n ${chalk.dim(\"npm:\")} ${chalk.green(\"https://www.npmjs.com/package/@profullstack/threatcrush\")}\n ${chalk.dim(\"License:\")} ${chalk.green(\"$499 lifetime\")} (or $399 with referral)\n\n${chalk.dim(\"Examples:\")}\n ${chalk.green(\"$\")} threatcrush monitor ${chalk.dim(\"# Real-time monitoring\")}\n ${chalk.green(\"$\")} threatcrush tui ${chalk.dim(\"# Interactive dashboard\")}\n ${chalk.green(\"$\")} threatcrush scan ./src ${chalk.dim(\"# Scan code for vulns\")}\n ${chalk.green(\"$\")} threatcrush pentest URL ${chalk.dim(\"# Pen test a URL\")}\n ${chalk.green(\"$\")} threatcrush modules install ${chalk.dim(\"# Install a module\")}\n ${chalk.green(\"$\")} threatcrush update ${chalk.dim(\"# Update to latest\")}\n ${chalk.green(\"$\")} threatcrush remove ${chalk.dim(\"# Uninstall completely\")}`)\n .version(PKG_VERSION, \"-v, --version\", \"Show version number\")\n .helpOption(\"-h, --help\", \"Show this help\")\n .addHelpText(\"after\", `\n${chalk.dim(\"─────────────────────────────────────────────────────\")}\n${chalk.dim(\"Modules:\")}\n ThreatCrush uses pluggable security modules. Core modules included:\n ${chalk.green(\"network-monitor\")} All TCP/UDP traffic, port scans, SYN floods\n ${chalk.green(\"log-watcher\")} nginx, Apache, syslog, journald\n ${chalk.green(\"ssh-guard\")} Failed logins, brute force, tunneling\n ${chalk.green(\"code-scanner\")} Vulnerabilities, secrets, dependency CVEs\n ${chalk.green(\"pentest-engine\")} SQLi, XSS, SSRF, API fuzzing\n ${chalk.green(\"dns-monitor\")} DNS tunneling, DGA detection\n ${chalk.green(\"firewall-rules\")} Auto-blocks via iptables/nftables\n ${chalk.green(\"alert-system\")} Slack, Discord, email, webhook, PagerDuty\n\n Browse community modules: ${chalk.green(\"threatcrush store\")}\n`);\n\n// ─── Real commands ───\n\nprogram\n .command(\"monitor\")\n .description(\"Real-time security monitoring (all ports, all protocols)\")\n .option(\"-m, --module <modules>\", \"Comma-separated module filter (e.g. ssh-guard,log-watcher)\")\n .option(\"--tui\", \"Launch the interactive TUI dashboard\")\n .action(async (opts) => {\n await monitorCommand({\n module: opts.module,\n tui: opts.tui,\n });\n });\n\nprogram\n .command(\"tui\")\n .description(\"Interactive security dashboard (htop for security)\")\n .alias(\"dashboard\")\n .action(async () => {\n await monitorCommand({ tui: true });\n });\n\nprogram\n .command(\"init\")\n .description(\"Sign in, auto-detect services, and configure ThreatCrush\")\n .action(async () => {\n await initCommand();\n });\n\nprogram\n .command(\"login\")\n .description(\"Log in to your threatcrush.com account\")\n .option(\"-e, --email <email>\", \"Email to log in with\")\n .action(async (opts) => {\n await loginCommand({ email: opts.email });\n });\n\nprogram\n .command(\"logout\")\n .description(\"Clear stored threatcrush.com credentials\")\n .action(async () => {\n await logoutCommand();\n });\n\nprogram\n .command(\"whoami\")\n .description(\"Show the currently logged-in threatcrush.com account\")\n .action(async () => {\n await whoamiCommand();\n });\n\nprogram\n .command(\"scan\")\n .description(\"Scan codebase for vulnerabilities and secrets\")\n .argument(\"[path]\", \"Path to scan\", \".\")\n .option(\"-f, --format <format>\", \"output format: text, json, or sarif\", \"text\")\n .option(\"-o, --output <file>\", \"write json/sarif output to a file instead of stdout\")\n .option(\n \"--fail-on <severities>\",\n \"exit 1 when a finding at or above any of these exists (comma-separated: critical,high,medium,low,info)\",\n )\n .option(\n \"--path-prefix <prefix>\",\n \"prepend this to SARIF file URIs — use when the scan root is not the repository root\",\n )\n .option(\"--deps\", \"also query OSV.dev for advisories against lockfile versions (network)\")\n .option(\"-v, --verbose\", \"list the paths that could not be read\")\n .action(async (targetPath: string, opts: {\n format?: string;\n output?: string;\n failOn?: string;\n pathPrefix?: string;\n deps?: boolean;\n verbose?: boolean;\n }) => {\n const format = (opts.format ?? \"text\").toLowerCase();\n if (![\"text\", \"json\", \"sarif\"].includes(format)) {\n console.error(chalk.red(`Unknown --format \"${opts.format}\" (expected text, json, or sarif)`));\n process.exit(2);\n }\n\n let failOn;\n try {\n failOn = parseFailOn(opts.failOn);\n } catch (err) {\n console.error(chalk.red((err as Error).message));\n process.exit(2);\n }\n\n await scanCommand(targetPath, {\n format: format as ScanFormat,\n output: opts.output,\n failOn,\n pathPrefix: opts.pathPrefix,\n dependencies: opts.deps,\n verbose: opts.verbose,\n });\n });\n\nprogram\n .command(\"pentest\")\n .description(\"Penetration test URLs and APIs\")\n .argument(\"<url>\", \"Target URL to pentest\")\n .action(async (url: string) => {\n await pentestCommand(url);\n });\n\nprogram\n .command(\"status\")\n .description(\"Show daemon status and loaded modules\")\n .action(async () => {\n await statusCommand();\n });\n\n// ─── Detection Rules (PRD 01) ───\n\nprogram\n .command(\"rules\")\n .description(\"Manage detection rules\")\n .argument(\"[action]\", \"list | show\", \"list\")\n .argument(\"[id]\", \"Rule ID (for show)\")\n .action(async (action: string, id: string) => {\n await rulesCommand({ action, id });\n });\n\n// ─── Hardening Scanner (PRD 03) ───\n\nprogram\n .command(\"harden\")\n .description(\"Run hardening security scan\")\n .option(\"--json\", \"Output results as JSON\")\n .action(async (opts: { json?: boolean }) => {\n await hardenCommand(opts);\n });\n\n// ─── Firewall Commands (PRD 02) ───\n\nprogram\n .command(\"block\")\n .description(\"Block an IP address via the firewall\")\n .argument(\"<ip>\", \"IP address to block\")\n .option(\"--ttl <duration>\", \"Block duration (e.g. 1h, 30m, 1d)\")\n .action(async (ip: string, opts: { ttl?: string }) => {\n await blockCommand(ip, opts);\n });\n\nprogram\n .command(\"unblock\")\n .description(\"Unblock an IP address\")\n .argument(\"<ip>\", \"IP address to unblock\")\n .action(async (ip: string) => {\n await unblockCommand(ip);\n });\n\nprogram\n .command(\"blocklist\")\n .description(\"Show active firewall blocklist\")\n .action(async () => {\n await blocklistCommand();\n });\n\nprogram\n .command(\"allowlist\")\n .description(\"Manage IP allowlist\")\n .argument(\"[action]\", \"list | add | remove\", \"list\")\n .argument(\"[value]\", \"IP/CIDR to add or remove\")\n .action(async (action: string, value: string) => {\n await allowlistCommand({ action, value });\n });\n\nprogram\n .command(\"start\")\n .description(\"Start the ThreatCrush daemon in the background\")\n .action(async () => {\n console.log(LOGO);\n await daemonStart();\n });\n\nprogram\n .command(\"stop\")\n .description(\"Stop the ThreatCrush daemon\")\n .action(async () => {\n console.log(LOGO);\n await daemonStop();\n });\n\nprogram\n .command(\"daemon\")\n .description(\"Run threatcrushd in the foreground (systemd / Docker ExecStart)\")\n .action(async () => {\n await daemonForeground();\n });\n\nprogram\n .command(\"install-service\")\n .description(\"Install the threatcrushd systemd unit (Linux, requires sudo)\")\n .action(async () => {\n await installServiceCommand();\n });\n\nprogram\n .command(\"uninstall-service\")\n .description(\"Remove the threatcrushd systemd unit (Linux, requires sudo)\")\n .action(async () => {\n await uninstallServiceCommand();\n });\n\nprogram\n .command(\"logs\")\n .description(\"Tail daemon logs\")\n .action(async () => {\n console.log(LOGO);\n const logPath = PATHS.logFile;\n if (!existsSync(logPath)) {\n console.log(chalk.yellow(` No log file found at ${logPath}`));\n console.log(chalk.dim(\" Start the daemon first with `threatcrush start`\\n\"));\n return;\n }\n console.log(chalk.green(` Tailing ${logPath}...\\n`));\n console.log(chalk.gray(\" Press Ctrl+C to stop\\n\"));\n execSync(`tail -f ${logPath}`, { stdio: \"inherit\" });\n });\n\nprogram\n .command(\"activate\")\n .description(\"Activate your license key\")\n .action(async () => {\n console.log(LOGO);\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n const key = await new Promise<string>((resolve) => {\n rl.question(chalk.green(\" Enter your ThreatCrush license key: \"), (answer) => {\n rl.close();\n resolve(answer.trim());\n });\n });\n\n if (!key) {\n console.log(chalk.red(\"\\n No key provided.\\n\"));\n return;\n }\n\n console.log(chalk.dim(\"\\n Activating license...\"));\n try {\n const res = await fetch(`${API_URL}/api/auth/activate`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ license_key: key }),\n });\n const result = await res.json() as Record<string, unknown>;\n\n if (!res.ok) {\n console.log(chalk.red(`\\n ✗ Activation failed: ${(result as Record<string, string>).error || \"Unknown error\"}\\n`));\n return;\n }\n\n console.log(chalk.green(\"\\n ✓ License activated successfully!\\n\"));\n console.log(chalk.dim(` Status: ${String(result.status ?? \"active\")}`));\n console.log(chalk.dim(` Expires: ${String(result.expires ?? \"never\")}\\n`));\n } catch {\n console.log(chalk.red(\"\\n ✗ Activation failed. Check your connection and try again.\\n\"));\n }\n });\n\n// ─── Real commands ───\n\nprogram\n .command(\"update\")\n .description(\"Update ThreatCrush CLI and installed bundle\")\n .option(\"--cli\", \"Update CLI only\")\n .option(\"--modules\", \"Update modules only\")\n .option(\"--desktop\", \"Update desktop app too\")\n .action(async (opts) => {\n console.log(LOGO);\n\n if (opts.modules) {\n console.log(LOGO);\n console.log(chalk.yellow(\" Updating modules...\\n\"));\n const pm = detectPackageManager();\n const commands = [\n getGlobalInstallCommand(pm, PKG_NAME, \"update\"),\n ];\n try {\n for (const cmd of commands) {\n console.log(chalk.green(` → ${cmd}\\n`));\n execSync(cmd, { stdio: \"inherit\" });\n }\n console.log(chalk.green(\"\\n ✓ Modules updated successfully!\\n\"));\n } catch (err) {\n console.log(chalk.red(\"\\n ✗ Module update failed. Try manually:\\n\"));\n for (const cmd of commands) {\n console.log(chalk.dim(` ${cmd}`));\n }\n console.log();\n }\n return;\n }\n\n const pm = detectPackageManager();\n const installConfig = readInstallConfig();\n const installMode = opts.cli ? \"server\" : (opts.desktop ? \"desktop\" : installConfig.installMode || \"server\");\n\n console.log(chalk.dim(` Detected package manager: ${pm}`));\n console.log(chalk.dim(` Install mode: ${installMode}\\n`));\n\n const commands = [getGlobalInstallCommand(pm, PKG_NAME, \"update\")];\n\n if (installMode === \"desktop\") {\n commands.push(getGlobalInstallCommand(pm, DESKTOP_PKG_NAME, \"update\"));\n }\n\n try {\n for (const cmd of commands) {\n console.log(chalk.green(` → ${cmd}\\n`));\n execSync(cmd, { stdio: \"inherit\" });\n }\n\n console.log(chalk.green(\"\\n ✓ ThreatCrush updated successfully!\\n\"));\n if (installMode === \"desktop\") {\n console.log(chalk.dim(\" Updated bundle: CLI + desktop app\\n\"));\n } else {\n console.log(chalk.dim(\" Updated bundle: CLI only\\n\"));\n }\n } catch (err) {\n console.log(chalk.red(\"\\n ✗ Update failed. Try manually:\\n\"));\n for (const cmd of commands) {\n console.log(chalk.dim(` ${cmd}`));\n }\n console.log();\n }\n });\n\nprogram\n .command(\"remove\")\n .description(\"Uninstall ThreatCrush and the installed bundle\")\n .alias(\"uninstall\")\n .action(async () => {\n console.log(LOGO);\n\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n const confirm = await new Promise<string>((resolve) => {\n rl.question(chalk.yellow(\" Are you sure you want to uninstall ThreatCrush? (y/N): \"), (answer) => {\n rl.close();\n resolve(answer.trim().toLowerCase());\n });\n });\n\n if (confirm !== \"y\" && confirm !== \"yes\") {\n console.log(chalk.dim(\"\\n Cancelled.\\n\"));\n return;\n }\n\n const pm = detectPackageManager();\n const installConfig = readInstallConfig();\n const installMode = installConfig.installMode || \"server\";\n const commands = [getGlobalInstallCommand(pm, PKG_NAME, \"remove\")];\n\n if (installMode === \"desktop\" && packageLooksInstalled(pm, DESKTOP_PKG_NAME)) {\n commands.push(getGlobalInstallCommand(pm, DESKTOP_PKG_NAME, \"remove\"));\n }\n\n console.log(chalk.dim(`\\n Detected package manager: ${pm}`));\n console.log(chalk.dim(` Install mode: ${installMode}\\n`));\n\n try {\n for (const cmd of commands) {\n console.log(chalk.green(` → ${cmd}\\n`));\n execSync(cmd, { stdio: \"inherit\" });\n }\n console.log(chalk.green(\"\\n ✓ ThreatCrush has been uninstalled.\\n\"));\n console.log(chalk.dim(\" We're sorry to see you go! 👋\\n\"));\n console.log(chalk.dim(\" Config files may remain at /etc/threatcrush/\"));\n console.log(chalk.dim(\" Logs may remain at /var/log/threatcrush/\"));\n console.log(chalk.dim(\" State may remain at /var/lib/threatcrush/\"));\n console.log(chalk.dim(` Local install metadata may remain at ${INSTALL_CONFIG_PATH}\\n`));\n } catch (err) {\n console.log(chalk.red(\"\\n ✗ Uninstall failed. Try manually:\\n\"));\n for (const cmd of commands) {\n console.log(chalk.dim(` ${cmd}`));\n }\n console.log();\n }\n });\n\nprogram\n .command(\"modules\")\n .description(\"Manage security modules\")\n .argument(\"[action]\", \"list | install | remove | available\")\n .argument(\"[name]\", \"Module name or path\")\n .action(async (action?: string, name?: string) => {\n await modulesCommand({ action, name });\n });\n\nconst storeCmd = program\n .command(\"store\")\n .description(\"Browse the module marketplace\")\n .action(async () => {\n console.log(LOGO);\n console.log(chalk.green(\" Module Marketplace\\n\"));\n console.log(chalk.dim(\" Loading available modules...\"));\n try {\n const res = await fetch(`${API_URL}/api/modules`);\n if (!res.ok) {\n console.log(chalk.red(` ✗ Failed to load modules: ${res.statusText}\\n`));\n return;\n }\n const data = await res.json() as { modules?: Array<{ slug: string; display_name: string; description: string; version: string; stars?: number }> };\n const mods = data.modules || [];\n if (mods.length === 0) {\n console.log(chalk.yellow(\" No modules available yet.\\n\"));\n return;\n }\n console.log();\n for (const mod of mods) {\n console.log(` ${chalk.green.bold(mod.display_name || mod.slug)} ${chalk.gray(`v${mod.version}`)}${mod.stars ? chalk.gray(` ⭐${mod.stars}`) : \"\"}`);\n console.log(` ${chalk.dim(mod.description)}\\n`);\n }\n } catch {\n console.log(chalk.dim(\" (Marketplace offline — browse at threatcrush.com/store)\\n\"));\n }\n });\n\nstoreCmd\n .command(\"search <query>\")\n .description(\"Search for modules in the store\")\n .action(async (query: string) => {\n console.log(LOGO);\n console.log(chalk.green(` Searching for \"${query}\"...\\n`));\n try {\n const res = await fetch(`${API_URL}/api/modules?q=${encodeURIComponent(query)}`);\n if (!res.ok) {\n console.log(chalk.red(` ✗ Search failed: ${res.statusText}\\n`));\n return;\n }\n const data = await res.json() as { modules?: Array<{ slug: string; display_name: string; description: string; version: string }> };\n const mods = data.modules || [];\n if (mods.length === 0) {\n console.log(chalk.yellow(` No modules matching \"${query}\"\\n`));\n return;\n }\n for (const mod of mods) {\n console.log(` ${chalk.green.bold(mod.display_name || mod.slug)} ${chalk.gray(`v${mod.version}`)}`);\n console.log(` ${chalk.dim(mod.description)}\\n`);\n }\n } catch {\n console.log(chalk.dim(` (Search offline — browse at threatcrush.com/store)\\n`));\n }\n });\n\nstoreCmd\n .command(\"publish <url>\")\n .description(\"Publish a module from a git URL or web URL\")\n .action(async (url: string) => {\n console.log(LOGO);\n\n // 1. Get email\n const configPath = join(homedir(), \".threatcrush\", \"config.json\");\n let email = \"\";\n try {\n const config = JSON.parse(readFileSync(configPath, \"utf-8\"));\n email = config.email || \"\";\n } catch {}\n\n if (!email) {\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n email = await new Promise<string>((resolve) => {\n rl.question(chalk.green(\" Enter your email: \"), (answer) => {\n rl.close();\n resolve(answer.trim());\n });\n });\n\n if (!email || !email.includes(\"@\")) {\n console.log(chalk.red(\"\\n Invalid email.\\n\"));\n return;\n }\n\n // Save email\n try {\n const dir = join(homedir(), \".threatcrush\");\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n writeFileSync(configPath, JSON.stringify({ email }, null, 2));\n console.log(chalk.dim(` Saved email to ${configPath}`));\n } catch {}\n }\n\n console.log(chalk.dim(`\\n Fetching metadata from ${url}...\\n`));\n\n // 2. Fetch metadata\n let meta: Record<string, unknown>;\n try {\n const res = await fetch(`${API_URL}/api/modules/fetch-meta`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ url, git_url: url }),\n });\n if (!res.ok) {\n const err = await res.json().catch(() => ({ error: res.statusText }));\n console.log(chalk.red(` ✗ Failed to fetch metadata: ${(err as Record<string, string>).error}\\n`));\n return;\n }\n meta = await res.json() as Record<string, unknown>;\n } catch (err) {\n console.log(chalk.red(` ✗ Failed to fetch metadata: ${err instanceof Error ? err.message : err}\\n`));\n return;\n }\n\n // 3. Preview\n console.log(chalk.green(\" ── Module Preview ──\\n\"));\n console.log(` ${chalk.bold(\"Name:\")} ${meta.name || chalk.dim(\"(none)\")}`);\n console.log(` ${chalk.bold(\"Display:\")} ${meta.display_name || chalk.dim(\"(none)\")}`);\n console.log(` ${chalk.bold(\"Description:\")} ${meta.description || chalk.dim(\"(none)\")}`);\n console.log(` ${chalk.bold(\"Version:\")} ${meta.version || \"0.1.0\"}`);\n console.log(` ${chalk.bold(\"License:\")} ${meta.license || \"MIT\"}`);\n console.log(` ${chalk.bold(\"Author:\")} ${meta.author_name || chalk.dim(\"(none)\")}`);\n console.log(` ${chalk.bold(\"Homepage:\")} ${meta.homepage_url || chalk.dim(\"(none)\")}`);\n console.log(` ${chalk.bold(\"Git:\")} ${meta.git_url || url}`);\n if (Array.isArray(meta.tags) && meta.tags.length > 0) {\n console.log(` ${chalk.bold(\"Tags:\")} ${(meta.tags as string[]).join(\", \")}`);\n }\n if (meta.stars) {\n console.log(` ${chalk.bold(\"Stars:\")} ⭐ ${meta.stars}`);\n }\n console.log();\n\n // 4. Confirm\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n const confirm = await new Promise<string>((resolve) => {\n rl.question(chalk.yellow(\" Publish this module? (y/N): \"), (answer) => {\n rl.close();\n resolve(answer.trim().toLowerCase());\n });\n });\n\n if (confirm !== \"y\" && confirm !== \"yes\") {\n console.log(chalk.dim(\"\\n Cancelled.\\n\"));\n return;\n }\n\n // 5. Publish\n console.log(chalk.dim(\"\\n Publishing...\"));\n try {\n const res = await fetch(`${API_URL}/api/modules`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n ...meta,\n author_email: email,\n git_url: (meta.git_url as string) || url,\n homepage_url: (meta.homepage_url as string) || url,\n }),\n });\n\n const result = await res.json() as Record<string, unknown>;\n\n if (!res.ok) {\n console.log(chalk.red(`\\n ✗ Publish failed: ${(result as Record<string, string>).error}\\n`));\n return;\n }\n\n const mod = result.module as Record<string, string>;\n const slug = mod?.slug || meta.name;\n console.log(chalk.green(`\\n ✓ Module published!`));\n console.log(chalk.dim(` ${API_URL}/store/${slug}\\n`));\n } catch (err) {\n console.log(chalk.red(`\\n ✗ Publish failed: ${err instanceof Error ? err.message : err}\\n`));\n }\n });\n\n// ─── Organization commands ───\n\nconst orgsCmd = program\n .command(\"orgs\")\n .alias(\"org\")\n .description(\"Manage organizations\")\n .action(async () => {\n await orgsCommand({});\n });\n\norgsCmd\n .command(\"list\")\n .alias(\"ls\")\n .description(\"List your organizations\")\n .action(async () => {\n await orgsCommand({ action: \"list\" });\n });\n\norgsCmd\n .command(\"create <name>\")\n .description(\"Create a new organization\")\n .action(async (name: string) => {\n await orgsCommand({ action: \"create\", name });\n });\n\norgsCmd\n .command(\"use <slug>\")\n .description(\"Switch to an organization\")\n .action(async (slug: string) => {\n await orgsCommand({ action: \"use\", name: slug });\n });\n\n// ─── Server commands ───\n\nconst serversCmd = program\n .command(\"servers\")\n .alias(\"server\")\n .alias(\"srv\")\n .description(\"Manage servers\")\n .action(async (opts) => {\n await serversCommand({ action: opts });\n });\n\nserversCmd\n .command(\"list\")\n .alias(\"ls\")\n .option(\"--org <slug>\", \"Filter by organization slug\")\n .description(\"List servers in current organization\")\n .action(async (opts) => {\n await serversCommand({ action: \"list\", org: opts.org });\n });\n\n// ─── Properties ───\n\nconst propsCmd = program\n .command(\"properties\")\n .alias(\"props\")\n .alias(\"targets\")\n .description(\"Manage scan/pentest targets (properties) in the current org\")\n .action(async () => {\n await propertiesListCommand({});\n });\n\npropsCmd\n .command(\"list\")\n .alias(\"ls\")\n .description(\"List properties in the current org\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"--kind <kind>\", \"Filter by kind (url|api|domain|ip|repo)\")\n .action(async (opts) => {\n await propertiesListCommand({ org: opts.org, kind: opts.kind });\n });\n\npropsCmd\n .command(\"add <name> <target>\")\n .description(\"Add a new property (url, api, domain, ip, or repo)\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-k, --kind <kind>\", \"url | api | domain | ip | repo (auto-detected if omitted)\")\n .option(\"-t, --tag <tags>\", \"Comma-separated tags\")\n .option(\"-d, --description <text>\", \"Description of the property\")\n .option(\"--disabled\", \"Create the property disabled\")\n .action(async (name: string, target: string, opts) => {\n await propertiesAddCommand(name, target, {\n org: opts.org,\n kind: opts.kind,\n tag: opts.tag,\n description: opts.description,\n disabled: opts.disabled,\n });\n });\n\npropsCmd\n .command(\"remove <nameOrId>\")\n .alias(\"rm\")\n .description(\"Delete a property\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-y, --yes\", \"Skip confirmation prompt\")\n .action(async (nameOrId: string, opts) => {\n await propertiesRemoveCommand(nameOrId, { org: opts.org, yes: opts.yes });\n });\n\npropsCmd\n .command(\"run\")\n .description(\"Run a scan or pentest against matching properties\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-t, --type <type>\", \"pentest | scan (default: pentest)\")\n .option(\"-k, --kind <kind>\", \"Limit to a single kind (url|api|domain|ip|repo)\")\n .option(\"-n, --name <name>\", \"Run only the property with this name\")\n .action(async (opts) => {\n await propertiesRunCommand({\n org: opts.org,\n type: opts.type,\n kind: opts.kind,\n name: opts.name,\n });\n });\n\npropsCmd\n .command(\"runs\")\n .alias(\"history\")\n .description(\"Show recent scan/pentest run history\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-p, --property <name>\", \"Show history for a single property\")\n .option(\"-l, --limit <n>\", \"Max runs per property\", \"10\")\n .action(async (opts) => {\n await propertiesRunsCommand({\n org: opts.org,\n property: opts.property,\n limit: parseInt(opts.limit, 10) || 10,\n });\n });\n\npropsCmd\n .command(\"import <file>\")\n .description(\"Bulk-import properties from a .json, .csv, or .tsv file\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-n, --dry-run\", \"Preview without writing\")\n .action(async (file: string, opts) => {\n await propertiesImportCommand(file, { org: opts.org, dryRun: opts.dryRun });\n });\n\n// ─── Connect command ───\n\nprogram\n .command(\"connect\")\n .description(\"Connect to a ThreatCrush server via SSH\")\n .argument(\"[target]\", \"Server name, user@hostname, or hostname\")\n .option(\"--org <slug>\", \"Organization slug\")\n .option(\"-u, --user <user>\", \"SSH username\")\n .option(\"-p, --port <port>\", \"SSH port\", \"22\")\n .option(\"-i, --identity <path>\", \"SSH identity file\")\n .action(async (target, opts) => {\n await connectCommand({\n target,\n org: opts.org,\n user: opts.user,\n port: opts.port,\n identity: opts.identity,\n });\n });\n\nprogram\n .command(\"help\")\n .description(\"Show help for threatcrush or a specific command\")\n .argument(\"[command]\", \"Command to show help for\")\n .action((commandName?: string) => {\n if (!commandName) {\n console.log(LOGO);\n program.outputHelp();\n return;\n }\n const sub = program.commands.find(\n (c) => c.name() === commandName || c.aliases().includes(commandName),\n );\n if (!sub) {\n console.log(chalk.yellow(` Unknown command: ${commandName}\\n`));\n program.outputHelp();\n return;\n }\n sub.outputHelp();\n });\n\n// Default action (no command — smart welcome based on current state)\nprogram.action(() => {\n welcomeCommand();\n});\n\nprogram.parse();\n","import { existsSync, createReadStream, statSync, accessSync, constants } from 'node:fs';\nimport { createInterface } from 'node:readline';\nimport { watch } from 'node:fs';\nimport chalk from 'chalk';\nimport { formatEvent, logger, banner } from '../core/logger.js';\nimport { autoDetectParser, detectAttackPattern, parseAuthLog, parseNginxLog } from '../core/log-parser.js';\nimport { initStateDB, insertEvent } from '../core/state.js';\nimport type { ThreatEvent, EventSeverity, EventCategory } from '../types/events.js';\n\ninterface MonitorOptions {\n module?: string;\n tui?: boolean;\n}\n\ninterface LogWatcher {\n path: string;\n name: string;\n category: EventCategory;\n}\n\nconst LOG_SOURCES: LogWatcher[] = [\n { path: '/var/log/auth.log', name: 'ssh-guard', category: 'auth' },\n { path: '/var/log/secure', name: 'ssh-guard', category: 'auth' },\n { path: '/var/log/nginx/access.log', name: 'log-watcher', category: 'web' },\n { path: '/var/log/syslog', name: 'log-watcher', category: 'system' },\n];\n\nexport async function monitorCommand(options: MonitorOptions): Promise<void> {\n if (options.tui) {\n // Dynamic import to avoid loading blessed when not needed\n const { startDashboard } = await import('../tui/dashboard.js');\n await startDashboard();\n return;\n }\n\n banner();\n logger.info('Starting foreground monitor...');\n\n const moduleFilter = options.module?.split(',').map((m) => m.trim());\n\n // Find log files that exist AND are readable by the current user.\n // Unreadable files would crash the tail stream with EACCES, so skip them\n // up-front instead of dying mid-monitor.\n const availableSources: LogWatcher[] = [];\n const unreadable: LogWatcher[] = [];\n for (const s of LOG_SOURCES) {\n if (moduleFilter && !moduleFilter.includes(s.name)) continue;\n if (!existsSync(s.path)) continue;\n try {\n accessSync(s.path, constants.R_OK);\n availableSources.push(s);\n } catch {\n unreadable.push(s);\n }\n }\n\n if (unreadable.length > 0) {\n logger.warn(`Skipping ${unreadable.length} unreadable log source(s):`);\n for (const s of unreadable) {\n console.log(` ${chalk.yellow('!')} ${chalk.gray(s.path)} (permission denied — add yourself to the 'adm' group or run as root)`);\n }\n console.log();\n }\n\n if (availableSources.length === 0) {\n logger.warn('No readable log files found to monitor.');\n logger.info('Available log paths checked:');\n for (const s of LOG_SOURCES) {\n const exists = existsSync(s.path);\n let readable = false;\n if (exists) {\n try { accessSync(s.path, constants.R_OK); readable = true; } catch { readable = false; }\n }\n const glyph = !exists ? chalk.red('✗ missing') : (readable ? chalk.green('✓ readable') : chalk.yellow('! no read perm'));\n console.log(` ${glyph} ${s.path}`);\n }\n console.log();\n logger.info('Starting demo mode with synthetic events...\\n');\n await runDemoMode();\n return;\n }\n\n try {\n initStateDB();\n } catch {\n // State DB optional for monitoring\n }\n\n logger.info(`Monitoring ${availableSources.length} log source(s):`);\n for (const src of availableSources) {\n console.log(` ${chalk.green('●')} ${chalk.white(src.name.padEnd(14))} → ${chalk.gray(src.path)}`);\n }\n console.log();\n console.log(chalk.gray(' Press Ctrl+C to stop\\n'));\n\n // Tail each log file\n for (const src of availableSources) {\n tailLog(src);\n }\n\n // Keep process alive\n await new Promise(() => {});\n}\n\nfunction tailLog(source: LogWatcher): void {\n const { path, name, category } = source;\n\n // Start reading from end of file\n const stat = statSync(path);\n let position = stat.size;\n\n const checkForNewData = () => {\n try {\n const currentStat = statSync(path);\n if (currentStat.size <= position) {\n if (currentStat.size < position) position = 0; // file rotated\n return;\n }\n\n const stream = createReadStream(path, { start: position, encoding: 'utf-8' });\n stream.on('error', (err) => {\n // Permission or IO error mid-read; log once and stop polling this source.\n logger.warn(`stopped tailing ${path}: ${(err as NodeJS.ErrnoException).code || err.message}`);\n position = currentStat.size;\n });\n const rl = createInterface({ input: stream });\n rl.on('error', () => { /* surfaced via stream 'error' above */ });\n\n rl.on('line', (line) => {\n if (!line.trim()) return;\n processLine(line, name, category);\n });\n\n rl.on('close', () => {\n position = currentStat.size;\n });\n } catch {\n // file may not be readable\n }\n };\n\n // Poll for changes (more reliable than fs.watch for log files)\n setInterval(checkForNewData, 1000);\n}\n\nfunction processLine(line: string, moduleName: string, category: EventCategory): void {\n const parsed = autoDetectParser(line);\n if (!parsed) return;\n\n let severity: EventSeverity = 'info';\n let message = line;\n\n if (parsed.source === 'auth') {\n const authEntry = parseAuthLog(line);\n if (!authEntry) return;\n\n if (/failed password/i.test(authEntry.fields.message)) {\n severity = 'high';\n message = `Failed SSH login for ${authEntry.fields.user || 'unknown'} from ${authEntry.fields.ip || 'unknown'}`;\n } else if (/accepted/i.test(authEntry.fields.message)) {\n severity = 'info';\n message = `SSH login accepted for ${authEntry.fields.user || 'unknown'}`;\n } else if (/invalid user/i.test(authEntry.fields.message)) {\n severity = 'high';\n message = `Invalid SSH user attempt: ${authEntry.fields.user || 'unknown'} from ${authEntry.fields.ip || 'unknown'}`;\n }\n } else if (parsed.source === 'nginx') {\n const nginxEntry = parseNginxLog(line);\n if (!nginxEntry) return;\n\n const status = parseInt(nginxEntry.fields.status);\n const attack = detectAttackPattern(nginxEntry.fields.path);\n\n if (attack) {\n severity = 'critical';\n message = `Attack detected [${attack.toUpperCase()}]: ${nginxEntry.fields.method} ${nginxEntry.fields.path}`;\n } else if (status >= 500) {\n severity = 'medium';\n message = `Server error ${status}: ${nginxEntry.fields.method} ${nginxEntry.fields.path}`;\n } else if (status >= 400) {\n severity = 'low';\n message = `Client error ${status}: ${nginxEntry.fields.method} ${nginxEntry.fields.path}`;\n } else {\n severity = 'info';\n message = `${nginxEntry.fields.method} ${nginxEntry.fields.path} → ${status}`;\n }\n }\n\n const event: ThreatEvent = {\n timestamp: new Date(),\n module: moduleName,\n category,\n severity,\n message,\n source_ip: parsed.fields.ip as string | undefined,\n };\n\n console.log(formatEvent(event.module, event.severity, event.message, event.source_ip));\n\n try {\n insertEvent(event);\n } catch {\n // State DB may not be available\n }\n}\n\nasync function runDemoMode(): Promise<void> {\n const demoEvents: Array<Omit<ThreatEvent, 'timestamp'>> = [\n { module: 'ssh-guard', category: 'auth', severity: 'info', message: 'SSH login accepted for ubuntu', source_ip: '10.0.0.1' },\n { module: 'log-watcher', category: 'web', severity: 'info', message: 'GET /api/health → 200', source_ip: '172.16.0.50' },\n { module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Failed SSH login for root', source_ip: '45.33.22.11' },\n { module: 'log-watcher', category: 'web', severity: 'low', message: 'GET /admin → 404', source_ip: '91.121.44.55' },\n { module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Failed SSH login for admin', source_ip: '45.33.22.11' },\n { module: 'log-watcher', category: 'web', severity: 'critical', message: 'Attack detected [SQLI]: GET /search?q=1%27+OR+1%3D1', source_ip: '185.220.101.44' },\n { module: 'log-watcher', category: 'web', severity: 'medium', message: 'Server error 502: GET /api/users', source_ip: '10.0.0.2' },\n { module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Invalid SSH user attempt: admin123', source_ip: '103.77.88.99' },\n { module: 'log-watcher', category: 'web', severity: 'critical', message: 'Attack detected [PATH_TRAVERSAL]: GET /../../etc/passwd', source_ip: '185.220.101.44' },\n { module: 'ssh-guard', category: 'auth', severity: 'high', message: 'Brute force detected — 6 failures in 45s', source_ip: '45.33.22.11' },\n { module: 'log-watcher', category: 'system', severity: 'medium', message: 'Unusual outbound connection to 198.51.100.1:4444', source_ip: '198.51.100.1' },\n { module: 'log-watcher', category: 'web', severity: 'info', message: 'GET /index.html → 200', source_ip: '172.16.0.51' },\n ];\n\n let i = 0;\n const interval = setInterval(() => {\n const event = demoEvents[i % demoEvents.length];\n console.log(formatEvent(event.module, event.severity, event.message, event.source_ip));\n i++;\n }, 1500 + Math.random() * 2000);\n\n process.on('SIGINT', () => {\n clearInterval(interval);\n console.log(chalk.gray('\\n Monitor stopped.'));\n process.exit(0);\n });\n\n await new Promise(() => {});\n}\n","import chalk from 'chalk';\nimport type { EventSeverity } from '../types/events.js';\n\nconst SEVERITY_COLORS: Record<EventSeverity, (s: string) => string> = {\n info: chalk.green,\n low: chalk.cyan,\n medium: chalk.yellow,\n high: chalk.red,\n critical: chalk.bgRed.white.bold,\n};\n\nconst LEVEL_COLORS: Record<string, (s: string) => string> = {\n debug: chalk.gray,\n info: chalk.green,\n warn: chalk.yellow,\n error: chalk.red,\n};\n\nexport function severityColor(severity: EventSeverity, text: string): string {\n return (SEVERITY_COLORS[severity] || chalk.white)(text);\n}\n\nexport function formatTimestamp(date: Date = new Date()): string {\n return chalk.gray(date.toISOString().replace('T', ' ').slice(0, 19));\n}\n\nexport function formatEvent(\n module: string,\n severity: EventSeverity,\n message: string,\n ip?: string,\n): string {\n const ts = formatTimestamp();\n const sev = severityColor(severity, `[${severity.toUpperCase()}]`.padEnd(10));\n const mod = chalk.cyan(`[${module}]`.padEnd(14));\n const src = ip ? chalk.magenta(` (${ip})`) : '';\n return `${ts} ${sev} ${mod} ${message}${src}`;\n}\n\nexport const logger = {\n debug: (msg: string) => console.log(`${formatTimestamp()} ${LEVEL_COLORS.debug('[DEBUG]')} ${msg}`),\n info: (msg: string) => console.log(`${formatTimestamp()} ${LEVEL_COLORS.info('[INFO]')} ${msg}`),\n warn: (msg: string) => console.log(`${formatTimestamp()} ${LEVEL_COLORS.warn('[WARN]')} ${msg}`),\n error: (msg: string) => console.error(`${formatTimestamp()} ${LEVEL_COLORS.error('[ERROR]')} ${msg}`),\n success: (msg: string) => console.log(`${formatTimestamp()} ${chalk.green('[OK]')} ${msg}`),\n threat: (msg: string, ip?: string) => {\n const src = ip ? chalk.magenta(` from ${ip}`) : '';\n console.log(`${formatTimestamp()} ${chalk.red.bold('[THREAT]')} ${chalk.red(msg)}${src}`);\n },\n};\n\nexport function banner(): void {\n console.log(chalk.green.bold(`\n ████████╗██╗ ██╗██████╗ ███████╗ █████╗ ████████╗ ██████╗██████╗ ██╗ ██╗███████╗██╗ ██╗\n ╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗╚══██╔══╝██╔════╝██╔══██╗██║ ██║██╔════╝██║ ██║\n ██║ ███████║██████╔╝█████╗ ███████║ ██║ ██║ ██████╔╝██║ ██║███████╗███████║\n ██║ ██╔══██║██╔══██╗██╔══╝ ██╔══██║ ██║ ██║ ██╔══██╗██║ ██║╚════██║██╔══██║\n ██║ ██║ ██║██║ ██║███████╗██║ ██║ ██║ ╚██████╗██║ ██║╚██████╔╝███████║██║ ██║\n ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝\n `));\n console.log(chalk.gray(' All-in-one security agent daemon — v0.1.0\\n'));\n}\n","import type { ParsedLogLine, NginxLogEntry, AuthLogEntry, SyslogEntry } from '../types/events.js';\n\n// Nginx combined log format:\n// 127.0.0.1 - - [04/Apr/2026:12:00:00 +0000] \"GET /path HTTP/1.1\" 200 1234 \"-\" \"Mozilla/5.0\"\nconst NGINX_REGEX = /^(\\S+) \\S+ \\S+ \\[([^\\]]+)\\] \"(\\S+) (\\S+) \\S+\" (\\d{3}) (\\d+) \"[^\"]*\" \"([^\"]*)\"/;\n\n// Auth.log format:\n// Apr 4 12:00:00 hostname sshd[1234]: Failed password for user from 1.2.3.4 port 22 ssh2\nconst AUTH_REGEX = /^(\\w+\\s+\\d+\\s+[\\d:]+)\\s+\\S+\\s+(\\S+?)(?:\\[\\d+\\])?:\\s+(.*)/;\n\n// Syslog format:\n// Apr 4 12:00:00 hostname process[pid]: message\nconst SYSLOG_REGEX = /^(\\w+\\s+\\d+\\s+[\\d:]+)\\s+\\S+\\s+(\\S+?)(?:\\[\\d+\\])?:\\s+(.*)/;\n\n// Extract IP from auth messages\nconst IP_REGEX = /(?:from|FROM)\\s+(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})/;\nconst INVALID_USER_REGEX = /(?:for\\s+invalid\\s+user)\\s+(\\S+?)(?:\\s+from|\\s*$)/;\nconst USER_REGEX = /(?:for|user)\\s+(\\S+?)(?:\\s+from|\\s*$)/;\n\n// Attack pattern signatures\nexport const ATTACK_PATTERNS = {\n sqli: [\n /(?:union\\s+(?:all\\s+)?select)/i,\n /(?:select\\s+.*\\s+from\\s+)/i,\n /(?:insert\\s+into\\s+)/i,\n /(?:drop\\s+(?:table|database))/i,\n /(?:or\\s+1\\s*=\\s*1)/i,\n /(?:'\\s*(?:or|and)\\s+')/i,\n /(?:--\\s*$|;\\s*--)/,\n /(?:\\/\\*.*\\*\\/)/,\n ],\n xss: [\n /<script[^>]*>/i,\n /javascript\\s*:/i,\n /on(?:load|error|click|mouseover)\\s*=/i,\n /eval\\s*\\(/i,\n /document\\.(?:cookie|write|location)/i,\n ],\n path_traversal: [\n /\\.\\.\\//,\n /\\.\\.\\\\/, \n /etc\\/(?:passwd|shadow|hosts)/,\n /proc\\/self/,\n /windows\\/system32/i,\n ],\n rfi: [\n /(?:https?|ftp):\\/\\/.*\\?/i,\n /php:\\/\\/(?:input|filter)/i,\n /data:\\/\\//i,\n ],\n};\n\nexport function parseNginxLog(line: string): NginxLogEntry | null {\n const match = line.match(NGINX_REGEX);\n if (!match) return null;\n\n return {\n timestamp: parseNginxTimestamp(match[2]),\n raw: line,\n source: 'nginx',\n fields: {\n ip: match[1],\n method: match[3],\n path: match[4],\n status: match[5],\n size: match[6],\n user_agent: match[7],\n },\n };\n}\n\nexport function parseAuthLog(line: string): AuthLogEntry | null {\n const match = line.match(AUTH_REGEX);\n if (!match) return null;\n\n const ipMatch = match[3].match(IP_REGEX);\n const userMatch = match[3].match(INVALID_USER_REGEX) || match[3].match(USER_REGEX);\n\n return {\n timestamp: parseSyslogTimestamp(match[1]),\n raw: line,\n source: 'auth',\n fields: {\n process: match[2],\n message: match[3],\n ip: ipMatch?.[1],\n user: userMatch?.[1],\n },\n };\n}\n\nexport function parseSyslog(line: string): SyslogEntry | null {\n const match = line.match(SYSLOG_REGEX);\n if (!match) return null;\n\n return {\n timestamp: parseSyslogTimestamp(match[1]),\n raw: line,\n source: 'syslog',\n fields: {\n facility: 'syslog',\n process: match[2],\n message: match[3],\n },\n };\n}\n\nexport function detectAttackPattern(path: string): string | null {\n // nginx logs the request URI URL-encoded, so raw signatures like `<script`\n // or `or 1=1` never match an encoded payload (e.g. `%3Cscript%3E`,\n // `%27%20OR%201=1`). Test the raw value AND its URL-decoded forms so that\n // single- and double-encoded payloads are still caught. decodeURIComponent\n // throws on a malformed `%` sequence, so guard each decode.\n const candidates = new Set<string>([path]);\n let current = path;\n for (let i = 0; i < 2; i++) {\n let decoded: string | null = null;\n try {\n decoded = decodeURIComponent(current);\n } catch {\n decoded = null;\n }\n if (decoded === null || decoded === current) break;\n candidates.add(decoded);\n current = decoded;\n }\n\n for (const [type, patterns] of Object.entries(ATTACK_PATTERNS)) {\n for (const pattern of patterns) {\n for (const candidate of candidates) {\n if (pattern.test(candidate)) {\n return type;\n }\n }\n }\n }\n return null;\n}\n\nexport function autoDetectParser(line: string): ParsedLogLine | null {\n // Try nginx first (most specific format)\n const nginx = parseNginxLog(line);\n if (nginx) return nginx;\n\n // Try auth log\n const auth = parseAuthLog(line);\n if (auth) return auth;\n\n // Fall back to generic syslog\n return parseSyslog(line);\n}\n\nfunction parseNginxTimestamp(s: string): Date {\n // \"04/Apr/2026:12:00:00 +0000\"\n // new Date(<unparseable>) returns an Invalid Date instead of throwing, so the\n // old try/catch never triggered and an Invalid Date leaked into downstream\n // time-window logic. Check getTime() explicitly and fall back to now.\n const cleaned = s.replace(/(\\d{2})\\/(\\w{3})\\/(\\d{4}):/, '$2 $1, $3 ');\n const d = new Date(cleaned);\n return Number.isNaN(d.getTime()) ? new Date() : d;\n}\n\nfunction parseSyslogTimestamp(s: string): Date {\n // \"Apr 4 12:00:00\" — no year. Assume the most recent year that is not in the\n // future, so a December log parsed in early January is dated to the previous\n // year rather than the current one.\n const now = new Date();\n let d = new Date(`${s} ${now.getFullYear()}`);\n if (Number.isNaN(d.getTime())) return now;\n if (d.getTime() > now.getTime()) {\n const prev = new Date(`${s} ${now.getFullYear() - 1}`);\n if (!Number.isNaN(prev.getTime())) d = prev;\n }\n return d;\n}\n","import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { banner, logger } from '../core/logger.js';\nimport type { RunResult, StructuredFinding } from '../core/run-result.js';\nimport { summarize } from '../core/run-result.js';\nimport { scanDependencies } from '../scan/dependencies.js';\nimport { meetsFailThreshold, scanPath } from '../scan/engine.js';\nimport { buildSarif } from '../scan/sarif.js';\nimport type { ScanFinding, Severity } from '../scan/types.js';\nimport { SEVERITY_ORDER } from '../scan/types.js';\n\nexport type ScanFormat = 'text' | 'json' | 'sarif';\n\nexport interface ScanCommandOptions {\n /**\n * `text` for humans, `sarif` for the Security tab and coverage validators,\n * `json` for anything else. Non-text formats put the payload on stdout (or\n * `--output`) and every human line on stderr, so\n * `threatcrush scan --format sarif > out.sarif` produces a valid file.\n */\n format?: ScanFormat;\n /** Write the machine-readable payload here instead of stdout. */\n output?: string;\n /** Exit non-zero when a finding at or above one of these severities exists. */\n failOn?: readonly Severity[];\n /** Prefix prepended to SARIF URIs when the scan root is not the repo root. */\n pathPrefix?: string;\n /** Print the paths that could not be read, not just the count. */\n verbose?: boolean;\n /**\n * Query OSV.dev for advisories against the resolved lockfile versions.\n * Off by default in the CLI because it is the only part of a scan that\n * needs the network — a CI job should opt in deliberately rather than\n * discover the dependency mid-run.\n */\n dependencies?: boolean;\n}\n\ninterface ScanOutcome {\n result: RunResult;\n findings: ScanFinding[];\n filesScanned: number;\n unreadable: string[];\n suppressed: number;\n root: string;\n}\n\nfunction readVersion(): string {\n for (const candidate of [\n join(__dirname, '..', 'package.json'),\n join(__dirname, '..', '..', 'package.json'),\n ]) {\n try {\n return (\n (JSON.parse(readFileSync(candidate, 'utf-8')) as { version?: string }).version ?? '0.0.0'\n );\n } catch {\n /* try the next candidate */\n }\n }\n return '0.0.0';\n}\n\nconst PKG_VERSION = readVersion();\n\n/** Parse `--fail-on critical,high` into severities, rejecting unknown names. */\nexport function parseFailOn(raw: string | undefined): Severity[] {\n if (!raw) return [];\n const requested = raw\n .split(',')\n .map((part) => part.trim().toLowerCase())\n .filter(Boolean);\n\n const unknown = requested.filter((name) => !SEVERITY_ORDER.includes(name as Severity));\n if (unknown.length > 0) {\n throw new Error(\n `unknown severity in --fail-on: ${unknown.join(', ')} (expected ${SEVERITY_ORDER.join(', ')})`,\n );\n }\n return requested as Severity[];\n}\n\nfunction toRunResult(\n targetPath: string,\n findings: readonly ScanFinding[],\n filesScanned: number,\n): RunResult {\n const structured: StructuredFinding[] = findings.map((finding) => ({\n type: finding.title,\n severity: finding.severity,\n message: finding.message,\n location: `${finding.file}:${finding.line}`,\n details: {\n file: finding.file,\n line: finding.line,\n snippet: finding.excerpt,\n ruleId: finding.ruleId,\n confidence: finding.confidence,\n ...(finding.cwe ? { cwe: finding.cwe } : {}),\n },\n }));\n const counts = summarize(structured);\n\n return {\n type: 'scan',\n target: targetPath,\n findings: structured,\n severity_summary: counts,\n summary:\n findings.length === 0\n ? `No issues found across ${filesScanned} files`\n : `${findings.length} issue(s): ${counts.critical}C ${counts.high}H ${counts.medium}M ${counts.low}L`,\n };\n}\n\nfunction failedResult(targetPath: string, message: string): RunResult {\n return {\n type: 'scan',\n target: targetPath,\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: `Scan failed: ${message}`,\n error: message,\n };\n}\n\n/**\n * Non-interactive scan used by the daemon and the runs worker.\n *\n * Includes dependency advisories, as it always has — the daemon runs on a\n * schedule against a server it can reach the network from, and an advisory\n * published since the last run is the main thing that changed.\n */\nexport async function runScan(targetPath: string): Promise<RunResult> {\n try {\n const report = scanPath(targetPath);\n const findings = [...report.findings, ...(await scanDependencies(targetPath))];\n return toRunResult(targetPath, findings, report.filesScanned);\n } catch (err) {\n return failedResult(targetPath, (err as Error).message);\n }\n}\n\nexport async function scanCommand(\n targetPath: string,\n options: ScanCommandOptions = {},\n): Promise<RunResult> {\n const format = options.format ?? 'text';\n const machineReadable = format !== 'text';\n // Human output goes to stderr whenever stdout is carrying a payload. A\n // banner in the middle of a SARIF document is exactly how \"the scan worked\n // but the pipeline reports zero findings\" happens.\n const say = machineReadable\n ? (line: string) => process.stderr.write(`${line}\\n`)\n : (line: string) => process.stdout.write(`${line}\\n`);\n\n if (!existsSync(targetPath)) {\n say(chalk.red(`Scan target does not exist: ${targetPath}`));\n process.exitCode = 2;\n return failedResult(targetPath, `no such path: ${targetPath}`);\n }\n\n if (!machineReadable) {\n banner();\n logger.info(`Scanning ${chalk.white(targetPath)} for security issues...\\n`);\n }\n\n const spinner = machineReadable ? null : ora({ text: 'Scanning files...', color: 'green' }).start();\n\n let outcome: ScanOutcome;\n try {\n let seen = 0;\n const report = scanPath(targetPath, {\n onFile: () => {\n seen += 1;\n if (spinner) spinner.text = `Scanning files... (${seen} files)`;\n },\n });\n if (options.dependencies) {\n if (spinner) spinner.text = 'Querying OSV.dev for dependency advisories...';\n report.findings.push(...(await scanDependencies(targetPath)));\n }\n outcome = {\n result: toRunResult(targetPath, report.findings, report.filesScanned),\n findings: report.findings,\n filesScanned: report.filesScanned,\n unreadable: report.unreadable,\n suppressed: report.suppressed,\n root: report.root,\n };\n } catch (err) {\n spinner?.fail(`Scan failed: ${(err as Error).message}`);\n process.exitCode = 2;\n return failedResult(targetPath, (err as Error).message);\n }\n\n spinner?.succeed(`Scanned ${outcome.filesScanned} files\\n`);\n\n if (outcome.unreadable.length > 0) {\n // Surfaced, never swallowed. An unexamined file is not a clean one, and a\n // scanner that hides read failures reports silence as safety.\n say(\n chalk.yellow(\n ` ! ${outcome.unreadable.length} path(s) could not be read and were NOT scanned`,\n ),\n );\n if (options.verbose) {\n for (const path of outcome.unreadable) say(chalk.gray(` ${path}`));\n }\n }\n\n if (outcome.suppressed > 0) {\n say(\n chalk.gray(\n ` · ${outcome.suppressed} finding(s) suppressed by inline threatcrush-disable comments`,\n ),\n );\n }\n\n if (machineReadable) {\n emitMachineReadable(format, outcome, targetPath, options, say);\n } else {\n printHuman(outcome);\n }\n\n const failOn = options.failOn ?? [];\n if (meetsFailThreshold(outcome.findings, failOn)) {\n say(\n chalk.red(\n `\\n ✗ findings at or above ${[...failOn].join('/')} — failing as requested by --fail-on`,\n ),\n );\n process.exitCode = 1;\n }\n\n return outcome.result;\n}\n\nfunction emitMachineReadable(\n format: ScanFormat,\n outcome: ScanOutcome,\n targetPath: string,\n options: ScanCommandOptions,\n say: (line: string) => void,\n): void {\n const payload =\n format === 'sarif'\n ? buildSarif(outcome.findings, {\n toolVersion: PKG_VERSION,\n pathPrefix: options.pathPrefix,\n // Relative to the working directory, NOT the scan root. `threatcrush\n // scan vulns` from a repo root must emit `vulns/secrets/x.env`, not\n // `secrets/x.env` — the second form matches nothing in the\n // consumer's view of the repository, so every finding lands\n // \"outside\" whatever it scoped to and a working scan reads as 0%.\n // This is the single most expensive mistake in the whole pipeline\n // and it fails silently. `--path-prefix` covers the remaining case:\n // a scan run from inside the subdirectory it is scanning.\n base: process.cwd(),\n root: resolve(outcome.root),\n })\n : {\n tool: 'threatcrush',\n version: PKG_VERSION,\n target: targetPath,\n filesScanned: outcome.filesScanned,\n unreadable: outcome.unreadable,\n suppressed: outcome.suppressed,\n summary: outcome.result.severity_summary,\n findings: outcome.findings,\n };\n\n const serialized = `${JSON.stringify(payload, null, 2)}\\n`;\n\n if (options.output) {\n mkdirSync(dirname(resolve(options.output)), { recursive: true });\n writeFileSync(options.output, serialized, 'utf-8');\n say(\n chalk.gray(\n ` ${format.toUpperCase()} written to ${options.output} (${outcome.findings.length} finding(s))`,\n ),\n );\n return;\n }\n process.stdout.write(serialized);\n}\n\nfunction printHuman(outcome: ScanOutcome): void {\n const { findings, filesScanned } = outcome;\n\n if (findings.length === 0) {\n console.log(chalk.green.bold(' ✓ No security issues found!'));\n console.log();\n return;\n }\n\n const counts = outcome.result.severity_summary;\n console.log(chalk.white.bold(' Scan Results'));\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log(\n ` ${chalk.red.bold(counts.critical + ' critical')} ` +\n `${chalk.red(counts.high + ' high')} ` +\n `${chalk.yellow(counts.medium + ' medium')} ` +\n `${chalk.gray(counts.low + ' low')}`,\n );\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log();\n\n for (const finding of findings) {\n const label = finding.severity.toUpperCase();\n const badge =\n finding.severity === 'critical'\n ? chalk.bgRed.white.bold(` ${label} `)\n : finding.severity === 'high'\n ? chalk.red(`[${label}]`)\n : finding.severity === 'medium'\n ? chalk.yellow(`[${label}]`)\n : chalk.gray(`[${label}]`);\n\n console.log(` ${badge} ${chalk.white.bold(finding.title)}`);\n console.log(\n ` ${chalk.gray('File:')} ${chalk.cyan(finding.file)}:${chalk.yellow(String(finding.line))}`,\n );\n console.log(` ${chalk.gray('Info:')} ${finding.message}`);\n if (finding.consequence) {\n console.log(` ${chalk.gray('Risk:')} ${chalk.dim(finding.consequence)}`);\n }\n if (finding.excerpt) {\n console.log(` ${chalk.gray('Code:')} ${finding.excerpt}`);\n }\n console.log(\n ` ${chalk.gray('Rule:')} ${chalk.dim(finding.ruleId)}` +\n (finding.cwe ? chalk.dim(` · ${finding.cwe}`) : '') +\n chalk.dim(` · confidence: ${finding.confidence}`),\n );\n console.log();\n }\n\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log(\n ` ${chalk.white.bold(`${findings.length} issue(s) found`)} across ${filesScanned} files`,\n );\n console.log();\n}\n","import process from 'node:process';\nimport chalk from 'chalk';\nimport cliCursor from 'cli-cursor';\nimport cliSpinners from 'cli-spinners';\nimport logSymbols from 'log-symbols';\nimport stripAnsi from 'strip-ansi';\nimport stringWidth from 'string-width';\nimport isInteractive from 'is-interactive';\nimport isUnicodeSupported from 'is-unicode-supported';\nimport stdinDiscarder from 'stdin-discarder';\n\nclass Ora {\n\t#linesToClear = 0;\n\t#isDiscardingStdin = false;\n\t#lineCount = 0;\n\t#frameIndex = -1;\n\t#lastSpinnerFrameTime = 0;\n\t#options;\n\t#spinner;\n\t#stream;\n\t#id;\n\t#initialInterval;\n\t#isEnabled;\n\t#isSilent;\n\t#indent;\n\t#text;\n\t#prefixText;\n\t#suffixText;\n\tcolor;\n\n\tconstructor(options) {\n\t\tif (typeof options === 'string') {\n\t\t\toptions = {\n\t\t\t\ttext: options,\n\t\t\t};\n\t\t}\n\n\t\tthis.#options = {\n\t\t\tcolor: 'cyan',\n\t\t\tstream: process.stderr,\n\t\t\tdiscardStdin: true,\n\t\t\thideCursor: true,\n\t\t\t...options,\n\t\t};\n\n\t\t// Public\n\t\tthis.color = this.#options.color;\n\n\t\t// It's important that these use the public setters.\n\t\tthis.spinner = this.#options.spinner;\n\n\t\tthis.#initialInterval = this.#options.interval;\n\t\tthis.#stream = this.#options.stream;\n\t\tthis.#isEnabled = typeof this.#options.isEnabled === 'boolean' ? this.#options.isEnabled : isInteractive({stream: this.#stream});\n\t\tthis.#isSilent = typeof this.#options.isSilent === 'boolean' ? this.#options.isSilent : false;\n\n\t\t// Set *after* `this.#stream`.\n\t\t// It's important that these use the public setters.\n\t\tthis.text = this.#options.text;\n\t\tthis.prefixText = this.#options.prefixText;\n\t\tthis.suffixText = this.#options.suffixText;\n\t\tthis.indent = this.#options.indent;\n\n\t\tif (process.env.NODE_ENV === 'test') {\n\t\t\tthis._stream = this.#stream;\n\t\t\tthis._isEnabled = this.#isEnabled;\n\n\t\t\tObject.defineProperty(this, '_linesToClear', {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#linesToClear;\n\t\t\t\t},\n\t\t\t\tset(newValue) {\n\t\t\t\t\tthis.#linesToClear = newValue;\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tObject.defineProperty(this, '_frameIndex', {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#frameIndex;\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tObject.defineProperty(this, '_lineCount', {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#lineCount;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\tget indent() {\n\t\treturn this.#indent;\n\t}\n\n\tset indent(indent = 0) {\n\t\tif (!(indent >= 0 && Number.isInteger(indent))) {\n\t\t\tthrow new Error('The `indent` option must be an integer from 0 and up');\n\t\t}\n\n\t\tthis.#indent = indent;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget interval() {\n\t\treturn this.#initialInterval ?? this.#spinner.interval ?? 100;\n\t}\n\n\tget spinner() {\n\t\treturn this.#spinner;\n\t}\n\n\tset spinner(spinner) {\n\t\tthis.#frameIndex = -1;\n\t\tthis.#initialInterval = undefined;\n\n\t\tif (typeof spinner === 'object') {\n\t\t\tif (spinner.frames === undefined) {\n\t\t\t\tthrow new Error('The given spinner must have a `frames` property');\n\t\t\t}\n\n\t\t\tthis.#spinner = spinner;\n\t\t} else if (!isUnicodeSupported()) {\n\t\t\tthis.#spinner = cliSpinners.line;\n\t\t} else if (spinner === undefined) {\n\t\t\t// Set default spinner\n\t\t\tthis.#spinner = cliSpinners.dots;\n\t\t} else if (spinner !== 'default' && cliSpinners[spinner]) {\n\t\t\tthis.#spinner = cliSpinners[spinner];\n\t\t} else {\n\t\t\tthrow new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);\n\t\t}\n\t}\n\n\tget text() {\n\t\treturn this.#text;\n\t}\n\n\tset text(value = '') {\n\t\tthis.#text = value;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget prefixText() {\n\t\treturn this.#prefixText;\n\t}\n\n\tset prefixText(value = '') {\n\t\tthis.#prefixText = value;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget suffixText() {\n\t\treturn this.#suffixText;\n\t}\n\n\tset suffixText(value = '') {\n\t\tthis.#suffixText = value;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget isSpinning() {\n\t\treturn this.#id !== undefined;\n\t}\n\n\t#getFullPrefixText(prefixText = this.#prefixText, postfix = ' ') {\n\t\tif (typeof prefixText === 'string' && prefixText !== '') {\n\t\t\treturn prefixText + postfix;\n\t\t}\n\n\t\tif (typeof prefixText === 'function') {\n\t\t\treturn prefixText() + postfix;\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t#getFullSuffixText(suffixText = this.#suffixText, prefix = ' ') {\n\t\tif (typeof suffixText === 'string' && suffixText !== '') {\n\t\t\treturn prefix + suffixText;\n\t\t}\n\n\t\tif (typeof suffixText === 'function') {\n\t\t\treturn prefix + suffixText();\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t#updateLineCount() {\n\t\tconst columns = this.#stream.columns ?? 80;\n\t\tconst fullPrefixText = this.#getFullPrefixText(this.#prefixText, '-');\n\t\tconst fullSuffixText = this.#getFullSuffixText(this.#suffixText, '-');\n\t\tconst fullText = ' '.repeat(this.#indent) + fullPrefixText + '--' + this.#text + '--' + fullSuffixText;\n\n\t\tthis.#lineCount = 0;\n\t\tfor (const line of stripAnsi(fullText).split('\\n')) {\n\t\t\tthis.#lineCount += Math.max(1, Math.ceil(stringWidth(line, {countAnsiEscapeCodes: true}) / columns));\n\t\t}\n\t}\n\n\tget isEnabled() {\n\t\treturn this.#isEnabled && !this.#isSilent;\n\t}\n\n\tset isEnabled(value) {\n\t\tif (typeof value !== 'boolean') {\n\t\t\tthrow new TypeError('The `isEnabled` option must be a boolean');\n\t\t}\n\n\t\tthis.#isEnabled = value;\n\t}\n\n\tget isSilent() {\n\t\treturn this.#isSilent;\n\t}\n\n\tset isSilent(value) {\n\t\tif (typeof value !== 'boolean') {\n\t\t\tthrow new TypeError('The `isSilent` option must be a boolean');\n\t\t}\n\n\t\tthis.#isSilent = value;\n\t}\n\n\tframe() {\n\t\t// Ensure we only update the spinner frame at the wanted interval,\n\t\t// even if the render method is called more often.\n\t\tconst now = Date.now();\n\t\tif (this.#frameIndex === -1 || now - this.#lastSpinnerFrameTime >= this.interval) {\n\t\t\tthis.#frameIndex = ++this.#frameIndex % this.#spinner.frames.length;\n\t\t\tthis.#lastSpinnerFrameTime = now;\n\t\t}\n\n\t\tconst {frames} = this.#spinner;\n\t\tlet frame = frames[this.#frameIndex];\n\n\t\tif (this.color) {\n\t\t\tframe = chalk[this.color](frame);\n\t\t}\n\n\t\tconst fullPrefixText = (typeof this.#prefixText === 'string' && this.#prefixText !== '') ? this.#prefixText + ' ' : '';\n\t\tconst fullText = typeof this.text === 'string' ? ' ' + this.text : '';\n\t\tconst fullSuffixText = (typeof this.#suffixText === 'string' && this.#suffixText !== '') ? ' ' + this.#suffixText : '';\n\n\t\treturn fullPrefixText + frame + fullText + fullSuffixText;\n\t}\n\n\tclear() {\n\t\tif (!this.#isEnabled || !this.#stream.isTTY) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.#stream.cursorTo(0);\n\n\t\tfor (let index = 0; index < this.#linesToClear; index++) {\n\t\t\tif (index > 0) {\n\t\t\t\tthis.#stream.moveCursor(0, -1);\n\t\t\t}\n\n\t\t\tthis.#stream.clearLine(1);\n\t\t}\n\n\t\tif (this.#indent || this.lastIndent !== this.#indent) {\n\t\t\tthis.#stream.cursorTo(this.#indent);\n\t\t}\n\n\t\tthis.lastIndent = this.#indent;\n\t\tthis.#linesToClear = 0;\n\n\t\treturn this;\n\t}\n\n\trender() {\n\t\tif (this.#isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.clear();\n\t\tthis.#stream.write(this.frame());\n\t\tthis.#linesToClear = this.#lineCount;\n\n\t\treturn this;\n\t}\n\n\tstart(text) {\n\t\tif (text) {\n\t\t\tthis.text = text;\n\t\t}\n\n\t\tif (this.#isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif (!this.#isEnabled) {\n\t\t\tif (this.text) {\n\t\t\t\tthis.#stream.write(`- ${this.text}\\n`);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this.isSpinning) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this.#options.hideCursor) {\n\t\t\tcliCursor.hide(this.#stream);\n\t\t}\n\n\t\tif (this.#options.discardStdin && process.stdin.isTTY) {\n\t\t\tthis.#isDiscardingStdin = true;\n\t\t\tstdinDiscarder.start();\n\t\t}\n\n\t\tthis.render();\n\t\tthis.#id = setInterval(this.render.bind(this), this.interval);\n\n\t\treturn this;\n\t}\n\n\tstop() {\n\t\tif (!this.#isEnabled) {\n\t\t\treturn this;\n\t\t}\n\n\t\tclearInterval(this.#id);\n\t\tthis.#id = undefined;\n\t\tthis.#frameIndex = 0;\n\t\tthis.clear();\n\t\tif (this.#options.hideCursor) {\n\t\t\tcliCursor.show(this.#stream);\n\t\t}\n\n\t\tif (this.#options.discardStdin && process.stdin.isTTY && this.#isDiscardingStdin) {\n\t\t\tstdinDiscarder.stop();\n\t\t\tthis.#isDiscardingStdin = false;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsucceed(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.success, text});\n\t}\n\n\tfail(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.error, text});\n\t}\n\n\twarn(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.warning, text});\n\t}\n\n\tinfo(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.info, text});\n\t}\n\n\tstopAndPersist(options = {}) {\n\t\tif (this.#isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst prefixText = options.prefixText ?? this.#prefixText;\n\t\tconst fullPrefixText = this.#getFullPrefixText(prefixText, ' ');\n\n\t\tconst symbolText = options.symbol ?? ' ';\n\n\t\tconst text = options.text ?? this.text;\n\t\tconst separatorText = symbolText ? ' ' : '';\n\t\tconst fullText = (typeof text === 'string') ? separatorText + text : '';\n\n\t\tconst suffixText = options.suffixText ?? this.#suffixText;\n\t\tconst fullSuffixText = this.#getFullSuffixText(suffixText, ' ');\n\n\t\tconst textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + '\\n';\n\n\t\tthis.stop();\n\t\tthis.#stream.write(textToWrite);\n\n\t\treturn this;\n\t}\n}\n\nexport default function ora(options) {\n\treturn new Ora(options);\n}\n\nexport async function oraPromise(action, options) {\n\tconst actionIsFunction = typeof action === 'function';\n\tconst actionIsPromise = typeof action.then === 'function';\n\n\tif (!actionIsFunction && !actionIsPromise) {\n\t\tthrow new TypeError('Parameter `action` must be a Function or a Promise');\n\t}\n\n\tconst {successText, failText} = typeof options === 'object'\n\t\t? options\n\t\t: {successText: undefined, failText: undefined};\n\n\tconst spinner = ora(options).start();\n\n\ttry {\n\t\tconst promise = actionIsFunction ? action(spinner) : action;\n\t\tconst result = await promise;\n\n\t\tspinner.succeed(\n\t\t\tsuccessText === undefined\n\t\t\t\t? undefined\n\t\t\t\t: (typeof successText === 'string' ? successText : successText(result)),\n\t\t);\n\n\t\treturn result;\n\t} catch (error) {\n\t\tspinner.fail(\n\t\t\tfailText === undefined\n\t\t\t\t? undefined\n\t\t\t\t: (typeof failText === 'string' ? failText : failText(error)),\n\t\t);\n\n\t\tthrow error;\n\t}\n}\n\nexport {default as spinners} from 'cli-spinners';\n","import process from 'node:process';\nimport restoreCursor from 'restore-cursor';\n\nlet isHidden = false;\n\nconst cliCursor = {};\n\ncliCursor.show = (writableStream = process.stderr) => {\n\tif (!writableStream.isTTY) {\n\t\treturn;\n\t}\n\n\tisHidden = false;\n\twritableStream.write('\\u001B[?25h');\n};\n\ncliCursor.hide = (writableStream = process.stderr) => {\n\tif (!writableStream.isTTY) {\n\t\treturn;\n\t}\n\n\trestoreCursor();\n\tisHidden = true;\n\twritableStream.write('\\u001B[?25l');\n};\n\ncliCursor.toggle = (force, writableStream) => {\n\tif (force !== undefined) {\n\t\tisHidden = force;\n\t}\n\n\tif (isHidden) {\n\t\tcliCursor.show(writableStream);\n\t} else {\n\t\tcliCursor.hide(writableStream);\n\t}\n};\n\nexport default cliCursor;\n","import process from 'node:process';\nimport onetime from 'onetime';\nimport {onExit} from 'signal-exit';\n\nconst terminal = process.stderr.isTTY\n\t? process.stderr\n\t: (process.stdout.isTTY ? process.stdout : undefined);\n\nconst restoreCursor = terminal ? onetime(() => {\n\tonExit(() => {\n\t\tterminal.write('\\u001B[?25h');\n\t}, {alwaysLast: true});\n}) : () => {};\n\nexport default restoreCursor;\n","const copyProperty = (to, from, property, ignoreNonConfigurable) => {\n\t// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.\n\t// `Function#prototype` is non-writable and non-configurable so can never be modified.\n\tif (property === 'length' || property === 'prototype') {\n\t\treturn;\n\t}\n\n\t// `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.\n\tif (property === 'arguments' || property === 'caller') {\n\t\treturn;\n\t}\n\n\tconst toDescriptor = Object.getOwnPropertyDescriptor(to, property);\n\tconst fromDescriptor = Object.getOwnPropertyDescriptor(from, property);\n\n\tif (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(to, property, fromDescriptor);\n};\n\n// `Object.defineProperty()` throws if the property exists, is not configurable and either:\n// - one its descriptors is changed\n// - it is non-writable and its value is changed\nconst canCopyProperty = function (toDescriptor, fromDescriptor) {\n\treturn toDescriptor === undefined || toDescriptor.configurable || (\n\t\ttoDescriptor.writable === fromDescriptor.writable\n\t\t&& toDescriptor.enumerable === fromDescriptor.enumerable\n\t\t&& toDescriptor.configurable === fromDescriptor.configurable\n\t\t&& (toDescriptor.writable || toDescriptor.value === fromDescriptor.value)\n\t);\n};\n\nconst changePrototype = (to, from) => {\n\tconst fromPrototype = Object.getPrototypeOf(from);\n\tif (fromPrototype === Object.getPrototypeOf(to)) {\n\t\treturn;\n\t}\n\n\tObject.setPrototypeOf(to, fromPrototype);\n};\n\nconst wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\\n${fromBody}`;\n\nconst toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');\nconst toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');\n\n// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.\n// We use `bind()` instead of a closure for the same reason.\n// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.\nconst changeToString = (to, from, name) => {\n\tconst withName = name === '' ? '' : `with ${name.trim()}() `;\n\tconst newToString = wrappedToString.bind(null, withName, from.toString());\n\t// Ensure `to.toString.toString` is non-enumerable and has the same `same`\n\tObject.defineProperty(newToString, 'name', toStringName);\n\tconst {writable, enumerable, configurable} = toStringDescriptor; // We destructue to avoid a potential `get` descriptor.\n\tObject.defineProperty(to, 'toString', {value: newToString, writable, enumerable, configurable});\n};\n\nexport default function mimicFunction(to, from, {ignoreNonConfigurable = false} = {}) {\n\tconst {name} = to;\n\n\tfor (const property of Reflect.ownKeys(from)) {\n\t\tcopyProperty(to, from, property, ignoreNonConfigurable);\n\t}\n\n\tchangePrototype(to, from);\n\tchangeToString(to, from, name);\n\n\treturn to;\n}\n","import mimicFunction from 'mimic-function';\n\nconst calledFunctions = new WeakMap();\n\nconst onetime = (function_, options = {}) => {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError('Expected a function');\n\t}\n\n\tlet returnValue;\n\tlet callCount = 0;\n\tconst functionName = function_.displayName || function_.name || '<anonymous>';\n\n\tconst onetime = function (...arguments_) {\n\t\tcalledFunctions.set(onetime, ++callCount);\n\n\t\tif (callCount === 1) {\n\t\t\treturnValue = function_.apply(this, arguments_);\n\t\t\tfunction_ = undefined;\n\t\t} else if (options.throw === true) {\n\t\t\tthrow new Error(`Function \\`${functionName}\\` can only be called once`);\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tmimicFunction(onetime, function_);\n\tcalledFunctions.set(onetime, callCount);\n\n\treturn onetime;\n};\n\nonetime.callCount = function_ => {\n\tif (!calledFunctions.has(function_)) {\n\t\tthrow new Error(`The given function \\`${function_.name}\\` is not wrapped by the \\`onetime\\` package`);\n\t}\n\n\treturn calledFunctions.get(function_);\n};\n\nexport default onetime;\n","/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals: NodeJS.Signals[] = []\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM')\n\nif (process.platform !== 'win32') {\n signals.push(\n 'SIGALRM',\n 'SIGABRT',\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT')\n}\n","// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js'\nexport { signals }\n\n// just a loosened process type so we can do some evil things\ntype ProcessRE = NodeJS.Process & {\n reallyExit: (code?: number | undefined | null) => any\n emit: (ev: string, ...a: any[]) => any\n}\n\nconst processOk = (process: any): process is ProcessRE =>\n !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n\nconst kExitEmitter = Symbol.for('signal-exit emitter')\nconst global: typeof globalThis & { [kExitEmitter]?: Emitter } = globalThis\nconst ObjectDefineProperty = Object.defineProperty.bind(Object)\n\n/**\n * A function that takes an exit code and signal as arguments\n *\n * In the case of signal exits *only*, a return value of true\n * will indicate that the signal is being handled, and we should\n * not synthetically exit with the signal we received. Regardless\n * of the handler return value, the handler is unloaded when an\n * otherwise fatal signal is received, so you get exactly 1 shot\n * at it, unless you add another onExit handler at that point.\n *\n * In the case of numeric code exits, we may already have committed\n * to exiting the process, for example via a fatal exception or\n * unhandled promise rejection, so it is impossible to stop safely.\n */\nexport type Handler = (\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n) => true | void\ntype ExitEvent = 'afterExit' | 'exit'\ntype Emitted = { [k in ExitEvent]: boolean }\ntype Listeners = { [k in ExitEvent]: Handler[] }\n\n// teeny special purpose ee\nclass Emitter {\n emitted: Emitted = {\n afterExit: false,\n exit: false,\n }\n\n listeners: Listeners = {\n afterExit: [],\n exit: [],\n }\n\n count: number = 0\n id: number = Math.random()\n\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter]\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n })\n }\n\n on(ev: ExitEvent, fn: Handler) {\n this.listeners[ev].push(fn)\n }\n\n removeListener(ev: ExitEvent, fn: Handler) {\n const list = this.listeners[ev]\n const i = list.indexOf(fn)\n /* c8 ignore start */\n if (i === -1) {\n return\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0\n } else {\n list.splice(i, 1)\n }\n }\n\n emit(\n ev: ExitEvent,\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n ): boolean {\n if (this.emitted[ev]) {\n return false\n }\n this.emitted[ev] = true\n let ret: boolean = false\n for (const fn of this.listeners[ev]) {\n ret = fn(code, signal) === true || ret\n }\n if (ev === 'exit') {\n ret = this.emit('afterExit', code, signal) || ret\n }\n return ret\n }\n}\n\nabstract class SignalExitBase {\n abstract onExit(cb: Handler, opts?: { alwaysLast?: boolean }): () => void\n abstract load(): void\n abstract unload(): void\n}\n\nconst signalExitWrap = <T extends SignalExitBase>(handler: T) => {\n return {\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n return handler.onExit(cb, opts)\n },\n load() {\n return handler.load()\n },\n unload() {\n return handler.unload()\n },\n }\n}\n\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => {}\n }\n load() {}\n unload() {}\n}\n\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'\n /* c8 ignore stop */\n #emitter = new Emitter()\n #process: ProcessRE\n #originalProcessEmit: ProcessRE['emit']\n #originalProcessReallyExit: ProcessRE['reallyExit']\n\n #sigListeners: { [k in NodeJS.Signals]?: () => void } = {}\n #loaded: boolean = false\n\n constructor(process: ProcessRE) {\n super()\n this.#process = process\n // { <signal>: <listener fn>, ... }\n this.#sigListeners = {}\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig)\n let { count } = this.#emitter\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit, and increment by the count of listeners it has\n // created.\n /* c8 ignore start */\n const p = process as unknown as {\n __signal_exit_emitter__?: { count: number }\n }\n if (\n typeof p.__signal_exit_emitter__ === 'object' &&\n typeof p.__signal_exit_emitter__.count === 'number'\n ) {\n count += p.__signal_exit_emitter__.count\n }\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload()\n const ret = this.#emitter.emit('exit', null, sig)\n /* c8 ignore start */\n const s = sig === 'SIGHUP' ? this.#hupSig : sig\n if (!ret) process.kill(process.pid, s)\n /* c8 ignore stop */\n }\n }\n }\n\n this.#originalProcessReallyExit = process.reallyExit\n this.#originalProcessEmit = process.emit\n }\n\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => {}\n }\n /* c8 ignore stop */\n\n if (this.#loaded === false) {\n this.load()\n }\n\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit'\n this.#emitter.on(ev, cb)\n return () => {\n this.#emitter.removeListener(ev, cb)\n if (\n this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0\n ) {\n this.unload()\n }\n }\n }\n\n load() {\n if (this.#loaded) {\n return\n }\n this.#loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1\n\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig]\n if (fn) this.#process.on(sig, fn)\n } catch (_) {}\n }\n\n this.#process.emit = (ev: string, ...a: any[]) => {\n return this.#processEmit(ev, ...a)\n }\n this.#process.reallyExit = (code?: number | null | undefined) => {\n return this.#processReallyExit(code)\n }\n }\n\n unload() {\n if (!this.#loaded) {\n return\n }\n this.#loaded = false\n\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig]\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig)\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n })\n this.#process.emit = this.#originalProcessEmit\n this.#process.reallyExit = this.#originalProcessReallyExit\n this.#emitter.count -= 1\n }\n\n #processReallyExit(code?: number | null | undefined) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0\n }\n this.#process.exitCode = code || 0\n /* c8 ignore stop */\n\n this.#emitter.emit('exit', this.#process.exitCode, null)\n return this.#originalProcessReallyExit.call(\n this.#process,\n this.#process.exitCode\n )\n }\n\n #processEmit(ev: string, ...args: any[]): any {\n const og = this.#originalProcessEmit\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0]\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args)\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null)\n /* c8 ignore stop */\n return ret\n } else {\n return og.call(this.#process, ev, ...args)\n }\n }\n}\n\nconst process = globalThis.process\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const {\n /**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\n onExit,\n\n /**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n load,\n\n /**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n unload,\n} = signalExitWrap(\n processOk(process) ? new SignalExit(process) : new SignalExitFallback()\n)\n","import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tif (process.platform !== 'win32') {\n\t\treturn process.env.TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(process.env.CI)\n\t\t|| Boolean(process.env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(process.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| process.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| process.env.TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| process.env.TERM_PROGRAM === 'vscode'\n\t\t|| process.env.TERM === 'xterm-256color'\n\t\t|| process.env.TERM === 'alacritty'\n\t\t|| process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n","import chalk from 'chalk';\nimport isUnicodeSupported from 'is-unicode-supported';\n\nconst main = {\n\tinfo: chalk.blue('ℹ'),\n\tsuccess: chalk.green('✔'),\n\twarning: chalk.yellow('⚠'),\n\terror: chalk.red('✖'),\n};\n\nconst fallback = {\n\tinfo: chalk.blue('i'),\n\tsuccess: chalk.green('√'),\n\twarning: chalk.yellow('‼'),\n\terror: chalk.red('×'),\n};\n\nconst logSymbols = isUnicodeSupported() ? main : fallback;\n\nexport default logSymbols;\n","export default function ansiRegex({onlyFirst = false} = {}) {\n\t// Valid string terminator sequences are BEL, ESC\\, and 0x9c\n\tconst ST = '(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)';\n\n\t// OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n\tconst osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n\t// CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n\tconst csi = '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]';\n\n\tconst pattern = `${osc}|${csi}`;\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Fast path: ANSI codes require ESC (7-bit) or CSI (8-bit) introducer\n\tif (!string.includes('\\u001B') && !string.includes('\\u009B')) {\n\t\treturn string;\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n","// Generated by scripts/build.js\n\n// prettier-ignore\nconst ambiguousRanges = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];\n\n// prettier-ignore\nconst fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];\n\n// prettier-ignore\nconst halfwidthRanges = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];\n\n// prettier-ignore\nconst narrowRanges = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];\n\n// prettier-ignore\nconst wideRanges = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141];\n\nexport {ambiguousRanges, fullwidthRanges, halfwidthRanges, narrowRanges, wideRanges};\n","/**\nBinary search on a sorted flat array of [start, end] pairs.\n\n@param {number[]} ranges - Flat array of inclusive [start, end] range pairs, e.g. [0, 5, 10, 20].\n@param {number} codePoint - The value to search for.\n@returns {boolean} Whether the value falls within any of the ranges.\n*/\nexport const isInRange = (ranges, codePoint) => {\n\tlet low = 0;\n\tlet high = Math.floor(ranges.length / 2) - 1;\n\twhile (low <= high) {\n\t\tconst mid = Math.floor((low + high) / 2);\n\t\tconst i = mid * 2;\n\t\tif (codePoint < ranges[i]) {\n\t\t\thigh = mid - 1;\n\t\t} else if (codePoint > ranges[i + 1]) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n};\n","import {\n\tambiguousRanges,\n\tfullwidthRanges,\n\thalfwidthRanges,\n\tnarrowRanges,\n\twideRanges,\n} from './lookup-data.js';\nimport {isInRange} from './utilities.js';\n\nconst minimumAmbiguousCodePoint = ambiguousRanges[0];\nconst maximumAmbiguousCodePoint = ambiguousRanges.at(-1);\nconst minimumFullWidthCodePoint = fullwidthRanges[0];\nconst maximumFullWidthCodePoint = fullwidthRanges.at(-1);\nconst minimumHalfWidthCodePoint = halfwidthRanges[0];\nconst maximumHalfWidthCodePoint = halfwidthRanges.at(-1);\nconst minimumNarrowCodePoint = narrowRanges[0];\nconst maximumNarrowCodePoint = narrowRanges.at(-1);\nconst minimumWideCodePoint = wideRanges[0];\nconst maximumWideCodePoint = wideRanges.at(-1);\n\nconst commonCjkCodePoint = 0x4E_00;\nconst [wideFastPathStart, wideFastPathEnd] = findWideFastPathRange(wideRanges);\n\n// Use a hot-path range so common `isWide` calls can skip binary search.\n// The range containing U+4E00 covers common CJK ideographs;\n// fallback to the largest range for resilience to Unicode table changes.\nfunction findWideFastPathRange(ranges) {\n\tlet fastPathStart = ranges[0];\n\tlet fastPathEnd = ranges[1];\n\n\tfor (let index = 0; index < ranges.length; index += 2) {\n\t\tconst start = ranges[index];\n\t\tconst end = ranges[index + 1];\n\n\t\tif (\n\t\t\tcommonCjkCodePoint >= start\n\t\t\t&& commonCjkCodePoint <= end\n\t\t) {\n\t\t\treturn [start, end];\n\t\t}\n\n\t\tif ((end - start) > (fastPathEnd - fastPathStart)) {\n\t\t\tfastPathStart = start;\n\t\t\tfastPathEnd = end;\n\t\t}\n\t}\n\n\treturn [fastPathStart, fastPathEnd];\n}\n\nexport const isAmbiguous = codePoint => {\n\tif (\n\t\tcodePoint < minimumAmbiguousCodePoint\n\t\t|| codePoint > maximumAmbiguousCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(ambiguousRanges, codePoint);\n};\n\nexport const isFullWidth = codePoint => {\n\tif (\n\t\tcodePoint < minimumFullWidthCodePoint\n\t\t|| codePoint > maximumFullWidthCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(fullwidthRanges, codePoint);\n};\n\nconst isHalfWidth = codePoint => {\n\tif (\n\t\tcodePoint < minimumHalfWidthCodePoint\n\t\t|| codePoint > maximumHalfWidthCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(halfwidthRanges, codePoint);\n};\n\nconst isNarrow = codePoint => {\n\tif (\n\t\tcodePoint < minimumNarrowCodePoint\n\t\t|| codePoint > maximumNarrowCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(narrowRanges, codePoint);\n};\n\nexport const isWide = codePoint => {\n\tif (\n\t\tcodePoint >= wideFastPathStart\n\t\t&& codePoint <= wideFastPathEnd\n\t) {\n\t\treturn true;\n\t}\n\n\tif (\n\t\tcodePoint < minimumWideCodePoint\n\t\t|| codePoint > maximumWideCodePoint\n\t) {\n\t\treturn false;\n\t}\n\n\treturn isInRange(wideRanges, codePoint);\n};\n\nexport function getCategory(codePoint) {\n\tif (isAmbiguous(codePoint)) {\n\t\treturn 'ambiguous';\n\t}\n\n\tif (isFullWidth(codePoint)) {\n\t\treturn 'fullwidth';\n\t}\n\n\tif (isHalfWidth(codePoint)) {\n\t\treturn 'halfwidth';\n\t}\n\n\tif (isNarrow(codePoint)) {\n\t\treturn 'narrow';\n\t}\n\n\tif (isWide(codePoint)) {\n\t\treturn 'wide';\n\t}\n\n\treturn 'neutral';\n}\n","import {getCategory, isAmbiguous, isFullWidth, isWide} from './lookup.js';\n\nfunction validate(codePoint) {\n\tif (!Number.isSafeInteger(codePoint)) {\n\t\tthrow new TypeError(`Expected a code point, got \\`${typeof codePoint}\\`.`);\n\t}\n}\n\nexport function eastAsianWidthType(codePoint) {\n\tvalidate(codePoint);\n\n\treturn getCategory(codePoint);\n}\n\nexport function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {\n\tvalidate(codePoint);\n\n\tif (\n\t\tisFullWidth(codePoint)\n\t\t|| isWide(codePoint)\n\t\t|| (ambiguousAsWide && isAmbiguous(codePoint))\n\t) {\n\t\treturn 2;\n\t}\n\n\treturn 1;\n}\n\n// Private exports for https://github.com/sindresorhus/is-fullwidth-code-point\nexport {isFullWidth as _isFullWidth, isWide as _isWide} from './lookup.js';\n","export default () => {\n\t// https://mths.be/emoji\n\treturn /[#*0-9]\\uFE0F?\\u20E3|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26AA\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C8\\u26CF\\u26D1\\u26E9\\u26F0-\\u26F5\\u26F7\\u26F8\\u26FA\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B55\\u3030\\u303D\\u3297\\u3299]\\uFE0F?|[\\u261D\\u270C\\u270D](?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?|[\\u270A\\u270B](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u2693\\u26A1\\u26AB\\u26C5\\u26CE\\u26D4\\u26EA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2795-\\u2797\\u27B0\\u27BF\\u2B50]|\\u26D3\\uFE0F?(?:\\u200D\\uD83D\\uDCA5)?|\\u26F9(?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?(?:\\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\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDC68\\uDC69]\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFC-\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFC-\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFD-\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFD\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFE])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFE]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?))?|\\uDC69(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?[\\uDC68\\uDC69]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?|\\uDC69\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?))|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFC-\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFC-\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFC-\\uDFFF])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFD-\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFD\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\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|\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF]|\\uDEEF\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFE])))?))?|\\uDEF1(?:\\uD83C(?:\\uDFFB(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFC-\\uDFFF])?|\\uDFFC(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])?|\\uDFFD(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])?|\\uDFFE(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])?|\\uDFFF(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB-\\uDFFE])?))?)/g;\n};\n","import stripAnsi from 'strip-ansi';\nimport {eastAsianWidth} from 'get-east-asian-width';\nimport emojiRegex from 'emoji-regex';\n\nconst segmenter = new Intl.Segmenter();\n\nconst defaultIgnorableCodePointRegex = /^\\p{Default_Ignorable_Code_Point}$/u;\n\nexport default function stringWidth(string, options = {}) {\n\tif (typeof string !== 'string' || string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tconst {\n\t\tambiguousIsNarrow = true,\n\t\tcountAnsiEscapeCodes = false,\n\t} = options;\n\n\tif (!countAnsiEscapeCodes) {\n\t\tstring = stripAnsi(string);\n\t}\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tlet width = 0;\n\tconst eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};\n\n\tfor (const {segment: character} of segmenter.segment(string)) {\n\t\tconst codePoint = character.codePointAt(0);\n\n\t\t// Ignore control characters\n\t\tif (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore zero-width characters\n\t\tif (\n\t\t\t(codePoint >= 0x20_0B && codePoint <= 0x20_0F) // Zero-width space, non-joiner, joiner, left-to-right mark, right-to-left mark\n\t\t\t|| codePoint === 0xFE_FF // Zero-width no-break space\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore combining characters\n\t\tif (\n\t\t\t(codePoint >= 0x3_00 && codePoint <= 0x3_6F) // Combining diacritical marks\n\t\t\t|| (codePoint >= 0x1A_B0 && codePoint <= 0x1A_FF) // Combining diacritical marks extended\n\t\t\t|| (codePoint >= 0x1D_C0 && codePoint <= 0x1D_FF) // Combining diacritical marks supplement\n\t\t\t|| (codePoint >= 0x20_D0 && codePoint <= 0x20_FF) // Combining diacritical marks for symbols\n\t\t\t|| (codePoint >= 0xFE_20 && codePoint <= 0xFE_2F) // Combining half marks\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore surrogate pairs\n\t\tif (codePoint >= 0xD8_00 && codePoint <= 0xDF_FF) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore variation selectors\n\t\tif (codePoint >= 0xFE_00 && codePoint <= 0xFE_0F) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// This covers some of the above cases, but we still keep them for performance reasons.\n\t\tif (defaultIgnorableCodePointRegex.test(character)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// TODO: Use `/\\p{RGI_Emoji}/v` when targeting Node.js 20.\n\t\tif (emojiRegex().test(character)) {\n\t\t\twidth += 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\twidth += eastAsianWidth(codePoint, eastAsianWidthOptions);\n\t}\n\n\treturn width;\n}\n","export default function isInteractive({stream = process.stdout} = {}) {\n\treturn Boolean(\n\t\tstream && stream.isTTY &&\n\t\tprocess.env.TERM !== 'dumb' &&\n\t\t!('CI' in process.env)\n\t);\n}\n","import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tconst {env} = process;\n\tconst {TERM, TERM_PROGRAM} = env;\n\n\tif (process.platform !== 'win32') {\n\t\treturn TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| TERM_PROGRAM === 'vscode'\n\t\t|| TERM === 'xterm-256color'\n\t\t|| TERM === 'alacritty'\n\t\t|| TERM === 'rxvt-unicode'\n\t\t|| TERM === 'rxvt-unicode-256color'\n\t\t|| env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n","import process from 'node:process';\n\nconst ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code\n\nclass StdinDiscarder {\n\t#activeCount = 0;\n\n\tstart() {\n\t\tthis.#activeCount++;\n\n\t\tif (this.#activeCount === 1) {\n\t\t\tthis.#realStart();\n\t\t}\n\t}\n\n\tstop() {\n\t\tif (this.#activeCount <= 0) {\n\t\t\tthrow new Error('`stop` called more times than `start`');\n\t\t}\n\n\t\tthis.#activeCount--;\n\n\t\tif (this.#activeCount === 0) {\n\t\t\tthis.#realStop();\n\t\t}\n\t}\n\n\t#realStart() {\n\t\t// No known way to make it work reliably on Windows.\n\t\tif (process.platform === 'win32' || !process.stdin.isTTY) {\n\t\t\treturn;\n\t\t}\n\n\t\tprocess.stdin.setRawMode(true);\n\t\tprocess.stdin.on('data', this.#handleInput);\n\t\tprocess.stdin.resume();\n\t}\n\n\t#realStop() {\n\t\tif (!process.stdin.isTTY) {\n\t\t\treturn;\n\t\t}\n\n\t\tprocess.stdin.off('data', this.#handleInput);\n\t\tprocess.stdin.pause();\n\t\tprocess.stdin.setRawMode(false);\n\t}\n\n\t#handleInput(chunk) {\n\t\t// Allow Ctrl+C to gracefully exit.\n\t\tif (chunk[0] === ASCII_ETX_CODE) {\n\t\t\tprocess.emit('SIGINT');\n\t\t}\n\t}\n}\n\nconst stdinDiscarder = new StdinDiscarder();\n\nexport default stdinDiscarder;\n","import os from 'node:os';\n\nexport type Severity = 'critical' | 'high' | 'medium' | 'low' | 'info';\n\nexport interface StructuredFinding {\n type: string;\n severity: Severity;\n message: string;\n location?: string;\n details?: Record<string, unknown>;\n}\n\nexport interface RunResult {\n type: 'scan' | 'pentest';\n target: string;\n findings: StructuredFinding[];\n severity_summary: Record<Severity, number>;\n summary: string;\n error?: string;\n}\n\nexport function emptyCounts(): Record<Severity, number> {\n return { critical: 0, high: 0, medium: 0, low: 0, info: 0 };\n}\n\nexport function summarize(findings: StructuredFinding[]): Record<Severity, number> {\n const counts = emptyCounts();\n for (const f of findings) counts[f.severity] = (counts[f.severity] || 0) + 1;\n return counts;\n}\n\nexport function workerId(): string {\n return `${os.hostname()}/${process.pid}`;\n}\n","/**\n * Dependency advisory lookup against OSV.dev (PRD 06).\n *\n * Split out of `commands/scan.ts` unchanged in behaviour. It is the only part\n * of a scan that makes network calls, and that difference is worth a module\n * boundary: the pattern rules are deterministic and fast, this is neither, and\n * CI wants to choose. `runScan` keeps calling it (the daemon has always\n * included advisories); the CLI asks for it with `--deps`.\n */\n\nimport { existsSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { ScanFinding, Severity } from './types.js';\n\ninterface OsvVulnerability {\n id: string;\n summary?: string;\n details?: string;\n severity?: Array<{ type: string; score: string }>;\n}\n\nconst LOCKFILES: readonly { file: string; ecosystem: string }[] = [\n { file: 'package-lock.json', ecosystem: 'npm' },\n { file: 'pnpm-lock.yaml', ecosystem: 'npm' },\n { file: 'yarn.lock', ecosystem: 'npm' },\n { file: 'requirements.txt', ecosystem: 'PyPI' },\n { file: 'Pipfile.lock', ecosystem: 'PyPI' },\n];\n\n/** Cap per lockfile, so a first run on a neglected tree summarises rather than floods OSV. */\nconst MAX_DEPS_PER_LOCKFILE = 50;\n\nexport async function scanDependencies(targetPath: string): Promise<ScanFinding[]> {\n const findings: ScanFinding[] = [];\n\n for (const { file, ecosystem } of LOCKFILES) {\n const lockPath = join(targetPath, file);\n if (!existsSync(lockPath)) continue;\n\n let deps: Array<{ name: string; version: string }>;\n try {\n deps = parseDependencies(lockPath, file);\n } catch {\n continue;\n }\n\n for (const dep of deps.slice(0, MAX_DEPS_PER_LOCKFILE)) {\n let vulns: OsvVulnerability[];\n try {\n vulns = await queryOsv(dep.name, dep.version, ecosystem);\n } catch {\n continue;\n }\n\n for (const vuln of vulns) {\n const cvss = vuln.severity?.find((entry) => entry.type === 'CVSS_V3')?.score;\n findings.push({\n ruleId: 'dependency-known-vulnerability',\n title: 'Dependency CVE',\n file,\n line: 1,\n severity: severityFromCvss(cvss),\n confidence: 'evidence',\n message: `${dep.name}@${dep.version}: ${vuln.summary ?? vuln.id}`,\n consequence: 'A published advisory exists for the exact version resolved in this lockfile.',\n excerpt: `${vuln.id}${cvss ? ` (CVSS: ${cvss})` : ''}`,\n category: 'dependency',\n });\n }\n }\n }\n\n return findings;\n}\n\nfunction severityFromCvss(score: string | undefined): Severity {\n if (!score) return 'medium';\n const value = Number.parseFloat(score);\n if (Number.isNaN(value)) return 'medium';\n if (value >= 9) return 'critical';\n if (value >= 7) return 'high';\n if (value >= 4) return 'medium';\n return 'low';\n}\n\nfunction parseDependencies(lockPath: string, filename: string): Array<{ name: string; version: string }> {\n const deps: Array<{ name: string; version: string }> = [];\n\n if (filename === 'package-lock.json') {\n const lock = JSON.parse(readFileSync(lockPath, 'utf-8')) as {\n packages?: Record<string, { version?: string }>;\n dependencies?: Record<string, { version?: string }>;\n };\n const packages = lock.packages ?? lock.dependencies ?? {};\n for (const [key, value] of Object.entries(packages)) {\n const name = key.replace(/^node_modules\\//, '');\n const version = value?.version;\n if (name && version && !name.startsWith('.')) deps.push({ name, version });\n }\n return deps;\n }\n\n if (filename === 'requirements.txt') {\n for (const line of readFileSync(lockPath, 'utf-8').split('\\n')) {\n const match = /^([a-zA-Z0-9_.-]+)==([0-9.]+)/.exec(line);\n if (match?.[1] && match[2]) deps.push({ name: match[1], version: match[2] });\n }\n }\n\n return deps;\n}\n\n/** Package names and versions are validated before they reach the query body. */\nfunction isValidPackageName(name: string): boolean {\n return /^[@a-zA-Z0-9_.\\-/]{1,214}$/.test(name);\n}\n\nfunction isValidVersion(version: string): boolean {\n return /^[0-9a-zA-Z._\\-+]{1,50}$/.test(version);\n}\n\nasync function queryOsv(name: string, version: string, ecosystem: string): Promise<OsvVulnerability[]> {\n if (!isValidPackageName(name) || !isValidVersion(version)) return [];\n\n try {\n const response = await fetch('https://api.osv.dev/v1/query', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ package: { name, ecosystem }, version }),\n signal: AbortSignal.timeout(5000),\n });\n if (!response.ok) return [];\n const data = (await response.json()) as { vulns?: OsvVulnerability[] };\n return data.vulns ?? [];\n } catch {\n return [];\n }\n}\n","/**\n * The scan engine: walk a tree, run every rule set over it, return findings.\n *\n * Kept free of any I/O beyond reading files — no printing, no exit codes, no\n * SARIF. The command layer decides how to present what this returns, which is\n * what lets the same scan feed a terminal, a SARIF file and a daemon run\n * without three implementations drifting apart.\n */\n\nimport { closeSync, fstatSync, openSync, readdirSync, readFileSync, statSync } from 'node:fs';\nimport { basename, dirname, extname, join, relative, sep } from 'node:path';\nimport { CODE_RULES, evaluateRule, proseLines } from './code-rules.js';\nimport { scanPackageJson, scanRequirementsTxt } from './manifest-rules.js';\nimport { isKnownPlaceholder, redactSecret, SECRET_RULES, SENSITIVE_FILES } from './secret-rules.js';\nimport type { ScanFinding, ScanLanguage, Severity } from './types.js';\nimport { severityRank } from './types.js';\n\nconst SKIP_DIRS = new Set([\n 'node_modules', '.git', '.next', '.nuxt', 'dist', 'build', 'out', '__pycache__',\n '.venv', 'venv', 'vendor', '.terraform', 'coverage', '.cache', '.pnpm-store',\n 'target', '.gradle', '.idea', '.vscode', 'bower_components', '.svelte-kit',\n]);\n\nconst SCAN_EXTENSIONS = new Set([\n '.ts', '.js', '.tsx', '.jsx', '.mjs', '.cjs', '.mts', '.cts',\n '.py', '.rb', '.go', '.java', '.kt', '.scala', '.php', '.rs',\n '.c', '.cc', '.cpp', '.h', '.hpp', '.cs', '.swift',\n '.yml', '.yaml', '.json', '.toml', '.ini', '.cfg', '.conf', '.env',\n '.sh', '.bash', '.zsh', '.tf', '.hcl', '.xml', '.properties', '.gradle',\n '.txt', '.md', '.sql', '.erb', '.ejs', '.vue', '.svelte',\n]);\n\nconst LANGUAGE_BY_EXTENSION: Record<string, ScanLanguage> = {\n '.js': 'javascript', '.jsx': 'javascript', '.mjs': 'javascript', '.cjs': 'javascript',\n '.ts': 'typescript', '.tsx': 'typescript', '.mts': 'typescript', '.cts': 'typescript',\n '.vue': 'javascript', '.svelte': 'javascript', '.ejs': 'javascript',\n '.py': 'python',\n '.rb': 'ruby', '.erb': 'ruby',\n '.go': 'go',\n '.java': 'java', '.kt': 'java', '.scala': 'java',\n '.php': 'php',\n '.sh': 'shell', '.bash': 'shell', '.zsh': 'shell',\n '.yml': 'config', '.yaml': 'config', '.json': 'config', '.toml': 'config',\n '.ini': 'config', '.cfg': 'config', '.conf': 'config', '.env': 'config',\n '.tf': 'config', '.hcl': 'config', '.properties': 'config',\n};\n\nexport function languageOf(filename: string): ScanLanguage {\n if (filename.startsWith('.env') || filename.endsWith('.env')) return 'config';\n return LANGUAGE_BY_EXTENSION[extname(filename).toLowerCase()] ?? 'other';\n}\n\nexport interface ScanOptions {\n /** Skip files larger than this. Defaults to 1 MiB. */\n maxFileBytes?: number;\n /** Called once per file actually read, for progress reporting. */\n onFile?: (path: string) => void;\n /** Restrict to these rule categories. Defaults to all. */\n categories?: readonly ScanFinding['category'][];\n}\n\nexport interface ScanReport {\n findings: ScanFinding[];\n filesScanned: number;\n /**\n * How many inline suppressions were honoured. Reported, never hidden: a\n * scan that came back quiet because someone silenced forty rules is a\n * different result from a scan that came back quiet.\n */\n suppressed: number;\n /**\n * Directory that finding paths are relative to. Equal to the target for a\n * directory scan, its parent for a single-file scan. SARIF URI resolution\n * needs this — guessing it from the target is what produces file URIs that\n * resolve to nothing.\n */\n root: string;\n /**\n * Files matched by extension but unreadable. Reported rather than swallowed:\n * a scan that could not read a file has not cleared it, and \"0 findings\"\n * over an unread tree is the failure this scanner exists to avoid.\n */\n unreadable: string[];\n}\n\n/**\n * Inline suppression, matching the convention `modules/code-scanner` already\n * uses so a repository does not learn two syntaxes for the same idea.\n *\n * // threatcrush-disable-next-line secret-aws-access-key fixture, not a key\n * // threatcrush-disable-line\n *\n * The rule id is optional; without one the whole line is suppressed. This\n * exists because the highest-volume false positive in practice is a scanner's\n * own test fixtures — a file of deliberately-malformed credentials is\n * indistinguishable from a file of leaked ones, and only the author knows\n * which. Suppressions are counted and reported: a quiet scan full of\n * suppressions is not a clean one.\n */\nconst SUPPRESS_NEXT = /threatcrush-disable-next-line(?:\\s+([\\w-]+))?/;\nconst SUPPRESS_LINE = /threatcrush-disable-line(?:\\s+([\\w-]+))?/;\n\nexport interface Suppressions {\n /** line index → set of rule ids, or `*` for every rule. */\n byLine: Map<number, Set<string>>;\n count: number;\n}\n\nexport function collectSuppressions(lines: readonly string[]): Suppressions {\n const byLine = new Map<number, Set<string>>();\n let count = 0;\n\n const add = (index: number, ruleId: string | undefined): void => {\n const existing = byLine.get(index) ?? new Set<string>();\n existing.add(ruleId ?? '*');\n byLine.set(index, existing);\n count += 1;\n };\n\n lines.forEach((line, index) => {\n const next = SUPPRESS_NEXT.exec(line);\n if (next) add(index + 1, next[1]);\n const same = SUPPRESS_LINE.exec(line);\n // `disable-next-line` also matches the `disable-line` substring, so only\n // treat it as a same-line directive when the longer form did not match.\n if (same && !next) add(index, same[1]);\n });\n\n return { byLine, count };\n}\n\nfunction isSuppressed(suppressions: Suppressions, index: number, ruleId: string): boolean {\n const rules = suppressions.byLine.get(index);\n if (!rules) return false;\n return rules.has('*') || rules.has(ruleId);\n}\n\n/** Scan a single file's text. Exposed for tests and for single-file callers. */\nexport function scanText(\n relativePath: string,\n text: string,\n language: ScanLanguage = languageOf(relativePath),\n): ScanFinding[] {\n const findings: ScanFinding[] = [];\n const lines = text.split('\\n');\n const suppressions = collectSuppressions(lines);\n\n // ── Credentials ────────────────────────────────────────────────────────\n lines.forEach((line, index) => {\n for (const rule of SECRET_RULES) {\n const match = rule.pattern.exec(line);\n if (!match) continue;\n if (isKnownPlaceholder(match[0])) continue;\n if (isSuppressed(suppressions, index, rule.id)) continue;\n\n findings.push({\n ruleId: rule.id,\n title: rule.name,\n file: relativePath,\n line: index + 1,\n severity: rule.severity,\n // A matched credential format is the finding, not a proxy for one.\n confidence: 'evidence',\n message: `Possible ${rule.name} detected`,\n consequence: rule.consequence,\n cwe: rule.cwe,\n excerpt: redactSecret(line.trim()).slice(0, 200),\n sensitive: true,\n category: 'secret',\n });\n }\n });\n\n // ── Code-level constructs ──────────────────────────────────────────────\n const prose = proseLines(lines);\n lines.forEach((_line, index) => {\n for (const rule of CODE_RULES) {\n if (isSuppressed(suppressions, index, rule.id)) continue;\n const match = evaluateRule(rule, { lines, index, language, prose });\n if (!match) continue;\n\n findings.push({\n ruleId: rule.id,\n title: rule.title,\n file: relativePath,\n line: index + 1,\n severity: match.severity,\n confidence: match.confidence,\n message: `${rule.title} (${rule.cwe})`,\n consequence: rule.consequence,\n cwe: rule.cwe,\n excerpt: (lines[index] ?? '').trim().slice(0, 200),\n category: 'code',\n });\n }\n });\n\n return findings;\n}\n\nfunction scanManifest(relativePath: string, filename: string, text: string): ScanFinding[] {\n const manifestFindings =\n filename === 'package.json'\n ? scanPackageJson(text)\n : filename === 'requirements.txt'\n ? scanRequirementsTxt(text)\n : [];\n\n return manifestFindings.map((finding) => ({\n ruleId: finding.ruleId,\n title: finding.title,\n file: relativePath,\n line: finding.line,\n severity: finding.severity,\n confidence: 'evidence' as const,\n message: finding.message,\n consequence: finding.consequence,\n cwe: finding.cwe,\n excerpt: finding.excerpt.slice(0, 200),\n category: 'manifest' as const,\n }));\n}\n\nexport function scanPath(targetPath: string, options: ScanOptions = {}): ScanReport {\n const maxFileBytes = options.maxFileBytes ?? 1024 * 1024;\n const allowed = options.categories ? new Set(options.categories) : null;\n const findings: ScanFinding[] = [];\n const unreadable: string[] = [];\n let filesScanned = 0;\n let suppressed = 0;\n\n // A file target is not a degenerate directory target. `readdirSync` on a\n // file throws ENOTDIR, which the walker below treats as an unreadable\n // directory — so `threatcrush scan app.js` reported a clean scan of a file\n // it never opened. Resolve the shape first, and walk only what is walkable.\n const rootIsDirectory = (() => {\n try {\n return statSync(targetPath).isDirectory();\n } catch {\n return true;\n }\n })();\n const walkRoot = rootIsDirectory ? targetPath : dirname(targetPath);\n\n const scanFile = (fullPath: string, filename: string): void => {\n const relativePath = toRelative(walkRoot, fullPath);\n const extension = extname(filename).toLowerCase();\n const isManifest = filename === 'package.json' || filename === 'requirements.txt';\n const scannable = SCAN_EXTENSIONS.has(extension) || filename.startsWith('.env');\n\n if (!scannable && !isManifest) {\n recordSensitiveFile(filename, relativePath, findings, []);\n return;\n }\n\n // Size-check and read through one descriptor.\n //\n // `statSync(path)` followed by `readFileSync(path)` is check-then-use: the\n // path can be replaced between the two calls, so the size that was checked\n // is not necessarily the size that gets read. Opening once and calling\n // `fstatSync` on the descriptor removes the window — the descriptor refers\n // to the same inode for both operations, whatever happens to the name.\n //\n // A scanner walking directories it does not control is exactly where this\n // matters, and CWE-362 is a class this tool reports on. Worth getting\n // right in its own walker.\n let text: string;\n let handle: number;\n try {\n handle = openSync(fullPath, 'r');\n } catch {\n unreadable.push(relativePath);\n return;\n }\n\n try {\n if (fstatSync(handle).size > maxFileBytes) return;\n text = readFileSync(handle, 'utf-8');\n } catch {\n unreadable.push(relativePath);\n return;\n } finally {\n try {\n closeSync(handle);\n } catch {\n /* the descriptor is going away regardless */\n }\n }\n\n filesScanned += 1;\n options.onFile?.(relativePath);\n suppressed += collectSuppressions(text.split('\\n')).count;\n\n const fileFindings = [\n ...scanText(relativePath, text, languageOf(filename)),\n ...(isManifest ? scanManifest(relativePath, filename, text) : []),\n ];\n\n findings.push(...fileFindings);\n recordSensitiveFile(filename, relativePath, findings, fileFindings);\n };\n\n const walk = (currentPath: string): void => {\n let entries;\n try {\n entries = readdirSync(currentPath, { withFileTypes: true });\n } catch {\n unreadable.push(toRelative(walkRoot, currentPath));\n return;\n }\n\n for (const entry of entries) {\n const fullPath = join(currentPath, entry.name);\n\n if (entry.isDirectory()) {\n if (SKIP_DIRS.has(entry.name)) continue;\n walk(fullPath);\n continue;\n }\n if (!entry.isFile()) continue;\n\n scanFile(fullPath, entry.name);\n }\n };\n\n if (rootIsDirectory) {\n walk(targetPath);\n } else {\n scanFile(targetPath, basename(targetPath));\n }\n\n const filtered = allowed ? findings.filter((f) => allowed.has(f.category)) : findings;\n filtered.sort(\n (a, b) =>\n severityRank(b.severity) - severityRank(a.severity) ||\n a.file.localeCompare(b.file) ||\n a.line - b.line,\n );\n\n return { findings: filtered, filesScanned, unreadable, suppressed, root: walkRoot };\n}\n\n/**\n * Report a file whose *name* is the finding — but only when its contents\n * produced nothing.\n *\n * A `.env` full of detected credentials does not also need \"this is a .env\n * file\" stapled to line 1. The filename finding exists for the case the\n * content rules cannot cover: an env file whose values are shapes no vendor\n * rule matches, which is still an env file that should not be committed.\n */\nfunction recordSensitiveFile(\n filename: string,\n relativePath: string,\n sink: ScanFinding[],\n fileFindings: readonly ScanFinding[],\n): void {\n if (fileFindings.length > 0) return;\n\n for (const sensitive of SENSITIVE_FILES) {\n const matches = filename === sensitive.pattern || filename.endsWith(sensitive.pattern);\n if (!matches) continue;\n sink.push({\n ruleId: 'sensitive-file-committed',\n title: 'Sensitive file',\n file: relativePath,\n line: 1,\n severity: sensitive.severity,\n confidence: 'evidence',\n message: sensitive.message,\n consequence: 'Anything in this file is in every clone, fork and CI cache of the repository.',\n cwe: 'CWE-538',\n excerpt: '',\n sensitive: true,\n category: 'file',\n });\n return;\n }\n}\n\nfunction toRelative(base: string, target: string): string {\n const rel = relative(base, target);\n return (rel === '' ? target : rel).split(sep).join('/');\n}\n\n/** Highest severity present, or null for a clean scan. */\nexport function peakSeverity(findings: readonly ScanFinding[]): Severity | null {\n let peak: Severity | null = null;\n for (const finding of findings) {\n if (!peak || severityRank(finding.severity) > severityRank(peak)) peak = finding.severity;\n }\n return peak;\n}\n\n/** True when any finding is at or above `threshold`. Drives `--fail-on`. */\nexport function meetsFailThreshold(\n findings: readonly ScanFinding[],\n threshold: readonly Severity[],\n): boolean {\n if (threshold.length === 0) return false;\n const floor = Math.min(...threshold.map(severityRank));\n return findings.some((finding) => severityRank(finding.severity) >= floor);\n}\n","/**\n * Shared vocabulary for `threatcrush scan`.\n *\n * The scan pipeline is deliberately three separable pieces — rules produce\n * findings, the engine walks the tree, the reporters serialise. Keeping the\n * types here means a reporter never has to import a rule table to know what a\n * finding looks like.\n */\n\nexport type Severity = 'critical' | 'high' | 'medium' | 'low' | 'info';\n\n/**\n * How much the scanner is claiming.\n *\n * `pattern` the dangerous construct is present on the line. Nothing more.\n * `contextual` the construct sits alongside something that looks like\n * attacker-controlled input. Still not proof of exploitability,\n * but a materially stronger claim — and the only one allowed to\n * present at the rule's full severity.\n * `evidence` the match *is* the finding, not a proxy for it. A hardcoded\n * AWS key is a committed credential whether or not any request\n * ever reaches it, so the severity cap below does not apply.\n *\n * This mirrors the confidence model in `modules/code-scanner` (PRD 0004), for\n * the same reason: a regex is not data-flow analysis, and a scanner that blurs\n * the two produces confident-sounding findings that waste triage time.\n */\nexport type Confidence = 'pattern' | 'contextual' | 'evidence';\n\nexport type ScanLanguage =\n | 'javascript'\n | 'typescript'\n | 'python'\n | 'ruby'\n | 'go'\n | 'java'\n | 'php'\n | 'shell'\n | 'config'\n | 'other';\n\nexport interface ScanFinding {\n /** Stable rule identifier, e.g. `js-sql-string-building`. Used as the SARIF ruleId. */\n ruleId: string;\n /** Short human title for the construct, e.g. \"SQL assembled by concatenation\". */\n title: string;\n /** Path relative to the scan root, POSIX-separated. */\n file: string;\n /** 1-based. Whole-file findings report 1, never 0 — SARIF forbids 0. */\n line: number;\n severity: Severity;\n confidence: Confidence;\n /** What was found, in a sentence. Shown to the operator. */\n message: string;\n /** What happens if it is real. An operator triages on consequence. */\n consequence?: string;\n /** `CWE-89`. Absent for findings with no clean CWE mapping. */\n cwe?: string;\n /**\n * The matched source line, trimmed. Redacted by the reporters for secret\n * findings — see `redactSecret`.\n */\n excerpt: string;\n /** True when `excerpt` may contain credential material. */\n sensitive?: boolean;\n category: 'secret' | 'code' | 'manifest' | 'dependency' | 'file';\n}\n\nexport const SEVERITY_ORDER: readonly Severity[] = ['info', 'low', 'medium', 'high', 'critical'];\n\nexport function severityRank(severity: Severity): number {\n const index = SEVERITY_ORDER.indexOf(severity);\n return index === -1 ? 0 : index;\n}\n\n/**\n * Cap for a bare pattern match.\n *\n * A construct that merely *exists* never presents as high or critical. Enforced\n * centrally rather than per-rule so no future rule can opt out of it by\n * accident.\n */\nexport function severityFor(declared: Severity, confidence: Confidence): Severity {\n if (confidence !== 'pattern') return declared;\n return severityRank(declared) > severityRank('medium') ? 'medium' : declared;\n}\n","/**\n * Code-level vulnerability rules for `threatcrush scan`.\n *\n * Why this file exists\n * --------------------\n * Measured against the public testbed at `profullstack/malware-test-prs`, the\n * CLI scored 15.6% true-positive rate with a 0.0% false-positive rate: it found\n * every hardcoded credential and none of the code-level classes — no SQL\n * injection, XSS, SSRF, command injection, deserialisation or template\n * injection. ThreatCrush was a secrets scanner wearing a code scanner's name.\n *\n * These rules close that gap without giving up the number that was actually\n * worth having. The false-positive denominator in that testbed is a control\n * group of `SAFE:` lines — each one a *correct* implementation of the same\n * pattern the neighbouring vulnerable code gets wrong. A scanner that flags one\n * is pattern-matching on syntax instead of following the data. So every rule\n * here is built against both halves: it must fire on the vulnerable shape and\n * stay silent on the corrected shape standing next to it.\n *\n * Three mechanisms do that work:\n *\n * 1. **Shape, not keyword.** `db.query(\"SELECT … $1\", [id])` and\n * `db.query(\"SELECT … '\" + id + \"'\")` both contain `SELECT`. Only the\n * second concatenates, and only the second matches.\n * 2. **Guard windows.** A construct is exonerated by the code around it —\n * an allow-list two lines up, a `realpath` on the same line, an\n * `ObjectInputFilter` installed before the `readObject()`. Comment lines\n * are excluded from the window, because a comment saying \"no allow-list\n * here\" is not an allow-list.\n * 3. **Confidence.** A construct that merely exists is capped at medium.\n * Escalation requires visible untrusted input. See `types.ts`.\n *\n * What this is not: data-flow analysis. It is line-oriented matching with a\n * small amount of local context, and it says so. Classes that genuinely need\n * whole-function reasoning — missing CSRF tokens, check-then-use races,\n * integer overflow — are deliberately absent rather than approximated by a\n * rule that would flag every session read in the codebase. See KNOWN_GAPS.\n */\n\nimport type { Confidence, ScanLanguage, Severity } from './types.js';\nimport { severityFor } from './types.js';\n\nexport interface CodeRule {\n id: string;\n title: string;\n /** What happens if it is real. An operator triages on consequence. */\n consequence: string;\n cwe: string;\n severity: Severity;\n /** Languages the rule applies to. `undefined` means every language. */\n languages?: readonly ScanLanguage[];\n pattern: RegExp;\n /**\n * The rule describes a construct that is ordinary on its own — reading a\n * file from a computed path is just software. Only report it when untrusted\n * input is visible nearby.\n */\n needsContext?: boolean;\n /**\n * Extra evidence that must appear in the guard window for the rule to fire.\n * Used where the dangerous part is the *combination* — a base64 blob is\n * harmless until something executes it.\n */\n requires?: RegExp;\n /**\n * Evidence that the construct is already handled. `false` opts the rule out\n * of the generic guard entirely — the CWE-532 rules are *about* reading\n * `process.env`, so the generic guard would veto every true positive.\n */\n guard?: RegExp | false;\n /** Lines of context searched backwards for guards and required evidence. */\n guardBack?: number;\n /**\n * Lines searched *forwards*. Zero for almost everything: code that fixes a\n * problem generally runs before the problem. XML parser hardening is the\n * exception — the factory is constructed, then configured, so the evidence\n * is below the match.\n */\n guardForward?: number;\n}\n\n/**\n * Things that look like attacker-controlled input, per language family.\n *\n * Deliberately shallow. It is a heuristic for *ranking*, not a taint-source\n * model. A real source list would be framework-aware and interprocedural,\n * which is exactly what this subsystem promises not to pretend to be.\n */\nconst UNTRUSTED_JS =\n /\\b(?:req|request|ctx|context)\\s*\\.\\s*(?:body|query|params|param|headers|cookies|url|files)\\b|\\bprocess\\.argv\\b|\\bwindow\\.location\\b|\\bdocument\\.location\\b|\\blocation\\.(?:search|hash|href)\\b|\\bsearchParams\\b|\\bgetParameter\\s*\\(|\\bgetQueryString\\s*\\(|\\bgetInputStream\\s*\\(/;\n\nconst UNTRUSTED_PY = /\\brequest\\b|\\bparams\\b|\\bflask\\b|\\bsys\\.argv\\b|\\bos\\.environ\\b\\s*\\[/;\n\nconst UNTRUSTED_RB = /\\bparams\\s*\\[|\\brequest\\b|\\bcookies\\s*\\[/;\n\nconst UNTRUSTED_GO =\n /\\br\\s*\\.\\s*(?:URL|Form|Body|Header|PostForm)\\b|\\bFormValue\\s*\\(|\\bQuery\\s*\\(\\s*\\)\\s*\\.\\s*Get\\s*\\(|\\bmux\\.Vars\\s*\\(/;\n\nconst UNTRUSTED_JAVA =\n /\\bgetParameter\\s*\\(|\\bgetQueryString\\s*\\(|\\bgetHeader\\s*\\(|\\bgetInputStream\\s*\\(|\\bgetCookies\\s*\\(|\\b@RequestParam\\b|\\b@PathVariable\\b/;\n\nexport function untrustedPatternFor(language: ScanLanguage): RegExp {\n switch (language) {\n case 'python':\n return UNTRUSTED_PY;\n case 'ruby':\n return UNTRUSTED_RB;\n case 'go':\n return UNTRUSTED_GO;\n case 'java':\n return UNTRUSTED_JAVA;\n default:\n return UNTRUSTED_JS;\n }\n}\n\n/**\n * Evidence that the dangerous construct on this line is already handled.\n *\n * Every entry here was added because a *correct* implementation in the testbed\n * corpus was otherwise flagged. They are named after what the safe code does,\n * not after what the finding is:\n *\n * allow/whitelist an allow-list decides what reaches the sink\n * escape/sanitize the value is encoded for its output context\n * realpath/… the path is resolved and re-checked before use\n * process.env/… the value comes from the environment, not the request\n * ObjectInputFilter a class allow-list is installed on the stream\n *\n * A guard match suppresses the finding rather than downgrading it. Reporting\n * \"we saw an allow-list but flagged it anyway\" is the behaviour that makes\n * operators stop reading scanner output.\n */\nexport const GENERIC_GUARD =\n /\\ballow(?:ed|list|_list|ed_hosts)?\\b|\\bwhitelist\\b|\\bescape(?:Html|Html4|Xml|Sql)?\\s*\\(|\\bhtml_escape\\b|\\bhtmlspecialchars\\s*\\(|\\bsanitiz\\w*\\b|\\bencoded\\b|\\brealpath\\b|\\bcommonpath\\b|\\bresolve\\(\\)\\.startsWith\\b|\\bprocess\\.env\\b|\\bos\\.environ\\b|\\bgetenv\\b|\\bENV\\s*\\[|setObjectInputFilter|ObjectInputFilter/i;\n\n/** Evidence that an XML parser factory has been hardened against XXE. */\nconst XXE_GUARD =\n /FEATURE_SECURE_PROCESSING|setExpandEntityReferences|disallow-doctype-decl|external-general-entities|external-parameter-entities|setXIncludeAware\\s*\\(\\s*false/;\n\n/** A sink that executes whatever string reaches it. */\nconst CODE_SINK =\n /\\bglobalThis\\s*\\[|\\bconstructor\\b|\\beval\\b|\\bFunction\\b|\\brun\\s*\\(|\\bvm\\s*\\.\\s*run/;\n\n/** A sink whose output is retained: a log, a console, an outbound request. */\nconst EXFIL_SINK = /\\bconsole\\s*\\.\\s*(?:log|debug|info|warn|error)\\s*\\(|\\bfetch\\s*\\(|\\baxios\\b|\\brequest\\s*\\(|\\.\\s*send\\s*\\(/;\n\n/**\n * SQL text that is being *assembled* rather than parameterised.\n *\n * The four tails are the four ways to build a string in the languages this\n * covers: `+` concatenation, `${}` template interpolation, `%`/`.format()`\n * substitution, and Ruby's `#{}`. A bound placeholder (`$1`, `?`, `%s` passed\n * as an argument) leaves a comma after the closing quote and matches none of\n * them — which is exactly how the safe counterparts stay unflagged.\n */\nconst SQL_KEYWORDS = 'SELECT|INSERT\\\\s+INTO|INSERT|UPDATE|DELETE\\\\s+FROM|DELETE|DROP|UNION\\\\s+SELECT';\n\n/**\n * A quoted string containing a SQL verb.\n *\n * Two variants, one per quote character, because the interesting strings\n * contain the *other* quote:\n *\n * \"SELECT id FROM users WHERE id = '\" + id + \"'\"\n *\n * A single `[\"'][^\"'\\n]*` class stops dead at that inner `'` and matches\n * nothing — which silently drops the most common SQL-injection shape in every\n * language at once. Match a double-quoted string with a class that excludes\n * only `\"`, and vice versa.\n */\nconst SQL_IN_DOUBLE = `\"[^\"\\\\n]*(?:${SQL_KEYWORDS})\\\\b[^\"\\\\n]*\"`;\nconst SQL_IN_SINGLE = `'[^'\\\\n]*(?:${SQL_KEYWORDS})\\\\b[^'\\\\n]*'`;\nconst SQL_STRING = `(?:${SQL_IN_DOUBLE}|${SQL_IN_SINGLE})`;\n\nexport const CODE_RULES: readonly CodeRule[] = [\n // ── Injection: SQL ───────────────────────────────────────────────────────\n {\n id: 'sql-string-concatenation',\n title: 'SQL assembled by concatenation or interpolation',\n consequence:\n 'A quote in the interpolated value changes the query’s meaning — the query runs as the attacker wrote it, not as you wrote it.',\n cwe: 'CWE-89',\n severity: 'critical',\n // The tail is what distinguishes assembly from parameterisation. A bound\n // query leaves a comma after the closing quote (`\"… = $1\", [id]`) and\n // matches none of these.\n pattern: new RegExp(\n `${SQL_STRING}\\\\s*\\\\+|` +\n `${SQL_STRING}\\\\s*%\\\\s*[\\\\w(]|` +\n `${SQL_STRING}\\\\s*\\\\.\\\\s*format\\\\s*\\\\(|` +\n '\\\\+\\\\s*(?:\"[^\"\\\\n]*|\\'[^\\'\\\\n]*)(?:WHERE|ORDER\\\\s+BY|VALUES|SET)\\\\b',\n 'i',\n ),\n },\n {\n id: 'sql-template-interpolation',\n title: 'SQL built from a template literal or f-string',\n consequence:\n 'Template interpolation is string concatenation with nicer syntax — it binds nothing and escapes nothing.',\n cwe: 'CWE-89',\n severity: 'critical',\n pattern: new RegExp(\n `\\`[^\\`\\\\n]*(?:${SQL_KEYWORDS})\\\\b[^\\`\\\\n]*\\\\$\\\\{|` +\n `\\\\bf\"[^\"\\\\n]*(?:${SQL_KEYWORDS})\\\\b[^\"\\\\n]*\\\\{|` +\n `\\\\bf'[^'\\\\n]*(?:${SQL_KEYWORDS})\\\\b[^'\\\\n]*\\\\{`,\n 'i',\n ),\n },\n {\n id: 'sql-format-call',\n title: 'SQL text produced by a format helper',\n consequence:\n '`Sprintf`/`String.format` substitute without quoting; the resulting string is concatenated SQL by another name.',\n cwe: 'CWE-89',\n severity: 'critical',\n languages: ['go', 'java'],\n pattern: new RegExp(\n `\\\\b(?:fmt\\\\.Sprintf|String\\\\.format)\\\\s*\\\\(\\\\s*\"[^\"\\\\n]*(?:${SQL_KEYWORDS})\\\\b`,\n 'i',\n ),\n },\n {\n id: 'rb-sql-interpolation',\n title: 'ActiveRecord query built by string interpolation',\n consequence:\n '`where(\"… #{value}\")` interpolates before the adapter sees it, so no binding ever happens.',\n cwe: 'CWE-89',\n severity: 'critical',\n languages: ['ruby'],\n pattern:\n /\\b(?:where|find_by_sql|execute|select_all|select_values|order|group|pluck)\\s*[( ]\\s*(?:\"[^\"\\n]*|'[^'\\n]*)#\\{/,\n },\n\n // ── Injection: OS command ────────────────────────────────────────────────\n {\n id: 'js-shell-exec-interpolation',\n title: 'shell execution with an interpolated string',\n consequence: 'A `;` or `$(…)` in the interpolated value runs as the server user.',\n cwe: 'CWE-78',\n severity: 'critical',\n languages: ['javascript', 'typescript'],\n pattern:\n /\\b(?:exec|execSync|spawn|spawnSync)\\s*\\(\\s*(?:`[^`]*\\$\\{|['\"][^'\"]*['\"]\\s*\\+|[a-zA-Z_$][\\w$]*\\s*\\+)/,\n },\n {\n id: 'py-shell-command-string',\n title: 'shell command built from a string',\n consequence:\n '`os.system` and `shell=True` hand the string to `/bin/sh`, which happily interprets metacharacters.',\n cwe: 'CWE-78',\n severity: 'critical',\n languages: ['python'],\n pattern:\n /\\bos\\.(?:system|popen)\\s*\\(\\s*(?:f?['\"][^'\"]*['\"]\\s*(?:\\+|%|\\.\\s*format)|f['\"]|[a-zA-Z_]\\w*\\s*[,)])|\\bsubprocess\\.(?:run|call|check_call|check_output|Popen)\\s*\\([^)]*\\bshell\\s*=\\s*True/,\n },\n {\n id: 'go-shell-exec-command',\n title: 'exec.Command invoking a shell',\n consequence:\n 'Passing `sh -c` re-introduces the shell that `exec.Command`’s argv interface exists to avoid.',\n cwe: 'CWE-78',\n severity: 'critical',\n languages: ['go'],\n pattern: /\\bexec\\.Command(?:Context)?\\s*\\(\\s*(?:ctx\\s*,\\s*)?\"(?:\\/bin\\/)?(?:sh|bash|zsh|cmd|powershell)\"\\s*,\\s*\"(?:-c|\\/c)\"/,\n },\n {\n id: 'rb-backtick-interpolation',\n title: 'backtick command with interpolation',\n consequence: 'Ruby backticks are a shell invocation; `#{}` inside one is command injection.',\n cwe: 'CWE-78',\n severity: 'critical',\n languages: ['ruby'],\n pattern: /`[^`\\n]*#\\{|\\bsystem\\s*\\(\\s*[\"'][^\"'\\n]*#\\{|%x\\[[^\\]]*#\\{/,\n },\n\n // ── Injection: dynamic code ──────────────────────────────────────────────\n {\n id: 'js-dynamic-code-execution',\n title: 'dynamic code execution',\n consequence: 'Any string reaching this call executes as code with the process’ privileges.',\n cwe: 'CWE-95',\n severity: 'critical',\n languages: ['javascript', 'typescript'],\n pattern:\n /\\beval\\s*\\(|\\bnew\\s+Function\\s*\\(|\\bvm\\s*\\.\\s*run(?:InThisContext|InNewContext|InContext)\\s*\\(|\\bset(?:Timeout|Interval)\\s*\\(\\s*(?:['\"`]|(?:req|request|ctx|params|query|body)\\b)/,\n },\n {\n id: 'js-indirect-code-sink',\n title: 'code sink reached indirectly',\n consequence:\n 'Resolving `eval`/`Function` through `globalThis[…]` or `.constructor` hides the sink from literal matching. Legitimate code has no reason to.',\n cwe: 'CWE-506',\n severity: 'high',\n languages: ['javascript', 'typescript'],\n pattern:\n /\\bglobalThis\\s*\\[\\s*[a-zA-Z_$][\\w$]*\\s*\\]|\\(\\s*function\\s*\\(\\s*\\)\\s*\\{\\s*\\}\\s*\\)\\s*\\.\\s*constructor/,\n },\n {\n id: 'js-encoded-payload-execution',\n title: 'encoded blob decoded next to a code sink',\n consequence:\n 'A base64 literal that is decoded and executed is the standard shape of a planted backdoor; the encoding exists to defeat review.',\n cwe: 'CWE-506',\n severity: 'critical',\n languages: ['javascript', 'typescript'],\n pattern: /\\bBuffer\\.from\\s*\\(\\s*[\\w.$]+\\s*,\\s*['\"]base64['\"]\\s*\\)|\\batob\\s*\\(\\s*[\\w.$]+\\s*\\)/,\n requires: CODE_SINK,\n guardBack: 6,\n guardForward: 3,\n },\n {\n id: 'py-dynamic-code-execution',\n title: 'dynamic code execution',\n consequence: 'Any string reaching this call executes as Python with the process’ privileges.',\n cwe: 'CWE-95',\n severity: 'critical',\n languages: ['python'],\n pattern: /\\b(?:eval|exec)\\s*\\(\\s*(?!['\"]\\s*\\))[a-zA-Z_(f'\"]/,\n needsContext: true,\n },\n {\n id: 'rb-dynamic-dispatch',\n title: 'dynamic code execution or unrestricted #send',\n consequence:\n '`eval` runs arbitrary Ruby; unrestricted `#send` lets the caller invoke any method on the receiver, including private ones.',\n cwe: 'CWE-95',\n severity: 'critical',\n languages: ['ruby'],\n pattern: /\\beval\\s*\\(|\\binstance_eval\\s*\\(|\\bclass_eval\\s*\\(|\\.\\s*send\\s*\\(\\s*(?:params|request|args)\\b/,\n },\n\n // ── Cross-site scripting ─────────────────────────────────────────────────\n {\n id: 'js-unescaped-html-sink',\n title: 'unescaped HTML rendering',\n consequence: 'A script tag in the value executes in the victim’s session — stored or reflected XSS.',\n cwe: 'CWE-79',\n severity: 'high',\n languages: ['javascript', 'typescript'],\n pattern:\n /\\bdangerouslySetInnerHTML\\s*=|\\.\\s*(?:innerHTML|outerHTML)\\s*=\\s*(?!\\s*['\"`]\\s*['\"`]\\s*;?\\s*$)|\\bdocument\\s*\\.\\s*write(?:ln)?\\s*\\(|\\.\\s*insertAdjacentHTML\\s*\\(/,\n },\n {\n id: 'java-html-writer-concatenation',\n title: 'HTML written to the response by concatenation',\n consequence:\n 'The servlet writer performs no encoding; a value concatenated into markup is rendered as markup.',\n cwe: 'CWE-79',\n severity: 'high',\n languages: ['java'],\n pattern: /\\b(?:println|print|write)\\s*\\(\\s*\"[^\"\\n]*<[^\"\\n]*\"\\s*\\+/,\n },\n {\n id: 'rb-unescaped-output',\n title: 'Rails output escaping bypassed',\n consequence:\n '`html_safe` and `raw` tell Rails the string is already safe. If it came from a parameter, it is not.',\n cwe: 'CWE-79',\n severity: 'high',\n languages: ['ruby'],\n pattern: /\\.\\s*html_safe\\b|\\braw\\s*\\(\\s*(?:params|request|@)|\\blink_to\\s+[^,\\n]+,\\s*params\\s*\\[/,\n },\n {\n id: 'py-template-autoescape-off',\n title: 'template rendering with escaping disabled',\n consequence:\n 'With autoescape off — or a `|safe` filter — every interpolated value is rendered as markup.',\n cwe: 'CWE-79',\n severity: 'high',\n languages: ['python'],\n pattern: /\\bEnvironment\\s*\\([^)]*\\bautoescape\\s*=\\s*False|\\|\\s*safe\\b|\\bMarkup\\s*\\(\\s*(?!['\"])/,\n },\n {\n id: 'py-template-from-input',\n title: 'template compiled from a non-literal source',\n consequence:\n 'Server-side template injection. In Jinja2 the sandbox is escapable, so this escalates from XSS to remote code execution.',\n cwe: 'CWE-1336',\n severity: 'critical',\n languages: ['python'],\n pattern: /\\bTemplate\\s*\\(\\s*(?!['\"])[a-zA-Z_]/,\n needsContext: true,\n },\n\n // ── Server-side request forgery ──────────────────────────────────────────\n {\n id: 'js-ssrf-outbound-request',\n title: 'outbound request to a non-constant URL',\n consequence:\n 'An attacker who controls the URL reaches the cloud metadata endpoint, localhost, and every service on the private network.',\n cwe: 'CWE-918',\n severity: 'high',\n languages: ['javascript', 'typescript'],\n pattern:\n /\\bfetch\\s*\\(\\s*[a-zA-Z_$][\\w$]*\\s*[,)]|\\bhttps?\\s*\\.\\s*(?:get|request)\\s*\\(\\s*[a-zA-Z_$][\\w$]*\\s*[,)]|\\baxios\\s*\\.\\s*get\\s*\\(\\s*[a-zA-Z_$][\\w$]*\\s*[,)]/,\n needsContext: true,\n },\n {\n id: 'py-ssrf-outbound-request',\n title: 'outbound request to a non-constant URL',\n consequence:\n 'An attacker who controls the URL reaches the cloud metadata endpoint, localhost, and every service on the private network.',\n cwe: 'CWE-918',\n severity: 'high',\n languages: ['python'],\n pattern:\n /\\brequests\\.(?:get|request|head)\\s*\\(\\s*[a-zA-Z_]\\w*\\s*[,)]|\\burlopen\\s*\\(\\s*[a-zA-Z_]\\w*\\s*[,)]|\\bhttpx\\.get\\s*\\(\\s*[a-zA-Z_]\\w*\\s*[,)]/,\n needsContext: true,\n },\n {\n id: 'go-ssrf-outbound-request',\n title: 'outbound request to a non-constant URL',\n consequence:\n 'An attacker who controls the URL reaches the cloud metadata endpoint, localhost, and every service on the private network.',\n cwe: 'CWE-918',\n severity: 'high',\n languages: ['go'],\n pattern: /\\bhttp\\.(?:Get|Post|Head)\\s*\\(\\s*(?:[a-zA-Z_]\\w*\\s*[,)]|\"[^\"]*\"\\s*\\+)/,\n needsContext: true,\n },\n\n // ── Open redirect ────────────────────────────────────────────────────────\n {\n id: 'js-open-redirect',\n title: 'redirect to a non-constant destination',\n consequence:\n 'Your domain becomes the credible first hop of a phishing chain; the victim sees your hostname in the link they clicked.',\n cwe: 'CWE-601',\n severity: 'medium',\n languages: ['javascript', 'typescript'],\n pattern:\n /\\b(?:res|response)\\s*\\.\\s*redirect\\s*\\(\\s*[a-zA-Z_$][\\w$]*\\s*\\)|\\bwindow\\s*\\.\\s*location(?:\\s*\\.\\s*(?:href|replace))?\\s*(?:=\\s*[a-zA-Z_$]|\\(\\s*[a-zA-Z_$][\\w$]*\\s*\\))/,\n needsContext: true,\n },\n\n // ── Deserialisation ──────────────────────────────────────────────────────\n {\n id: 'py-unsafe-deserialization',\n title: 'deserialisation of untrusted data',\n consequence:\n '`pickle` and `yaml.load` instantiate arbitrary types during parsing — a crafted payload is remote code execution, not a parse error.',\n cwe: 'CWE-502',\n severity: 'critical',\n languages: ['python'],\n pattern: /\\bpickle\\.loads?\\s*\\(|\\bcPickle\\.loads?\\s*\\(|\\bmarshal\\.loads\\s*\\(|\\byaml\\.load\\s*\\(|\\bjsonpickle\\.decode\\s*\\(/,\n },\n {\n id: 'java-unsafe-deserialization',\n title: 'Java deserialisation without a class filter',\n consequence:\n 'A gadget chain in the classpath turns `readObject()` on attacker bytes into remote code execution.',\n cwe: 'CWE-502',\n severity: 'critical',\n languages: ['java'],\n pattern: /\\breadObject\\s*\\(\\s*\\)|\\bnew\\s+ObjectInputStream\\s*\\(/,\n guardBack: 8,\n // The stream is constructed, *then* filtered. Without a forward window the\n // guarded case matches on its constructor line and reports a correct\n // implementation as a finding.\n guardForward: 6,\n },\n {\n id: 'js-unsafe-yaml-load',\n title: 'YAML parsed with type resolution enabled',\n consequence: 'A crafted document can instantiate arbitrary types during parsing.',\n cwe: 'CWE-502',\n severity: 'high',\n languages: ['javascript', 'typescript'],\n pattern: /\\byaml\\s*\\.\\s*load\\s*\\((?![^)]*safe)|\\bloadAll\\s*\\([^)]*unsafe/i,\n },\n\n // ── XML external entities ────────────────────────────────────────────────\n {\n id: 'java-xxe-parser-defaults',\n title: 'XML parser left on its insecure defaults',\n consequence:\n 'External entity expansion reads local files and makes outbound requests on the parser’s behalf — file disclosure and SSRF from a document.',\n cwe: 'CWE-611',\n severity: 'high',\n languages: ['java'],\n pattern:\n /\\b(?:DocumentBuilderFactory|SAXParserFactory|XMLInputFactory|TransformerFactory|SchemaFactory)\\s*\\.\\s*newInstance\\s*\\(\\s*\\)/,\n guard: XXE_GUARD,\n guardBack: 4,\n guardForward: 8,\n },\n {\n id: 'java-xxe-parse-call',\n title: 'XML parsed by a builder that was never hardened',\n consequence:\n 'The expansion happens at `parse()`. Flagging only the factory misses the line where the document is actually read.',\n cwe: 'CWE-611',\n severity: 'high',\n languages: ['java'],\n // Receiver-qualified so `LocalDate.parse(s)` and friends stay out of it.\n pattern: /\\b\\w*(?:[Bb]uilder|[Pp]arser|[Rr]eader)\\s*\\.\\s*parse\\s*\\(/,\n guard: XXE_GUARD,\n guardBack: 6,\n guardForward: 4,\n },\n\n // ── Path traversal ───────────────────────────────────────────────────────\n {\n id: 'py-path-traversal',\n title: 'file opened at a path built from input',\n consequence: 'A `../` sequence — or an absolute path — reads or writes outside the intended directory.',\n cwe: 'CWE-22',\n severity: 'high',\n languages: ['python'],\n pattern: /\\bopen\\s*\\(\\s*(?:os\\.path\\.join\\s*\\(|[a-zA-Z_]\\w*\\s*\\+|f['\"])/,\n needsContext: true,\n },\n {\n id: 'js-path-traversal',\n title: 'file path built from a variable',\n consequence: 'A `../` sequence in the value reads or writes outside the intended directory.',\n cwe: 'CWE-22',\n severity: 'medium',\n languages: ['javascript', 'typescript'],\n pattern:\n /\\b(?:readFile|readFileSync|writeFile|writeFileSync|createReadStream|createWriteStream|unlink|unlinkSync|sendFile)\\s*\\(\\s*(?:`[^`]*\\$\\{|[a-zA-Z_$][\\w$]*\\s*\\+|path\\.join\\s*\\([^)]*(?:req|request)\\b)/,\n needsContext: true,\n },\n\n // ── Cryptography, tokens, randomness ─────────────────────────────────────\n {\n id: 'js-jwt-decode-without-verify',\n title: 'JWT decoded without verifying the signature',\n consequence:\n '`decode` parses the claims and checks nothing. Anyone can mint a token with any `sub` and any `role`.',\n cwe: 'CWE-347',\n severity: 'critical',\n languages: ['javascript', 'typescript'],\n pattern: /\\bjwt\\s*\\.\\s*decode\\s*\\(|\\bjsonwebtoken\\s*\\.\\s*decode\\s*\\(|\\bdecodeJwt\\s*\\(/,\n },\n {\n id: 'tls-verification-disabled',\n title: 'TLS certificate verification disabled',\n consequence:\n 'Every connection made this way is trivially interceptable; the encryption is decorative.',\n cwe: 'CWE-295',\n severity: 'high',\n pattern:\n /rejectUnauthorized\\s*:\\s*false|NODE_TLS_REJECT_UNAUTHORIZED\\s*[=:]\\s*['\"]?0|strictSSL\\s*:\\s*false|\\bverify\\s*=\\s*False\\b|InsecureSkipVerify\\s*:\\s*true/,\n },\n {\n id: 'weak-hash-on-credential',\n title: 'broken hash used on a credential',\n consequence: 'MD5 and SHA-1 are fast and collision-prone; hashed passwords are recoverable.',\n cwe: 'CWE-327',\n severity: 'high',\n pattern:\n /(?:createHash|hashlib|MessageDigest\\.getInstance|Digest::)\\s*[.(]?\\s*['\"]?(?:md5|MD5|sha1|SHA-?1)['\"]?\\s*\\)?[\\s\\S]{0,80}(?:password|passwd|secret|token|credential)/i,\n },\n {\n id: 'insecure-randomness-for-secret',\n title: 'predictable randomness used for a security value',\n consequence:\n '`Math.random`/`random.random` are predictable; tokens, session ids and reset codes built from them are guessable.',\n cwe: 'CWE-338',\n severity: 'high',\n pattern:\n /(?:token|secret|password|salt|nonce|session|otp|reset|apikey|api_key)[\\w]*\\s*[:=][^;\\n]{0,60}(?:Math\\s*\\.\\s*random\\s*\\(|\\brandom\\s*\\.\\s*(?:random|randint|choice)\\s*\\(|\\brand\\s*\\()/i,\n },\n {\n id: 'redos-nested-quantifier',\n title: 'regex with nested unbounded quantifiers',\n consequence:\n 'Catastrophic backtracking: a crafted input of a few dozen characters pins a CPU core for minutes.',\n cwe: 'CWE-1333',\n severity: 'medium',\n pattern: /\\([^)\\n]*[+*]\\s*\\)\\s*[+*]|\\([^)\\n]*\\{\\d+,\\}\\s*\\)\\s*[+*{]/,\n },\n\n // ── Temporary files ──────────────────────────────────────────────────────\n {\n id: 'insecure-temp-file',\n title: 'predictable temporary file path',\n consequence:\n 'A predictable name in a world-writable directory is a symlink attack: an attacker pre-creates the path and your process writes through it.',\n cwe: 'CWE-377',\n severity: 'medium',\n // A hardcoded path under /tmp is the finding whether or not it is\n // formatted: `\"/tmp/application.log.tmp\"` is worse than the PID-based one,\n // because every process on the host can predict it exactly.\n pattern:\n /\\btempfile\\.mktemp\\s*\\(|\\bos\\.tmpnam\\s*\\(|['\"]\\/tmp\\/[^'\"\\n]+['\"]|['\"]\\/tmp\\/[^'\"\\n]*\\{|\\bFile\\.createTempFile\\s*\\(/,\n },\n\n // ── Information exposure ─────────────────────────────────────────────────\n {\n id: 'py-stack-trace-returned',\n title: 'stack trace returned to the caller',\n consequence:\n 'Tracebacks leak absolute paths, dependency versions and source fragments — the reconnaissance an attacker would otherwise have to guess at.',\n cwe: 'CWE-209',\n severity: 'medium',\n languages: ['python'],\n pattern: /\\breturn\\b[^\\n]*\\btraceback\\.(?:format_exc|format_exception|print_exc)\\s*\\(|\\breturn\\b[^\\n]*\\bstr\\s*\\(\\s*e\\s*\\)/,\n },\n {\n id: 'js-environment-exfiltration',\n title: 'process environment serialised into a payload',\n consequence:\n 'The environment is where every secret lives. Serialising it whole into a request body is credential exfiltration regardless of the endpoint.',\n cwe: 'CWE-532',\n severity: 'critical',\n languages: ['javascript', 'typescript'],\n pattern: /\\bJSON\\.stringify\\s*\\(\\s*\\{?[^)]*\\bprocess\\.env\\b(?!\\s*\\.)/,\n guard: false,\n },\n {\n id: 'js-credential-logged',\n title: 'credential read from the environment into a log sink',\n consequence:\n 'CI retains job logs, and on public forks it publishes them. A token printed once is a token leaked permanently.',\n cwe: 'CWE-532',\n severity: 'high',\n languages: ['javascript', 'typescript'],\n pattern: /\\b(?:token|apiKey|api_key|secret|password|credential|auth)\\w*\\s*:\\s*process\\.env\\.\\w+/i,\n requires: EXFIL_SINK,\n guard: false,\n guardBack: 4,\n guardForward: 1,\n },\n\n // ── Prototype pollution ──────────────────────────────────────────────────\n {\n id: 'js-prototype-pollution',\n title: 'write to a prototype-reachable key',\n consequence:\n 'An attacker-supplied `__proto__` key changes behaviour for every object in the process, including ones it never touched.',\n cwe: 'CWE-1321',\n severity: 'high',\n languages: ['javascript', 'typescript'],\n pattern:\n /\\[\\s*['\"]__proto__['\"]\\s*\\]|\\bObject\\s*\\.\\s*assign\\s*\\(\\s*[\\w.$]*\\.prototype\\b|\\.\\s*__proto__\\s*=/,\n },\n];\n\n/**\n * Classes deliberately not implemented, and why.\n *\n * Recorded in code rather than in a document because the reason is a design\n * constraint, not a backlog item: each of these needs reasoning this scanner\n * does not do, and the line-oriented approximation of each one flags ordinary\n * software. A missing detection is a known number. A rule that fires on every\n * session read is a scanner nobody runs twice.\n */\nexport const KNOWN_GAPS: readonly { cwe: string; name: string; why: string }[] = [\n {\n cwe: 'CWE-352',\n name: 'Missing CSRF token',\n why: 'Requires knowing that a handler is state-changing and that no token check dominates the mutation. Line-locally, the vulnerable and the guarded handler are the same code.',\n },\n {\n cwe: 'CWE-362',\n name: 'Check-then-use race (TOCTOU)',\n why: 'Requires pairing a check with a later use of the same path across statements. A rule matching either half alone flags every `os.path.exists`.',\n },\n {\n cwe: 'CWE-190',\n name: 'Integer overflow / unchecked narrowing',\n why: 'Requires range reasoning about the operands. Flagging arithmetic on a request value would flag arithmetic.',\n },\n {\n cwe: 'CWE-1321',\n name: 'Prototype pollution via generic dynamic assignment',\n why: '`target[key] = source[key]` is both the vulnerable merge and the guarded one; only a denylist several lines away distinguishes them. The explicit `__proto__` shapes are covered.',\n },\n];\n\nexport interface MatchContext {\n /** All lines of the file, 0-indexed. */\n lines: readonly string[];\n /** 0-indexed position of the line being tested. */\n index: number;\n language: ScanLanguage;\n /**\n * Indexes inside a multi-line string or block comment, from `proseLines`.\n * Treated exactly like comment lines: not scanned, not guard evidence.\n */\n prose?: ReadonlySet<number>;\n}\n\nconst COMMENT_PREFIX = /^\\s*(?:\\/\\/|\\/\\*|\\*|#|--|<!--)/;\n\n/**\n * A line that introduces a name rather than doing something with it.\n *\n * Excluded from guard windows because a *name* is not evidence. The corpus\n * contains `def sanitize_path_vulnerable(path):` directly above three\n * catastrophic-backtracking regexes: reading that signature as proof of\n * sanitisation suppressed all three. Naming a function `sanitize` does not\n * sanitise anything, and neither does calling one `validate` or `escape`.\n */\nconst DEFINITION_PREFIX =\n /^\\s*(?:(?:export|public|private|protected|static|final|async|abstract)\\s+)*(?:def|function|func|class|module|interface|struct|impl|fn|sub)\\b/;\n\n/**\n * Comment lines are documentation, not code.\n *\n * Excluded from guard windows for a reason found the hard way: the testbed's\n * vulnerable cases carry comments like \"No `__proto__` guard\" and \"without\n * allow-list validation\". Reading those as evidence of a guard suppresses\n * exactly the findings the corpus exists to measure.\n */\nexport function isComment(line: string): boolean {\n return COMMENT_PREFIX.test(line);\n}\n\n/**\n * Line indexes belonging to multi-line strings and block comments.\n *\n * Python module docstrings are the case that forced this. Every file in the\n * testbed opens with a `\"\"\"…\"\"\"` header describing the vulnerability it\n * contains — `pickle.loads`, `(a+)+`, `autoescape=False` — and scanning that\n * prose produces findings *about the documentation*, reported at line 9 of a\n * file whose code starts at line 18. They are unattributable by construction,\n * and they are the scanner reading its own description back to itself.\n */\nexport function proseLines(lines: readonly string[]): Set<number> {\n const inside = new Set<number>();\n let delimiter: string | null = null;\n\n lines.forEach((line, index) => {\n if (delimiter) {\n inside.add(index);\n if (line.includes(delimiter)) delimiter = null;\n return;\n }\n for (const candidate of ['\"\"\"', \"'''\"]) {\n const start = line.indexOf(candidate);\n if (start === -1) continue;\n // A docstring opened and closed on one line encloses nothing.\n if (line.indexOf(candidate, start + candidate.length) !== -1) return;\n delimiter = candidate;\n inside.add(index);\n return;\n }\n });\n\n return inside;\n}\n\nfunction skippable(line: string, index: number, prose?: ReadonlySet<number>): boolean {\n return isComment(line) || DEFINITION_PREFIX.test(line) || (prose?.has(index) ?? false);\n}\n\nfunction windowText(\n lines: readonly string[],\n index: number,\n back: number,\n forward: number,\n prose?: ReadonlySet<number>,\n): string {\n const from = Math.max(0, index - back);\n const to = Math.min(lines.length - 1, index + forward);\n const collected: string[] = [];\n for (let i = from; i <= to; i += 1) {\n const line = lines[i] ?? '';\n if (i !== index && skippable(line, i, prose)) continue;\n collected.push(line);\n }\n return collected.join('\\n');\n}\n\nexport interface RuleMatch {\n rule: CodeRule;\n confidence: Confidence;\n severity: Severity;\n}\n\n/**\n * Test one rule against one line.\n *\n * Returns `null` when the rule does not apply, does not match, is guarded, or\n * needs context it cannot see.\n */\nexport function evaluateRule(rule: CodeRule, ctx: MatchContext): RuleMatch | null {\n if (rule.languages && !rule.languages.includes(ctx.language)) return null;\n\n const line = ctx.lines[ctx.index] ?? '';\n if (isComment(line) || ctx.prose?.has(ctx.index)) return null;\n if (!rule.pattern.test(line)) return null;\n\n const back = rule.guardBack ?? 8;\n const forward = rule.guardForward ?? 0;\n const context = windowText(ctx.lines, ctx.index, back, forward, ctx.prose);\n\n if (rule.requires && !rule.requires.test(context)) return null;\n\n const guard = rule.guard === undefined ? GENERIC_GUARD : rule.guard;\n if (guard && (guard.test(line) || guard.test(context))) return null;\n\n const untrusted = untrustedPatternFor(ctx.language);\n const contextual = untrusted.test(line) || untrusted.test(context);\n if (rule.needsContext && !contextual) return null;\n\n const confidence: Confidence = contextual ? 'contextual' : 'pattern';\n return { rule, confidence, severity: severityFor(rule.severity, confidence) };\n}\n","/**\n * Dependency-manifest rules — typosquats, dependency confusion, and\n * install-time lifecycle scripts.\n *\n * This is the one detector here that does not need a vulnerability to exist\n * yet. `event-stream` (2018), `ua-parser-js` (2021) and `node-ipc` (2022) were\n * all advisory-clean at the moment they were installed; the advisory gets\n * written *after* somebody notices. What they shared was a name you would\n * misread and a lifecycle script that ran with the installing user's\n * privileges. Both are visible in the manifest, before anything is fetched.\n */\n\nimport type { Severity } from './types.js';\n\nexport interface ManifestFinding {\n ruleId: string;\n title: string;\n line: number;\n severity: Severity;\n cwe: string;\n message: string;\n consequence: string;\n excerpt: string;\n}\n\n/**\n * Popular package names, by ecosystem.\n *\n * Not a registry mirror and not trying to be. It is the set of names worth\n * *impersonating* — a typosquat only pays off against a package people install\n * without looking. A longer list would not find more attacks; it would find\n * more legitimate packages that happen to sit one edit from something famous.\n */\nconst POPULAR_NPM = [\n 'react', 'react-dom', 'lodash', 'express', 'axios', 'chalk', 'commander', 'debug',\n 'moment', 'dayjs', 'uuid', 'dotenv', 'typescript', 'webpack', 'vite', 'rollup',\n 'eslint', 'prettier', 'jest', 'vitest', 'mocha', 'chai', 'sinon', 'request',\n 'node-fetch', 'cross-env', 'rimraf', 'glob', 'minimist', 'yargs', 'inquirer',\n 'colors', 'ora', 'semver', 'ws', 'socket.io', 'mongoose', 'sequelize', 'knex',\n 'pg', 'mysql', 'mysql2', 'redis', 'ioredis', 'jsonwebtoken', 'bcrypt', 'passport',\n 'cors', 'helmet', 'morgan', 'body-parser', 'multer', 'nodemailer', 'puppeteer',\n 'playwright', 'cheerio', 'sharp', 'canvas', 'esbuild', 'babel', 'postcss',\n 'tailwindcss', 'next', 'nuxt', 'vue', 'svelte', 'angular', 'rxjs', 'zod',\n];\n\nconst POPULAR_PYPI = [\n 'requests', 'urllib3', 'numpy', 'pandas', 'scipy', 'flask', 'django', 'fastapi',\n 'sqlalchemy', 'pydantic', 'click', 'jinja2', 'pyyaml', 'boto3', 'botocore',\n 'setuptools', 'wheel', 'pip', 'six', 'certifi', 'idna', 'chardet', 'attrs',\n 'python-dateutil', 'pytz', 'pytest', 'tox', 'black', 'flake8', 'mypy', 'isort',\n 'beautifulsoup4', 'lxml', 'pillow', 'matplotlib', 'seaborn', 'scikit-learn',\n 'tensorflow', 'torch', 'transformers', 'openai', 'anthropic', 'httpx', 'aiohttp',\n 'celery', 'redis', 'psycopg2', 'pymongo', 'cryptography', 'paramiko', 'colorama',\n];\n\n/**\n * Names that read as belonging to a private registry.\n *\n * A manifest that asks a public index for a package whose name announces it is\n * internal is the dependency-confusion setup: whoever registers the name\n * publicly first wins, and the build takes their copy.\n */\nconst INTERNAL_MARKER = /(?:^|[-_/@])(?:internal|private|corp|intranet|inhouse|confidential)(?:$|[-_/])/i;\n\n/** Strip the separators a squatter varies but a reader does not notice. */\nfunction normalizeName(name: string): string {\n return name.toLowerCase().replace(/^@/, '').replace(/[-_.\\s]/g, '');\n}\n\n/**\n * Damerau-Levenshtein distance, capped.\n *\n * Damerau rather than plain Levenshtein because the single most common\n * typosquat is a transposition — `lodahs` for `lodash`, `reqeust` for\n * `request`. Levenshtein scores those as 2, the same as two unrelated edits,\n * which puts them below any threshold tight enough to be useful.\n */\nexport function editDistance(a: string, b: string, cap = 3): number {\n if (a === b) return 0;\n if (Math.abs(a.length - b.length) > cap) return cap + 1;\n\n const rows: number[][] = [];\n for (let i = 0; i <= a.length; i += 1) {\n rows.push(new Array<number>(b.length + 1).fill(0));\n rows[i]![0] = i;\n }\n for (let j = 0; j <= b.length; j += 1) rows[0]![j] = j;\n\n for (let i = 1; i <= a.length; i += 1) {\n for (let j = 1; j <= b.length; j += 1) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n let best = Math.min(\n rows[i - 1]![j]! + 1,\n rows[i]![j - 1]! + 1,\n rows[i - 1]![j - 1]! + cost,\n );\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n best = Math.min(best, rows[i - 2]![j - 2]! + 1);\n }\n rows[i]![j] = best;\n }\n }\n return rows[a.length]![b.length]!;\n}\n\nexport interface SquatVerdict {\n impersonates: string;\n /** `separator` when only punctuation differs, `edit` when a character does. */\n kind: 'separator' | 'edit';\n}\n\n/**\n * Whether `name` looks like an attempt to be mistaken for a popular package.\n *\n * Exact matches return null first, always. The check that follows is\n * deliberately asymmetric: a name is suspicious for being *close to* a popular\n * package, never for being popular itself.\n */\nexport function detectTyposquat(name: string, ecosystem: 'npm' | 'pypi'): SquatVerdict | null {\n const popular = ecosystem === 'npm' ? POPULAR_NPM : POPULAR_PYPI;\n const lower = name.toLowerCase().replace(/^@[^/]+\\//, '');\n if (popular.includes(lower)) return null;\n if (lower.length < 4) return null;\n\n const normalized = normalizeName(lower);\n for (const candidate of popular) {\n const candidateNormalized = normalizeName(candidate);\n // `urllib-3` and `pythondateutil` normalise onto their targets exactly.\n // Nothing legitimate reaches a popular package's spelling by deleting or\n // inserting punctuation.\n if (normalized === candidateNormalized) return { impersonates: candidate, kind: 'separator' };\n if (editDistance(normalized, candidateNormalized, 1) === 1) {\n return { impersonates: candidate, kind: 'edit' };\n }\n }\n return null;\n}\n\nconst LIFECYCLE_SCRIPTS = ['preinstall', 'install', 'postinstall', 'prepare', 'prepublish'];\n\n/**\n * Scan a `package.json`.\n *\n * Text-oriented rather than object-oriented so every finding can carry the\n * line it came from. A finding an operator cannot navigate to is a finding\n * they will not act on.\n */\nexport function scanPackageJson(text: string): ManifestFinding[] {\n const findings: ManifestFinding[] = [];\n const lines = text.split('\\n');\n\n let parsed: Record<string, unknown>;\n try {\n parsed = JSON.parse(text) as Record<string, unknown>;\n } catch {\n return findings;\n }\n\n const lineOf = (needle: string): number => {\n const index = lines.findIndex((line) => line.includes(`\"${needle}\"`));\n return index === -1 ? 1 : index + 1;\n };\n\n const depBuckets = ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies'];\n for (const bucket of depBuckets) {\n const deps = parsed[bucket];\n if (!deps || typeof deps !== 'object') continue;\n for (const name of Object.keys(deps as Record<string, unknown>)) {\n const line = lineOf(name);\n\n if (INTERNAL_MARKER.test(name)) {\n findings.push({\n ruleId: 'manifest-dependency-confusion',\n title: 'internal-looking package resolved from a public registry',\n line,\n severity: 'critical',\n cwe: 'CWE-1357',\n message: `\"${name}\" names itself as internal but carries no registry pin`,\n consequence:\n 'Whoever registers this name publicly first wins the resolution, and their code runs in your build.',\n excerpt: (lines[line - 1] ?? '').trim(),\n });\n continue;\n }\n\n const squat = detectTyposquat(name, 'npm');\n if (squat) {\n findings.push({\n ruleId: 'manifest-typosquat',\n title: 'dependency name close to a popular package',\n line,\n severity: 'high',\n cwe: 'CWE-1357',\n message:\n squat.kind === 'separator'\n ? `\"${name}\" differs from \"${squat.impersonates}\" only in punctuation`\n : `\"${name}\" is one edit from \"${squat.impersonates}\"`,\n consequence:\n 'A reviewer scanning a diff reads the name they expected. The package that installs is the one that was written.',\n excerpt: (lines[line - 1] ?? '').trim(),\n });\n }\n }\n }\n\n const scripts = parsed.scripts;\n if (scripts && typeof scripts === 'object') {\n for (const [name, body] of Object.entries(scripts as Record<string, unknown>)) {\n if (!LIFECYCLE_SCRIPTS.includes(name)) continue;\n findings.push({\n ruleId: 'manifest-install-lifecycle-script',\n title: 'install-time lifecycle script',\n line: lineOf(name),\n severity: 'medium',\n cwe: 'CWE-506',\n message: `\"${name}\" runs automatically on install: ${String(body).slice(0, 120)}`,\n consequence:\n 'Lifecycle scripts run with the installing user’s privileges and network access, before any code is reviewed. It is the execution vector every notable npm compromise has used.',\n excerpt: (lines[lineOf(name) - 1] ?? '').trim(),\n });\n }\n }\n\n return findings;\n}\n\n/** Scan a `requirements.txt`. Same checks, different grammar. */\nexport function scanRequirementsTxt(text: string): ManifestFinding[] {\n const findings: ManifestFinding[] = [];\n const lines = text.split('\\n');\n\n lines.forEach((raw, index) => {\n const line = raw.trim();\n if (!line || line.startsWith('#') || line.startsWith('-')) return;\n\n const match = /^([A-Za-z0-9_.-]+)\\s*(?:[=<>!~]=|@|$)/.exec(line);\n const name = match?.[1];\n if (!name) return;\n\n if (INTERNAL_MARKER.test(name)) {\n findings.push({\n ruleId: 'manifest-dependency-confusion',\n title: 'internal-looking package resolved from a public index',\n line: index + 1,\n severity: 'critical',\n cwe: 'CWE-1357',\n message: `\"${name}\" names itself as internal but carries no index pin`,\n consequence:\n 'pip resolves the highest version across every configured index, so a public package of the same name shadows the private one.',\n excerpt: line,\n });\n return;\n }\n\n const squat = detectTyposquat(name, 'pypi');\n if (squat) {\n findings.push({\n ruleId: 'manifest-typosquat',\n title: 'dependency name close to a popular package',\n line: index + 1,\n severity: 'high',\n cwe: 'CWE-1357',\n message:\n squat.kind === 'separator'\n ? `\"${name}\" differs from \"${squat.impersonates}\" only in punctuation`\n : `\"${name}\" is one edit from \"${squat.impersonates}\"`,\n consequence:\n 'A reviewer scanning a diff reads the name they expected. The package that installs is the one that was written.',\n excerpt: line,\n });\n }\n });\n\n return findings;\n}\n","/**\n * Credential-shape rules for `threatcrush scan`.\n *\n * These are the rules ThreatCrush already scored 0.0% false positives on\n * against the public testbed's control group, so the bar for changing one is\n * high: a secret rule earns its place by matching material that is a\n * credential, not by matching material that looks vaguely random.\n *\n * The distinction that keeps the false-positive rate at zero is *shape with a\n * vendor prefix*. `AKIA…`, `ghp_…`, `xoxb-…`, `sk_live_…` are issued formats —\n * nothing else produces them. Entropy alone is not a rule here, because\n * entropy alone flags every UUID, hash and minified bundle in the tree.\n *\n * Two lines in the testbed corpus are the reason for that discipline. Both\n * live in the same `.env` file as five real credentials:\n *\n * AWS_ROLE_ARN=arn:aws:iam::123456789012:role/app-runtime\n * DATABASE_URL_SSM_PARAMETER=/prod/app/database-url\n *\n * An identifier and a lookup path. Both sit under secret-shaped variable\n * names, and neither is a credential. A rule keyed on the variable name would\n * flag both.\n */\n\nimport type { Severity } from './types.js';\n\nexport interface SecretRule {\n id: string;\n /** Vendor-facing name, e.g. \"AWS Access Key\". */\n name: string;\n pattern: RegExp;\n severity: Severity;\n cwe: string;\n /** What an attacker does with it. */\n consequence: string;\n}\n\nexport const SECRET_RULES: readonly SecretRule[] = [\n {\n id: 'secret-aws-access-key',\n name: 'AWS Access Key',\n pattern: /\\b(?:AKIA|ASIA|ABIA|ACCA)[0-9A-Z]{16}\\b/,\n severity: 'critical',\n cwe: 'CWE-798',\n consequence: 'Paired with a secret key, grants the API access of whatever IAM principal issued it.',\n },\n {\n id: 'secret-aws-secret-key',\n name: 'AWS Secret Access Key',\n pattern:\n /(?:aws_secret_access_key|AWS_SECRET(?:_ACCESS_KEY)?)\\s*[=:]\\s*['\"]?([A-Za-z0-9/+=]{40})['\"]?/i,\n severity: 'critical',\n cwe: 'CWE-798',\n consequence: 'The other half of an AWS credential pair; on its own it is still the hard half to guess.',\n },\n {\n id: 'secret-github-token',\n name: 'GitHub Token',\n pattern: /\\b(?:ghp_[A-Za-z0-9]{36}|gho_[A-Za-z0-9]{36}|ghu_[A-Za-z0-9]{36}|ghs_[A-Za-z0-9]{36}|ghr_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{60,})\\b/,\n severity: 'critical',\n cwe: 'CWE-798',\n consequence: 'Repository read or write as the issuing account, including the ability to push workflow changes.',\n },\n {\n id: 'secret-npm-token',\n name: 'npm Token',\n pattern: /\\bnpm_[A-Za-z0-9]{36}\\b/,\n severity: 'critical',\n cwe: 'CWE-798',\n consequence: 'Publish rights to every package the account owns — a supply-chain compromise in one command.',\n },\n {\n id: 'secret-private-key',\n name: 'Private Key',\n pattern: /-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY(?: BLOCK)?-----/,\n severity: 'critical',\n cwe: 'CWE-798',\n consequence: 'Key material, committed. Rotation is the only remediation.',\n },\n {\n id: 'secret-slack-token',\n name: 'Slack Token',\n pattern: /\\bxox[bpoasr]-[A-Za-z0-9-]{10,}/,\n severity: 'critical',\n cwe: 'CWE-798',\n consequence: 'Read and post access to the workspace as the installing app.',\n },\n {\n id: 'secret-slack-webhook',\n name: 'Slack Webhook URL',\n pattern: /https:\\/\\/hooks\\.slack\\.com\\/services\\/[A-Za-z0-9_+\\/-]{6,}/,\n severity: 'high',\n cwe: 'CWE-798',\n consequence: 'The URL *is* the credential — anyone holding it can post to that channel.',\n },\n {\n id: 'secret-stripe-key',\n name: 'Stripe Key',\n pattern: /\\b(?:sk_live_|rk_live_|sk_test_|rk_test_)[A-Za-z0-9]{20,}\\b/,\n severity: 'critical',\n cwe: 'CWE-798',\n consequence: 'Charge, refund and customer-data access against the account.',\n },\n {\n id: 'secret-sendgrid-key',\n name: 'SendGrid API Key',\n pattern: /\\bSG\\.[A-Za-z0-9_-]{16,}\\.[A-Za-z0-9_-]{16,}\\b/,\n severity: 'critical',\n cwe: 'CWE-798',\n consequence: 'Send mail as the domain — the credential behind most convincing phishing from a real sender.',\n },\n {\n id: 'secret-google-api-key',\n name: 'Google API Key',\n pattern: /\\bAIza[0-9A-Za-z_-]{35}\\b/,\n severity: 'high',\n cwe: 'CWE-798',\n consequence: 'Quota theft at minimum; API access to whatever the key was scoped to at worst.',\n },\n {\n id: 'secret-openai-key',\n name: 'OpenAI API Key',\n pattern: /\\bsk-(?:proj-)?[A-Za-z0-9_-]{32,}\\b/,\n severity: 'critical',\n cwe: 'CWE-798',\n consequence: 'Billed inference against the owner’s account, with no per-key spend limit by default.',\n },\n {\n id: 'secret-anthropic-key',\n name: 'Anthropic API Key',\n pattern: /\\bsk-ant-(?:api\\d{2}-)?[A-Za-z0-9_-]{32,}\\b/,\n severity: 'critical',\n cwe: 'CWE-798',\n consequence: 'Billed inference against the owner’s account.',\n },\n {\n id: 'secret-database-url',\n name: 'Database URL with credentials',\n // Requires a credential segment before the `@` — `postgres://localhost/db`\n // is a hostname, not a secret.\n pattern: /\\b(?:postgres(?:ql)?|mysql|mongodb(?:\\+srv)?|redis|amqp|clickhouse):\\/\\/[^\\s'\"@\\/]*:[^\\s'\"@\\/]*@[^\\s'\"]+/i,\n severity: 'high',\n cwe: 'CWE-798',\n consequence: 'Direct database access, usually bypassing every application-level authorisation check.',\n },\n {\n id: 'secret-jwt',\n name: 'JSON Web Token',\n pattern: /\\beyJ[A-Za-z0-9_-]{8,}\\.eyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_.+/=-]*/,\n severity: 'medium',\n cwe: 'CWE-798',\n consequence: 'Session or service identity until it expires — and committed tokens are usually long-lived.',\n },\n {\n id: 'secret-generic-api-key',\n name: 'Generic API Key',\n // Quoted assignment only. An unquoted value in a `.env` is covered by the\n // vendor-prefixed rules above; matching it here is what starts flagging\n // ARNs and parameter-store paths.\n pattern: /(?:api[_-]?key|apikey|access[_-]?token|auth[_-]?token)\\s*[=:]\\s*['\"]([A-Za-z0-9\\-_.]{20,})['\"]/i,\n severity: 'high',\n cwe: 'CWE-798',\n consequence: 'Whatever the third-party service lets the key do, for as long as it stays valid.',\n },\n {\n id: 'secret-generic-credential',\n name: 'Hardcoded Credential',\n pattern: /(?:secret|password|passwd|pwd|token)\\s*[=:]\\s*['\"]([^'\"\\s]{8,})['\"]/i,\n severity: 'high',\n cwe: 'CWE-798',\n consequence: 'A password in source is a password in every clone, fork and CI cache of that source.',\n },\n {\n id: 'secret-hex-token',\n name: 'High-entropy Hex Token',\n pattern: /(?:token|key|secret|auth|signing)\\w*\\s*[=:]\\s*['\"]?([0-9a-f]{32,})['\"]?/i,\n severity: 'medium',\n cwe: 'CWE-798',\n consequence: 'Signing secrets and session keys are usually hex; a leaked one forges anything they sign.',\n },\n];\n\n/**\n * Values that satisfy a credential shape but are not credentials.\n *\n * Kept deliberately short. Every entry is a documented, publicly-published\n * placeholder — not a guess that something \"looks like a test value\". A\n * generous allow-list here is how a scanner talks itself out of a real finding.\n */\nconst KNOWN_PLACEHOLDERS = [\n // Deliberately NOT here: AWS's published documentation key/secret pair\n // (`AKIAIOSFODNN7EXAMPLE`, `wJalrXUtnFEMI/…`). GitHub allow-lists them, and\n // the argument for following suit is that they authenticate nothing. The\n // argument against is stronger: they appear in a repository because someone\n // pasted a credentials template and left it there, and the remediation —\n // move this to the secret manager — is identical to the one for a live key.\n // Exempting them means the scanner goes quiet on the file most likely to\n // acquire a real key next.\n /\\bEXAMPLE_?KEY\\b/i,\n /\\bYOUR_[A-Z_]*(?:KEY|TOKEN|SECRET|PASSWORD)\\b/,\n /\\b(?:xxx+|X{4,}|\\*{4,}|<[a-z-]+>)\\b/,\n /\\bchangeme\\b/i,\n];\n\n/**\n * Whether the matched text is a documented placeholder rather than material.\n *\n * Note what this does *not* do: it does not exempt a value for being all\n * zeros, all A's, or otherwise \"obviously fake\". Those shapes are exactly what\n * the testbed's fixtures use, deliberately, and a scanner that skips them\n * scores zero on a corpus of real credential formats. Only values a vendor has\n * published as examples are exempt.\n */\nexport function isKnownPlaceholder(text: string): boolean {\n return KNOWN_PLACEHOLDERS.some((pattern) => pattern.test(text));\n}\n\n/**\n * Replace anything that looks like credential material with asterisks.\n *\n * Applied to every excerpt on a secret finding before it reaches a terminal, a\n * SARIF file, a CI log or a PR comment. A scanner that prints the secret it\n * found has moved the secret somewhere new, and CI logs are retained and, on\n * public forks, published.\n */\nexport function redactSecret(line: string): string {\n return line.replace(/([A-Za-z0-9+/=_.-]{12,})/g, (match) => {\n if (match.length <= 12) return match;\n return `${match.slice(0, 3)}${'*'.repeat(Math.min(16, match.length - 3))}`;\n });\n}\n\n/** Files whose mere presence is worth reporting, independent of content. */\nexport const SENSITIVE_FILES: readonly { pattern: string; message: string; severity: Severity }[] = [\n { pattern: '.env', message: 'Environment file committed — the usual home of every runtime credential', severity: 'high' },\n { pattern: '.env.local', message: 'Local environment file committed', severity: 'high' },\n { pattern: '.env.production', message: 'Production environment file committed', severity: 'critical' },\n { pattern: 'id_rsa', message: 'Private SSH key committed', severity: 'critical' },\n { pattern: 'id_ed25519', message: 'Private SSH key committed', severity: 'critical' },\n { pattern: 'id_ecdsa', message: 'Private SSH key committed', severity: 'critical' },\n { pattern: '.pem', message: 'PEM certificate or key file committed', severity: 'high' },\n { pattern: '.p12', message: 'PKCS#12 keystore committed', severity: 'high' },\n { pattern: '.pfx', message: 'PKCS#12 keystore committed', severity: 'high' },\n { pattern: '.keystore', message: 'Java keystore committed', severity: 'high' },\n // Deliberately not `.npmrc`. Its presence is normal; only an `_authToken`\n // line in it is a credential, and that is a content match, not a filename\n // match. Reporting the file itself trades a real finding for a chore.\n];\n","/**\n * SARIF 2.1.0 output.\n *\n * Why native, rather than converting the CLI's terminal output: a text parser\n * sitting between a scanner and its consumer fails in the one way that matters\n * — silently. `profullstack/malware-test-prs` documents three separate bugs its\n * `threatcrush-to-sarif.py` hit, and one of them (paths relative to the scan\n * root, unprefixed) made a working scan report a 0% true-positive rate. The\n * scan was fine. The pipe was lying.\n *\n * Emitting SARIF from the process that found the finding removes that class of\n * failure. It also makes the output portable: GitHub's Security tab, the\n * testbed's coverage validator, and any other SARIF consumer read the same\n * bytes, and none of them has to know what a ThreatCrush terminal line looks\n * like.\n *\n * Two details the spec is strict about and consumers are not forgiving about:\n *\n * - `startLine` must be >= 1. Whole-file findings carry no line, so they are\n * clamped rather than emitted as 0, which fails schema validation.\n * - `artifactLocation.uri` must be relative to something the consumer can\n * resolve. Absolute paths from a CI runner (`/home/runner/work/…`) match\n * nothing in the repository view, so every finding lands \"outside\" whatever\n * the consumer was scoping to.\n */\n\nimport { isAbsolute, relative, resolve, sep } from 'node:path';\nimport type { ScanFinding, Severity } from './types.js';\n\nexport const SARIF_VERSION = '2.1.0';\nexport const SARIF_SCHEMA =\n 'https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json';\n\nexport type SarifLevel = 'error' | 'warning' | 'note' | 'none';\n\n/**\n * SARIF has three levels; ThreatCrush has five severities. The mapping is\n * lossy in the direction that matters least — the exact severity survives in\n * `properties.severity` and in `security-severity`, which is what GitHub's\n * Security tab actually sorts on.\n */\nexport function sarifLevel(severity: Severity): SarifLevel {\n switch (severity) {\n case 'critical':\n case 'high':\n return 'error';\n case 'medium':\n return 'warning';\n case 'low':\n return 'note';\n default:\n return 'none';\n }\n}\n\n/** GitHub reads this to place a finding on its own severity scale. */\nexport function securitySeverity(severity: Severity): string {\n switch (severity) {\n case 'critical':\n return '9.0';\n case 'high':\n return '7.0';\n case 'medium':\n return '5.0';\n case 'low':\n return '3.0';\n default:\n return '1.0';\n }\n}\n\n/**\n * Turn a finding's path into a SARIF artifact URI.\n *\n * Findings carry paths relative to the *scan root*; consumers resolve URIs\n * against the *repository root*. Those are the same directory only when the\n * scan target is `.`, and the difference is silent — `secrets/x.env` matches\n * nothing in a repository that holds `vulns/secrets/x.env`, so a working scan\n * reports every finding as out-of-scope. `root` closes that gap by\n * reconstructing the absolute path before making it relative to `base`.\n *\n * Files outside `base` keep an absolute POSIX path rather than acquiring a run\n * of `../` segments no consumer resolves usefully.\n */\nexport function toArtifactUri(\n filePath: string,\n base: string,\n prefix = '',\n root = base,\n): string {\n const absolute = isAbsolute(filePath) ? filePath : resolve(root, filePath);\n const relativePath = relative(base, absolute);\n const escapedOut = relativePath.startsWith('..') || relativePath === '';\n const chosen = escapedOut ? absolute : relativePath;\n const posix = chosen.split(sep).join('/').replace(/^\\.\\//, '');\n if (!prefix || escapedOut) return posix;\n const trimmed = prefix.replace(/^\\/+|\\/+$/g, '');\n return trimmed ? `${trimmed}/${posix}` : posix;\n}\n\nexport interface SarifOptions {\n /** Version string reported as the tool's. */\n toolVersion: string;\n /**\n * Prepended to every relative URI. Covers the one case `root` cannot: a\n * scan run from *inside* the directory it is scanning, where the repository\n * root is not an ancestor of the working directory in any way the process\n * can observe.\n */\n pathPrefix?: string;\n /** Absolute path the URIs are made relative to. Defaults to `process.cwd()`. */\n base?: string;\n /** Absolute scan root that finding paths are relative to. Defaults to `base`. */\n root?: string;\n}\n\ninterface SarifRule {\n id: string;\n name: string;\n shortDescription: { text: string };\n fullDescription: { text: string };\n help: { text: string; markdown: string };\n defaultConfiguration: { level: SarifLevel };\n properties: {\n tags: string[];\n 'security-severity': string;\n precision: string;\n };\n}\n\n/**\n * Build a complete SARIF log.\n *\n * Always returns a valid run, including for zero findings — an empty `results`\n * array is a meaningful statement (\"looked, found nothing\") and consumers\n * distinguish it from a missing file.\n */\nexport function buildSarif(findings: readonly ScanFinding[], options: SarifOptions): unknown {\n const rules = new Map<string, SarifRule>();\n\n for (const finding of findings) {\n if (rules.has(finding.ruleId)) continue;\n const tags = ['security'];\n if (finding.cwe) tags.push(`external/cwe/${finding.cwe.toLowerCase()}`);\n tags.push(`threatcrush/${finding.category}`);\n\n const description = finding.consequence\n ? `${finding.title}. ${finding.consequence}`\n : finding.title;\n\n rules.set(finding.ruleId, {\n id: finding.ruleId,\n name: finding.ruleId,\n shortDescription: { text: finding.title },\n fullDescription: { text: description },\n help: {\n text: description,\n markdown: finding.consequence\n ? `**${finding.title}**\\n\\n${finding.consequence}`\n : `**${finding.title}**`,\n },\n defaultConfiguration: { level: sarifLevel(finding.severity) },\n properties: {\n tags,\n 'security-severity': securitySeverity(finding.severity),\n // SARIF's vocabulary for how much the rule is claiming. It lines up\n // with the confidence model: a bare construct match is `medium`, a\n // match with visible untrusted input is `high`.\n precision: finding.confidence === 'pattern' ? 'medium' : 'high',\n },\n });\n }\n\n const base = options.base ?? process.cwd();\n const root = options.root ?? base;\n\n const results = findings.map((finding) => ({\n ruleId: finding.ruleId,\n level: sarifLevel(finding.severity),\n message: { text: finding.message },\n locations: [\n {\n physicalLocation: {\n artifactLocation: {\n uri: toArtifactUri(finding.file, base, options.pathPrefix, root),\n uriBaseId: '%SRCROOT%',\n },\n region: {\n // Clamped, never 0. A whole-file finding has no line; SARIF has no\n // way to say that, and 0 fails validation outright.\n startLine: Math.max(1, finding.line),\n snippet: { text: finding.excerpt },\n },\n },\n },\n ],\n partialFingerprints: {\n primaryLocationLineHash: `${finding.ruleId}:${finding.file}:${Math.max(1, finding.line)}`,\n },\n properties: {\n severity: finding.severity,\n confidence: finding.confidence,\n category: finding.category,\n ...(finding.cwe ? { cwe: finding.cwe } : {}),\n },\n }));\n\n return {\n $schema: SARIF_SCHEMA,\n version: SARIF_VERSION,\n runs: [\n {\n tool: {\n driver: {\n name: 'ThreatCrush',\n version: options.toolVersion,\n informationUri: 'https://threatcrush.com',\n rules: [...rules.values()],\n },\n },\n results,\n columnKind: 'utf16CodeUnits',\n },\n ],\n };\n}\n","import { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { execSync } from 'node:child_process';\nimport readline from 'node:readline';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { generateDefaultConfig, generateModuleConfig } from '../core/config.js';\nimport { banner, logger } from '../core/logger.js';\nimport { isLoggedIn, readCliConfig } from '../core/cli-config.js';\nimport { login } from './login.js';\n\ninterface DetectedService {\n name: string;\n binary: string;\n running: boolean;\n logPath?: string;\n}\n\nconst SERVICES_TO_DETECT: Array<{\n name: string;\n binaries: string[];\n logPaths: string[];\n moduleConfig: Record<string, unknown>;\n}> = [\n {\n name: 'sshd',\n binaries: ['sshd'],\n logPaths: ['/var/log/auth.log', '/var/log/secure'],\n moduleConfig: { log_path: '/var/log/auth.log', max_failed_attempts: 5, ban_duration_minutes: 30 },\n },\n {\n name: 'nginx',\n binaries: ['nginx'],\n logPaths: ['/var/log/nginx/access.log', '/var/log/nginx/error.log'],\n moduleConfig: { access_log: '/var/log/nginx/access.log', error_log: '/var/log/nginx/error.log' },\n },\n {\n name: 'apache',\n binaries: ['apache2', 'httpd'],\n logPaths: ['/var/log/apache2/access.log', '/var/log/httpd/access_log'],\n moduleConfig: { access_log: '/var/log/apache2/access.log' },\n },\n {\n name: 'postgresql',\n binaries: ['postgres', 'postgresql'],\n logPaths: ['/var/log/postgresql/postgresql-main.log'],\n moduleConfig: { log_path: '/var/log/postgresql/' },\n },\n {\n name: 'mysql',\n binaries: ['mysqld', 'mariadbd'],\n logPaths: ['/var/log/mysql/error.log', '/var/log/mariadb/mariadb.log'],\n moduleConfig: { log_path: '/var/log/mysql/' },\n },\n {\n name: 'redis',\n binaries: ['redis-server'],\n logPaths: ['/var/log/redis/redis-server.log'],\n moduleConfig: { log_path: '/var/log/redis/' },\n },\n {\n name: 'bind',\n binaries: ['named', 'bind9'],\n logPaths: ['/var/log/named/', '/var/log/bind/'],\n moduleConfig: { log_path: '/var/log/named/' },\n },\n];\n\nfunction isProcessRunning(name: string): boolean {\n try {\n execSync(`pgrep -x ${name}`, { stdio: 'pipe' });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction binaryExists(name: string): boolean {\n try {\n execSync(`which ${name}`, { stdio: 'pipe' });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction findLogPath(paths: string[]): string | undefined {\n return paths.find((p) => existsSync(p));\n}\n\nasync function promptYesNo(question: string, fallback: boolean): Promise<boolean> {\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n const hint = fallback ? '(Y/n)' : '(y/N)';\n return new Promise((resolve) => rl.question(`${question} ${hint}: `, (answer) => {\n rl.close();\n const trimmed = answer.trim().toLowerCase();\n if (!trimmed) return resolve(fallback);\n resolve(trimmed === 'y' || trimmed === 'yes');\n }));\n}\n\nasync function ensureLoggedIn(): Promise<void> {\n if (isLoggedIn()) {\n const cfg = readCliConfig();\n console.log(chalk.green(` ✓ Signed in as ${chalk.white(cfg.email || cfg.user_id || 'unknown')}\\n`));\n return;\n }\n\n console.log(chalk.green.bold(' Step 1 — Sign in to threatcrush.com'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(chalk.dim(\" Your license, organizations, and module store access live on\"));\n console.log(chalk.dim(' threatcrush.com. You can skip this and sign in later with'));\n console.log(chalk.dim(` ${chalk.white('threatcrush login')}.\\n`));\n\n const wantsLogin = await promptYesNo(chalk.green(' Sign in now?'), true);\n if (!wantsLogin) {\n console.log(chalk.yellow('\\n Skipped login — running setup in offline mode.\\n'));\n return;\n }\n\n let attempts = 0;\n while (attempts < 3) {\n const result = await login();\n if (result.ok) {\n console.log(chalk.green(`\\n ✓ Logged in as ${chalk.white(result.email)}\\n`));\n return;\n }\n attempts++;\n console.log(chalk.red(`\\n ✗ ${result.error}`));\n if (attempts < 3) {\n const retry = await promptYesNo(chalk.yellow(' Try again?'), true);\n if (!retry) break;\n }\n }\n\n console.log(chalk.yellow('\\n Continuing setup without authentication — you can run'));\n console.log(chalk.dim(` ${chalk.white('threatcrush login')} at any time.\\n`));\n}\n\nexport async function initCommand(): Promise<void> {\n banner();\n logger.info('Initializing ThreatCrush...\\n');\n\n await ensureLoggedIn();\n\n console.log(chalk.green.bold(' Step 2 — Detect services and write config'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n const spinner = ora({ text: 'Detecting services...', color: 'green' }).start();\n const detected: DetectedService[] = [];\n\n for (const svc of SERVICES_TO_DETECT) {\n const foundBinary = svc.binaries.find((b) => binaryExists(b));\n if (foundBinary) {\n const running = svc.binaries.some((b) => isProcessRunning(b));\n const logPath = findLogPath(svc.logPaths);\n detected.push({\n name: svc.name,\n binary: foundBinary,\n running,\n logPath,\n });\n }\n }\n\n spinner.succeed(`Found ${detected.length} service(s)\\n`);\n\n // Print findings\n if (detected.length === 0) {\n console.log(chalk.yellow(' No monitored services detected on this system.'));\n console.log(chalk.gray(' ThreatCrush will still work with manual configuration.\\n'));\n } else {\n console.log(chalk.green.bold(' Detected Services:'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n for (const svc of detected) {\n const status = svc.running\n ? chalk.green('● running')\n : chalk.yellow('○ installed');\n const log = svc.logPath\n ? chalk.gray(` → ${svc.logPath}`)\n : chalk.gray(' → no log found');\n console.log(` ${status} ${chalk.white.bold(svc.name.padEnd(14))}${log}`);\n }\n console.log();\n }\n\n // Generate config files\n const configDir = '/etc/threatcrush';\n const confDDir = `${configDir}/threatcrushd.conf.d`;\n\n const canWrite = checkWriteAccess(configDir);\n\n if (!canWrite) {\n console.log(chalk.yellow(' ⚠ Cannot write to /etc/threatcrush/ (run with sudo for full setup)'));\n console.log(chalk.gray(' Printing generated configs instead:\\n'));\n\n // Print main config\n console.log(chalk.green.bold(' Main config (/etc/threatcrush/threatcrushd.conf):'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n const mainConfig = generateDefaultConfig(detected.map((d) => d.name));\n for (const line of mainConfig.split('\\n')) {\n console.log(chalk.gray(' ') + chalk.white(line));\n }\n console.log();\n\n // Print module configs\n for (const svc of detected) {\n const svcDef = SERVICES_TO_DETECT.find((s) => s.name === svc.name);\n if (!svcDef) continue;\n const modName = svc.name === 'sshd' ? 'ssh-guard' : 'log-watcher';\n console.log(chalk.green.bold(` Module config (${confDDir}/${modName}.conf):`));\n const modConfig = generateModuleConfig(modName, {\n ...svcDef.moduleConfig,\n log_path: svc.logPath || svcDef.logPaths[0],\n });\n for (const line of modConfig.split('\\n')) {\n console.log(chalk.gray(' ') + chalk.white(line));\n }\n console.log();\n }\n } else {\n const spinner2 = ora({ text: 'Writing configuration files...', color: 'green' }).start();\n\n mkdirSync(confDDir, { recursive: true });\n mkdirSync('/var/log/threatcrush', { recursive: true });\n mkdirSync('/var/lib/threatcrush', { recursive: true });\n\n // Write main config\n const mainConfig = generateDefaultConfig(detected.map((d) => d.name));\n writeFileSync(`${configDir}/threatcrushd.conf`, mainConfig);\n\n // Write module configs\n for (const svc of detected) {\n const svcDef = SERVICES_TO_DETECT.find((s) => s.name === svc.name);\n if (!svcDef) continue;\n const modName = svc.name === 'sshd' ? 'ssh-guard' : 'log-watcher';\n const modConfig = generateModuleConfig(modName, {\n ...svcDef.moduleConfig,\n log_path: svc.logPath || svcDef.logPaths[0],\n });\n writeFileSync(`${confDDir}/${modName}.conf`, modConfig);\n }\n\n spinner2.succeed('Configuration written successfully');\n console.log();\n console.log(chalk.green(' ✓ Main config: ') + chalk.white(`${configDir}/threatcrushd.conf`));\n console.log(chalk.green(' ✓ Module dir: ') + chalk.white(confDDir));\n console.log(chalk.green(' ✓ Log dir: ') + chalk.white('/var/log/threatcrush/'));\n console.log(chalk.green(' ✓ State dir: ') + chalk.white('/var/lib/threatcrush/'));\n }\n\n console.log();\n console.log(chalk.green(' Next steps:'));\n console.log(chalk.gray(' 1. Review and edit the config files'));\n console.log(chalk.gray(' 2. Run ') + chalk.white('threatcrush monitor') + chalk.gray(' to start monitoring'));\n console.log(chalk.gray(' 3. Run ') + chalk.white('threatcrush monitor --tui') + chalk.gray(' for the dashboard'));\n console.log();\n}\n\nfunction checkWriteAccess(dir: string): boolean {\n try {\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n return true;\n } catch {\n return false;\n }\n}\n","import { readFileSync, existsSync, readdirSync } from 'node:fs';\nimport { join } from 'node:path';\nimport TOML from '@iarna/toml';\nimport type { ThreatCrushConfig, ModuleConfig } from '../types/config.js';\n\nconst DEFAULT_CONFIG_PATH = '/etc/threatcrush/threatcrushd.conf';\nconst DEFAULT_CONFDIR = '/etc/threatcrush/threatcrushd.conf.d';\n\nconst DEFAULT_CONFIG: ThreatCrushConfig = {\n daemon: {\n pid_file: '/var/run/threatcrush/threatcrushd.pid',\n log_level: 'info',\n log_file: '/var/log/threatcrush/threatcrushd.log',\n state_db: '/var/lib/threatcrush/state.db',\n },\n api: {\n enabled: true,\n bind: '127.0.0.1:9393',\n tls: false,\n },\n alerts: {},\n modules: {\n auto_update: true,\n update_interval: '24h',\n module_dir: '/etc/threatcrush/modules',\n config_dir: DEFAULT_CONFDIR,\n },\n};\n\nexport function loadConfig(configPath?: string): ThreatCrushConfig {\n const path = configPath || DEFAULT_CONFIG_PATH;\n if (!existsSync(path)) {\n return { ...DEFAULT_CONFIG };\n }\n\n try {\n const raw = readFileSync(path, 'utf-8');\n const parsed = TOML.parse(raw) as unknown as Partial<ThreatCrushConfig>;\n return {\n daemon: { ...DEFAULT_CONFIG.daemon, ...parsed.daemon },\n api: { ...DEFAULT_CONFIG.api, ...parsed.api },\n alerts: parsed.alerts || {},\n modules: { ...DEFAULT_CONFIG.modules, ...parsed.modules },\n license: parsed.license,\n };\n } catch {\n return { ...DEFAULT_CONFIG };\n }\n}\n\nexport function loadModuleConfigs(confDir?: string): Map<string, ModuleConfig> {\n const dir = confDir || DEFAULT_CONFDIR;\n const configs = new Map<string, ModuleConfig>();\n\n if (!existsSync(dir)) {\n return configs;\n }\n\n const files = readdirSync(dir).filter((f) => f.endsWith('.conf'));\n for (const file of files) {\n try {\n const raw = readFileSync(join(dir, file), 'utf-8');\n const parsed = TOML.parse(raw) as Record<string, unknown>;\n for (const [name, config] of Object.entries(parsed)) {\n configs.set(name, config as ModuleConfig);\n }\n } catch {\n // skip bad configs\n }\n }\n\n return configs;\n}\n\nexport function generateDefaultConfig(detectedServices: string[]): string {\n const config: Record<string, unknown> = {\n daemon: DEFAULT_CONFIG.daemon,\n api: DEFAULT_CONFIG.api,\n modules: DEFAULT_CONFIG.modules,\n };\n\n return TOML.stringify(config as any);\n}\n\nexport function generateModuleConfig(\n moduleName: string,\n defaults: Record<string, unknown> = {},\n): string {\n const config: Record<string, unknown> = {\n [moduleName]: {\n enabled: true,\n ...defaults,\n },\n };\n return TOML.stringify(config as any);\n}\n","import { existsSync, mkdirSync, readFileSync, writeFileSync, chmodSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { homedir } from 'node:os';\n\nexport const CLI_CONFIG_DIR = join(homedir(), '.threatcrush');\nexport const CLI_CONFIG_PATH = join(CLI_CONFIG_DIR, 'config.json');\n\nexport interface CliConfig {\n email?: string;\n user_id?: string;\n token?: string;\n refresh_token?: string;\n expires_at?: number;\n display_name?: string;\n current_org_id?: string;\n current_org_slug?: string;\n}\n\nexport function readCliConfig(): CliConfig {\n try {\n return JSON.parse(readFileSync(CLI_CONFIG_PATH, 'utf-8')) as CliConfig;\n } catch {\n return {};\n }\n}\n\nexport function writeCliConfig(config: CliConfig): void {\n if (!existsSync(CLI_CONFIG_DIR)) mkdirSync(CLI_CONFIG_DIR, { recursive: true });\n writeFileSync(CLI_CONFIG_PATH, JSON.stringify(config, null, 2), 'utf-8');\n try { chmodSync(CLI_CONFIG_PATH, 0o600); } catch { /* non-posix */ }\n}\n\nexport function updateCliConfig(patch: Partial<CliConfig>): CliConfig {\n const current = readCliConfig();\n const next = { ...current, ...patch };\n writeCliConfig(next);\n return next;\n}\n\nexport function clearCliConfig(keys?: Array<keyof CliConfig>): void {\n const current = readCliConfig();\n if (!keys) {\n writeCliConfig({});\n return;\n }\n for (const key of keys) delete current[key];\n writeCliConfig(current);\n}\n\nexport function isLoggedIn(): boolean {\n const cfg = readCliConfig();\n if (!cfg.token) return false;\n if (cfg.expires_at && cfg.expires_at * 1000 < Date.now()) return false;\n return true;\n}\n\nexport function authHeaders(): Record<string, string> {\n const cfg = readCliConfig();\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\n if (cfg.token) headers['Authorization'] = `Bearer ${cfg.token}`;\n return headers;\n}\n","import readline from 'node:readline';\nimport { Writable } from 'node:stream';\nimport chalk from 'chalk';\nimport { banner } from '../core/logger.js';\nimport {\n authHeaders,\n clearCliConfig,\n isLoggedIn,\n readCliConfig,\n updateCliConfig,\n CLI_CONFIG_PATH,\n} from '../core/cli-config.js';\n\nconst API_URL = process.env.THREATCRUSH_API_URL || 'https://threatcrush.com';\n\nfunction prompt(question: string): Promise<string> {\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n return new Promise((resolve) => rl.question(question, (answer) => {\n rl.close();\n resolve(answer.trim());\n }));\n}\n\nfunction promptPassword(question: string): Promise<string> {\n return new Promise((resolve) => {\n const muted = new Writable({\n write(_chunk, _enc, cb) { cb(); },\n });\n const rl = readline.createInterface({ input: process.stdin, output: muted, terminal: true });\n process.stdout.write(question);\n rl.question('', (answer) => {\n rl.close();\n process.stdout.write('\\n');\n resolve(answer);\n });\n });\n}\n\nexport interface LoginOptions {\n email?: string;\n password?: string;\n silent?: boolean;\n}\n\ninterface LoginSuccess {\n ok: true;\n email: string;\n userId: string;\n displayName?: string;\n}\ninterface LoginFailure {\n ok: false;\n error: string;\n}\n\nexport async function login(options: LoginOptions = {}): Promise<LoginSuccess | LoginFailure> {\n const email = options.email || (await prompt(chalk.green(' Email: ')));\n if (!email || !email.includes('@')) {\n return { ok: false, error: 'A valid email is required.' };\n }\n\n const password = options.password || (await promptPassword(chalk.green(' Password: ')));\n if (!password) {\n return { ok: false, error: 'Password is required.' };\n }\n\n let res: Response;\n try {\n res = await fetch(`${API_URL}/api/auth/login`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ email, password }),\n });\n } catch (err) {\n return { ok: false, error: `Network error: ${(err as Error).message}` };\n }\n\n const data = await res.json().catch(() => ({})) as {\n user?: { id?: string; email?: string };\n session?: { access_token?: string; refresh_token?: string; expires_at?: number };\n error?: string;\n };\n\n if (!res.ok || !data.session?.access_token || !data.user?.id) {\n return { ok: false, error: data.error || `Login failed (${res.status})` };\n }\n\n updateCliConfig({\n email: data.user.email || email,\n user_id: data.user.id,\n token: data.session.access_token,\n refresh_token: data.session.refresh_token,\n expires_at: data.session.expires_at,\n });\n\n return {\n ok: true,\n email: data.user.email || email,\n userId: data.user.id,\n };\n}\n\nexport async function loginCommand(opts: { email?: string } = {}): Promise<void> {\n banner();\n\n if (isLoggedIn()) {\n const cfg = readCliConfig();\n console.log(chalk.green(` ✓ Already logged in as ${chalk.white(cfg.email || cfg.user_id || 'unknown')}`));\n console.log(chalk.dim(` Run ${chalk.white('threatcrush logout')} to sign out.\\n`));\n return;\n }\n\n console.log(chalk.green(' Log in to threatcrush.com'));\n console.log(chalk.gray(' ' + '─'.repeat(40)));\n\n const result = await login({ email: opts.email });\n if (!result.ok) {\n console.log(chalk.red(`\\n ✗ ${result.error}\\n`));\n console.log(chalk.dim(` Forgot password? ${API_URL}/auth/forgot-password`));\n console.log(chalk.dim(` No account yet? ${API_URL}/auth/signup\\n`));\n return;\n }\n\n console.log(chalk.green(`\\n ✓ Logged in as ${chalk.white(result.email)}`));\n console.log(chalk.dim(` Credentials saved to ${CLI_CONFIG_PATH}\\n`));\n\n // Pre-fetch current org for convenience.\n try {\n const res = await fetch(`${API_URL}/api/orgs`, { headers: authHeaders() });\n if (res.ok) {\n const data = await res.json() as { organizations?: Array<{ id: string; slug: string; name: string }> };\n const orgs = data.organizations || [];\n if (orgs.length > 0) {\n updateCliConfig({ current_org_id: orgs[0].id, current_org_slug: orgs[0].slug });\n console.log(chalk.dim(` Current org: ${chalk.white(orgs[0].name)} (${orgs[0].slug})\\n`));\n } else {\n console.log(chalk.dim(` Tip: create an organization with ${chalk.white('threatcrush orgs create <name>')}\\n`));\n }\n }\n } catch {\n // optional — skip silently\n }\n}\n\nexport async function logoutCommand(): Promise<void> {\n banner();\n\n if (!isLoggedIn()) {\n console.log(chalk.dim(' Not logged in.\\n'));\n return;\n }\n\n clearCliConfig(['token', 'refresh_token', 'expires_at', 'current_org_id', 'current_org_slug']);\n console.log(chalk.green(' ✓ Logged out.\\n'));\n console.log(chalk.dim(' Re-authenticate with `threatcrush login`.\\n'));\n}\n\nexport async function whoamiCommand(): Promise<void> {\n banner();\n const cfg = readCliConfig();\n\n if (!cfg.token) {\n console.log(chalk.yellow(' Not logged in.'));\n console.log(chalk.dim(` Log in with ${chalk.white('threatcrush login')}.\\n`));\n return;\n }\n\n try {\n const res = await fetch(`${API_URL}/api/auth/me`, { headers: authHeaders() });\n if (res.status === 401) {\n console.log(chalk.yellow(' Session expired. Please log in again.\\n'));\n clearCliConfig(['token', 'refresh_token', 'expires_at']);\n return;\n }\n const data = await res.json() as { profile?: Record<string, unknown>; error?: string };\n if (!res.ok || !data.profile) {\n console.log(chalk.red(` ✗ ${data.error || 'Failed to fetch profile'}\\n`));\n return;\n }\n\n const p = data.profile;\n console.log(chalk.green.bold(' Logged in as'));\n console.log(chalk.gray(' ' + '─'.repeat(50)));\n console.log(` Email: ${chalk.white(String(p.email || cfg.email || '—'))}`);\n if (p.display_name) console.log(` Display name: ${chalk.white(String(p.display_name))}`);\n if (p.phone) console.log(` Phone: ${chalk.white(String(p.phone))}`);\n if (cfg.current_org_slug) console.log(` Current org: ${chalk.white(cfg.current_org_slug)}`);\n console.log();\n } catch (err) {\n console.log(chalk.red(` ✗ Could not reach ${API_URL}: ${(err as Error).message}\\n`));\n }\n}\n","import { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport TOML from '@iarna/toml';\nimport type { LoadedModule } from '../types/module.js';\nimport type { ModuleManifest } from '../types/config.js';\nimport { loadModuleConfigs } from './config.js';\nimport { PATHS } from '../daemon/paths.js';\n\nexport function discoverModules(\n moduleDir?: string,\n confDir?: string,\n): LoadedModule[] {\n const modules: LoadedModule[] = [];\n const configs = loadModuleConfigs(confDir || PATHS.confD);\n\n // Search paths: configured module dir + local ./modules/\n const searchPaths = [\n moduleDir || PATHS.moduleDir,\n resolve(process.cwd(), 'modules'),\n ];\n\n // Also check for built-in modules relative to this package\n const builtinDir = resolve(__dirname || '.', '..', 'modules');\n if (existsSync(builtinDir)) {\n searchPaths.push(builtinDir);\n }\n\n for (const basePath of searchPaths) {\n if (!existsSync(basePath)) continue;\n\n const entries = readdirSync(basePath, { withFileTypes: true });\n for (const entry of entries) {\n if (!entry.isDirectory()) continue;\n\n const modPath = join(basePath, entry.name);\n const manifestPath = join(modPath, 'mod.toml');\n\n if (!existsSync(manifestPath)) continue;\n\n try {\n const raw = readFileSync(manifestPath, 'utf-8');\n const manifest = TOML.parse(raw) as unknown as ModuleManifest;\n const config = configs.get(manifest.module.name) || { enabled: true };\n\n modules.push({\n manifest: {\n name: manifest.module.name,\n version: manifest.module.version,\n description: manifest.module.description,\n author: manifest.module.author,\n },\n config,\n status: 'loaded',\n eventCount: 0,\n path: modPath,\n });\n } catch {\n // skip bad modules\n }\n }\n }\n\n return modules;\n}\n\nexport function getBuiltinModulePaths(): string[] {\n return [\n resolve(__dirname || '.', '..', 'modules', 'log-watcher'),\n resolve(__dirname || '.', '..', 'modules', 'ssh-guard'),\n ];\n}\n","import chalk from 'chalk';\nimport { banner, logger } from '../core/logger.js';\nimport { discoverModules } from '../core/module-loader.js';\nimport { initStateDB, getEventCount, getThreatCount, getRecentEvents } from '../core/state.js';\nimport { IpcClient } from '../core/ipc-client.js';\nimport { findRunningDaemon } from '../daemon/pidfile.js';\nimport { PATHS } from '../daemon/paths.js';\n\nexport async function statusCommand(): Promise<void> {\n banner();\n\n const pid = findRunningDaemon();\n const client = new IpcClient();\n let live: Awaited<ReturnType<IpcClient['status']>> | null = null;\n if (pid) {\n try {\n await client.connect();\n live = await client.status();\n } catch {\n // daemon PID present but IPC unreachable\n } finally {\n client.close();\n }\n }\n\n console.log(chalk.green.bold(' Daemon Status'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n\n if (live) {\n console.log(` Status: ${chalk.green.bold('● RUNNING')}`);\n console.log(` PID: ${chalk.white(String(live.pid))}`);\n console.log(` Started: ${chalk.white(live.startedAt)}`);\n console.log(` Uptime: ${chalk.white(formatUptime(live.uptimeSeconds))}`);\n console.log(` Version: ${chalk.white(live.version)}`);\n console.log(` Mode: ${chalk.white(live.mode)}`);\n console.log(` Socket: ${chalk.gray(live.paths.socket)}`);\n } else if (pid) {\n console.log(` Status: ${chalk.yellow.bold('● RUNNING (IPC unreachable)')}`);\n console.log(` PID: ${chalk.white(String(pid))}`);\n console.log(` Socket: ${chalk.gray(PATHS.socket)}`);\n } else {\n console.log(` Status: ${chalk.gray('○ NOT RUNNING')}`);\n console.log(` Start it: ${chalk.white('threatcrush start')}`);\n }\n console.log();\n\n // Modules\n console.log(chalk.green.bold(' Modules'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n if (live && live.modules.length > 0) {\n for (const mod of live.modules) {\n const dot =\n mod.status === 'running' ? chalk.green('●') :\n mod.status === 'loaded' ? chalk.cyan('○') :\n mod.status === 'error' ? chalk.red('✗') : chalk.gray('○');\n console.log(` ${dot} ${chalk.white.bold(mod.name.padEnd(18))} ${chalk.gray(mod.status.padEnd(10))} ${chalk.dim(`${mod.events} events`)}`);\n }\n } else {\n const modules = discoverModules();\n if (modules.length === 0) {\n console.log(chalk.gray(' No modules discovered. Run `threatcrush init`.'));\n } else {\n for (const mod of modules) {\n const enabled = mod.config.enabled !== false;\n const status = enabled ? chalk.green('● enabled ') : chalk.gray('○ disabled');\n console.log(` ${status} ${chalk.white.bold(mod.manifest.name.padEnd(18))} ${chalk.gray('v' + mod.manifest.version)}`);\n }\n }\n }\n console.log();\n\n // Event stats\n try {\n if (!live) initStateDB(PATHS.stateDb);\n const total = live ? live.counters.events : getEventCount();\n const threats = live ? live.counters.threats : getThreatCount();\n const last24h = getEventCount(new Date(Date.now() - 86400000));\n const threats24h = getThreatCount(new Date(Date.now() - 86400000));\n\n console.log(chalk.green.bold(' Event Statistics'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(` Total events: ${chalk.white(total.toString())}`);\n console.log(` Total threats: ${chalk.red(threats.toString())}`);\n console.log(` Events (24h): ${chalk.white(last24h.toString())}`);\n console.log(` Threats (24h): ${chalk.red(threats24h.toString())}`);\n console.log();\n\n const recent = getRecentEvents(5);\n if (recent.length > 0) {\n console.log(chalk.green.bold(' Recent Events'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n for (const evt of recent) {\n const sev = evt.severity === 'critical' || evt.severity === 'high'\n ? chalk.red(`[${evt.severity.toUpperCase()}]`)\n : evt.severity === 'medium'\n ? chalk.yellow(`[${evt.severity.toUpperCase()}]`)\n : chalk.green(`[${evt.severity.toUpperCase()}]`);\n console.log(` ${chalk.gray(evt.timestamp.toISOString().slice(0, 19))} ${sev.padEnd(20)} ${evt.message}`);\n }\n }\n } catch {\n logger.info('No event data available yet.');\n }\n console.log();\n}\n\nfunction formatUptime(seconds: number): string {\n if (seconds < 60) return `${seconds}s`;\n const m = Math.floor(seconds / 60);\n if (m < 60) return `${m}m ${seconds % 60}s`;\n const h = Math.floor(m / 60);\n if (h < 24) return `${h}h ${m % 60}m`;\n const d = Math.floor(h / 24);\n return `${d}d ${h % 24}h`;\n}\n","import { execFileSync } from 'node:child_process';\nimport { existsSync, mkdirSync, writeFileSync, cpSync, rmSync, readFileSync } from 'node:fs';\nimport { basename, join, resolve } from 'node:path';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport TOML from '@iarna/toml';\nimport { banner, logger } from '../core/logger.js';\nimport { discoverModules } from '../core/module-loader.js';\nimport { PATHS, ensureRuntimeDirs } from '../daemon/paths.js';\nimport { findRunningDaemon } from '../daemon/pidfile.js';\n\nconst API_URL = process.env.THREATCRUSH_API_URL || 'https://threatcrush.com';\n\nfunction modulesDir(): string {\n ensureRuntimeDirs();\n return PATHS.moduleDir;\n}\n\nfunction safeModuleDirName(name: string, label = 'module name'): string {\n if (!/^[A-Za-z0-9._@-]+$/.test(name) || name === '.' || name === '..') {\n throw new Error(`Unsafe ${label}: ${name}`);\n }\n return name;\n}\n\nfunction moduleDestination(dir: string, name: string, label?: string): string {\n return join(dir, safeModuleDirName(name, label));\n}\n\nfunction assertSafeTarballEntries(tarPath: string): void {\n const listing = execFileSync('tar', ['-tzf', tarPath], { encoding: 'utf-8' });\n for (const entry of listing.split('\\n').map((line) => line.trim()).filter(Boolean)) {\n const normalized = entry.replace(/\\\\/g, '/');\n const segments = normalized.split('/');\n if (normalized.startsWith('/') || segments.includes('..')) {\n throw new Error(`Unsafe tarball entry: ${entry}`);\n }\n }\n}\n\nfunction validateManifest(modPath: string): { ok: boolean; error?: string; name?: string; version?: string } {\n const manifestPath = join(modPath, 'mod.toml');\n if (!existsSync(manifestPath)) {\n return { ok: false, error: `mod.toml not found at ${manifestPath}` };\n }\n try {\n const raw = readFileSync(manifestPath, 'utf-8');\n const parsed = TOML.parse(raw) as { module?: { name?: string; version?: string } };\n const name = parsed.module?.name;\n const version = parsed.module?.version;\n if (!name) return { ok: false, error: 'mod.toml is missing [module] name' };\n if (!version) return { ok: false, error: 'mod.toml is missing [module] version' };\n return { ok: true, name, version };\n } catch (err) {\n return { ok: false, error: `Invalid mod.toml: ${(err as Error).message}` };\n }\n}\n\nfunction notifyDaemonIfRunning(): void {\n if (!findRunningDaemon()) return;\n console.log(chalk.dim(` ℹ threatcrushd is running — restart it to load/unload modules:`));\n console.log(chalk.dim(` ${chalk.white('threatcrush stop && threatcrush start')}`));\n}\n\nexport async function modulesListCommand(): Promise<void> {\n banner();\n\n const modules = discoverModules();\n\n console.log(chalk.green.bold(' Installed Modules'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(chalk.dim(` module dir: ${PATHS.moduleDir}\\n`));\n\n if (modules.length === 0) {\n console.log(chalk.gray(' No modules installed.'));\n console.log();\n console.log(chalk.gray(' Browse available modules:'));\n console.log(chalk.white(' threatcrush store'));\n console.log();\n console.log(chalk.gray(' Or install from the marketplace:'));\n console.log(chalk.white(' threatcrush modules install <name>'));\n console.log();\n return;\n }\n\n console.log(\n chalk.gray(' ') +\n chalk.white.bold('Name'.padEnd(22)) +\n chalk.white.bold('Version'.padEnd(12)) +\n chalk.white.bold('Status'.padEnd(12)) +\n chalk.white.bold('Description'),\n );\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n\n for (const mod of modules) {\n const enabled = mod.config.enabled !== false;\n const status = enabled ? chalk.green('enabled') : chalk.gray('disabled');\n console.log(\n chalk.gray(' ') +\n chalk.white(mod.manifest.name.padEnd(22)) +\n chalk.gray(mod.manifest.version.padEnd(12)) +\n status.padEnd(21) +\n chalk.gray(mod.manifest.description || '—'),\n );\n }\n console.log();\n}\n\nexport async function modulesInstallCommand(source: string): Promise<void> {\n banner();\n\n console.log(chalk.green.bold(' Module Installation'));\n console.log(chalk.gray(' ' + '─'.repeat(50)));\n console.log();\n\n const dir = modulesDir();\n\n // ── Local path ──\n if (source.startsWith('./') || source.startsWith('/') || source.startsWith('~')) {\n const absPath = resolve(source.startsWith('~') ? source.replace('~', process.env.HOME || '') : source);\n if (!existsSync(absPath)) {\n console.log(chalk.red(` ✗ Path not found: ${absPath}\\n`));\n return;\n }\n const check = validateManifest(absPath);\n if (!check.ok) {\n console.log(chalk.red(` ✗ ${check.error}\\n`));\n return;\n }\n let dest: string;\n try {\n dest = moduleDestination(dir, check.name!);\n } catch (err) {\n console.log(chalk.red(` x ${(err as Error).message}\\n`));\n return;\n }\n if (existsSync(dest)) {\n console.log(chalk.yellow(` ! ${check.name} is already installed at ${dest}`));\n console.log(chalk.dim(` Run ${chalk.white(`threatcrush modules remove ${check.name}`)} first.\\n`));\n return;\n }\n const spinner = ora({ text: `Copying module files...`, color: 'green' }).start();\n try {\n cpSync(absPath, dest, { recursive: true, dereference: true });\n spinner.succeed(`Installed ${chalk.white(check.name!)} v${check.version} → ${dest}`);\n } catch (err) {\n spinner.fail(`Copy failed: ${(err as Error).message}`);\n return;\n }\n notifyDaemonIfRunning();\n console.log();\n return;\n }\n\n // ── Git URL (github:user/repo or full https://) ──\n if (source.startsWith('github:') || source.startsWith('https://') || source.startsWith('git@') || source.endsWith('.git')) {\n const gitUrl = source.startsWith('github:')\n ? `https://github.com/${source.slice('github:'.length)}.git`\n : source;\n\n let name: string;\n let dest: string;\n try {\n name = safeModuleDirName(basename(gitUrl.replace(/\\.git$/, '')), 'repository name');\n dest = moduleDestination(dir, name);\n } catch (err) {\n console.log(chalk.red(` x ${(err as Error).message}\\n`));\n return;\n }\n if (existsSync(dest)) {\n console.log(chalk.yellow(` ! ${name} is already installed at ${dest}`));\n console.log(chalk.dim(` Run ${chalk.white(`threatcrush modules remove ${name}`)} first.\\n`));\n return;\n }\n const spinner = ora({ text: `Cloning ${gitUrl}...`, color: 'green' }).start();\n try {\n execFileSync('git', ['clone', '--depth', '1', '--', gitUrl, dest], { stdio: 'pipe' });\n } catch (err) {\n spinner.fail(`Clone failed: ${(err as Error).message}`);\n return;\n }\n const check = validateManifest(dest);\n if (!check.ok) {\n spinner.fail(check.error!);\n try { rmSync(dest, { recursive: true, force: true }); } catch {}\n return;\n }\n spinner.succeed(`Installed ${chalk.white(check.name!)} v${check.version} → ${dest}`);\n notifyDaemonIfRunning();\n console.log();\n return;\n }\n\n // ── Marketplace lookup ──\n const spinner = ora({ text: `Fetching module: ${source}...`, color: 'green' }).start();\n let data: {\n success?: boolean;\n downloads?: number;\n module?: {\n name: string;\n slug: string;\n version: string;\n license: string;\n os_support?: string[];\n install: {\n npm_package?: string;\n git_url?: string;\n tarball_url?: string;\n };\n };\n };\n\n try {\n const res = await fetch(`${API_URL}/api/modules/${source}/install`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ platform: 'linux-cli' }),\n });\n if (!res.ok) {\n const err = await res.json().catch(() => ({ error: res.statusText }));\n spinner.fail(`Module not found: ${(err as Record<string, string>).error || source}`);\n console.log(chalk.gray(` Browse: ${API_URL}/store\\n`));\n return;\n }\n data = await res.json();\n } catch (err) {\n spinner.fail(`Network error: ${(err as Error).message}`);\n return;\n }\n\n const mod = data.module;\n if (!mod) {\n spinner.fail('Malformed response from marketplace');\n return;\n }\n spinner.succeed(`Found ${mod.name} v${mod.version}`);\n\n const install = mod.install;\n let dest: string;\n try {\n dest = moduleDestination(dir, mod.slug, 'module slug');\n } catch (err) {\n console.log(chalk.red(` x ${(err as Error).message}\\n`));\n return;\n }\n if (existsSync(dest)) {\n console.log(chalk.yellow(` ! ${mod.slug} is already installed at ${dest}\\n`));\n return;\n }\n\n if (install.npm_package) {\n const npmSpinner = ora({ text: `Installing ${install.npm_package}...`, color: 'green' }).start();\n try {\n execFileSync('npm', ['install', '-g', '--', install.npm_package], { stdio: 'pipe' });\n npmSpinner.succeed(`Package ${install.npm_package} installed globally`);\n } catch (err) {\n npmSpinner.fail(`npm install failed: ${(err as Error).message}`);\n return;\n }\n } else if (install.git_url) {\n const cloneSpinner = ora({ text: 'Cloning module repository...', color: 'green' }).start();\n try {\n execFileSync('git', ['clone', '--depth', '1', '--', install.git_url, dest], { stdio: 'pipe' });\n } catch (err) {\n cloneSpinner.fail(`Clone failed: ${(err as Error).message}`);\n return;\n }\n const check = validateManifest(dest);\n if (!check.ok) {\n cloneSpinner.fail(check.error!);\n try { rmSync(dest, { recursive: true, force: true }); } catch {}\n return;\n }\n cloneSpinner.succeed(`Installed ${mod.name} v${mod.version} → ${dest}`);\n } else if (install.tarball_url) {\n const dlSpinner = ora({ text: 'Downloading module tarball...', color: 'green' }).start();\n try {\n const res = await fetch(install.tarball_url);\n if (!res.ok) { dlSpinner.fail(`HTTP ${res.status}`); return; }\n const tar = join(dir, `${mod.slug}.tar.gz`);\n writeFileSync(tar, Buffer.from(await res.arrayBuffer()));\n assertSafeTarballEntries(tar);\n execFileSync('tar', ['-xzf', tar, '-C', dir], { stdio: 'pipe' });\n rmSync(tar, { force: true });\n const check = validateManifest(dest);\n if (!check.ok) {\n dlSpinner.fail(check.error!);\n return;\n }\n dlSpinner.succeed(`Installed ${mod.name} v${mod.version} → ${dest}`);\n } catch (err) {\n dlSpinner.fail(`Download failed: ${(err as Error).message}`);\n return;\n }\n } else {\n logger.info('No installable artifact provided for this module.');\n return;\n }\n\n notifyDaemonIfRunning();\n console.log();\n}\n\nexport async function modulesRemoveCommand(name: string): Promise<void> {\n banner();\n\n console.log(chalk.green.bold(' Module Removal'));\n console.log(chalk.gray(' ' + '─'.repeat(50)));\n\n const dir = modulesDir();\n let target: string;\n try {\n target = moduleDestination(dir, name);\n } catch (err) {\n console.log(chalk.red(` x ${(err as Error).message}\\n`));\n return;\n }\n if (!existsSync(target)) {\n console.log(chalk.yellow(` ! No module named \"${name}\" in ${dir}\\n`));\n return;\n }\n\n const check = validateManifest(target);\n if (check.ok && check.name !== name) {\n console.log(chalk.yellow(` ! Directory name \"${name}\" does not match manifest name \"${check.name}\"`));\n }\n\n try {\n rmSync(target, { recursive: true, force: true });\n console.log(chalk.green(` ✓ Removed ${name} from ${dir}\\n`));\n } catch (err) {\n console.log(chalk.red(` ✗ Failed to remove: ${(err as Error).message}\\n`));\n return;\n }\n\n notifyDaemonIfRunning();\n}\n\nexport async function modulesCommand(opts: { action?: string; name?: string }): Promise<void> {\n const action = opts.action || 'list';\n\n switch (action) {\n case 'list':\n case 'available':\n case 'ls':\n await modulesListCommand();\n break;\n case 'install':\n case 'add':\n if (!opts.name) {\n banner();\n console.log(chalk.red(' Module name required.'));\n console.log(chalk.gray(' Usage:'));\n console.log(chalk.gray(' threatcrush modules install <marketplace-name>'));\n console.log(chalk.gray(' threatcrush modules install ./local-path'));\n console.log(chalk.gray(' threatcrush modules install github:user/repo'));\n console.log(chalk.gray(' threatcrush modules install https://github.com/user/repo.git\\n'));\n return;\n }\n await modulesInstallCommand(opts.name);\n break;\n case 'remove':\n case 'rm':\n case 'uninstall':\n if (!opts.name) {\n banner();\n console.log(chalk.red(' Module name required.'));\n console.log(chalk.gray(' Usage: threatcrush modules remove <name>\\n'));\n return;\n }\n await modulesRemoveCommand(opts.name);\n break;\n default:\n banner();\n console.log(chalk.yellow(` Unknown action: ${action}`));\n console.log(chalk.gray(' Available actions: list, install, remove\\n'));\n await modulesListCommand();\n break;\n }\n}\n","import { execSync } from 'node:child_process';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { banner, logger } from '../core/logger.js';\nimport type { RunResult, StructuredFinding } from '../core/run-result.js';\nimport { summarize } from '../core/run-result.js';\n\ninterface PentestResult {\n url: string;\n type: string;\n severity: 'low' | 'medium' | 'high' | 'critical';\n message: string;\n details?: string;\n}\n\n// Basic vulnerability tests\nconst PENTEST_CHECKS = [\n {\n name: 'XSS Reflected',\n test: (html: string) => /<script>alert\\(1\\)<\\/script>|<img\\s+src=x\\s+onerror=alert/i.test(html),\n severity: 'critical' as const,\n message: 'Reflected XSS payload rendered in response',\n },\n {\n name: 'Open Redirect',\n test: (url: string, body: string) => body.includes('location.href') || body.includes('window.location'),\n severity: 'medium' as const,\n message: 'Potential open redirect detected',\n },\n {\n name: 'Missing Security Headers',\n test: (_url: string, _body: string, headers: Record<string, string>) => {\n const required = ['x-content-type-options', 'x-frame-options', 'strict-transport-security'];\n const missing = required.filter(h => !headers[h.toLowerCase()]);\n return missing.length > 2;\n },\n severity: 'low' as const,\n message: 'Missing critical security headers (X-Content-Type-Options, X-Frame-Options, HSTS)',\n },\n {\n name: 'Server Version Disclosure',\n test: (_url: string, _body: string, headers: Record<string, string>) => {\n return !!(headers['server'] && /apache|nginx|iis|tomcat/i.test(headers['server']));\n },\n severity: 'low' as const,\n message: 'Server version disclosed in response header',\n },\n {\n name: 'Directory Listing',\n test: (html: string) => /Index of\\s*\\/|<title>Directory Listing/i.test(html),\n severity: 'medium' as const,\n message: 'Directory listing enabled',\n },\n {\n name: 'Error Page Information Disclosure',\n test: (html: string) => /stack trace|traceback|exception|at\\s+\\w+\\.\\w+\\(/i.test(html),\n severity: 'medium' as const,\n message: 'Error page reveals internal information',\n },\n // PRD 07: Additional checks\n {\n name: 'CORS Misconfiguration',\n test: (_url: string, _body: string, headers: Record<string, string>) => {\n const acao = headers['access-control-allow-origin'];\n return acao === '*' || acao === 'null';\n },\n severity: 'medium' as const,\n message: 'CORS allows any origin (Access-Control-Allow-Origin: *)',\n },\n {\n name: 'Cookie Security',\n test: (_url: string, _body: string, headers: Record<string, string>) => {\n const setCookie = headers['set-cookie'] || '';\n return setCookie.length > 0 && (!setCookie.includes('HttpOnly') || !setCookie.includes('Secure'));\n },\n severity: 'medium' as const,\n message: 'Cookies missing HttpOnly or Secure flags',\n },\n {\n name: 'Content Security Policy',\n test: (_url: string, _body: string, headers: Record<string, string>) => {\n return !headers['content-security-policy'];\n },\n severity: 'low' as const,\n message: 'No Content-Security-Policy header set',\n },\n {\n name: 'Sensitive Path Exposure',\n test: (html: string) => /\\.env|wp-admin|phpinfo|\\.git\\/config|server-status/i.test(html),\n severity: 'high' as const,\n message: 'Response references sensitive paths or admin endpoints',\n },\n];\n\nexport async function runPentest(rawUrl: string): Promise<RunResult> {\n const targetUrl = rawUrl.startsWith('http') ? rawUrl : `https://${rawUrl}`;\n const results = await collectPentestResults(targetUrl);\n const structured: StructuredFinding[] = results.map((r) => ({\n type: r.type,\n severity: r.severity === 'low' ? 'low' : (r.severity as StructuredFinding['severity']),\n message: r.message,\n location: r.url,\n details: r.details ? { detail: r.details } : undefined,\n }));\n const counts = summarize(structured);\n return {\n type: 'pentest',\n target: targetUrl,\n findings: structured,\n severity_summary: counts,\n summary: structured.length === 0\n ? 'No vulnerabilities detected'\n : `${structured.length} issue(s): ${counts.critical}C ${counts.high}H ${counts.medium}M ${counts.low}L`,\n };\n}\n\nasync function collectPentestResults(targetUrl: string): Promise<PentestResult[]> {\n const results: PentestResult[] = [];\n try {\n const resp = await fetch(targetUrl, { redirect: 'manual' });\n const headers: Record<string, string> = {};\n resp.headers.forEach((v, k) => { headers[k] = v; });\n const body = await resp.text();\n for (const check of PENTEST_CHECKS) {\n try {\n if (check.test(body, body, headers)) {\n results.push({ url: targetUrl, type: check.name, severity: check.severity, message: check.message });\n }\n } catch { /* skip */ }\n }\n } catch {\n return results;\n }\n\n const sqliPayloads = [\"' OR 1=1--\", \"1' UNION SELECT NULL--\", \"' AND '1'='1\"];\n for (const payload of sqliPayloads) {\n try {\n const testUrl = `${targetUrl}?id=${encodeURIComponent(payload)}`;\n const resp = await fetch(testUrl, { redirect: 'manual', signal: AbortSignal.timeout(5000) });\n const body = await resp.text();\n if (/sql\\s+(syntax|error|exception)|mysql|postgres|ORA-\\d+/i.test(body)) {\n results.push({ url: testUrl, type: 'SQL Injection', severity: 'critical', message: `SQL error with payload: ${payload}` });\n }\n } catch { /* skip */ }\n }\n\n const traversalPaths = ['../../etc/passwd', '..%2F..%2Fetc%2Fpasswd', '....//....//etc/passwd'];\n for (const path of traversalPaths) {\n try {\n const testUrl = `${targetUrl}/${path}`;\n const resp = await fetch(testUrl, { redirect: 'manual', signal: AbortSignal.timeout(5000) });\n const body = await resp.text();\n if (/root:.*:0:0:|daemon:.*:1:1:|nobody:.*:65534/i.test(body)) {\n results.push({ url: testUrl, type: 'Path Traversal', severity: 'critical', message: `Possible /etc/passwd disclosure: ${path}` });\n }\n } catch { /* skip */ }\n }\n\n const methods = ['OPTIONS', 'TRACE', 'DELETE', 'PUT'];\n for (const method of methods) {\n try {\n const resp = await fetch(targetUrl, { method, signal: AbortSignal.timeout(5000) });\n if (resp.status < 400 && method !== 'OPTIONS') {\n results.push({ url: targetUrl, type: `Unsafe HTTP Method: ${method}`, severity: 'medium', message: `${method} allowed (status ${resp.status})` });\n }\n if (method === 'OPTIONS') {\n const allow = resp.headers.get('allow');\n if (allow && /DELETE|PUT|TRACE/i.test(allow)) {\n results.push({ url: targetUrl, type: 'HTTP Methods', severity: 'low', message: `Allowed methods: ${allow}` });\n }\n }\n } catch { /* skip */ }\n }\n\n return results;\n}\n\nexport async function pentestCommand(targetUrl: string): Promise<RunResult> {\n banner();\n\n // Ensure URL has protocol\n if (!targetUrl.startsWith('http')) {\n targetUrl = `https://${targetUrl}`;\n }\n\n logger.info(`Penetration testing ${chalk.white(targetUrl)}...\\n`);\n\n const results: PentestResult[] = [];\n\n // Test 1: Basic response analysis\n const spinner = ora({ text: 'Fetching target...', color: 'green' }).start();\n try {\n const resp = await fetch(targetUrl, { redirect: 'manual' });\n const headers: Record<string, string> = {};\n resp.headers.forEach((v, k) => { headers[k] = v; });\n const body = await resp.text();\n\n spinner.succeed(`Got ${resp.status} response\\n`);\n\n // Run all checks\n for (const check of PENTEST_CHECKS) {\n try {\n if (check.test(body, body, headers)) {\n results.push({\n url: targetUrl,\n type: check.name,\n severity: check.severity,\n message: check.message,\n });\n }\n } catch {\n // Skip check on error\n }\n }\n } catch (err) {\n spinner.fail(`Failed to reach target: ${(err as Error).message}`);\n console.log(chalk.gray(' Check the URL and try again.\\n'));\n return {\n type: 'pentest',\n target: targetUrl,\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: `Failed to reach target: ${(err as Error).message}`,\n error: (err as Error).message,\n };\n }\n\n // Test 2: SQL injection probe\n const sqliSpinner = ora({ text: 'Testing SQL injection vectors...', color: 'green' }).start();\n const sqliPayloads = [\"' OR 1=1--\", \"1' UNION SELECT NULL--\", \"' AND '1'='1\"];\n for (const payload of sqliPayloads) {\n try {\n const testUrl = `${targetUrl}?id=${encodeURIComponent(payload)}`;\n const resp = await fetch(testUrl, { redirect: 'manual', signal: AbortSignal.timeout(5000) });\n const body = await resp.text();\n if (/sql\\s+(syntax|error|exception)|mysql|postgres|ORA-\\d+/i.test(body)) {\n results.push({\n url: testUrl,\n type: 'SQL Injection',\n severity: 'critical',\n message: `SQL error response detected with payload: ${payload}`,\n });\n }\n } catch {\n // Skip on timeout/network error\n }\n }\n sqliSpinner.succeed('SQL injection tests complete\\n');\n\n // Test 3: Path traversal probe\n const pathSpinner = ora({ text: 'Testing path traversal...', color: 'green' }).start();\n const traversalPaths = ['../../etc/passwd', '..%2F..%2Fetc%2Fpasswd', '....//....//etc/passwd'];\n for (const path of traversalPaths) {\n try {\n const testUrl = `${targetUrl}/${path}`;\n const resp = await fetch(testUrl, { redirect: 'manual', signal: AbortSignal.timeout(5000) });\n const body = await resp.text();\n if (/root:.*:0:0:|daemon:.*:1:1:|nobody:.*:65534/i.test(body)) {\n results.push({\n url: testUrl,\n type: 'Path Traversal',\n severity: 'critical',\n message: `Possible /etc/passwd disclosure via: ${path}`,\n });\n }\n } catch {\n // Skip on timeout/network error\n }\n }\n pathSpinner.succeed('Path traversal tests complete\\n');\n\n // Test 4: HTTP methods\n const methodSpinner = ora({ text: 'Testing HTTP methods...', color: 'green' }).start();\n const methods = ['OPTIONS', 'TRACE', 'DELETE', 'PUT'];\n for (const method of methods) {\n try {\n const resp = await fetch(targetUrl, { method, signal: AbortSignal.timeout(5000) });\n if (resp.status < 400 && method !== 'OPTIONS') {\n results.push({\n url: targetUrl,\n type: `Unsafe HTTP Method: ${method}`,\n severity: 'medium',\n message: `${method} method is allowed (status ${resp.status})`,\n });\n }\n if (method === 'OPTIONS') {\n const allow = resp.headers.get('allow');\n if (allow && /DELETE|PUT|TRACE/i.test(allow)) {\n results.push({\n url: targetUrl,\n type: 'HTTP Methods',\n severity: 'low',\n message: `Allowed methods: ${allow}`,\n });\n }\n }\n } catch {\n // Skip on error\n }\n }\n methodSpinner.succeed('HTTP method tests complete\\n');\n\n const structured: StructuredFinding[] = results.map((r) => ({\n type: r.type,\n severity: r.severity as StructuredFinding['severity'],\n message: r.message,\n location: r.url,\n details: r.details ? { detail: r.details } : undefined,\n }));\n const sevCounts = summarize(structured);\n\n // Print results\n if (results.length === 0) {\n console.log(chalk.green.bold(' ✓ No vulnerabilities detected in basic scan!'));\n console.log(chalk.dim(' Note: This is a basic scan. Full pentest requires manual review.\\n'));\n return {\n type: 'pentest',\n target: targetUrl,\n findings: [],\n severity_summary: sevCounts,\n summary: 'No vulnerabilities detected',\n };\n }\n\n const critical = results.filter(r => r.severity === 'critical');\n const high = results.filter(r => r.severity === 'high');\n const medium = results.filter(r => r.severity === 'medium');\n const low = results.filter(r => r.severity === 'low');\n\n console.log(chalk.white.bold(' Penetration Test Results'));\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log(\n ` ${chalk.red.bold(critical.length + ' critical')} ` +\n `${chalk.red(high.length + ' high')} ` +\n `${chalk.yellow(medium.length + ' medium')} ` +\n `${chalk.gray(low.length + ' low')}`,\n );\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log();\n\n const sorted = [...critical, ...high, ...medium, ...low];\n for (const r of sorted) {\n const sev =\n r.severity === 'critical' ? chalk.bgRed.white.bold(` ${r.severity.toUpperCase()} `) :\n r.severity === 'high' ? chalk.red(`[${r.severity.toUpperCase()}]`) :\n r.severity === 'medium' ? chalk.yellow(`[${r.severity.toUpperCase()}]`) :\n chalk.gray(`[${r.severity.toUpperCase()}]`);\n\n console.log(` ${sev} ${chalk.white.bold(r.type)}`);\n console.log(` ${chalk.gray('URL:')} ${chalk.cyan(r.url)}`);\n console.log(` ${chalk.gray('Info:')} ${r.message}`);\n if (r.details) console.log(` ${chalk.gray('Details:')} ${r.details}`);\n console.log();\n }\n\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log(` ${chalk.white.bold(`${results.length} issue(s) found`)}`);\n console.log(chalk.dim(' Note: This is an automated basic scan. Manual review recommended.\\n'));\n\n return {\n type: 'pentest',\n target: targetUrl,\n findings: structured,\n severity_summary: sevCounts,\n summary: `${results.length} issue(s): ${sevCounts.critical}C ${sevCounts.high}H ${sevCounts.medium}M ${sevCounts.low}L`,\n };\n}\n","import chalk from \"chalk\";\nimport { homedir } from \"node:os\";\nimport { readFileSync, writeFileSync, mkdirSync, existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nconst API_URL = process.env.THREATCRUSH_API_URL || \"https://threatcrush.com\";\nconst CONFIG_PATH = join(homedir(), \".threatcrush\", \"config.json\");\n\ninterface CliConfig {\n email?: string;\n token?: string;\n current_org_id?: string;\n current_org_slug?: string;\n}\n\nfunction readConfig(): CliConfig {\n try {\n return JSON.parse(readFileSync(CONFIG_PATH, \"utf-8\"));\n } catch {\n return {};\n }\n}\n\nfunction writeConfig(config: CliConfig) {\n const dir = join(homedir(), \".threatcrush\");\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2));\n}\n\nfunction getAuthHeaders(): Record<string, string> {\n const config = readConfig();\n const headers: Record<string, string> = { \"Content-Type\": \"application/json\" };\n if (config.token) headers[\"Authorization\"] = `Bearer ${config.token}`;\n return headers;\n}\n\n// ─── Organizations ───\n\nexport async function orgsCommand(options: { action?: string; name?: string }): Promise<void> {\n const { action, name } = options;\n\n if (action === \"create\") {\n if (!name) {\n console.log(chalk.red(\" Usage: threatcrush orgs create <name>\\n\"));\n return;\n }\n await createOrganization(name);\n return;\n }\n\n if (action === \"use\") {\n if (!name) {\n console.log(chalk.red(\" Usage: threatcrush orgs use <slug>\\n\"));\n return;\n }\n await useOrganization(name);\n return;\n }\n\n if (action === \"list\" || !action) {\n await listOrganizations();\n return;\n }\n\n console.log(chalk.red(` Unknown action: ${action}`));\n console.log(chalk.dim(\" Available: list, create, use\\n\"));\n}\n\nasync function listOrganizations(): Promise<void> {\n console.log(chalk.green(\" Your Organizations\\n\"));\n\n try {\n const res = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!res.ok) {\n if (res.status === 401) {\n console.log(chalk.red(\" Not authenticated. Run: threatcrush login\\n\"));\n return;\n }\n console.log(chalk.red(` Failed to list organizations: ${res.statusText}\\n`));\n return;\n }\n\n const data = await res.json() as { organizations?: Array<Record<string, unknown>> };\n const orgs = data.organizations || [];\n\n if (orgs.length === 0) {\n console.log(chalk.yellow(\" No organizations found.\"));\n console.log(chalk.dim(\" Create one: threatcrush orgs create <name>\\n\"));\n return;\n }\n\n const config = readConfig();\n for (const org of orgs) {\n const isCurrent = org.id === config.current_org_id;\n const role = org.user_role as string;\n const slug = org.slug as string;\n const name = org.name as string;\n\n console.log(` ${isCurrent ? chalk.green(\"●\") : chalk.gray(\"○\")} ${chalk.bold(name)} ${chalk.gray(`(/${slug})`)}`);\n console.log(` ${chalk.dim(`Role: ${role}`)}`);\n console.log();\n }\n\n console.log(chalk.dim(\" Switch org: threatcrush orgs use <slug>\"));\n console.log(chalk.dim(\" Create org: threatcrush orgs create <name>\\n\"));\n } catch (err) {\n console.log(chalk.red(` Failed to list organizations: ${err instanceof Error ? err.message : err}\\n`));\n }\n}\n\nasync function createOrganization(name: string): Promise<void> {\n console.log(chalk.green(` Creating organization \"${name}\"...\\n`));\n\n try {\n const res = await fetch(`${API_URL}/api/orgs`, {\n method: \"POST\",\n headers: getAuthHeaders(),\n body: JSON.stringify({ name }),\n });\n\n if (!res.ok) {\n const err = await res.json().catch(() => ({ error: res.statusText }));\n console.log(chalk.red(` Failed: ${(err as Record<string, string>).error}\\n`));\n return;\n }\n\n const data = await res.json() as { organization: Record<string, unknown> };\n const org = data.organization;\n\n console.log(chalk.green(\" ✓ Organization created!\"));\n console.log(chalk.dim(` Name: ${org.name}`));\n console.log(chalk.dim(` Slug: /${org.slug}\\n`));\n\n // Auto-switch to new org\n const config = readConfig();\n config.current_org_id = org.id as string;\n config.current_org_slug = org.slug as string;\n writeConfig(config);\n\n console.log(chalk.dim(\" Now using this organization.\\n\"));\n } catch (err) {\n console.log(chalk.red(` Failed: ${err instanceof Error ? err.message : err}\\n`));\n }\n}\n\nasync function useOrganization(slug: string): Promise<void> {\n console.log(chalk.green(` Switching to organization \"${slug}\"...\\n`));\n\n try {\n const res = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!res.ok) {\n console.log(chalk.red(` Failed to list organizations: ${res.statusText}\\n`));\n return;\n }\n\n const data = await res.json() as { organizations?: Array<Record<string, unknown>> };\n const orgs = data.organizations || [];\n const org = orgs.find((o) => o.slug === slug);\n\n if (!org) {\n console.log(chalk.red(` Organization \"/${slug}\" not found.\\n`));\n return;\n }\n\n const config = readConfig();\n config.current_org_id = org.id as string;\n config.current_org_slug = org.slug as string;\n writeConfig(config);\n\n console.log(chalk.green(\" ✓ Now using:\"));\n console.log(chalk.dim(` Name: ${org.name}`));\n console.log(chalk.dim(` Slug: /${org.slug}`));\n console.log(chalk.dim(` Role: ${org.user_role}\\n`));\n } catch (err) {\n console.log(chalk.red(` Failed: ${err instanceof Error ? err.message : err}\\n`));\n }\n}\n","import chalk from \"chalk\";\nimport { homedir } from \"node:os\";\nimport { readFileSync, existsSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nconst API_URL = process.env.THREATCRUSH_API_URL || \"https://threatcrush.com\";\nconst CONFIG_PATH = join(homedir(), \".threatcrush\", \"config.json\");\n\ninterface CliConfig {\n email?: string;\n token?: string;\n current_org_id?: string;\n current_org_slug?: string;\n}\n\nfunction readConfig(): CliConfig {\n try {\n return JSON.parse(readFileSync(CONFIG_PATH, \"utf-8\"));\n } catch {\n return {};\n }\n}\n\nfunction getAuthHeaders(): Record<string, string> {\n const config = readConfig();\n const headers: Record<string, string> = { \"Content-Type\": \"application/json\" };\n if (config.token) headers[\"Authorization\"] = `Bearer ${config.token}`;\n return headers;\n}\n\ninterface Server {\n id: string;\n name: string;\n hostname: string | null;\n ip_address: string | null;\n port: number;\n ssh_username: string | null;\n status: string;\n last_seen: string | null;\n threatcrushd_version: string | null;\n}\n\n// ─── Servers ───\n\nexport async function serversCommand(options: { action?: string; name?: string; org?: string }): Promise<void> {\n const { action, name, org } = options;\n\n if (action === \"list\" || !action) {\n await listServers(org);\n return;\n }\n\n if (action === \"add\") {\n console.log(chalk.red(\" Interactive server add is not yet implemented.\"));\n console.log(chalk.dim(\" Use the web dashboard to add servers: https://threatcrush.com/dashboard\\n\"));\n return;\n }\n\n console.log(chalk.red(` Unknown action: ${action}`));\n console.log(chalk.dim(\" Available: list\\n\"));\n}\n\nasync function listServers(orgSlug?: string): Promise<void> {\n const config = readConfig();\n\n if (!config.current_org_id && !orgSlug) {\n console.log(chalk.yellow(\" No current organization set.\"));\n console.log(chalk.dim(\" Set one with: threatcrush orgs use <slug>\\n\"));\n return;\n }\n\n console.log(chalk.green(\" Servers\\n\"));\n\n try {\n // First get orgs to resolve the ID if only slug is given\n let orgId = config.current_org_id;\n\n if (orgSlug) {\n const orgsRes = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!orgsRes.ok) {\n console.log(chalk.red(` Failed to fetch organizations: ${orgsRes.statusText}\\n`));\n return;\n }\n const orgsData = await orgsRes.json() as { organizations?: Array<Record<string, unknown>> };\n const org = (orgsData.organizations || []).find((o) => o.slug === orgSlug);\n if (!org) {\n console.log(chalk.red(` Organization \"/${orgSlug}\" not found.\\n`));\n return;\n }\n orgId = org.id as string;\n }\n\n if (!orgId) {\n console.log(chalk.red(\" Could not resolve organization.\\n\"));\n return;\n }\n\n const res = await fetch(`${API_URL}/api/orgs/${orgId}/servers`, { headers: getAuthHeaders() });\n if (!res.ok) {\n console.log(chalk.red(` Failed to list servers: ${res.statusText}\\n`));\n return;\n }\n\n const data = await res.json() as { servers?: Server[] };\n const servers = data.servers || [];\n\n if (servers.length === 0) {\n console.log(chalk.yellow(\" No servers registered.\"));\n console.log(chalk.dim(\" Add servers via the web dashboard.\\n\"));\n return;\n }\n\n for (const server of servers) {\n const statusColor = server.status === \"online\" ? chalk.green : server.status === \"unreachable\" ? chalk.red : chalk.gray;\n const statusDot = server.status === \"online\" ? \"●\" : \"○\";\n\n console.log(` ${statusColor(statusDot)} ${chalk.bold(server.name)}`);\n console.log(` ${chalk.dim(`${server.hostname || server.ip_address}:${server.port}`)}`);\n console.log(` Status: ${statusColor(server.status)}`);\n if (server.last_seen) {\n console.log(` Last seen: ${chalk.dim(timeAgo(server.last_seen))}`);\n }\n if (server.threatcrushd_version) {\n console.log(` Version: ${chalk.dim(server.threatcrushd_version)}`);\n }\n if (server.ssh_username) {\n console.log(` SSH user: ${chalk.dim(server.ssh_username)}`);\n }\n console.log();\n }\n\n console.log(chalk.dim(\" Connect: threatcrush connect <server-name>\\n\"));\n } catch (err) {\n console.log(chalk.red(` Failed: ${err instanceof Error ? err.message : err}\\n`));\n }\n}\n\nfunction timeAgo(dateStr: string): string {\n const date = new Date(dateStr);\n const now = new Date();\n const seconds = Math.floor((now.getTime() - date.getTime()) / 1000);\n\n if (seconds < 60) return \"just now\";\n if (seconds < 3600) return `${Math.floor(seconds / 60)}m ago`;\n if (seconds < 86400) return `${Math.floor(seconds / 3600)}h ago`;\n return `${Math.floor(seconds / 86400)}d ago`;\n}\n","import chalk from \"chalk\";\nimport { homedir } from \"node:os\";\nimport { readFileSync, existsSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { execSync, spawn } from \"node:child_process\";\n\nconst API_URL = process.env.THREATCRUSH_API_URL || \"https://threatcrush.com\";\nconst CONFIG_PATH = join(homedir(), \".threatcrush\", \"config.json\");\n\ninterface CliConfig {\n email?: string;\n token?: string;\n current_org_id?: string;\n current_org_slug?: string;\n}\n\ninterface Server {\n id: string;\n name: string;\n hostname: string | null;\n ip_address: string | null;\n port: number;\n ssh_username: string | null;\n}\n\nfunction readConfig(): CliConfig {\n try {\n return JSON.parse(readFileSync(CONFIG_PATH, \"utf-8\"));\n } catch {\n return {};\n }\n}\n\nfunction getAuthHeaders(): Record<string, string> {\n const config = readConfig();\n const headers: Record<string, string> = { \"Content-Type\": \"application/json\" };\n if (config.token) headers[\"Authorization\"] = `Bearer ${config.token}`;\n return headers;\n}\n\nexport async function connectCommand(options: {\n target?: string;\n org?: string;\n user?: string;\n port?: string;\n identity?: string;\n}): Promise<void> {\n const { target, org, user, port, identity } = options;\n\n if (!target) {\n // Interactive mode — list available servers\n await interactiveConnect(org);\n return;\n }\n\n // Check if target is a server name (resolve via API)\n const server = await resolveServer(target, org);\n\n if (server) {\n // Connect via SSH using server metadata\n await sshConnect({\n hostname: server.hostname || server.ip_address,\n port: server.port,\n username: user || server.ssh_username || null,\n identity,\n });\n } else if (target.includes(\"@\") || target.includes(\".\")) {\n // Treat as direct hostname\n await sshConnect({\n hostname: target.includes(\"@\") ? target.split(\"@\")[1] : target,\n port: parseInt(port || \"22\", 10),\n username: target.includes(\"@\") ? target.split(\"@\")[0] : (user || null),\n identity,\n });\n } else {\n console.log(chalk.red(` Server \"${target}\" not found in your organizations.\\n`));\n console.log(chalk.dim(\" List available servers: threatcrush servers list\"));\n console.log(chalk.dim(\" Or connect directly: threatcrush connect user@hostname\\n\"));\n }\n}\n\nasync function interactiveConnect(orgSlug?: string): Promise<void> {\n const config = readConfig();\n\n try {\n // Get orgs\n const orgsRes = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!orgsRes.ok) {\n console.log(chalk.red(\" Failed to fetch organizations. Are you logged in?\\n\"));\n return;\n }\n const orgsData = await orgsRes.json() as { organizations?: Array<Record<string, unknown>> };\n let orgs = orgsData.organizations || [];\n\n if (orgSlug) {\n orgs = orgs.filter((o) => o.slug === orgSlug);\n }\n\n if (orgs.length === 0) {\n console.log(chalk.yellow(\" No organizations found.\"));\n console.log(chalk.dim(\" Create one: threatcrush orgs create <name>\\n\"));\n return;\n }\n\n // If multiple orgs, pick current\n let orgId = config.current_org_id;\n if (orgs.length > 1 && !orgId) {\n orgId = orgs[0].id as string;\n }\n if (!orgId) {\n orgId = orgs[0].id as string;\n }\n\n // Get servers for org\n const serversRes = await fetch(`${API_URL}/api/orgs/${orgId}/servers`, { headers: getAuthHeaders() });\n if (!serversRes.ok) {\n console.log(chalk.red(\" Failed to fetch servers.\\n\"));\n return;\n }\n const serversData = await serversRes.json() as { servers?: Server[] };\n const servers = serversData.servers || [];\n\n if (servers.length === 0) {\n console.log(chalk.yellow(\" No servers in this organization.\"));\n console.log(chalk.dim(\" Add servers via the web dashboard.\\n\"));\n return;\n }\n\n console.log(chalk.green(\" Available Servers\\n\"));\n\n for (const server of servers) {\n const s = server as unknown as Record<string, unknown>;\n const status = s.status as string;\n const statusColor = status === \"online\" ? chalk.green : chalk.gray;\n const statusDot = status === \"online\" ? \"●\" : \"○\";\n console.log(` ${chalk.bold((s.name as string).padEnd(20))} ${statusColor(statusDot)} ${chalk.dim(`${s.hostname || s.ip_address}:${s.port}`)}`);\n }\n\n console.log();\n console.log(chalk.dim(\" Connect: threatcrush connect <server-name>\"));\n console.log(chalk.dim(\" Or: threatcrush connect user@hostname\\n\"));\n } catch (err) {\n console.log(chalk.red(` Failed: ${err instanceof Error ? err.message : err}\\n`));\n }\n}\n\nasync function resolveServer(nameOrSlug: string, orgSlug?: string): Promise<Server | null> {\n const config = readConfig();\n\n try {\n // Get orgs\n let orgId = config.current_org_id;\n\n if (orgSlug) {\n const orgsRes = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!orgsRes.ok) return null;\n const orgsData = await orgsRes.json() as { organizations?: Array<Record<string, unknown>> };\n const org = (orgsData.organizations || []).find((o) => o.slug === orgSlug);\n if (!org) return null;\n orgId = org.id as string;\n }\n\n if (!orgId) {\n // Try first org\n const orgsRes = await fetch(`${API_URL}/api/orgs`, { headers: getAuthHeaders() });\n if (!orgsRes.ok) return null;\n const orgsData = await orgsRes.json() as { organizations?: Array<Record<string, unknown>> };\n orgId = (orgsData.organizations || [])[0]?.id as string;\n if (!orgId) return null;\n }\n\n // Get servers\n const serversRes = await fetch(`${API_URL}/api/orgs/${orgId}/servers`, { headers: getAuthHeaders() });\n if (!serversRes.ok) return null;\n const serversData = await serversRes.json() as { servers?: Server[] };\n const servers = serversData.servers || [];\n\n // Match by name\n const server = servers.find((s) => s.name.toLowerCase() === nameOrSlug.toLowerCase());\n return server || null;\n } catch {\n return null;\n }\n}\n\nasync function sshConnect(options: {\n hostname: string | null;\n port: number;\n username: string | null;\n identity?: string;\n}): Promise<void> {\n const { hostname, port, username, identity } = options;\n\n if (!hostname) {\n console.log(chalk.red(\" No hostname available for this server.\\n\"));\n return;\n }\n\n const user = username || \"root\";\n\n console.log(chalk.green(` Connecting to ${user}@${hostname}:${port}...\\n`));\n console.log(chalk.dim(\" (Spawning SSH session — exit with Ctrl+D or type 'exit')\\n\"));\n\n const sshArgs = [\"-p\", String(port)];\n if (identity) {\n sshArgs.push(\"-i\", identity);\n }\n sshArgs.push(`${user}@${hostname}`);\n\n // Spawn SSH as a direct child process, inheriting stdio\n const ssh = spawn(\"ssh\", sshArgs, { stdio: \"inherit\" });\n\n ssh.on(\"error\", (err) => {\n console.log(chalk.red(`\\n SSH error: ${err.message}\\n`));\n });\n\n ssh.on(\"exit\", (code) => {\n if (code === 0) {\n console.log(chalk.dim(\"\\n SSH session ended.\\n\"));\n } else if (code !== null) {\n console.log(chalk.yellow(`\\n SSH exited with code ${code}\\n`));\n }\n });\n}\n","import { spawn } from 'node:child_process';\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { openSync } from 'node:fs';\nimport chalk from 'chalk';\nimport { runDaemon } from '../daemon/index.js';\nimport { PATHS, ensureRuntimeDirs } from '../daemon/paths.js';\nimport { findRunningDaemon, removePidFile } from '../daemon/pidfile.js';\nimport { IpcClient } from '../core/ipc-client.js';\n\nconst DAEMON_ENTRY = join(__dirname, 'daemon.js');\n\nexport async function daemonForeground(): Promise<void> {\n await runDaemon();\n}\n\nexport async function daemonStart(): Promise<void> {\n const pid = findRunningDaemon();\n if (pid) {\n console.log(chalk.yellow(` threatcrushd already running (pid ${pid}).`));\n return;\n }\n\n ensureRuntimeDirs();\n\n if (!existsSync(DAEMON_ENTRY)) {\n console.log(chalk.red(` Daemon entry not found at ${DAEMON_ENTRY}.`));\n console.log(chalk.dim(' Reinstall with `threatcrush update` or `pnpm run build` in the cli package.'));\n return;\n }\n\n let out: number;\n let err: number;\n try {\n out = openSync(PATHS.logFile, 'a');\n err = openSync(PATHS.logFile, 'a');\n } catch (e) {\n const code = (e as NodeJS.ErrnoException).code;\n console.log(chalk.red(` ✗ Cannot write daemon log at ${PATHS.logFile} (${code ?? 'error'}).`));\n if (code === 'EACCES') {\n console.log(\n chalk.dim(\n PATHS.mode === 'system'\n ? ' Run as root (sudo) to use system paths, or run without sudo to use ~/.threatcrush.'\n : ` Fix permissions on ${PATHS.logDir} (it should be owned by your user).`,\n ),\n );\n }\n return;\n }\n\n const child = spawn(process.execPath, [DAEMON_ENTRY], {\n detached: true,\n stdio: ['ignore', out, err],\n env: { ...process.env, THREATCRUSH_DAEMON: '1' },\n });\n child.unref();\n\n // Wait briefly for the socket to come up\n const deadline = Date.now() + 3000;\n while (Date.now() < deadline) {\n if (IpcClient.isDaemonRunning()) break;\n await new Promise((r) => setTimeout(r, 100));\n }\n\n if (IpcClient.isDaemonRunning()) {\n console.log(chalk.green(` ✓ threatcrushd started (pid ${child.pid})`));\n console.log(chalk.dim(` socket: ${PATHS.socket}`));\n console.log(chalk.dim(` log: ${PATHS.logFile}\\n`));\n } else {\n console.log(chalk.red(` ✗ threatcrushd did not come up within 3s.`));\n console.log(chalk.dim(` check log: ${PATHS.logFile}\\n`));\n }\n}\n\nexport async function daemonStop(): Promise<void> {\n const pid = findRunningDaemon();\n if (!pid) {\n console.log(chalk.dim(' No running daemon found.'));\n return;\n }\n\n try {\n const client = new IpcClient();\n await client.connect();\n await client.shutdown().catch(() => {});\n client.close();\n } catch {\n try { process.kill(pid, 'SIGTERM'); } catch {}\n }\n\n const deadline = Date.now() + 3000;\n while (Date.now() < deadline) {\n try { process.kill(pid, 0); } catch { break; }\n await new Promise((r) => setTimeout(r, 100));\n }\n\n try { process.kill(pid, 0); } catch {\n removePidFile();\n console.log(chalk.green(` ✓ threatcrushd stopped.`));\n return;\n }\n\n try { process.kill(pid, 'SIGKILL'); } catch {}\n removePidFile();\n console.log(chalk.yellow(` ! threatcrushd was killed (SIGKILL).`));\n}\n","import { appendFileSync, existsSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { PATHS, ensureRuntimeDirs } from './paths.js';\nimport { findRunningDaemon, removePidFile, writePidFile } from './pidfile.js';\nimport { IpcServer } from './ipc-server.js';\nimport { ModuleHost } from './module-host.js';\nimport { AlertDispatcher } from './alerts/index.js';\nimport { RunsWorker } from './workers/runs-worker.js';\nimport { RuleEngine } from './rules/engine.js';\nimport { loadAllRules } from './rules/loader.js';\nimport { detectFirewallAdapter } from './firewall/adapters.js';\nimport { RemediationManager } from './firewall/remediation.js';\nimport { bus } from './event-bus.js';\nimport { initStateDB, closeDB } from '../core/state.js';\nimport { loadConfig } from '../core/config.js';\nimport { captureException, flushTelemetry, initTelemetry } from '../core/telemetry.js';\nimport type { ThreatEvent } from '../types/events.js';\n\nfunction readVersion(): string {\n try {\n const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8'));\n return pkg.version || '0.0.0';\n } catch {\n return '0.0.0';\n }\n}\n\nfunction logLine(line: string): void {\n try {\n appendFileSync(PATHS.logFile, `${new Date().toISOString()} ${line}\\n`);\n } catch {\n // best-effort\n }\n}\n\nexport async function runDaemon(): Promise<void> {\n if (findRunningDaemon()) {\n console.error(`threatcrushd already running (pid file at ${PATHS.pidFile}).`);\n process.exit(1);\n }\n\n ensureRuntimeDirs();\n writePidFile();\n\n await initTelemetry('daemon');\n process.on('uncaughtException', (err) => {\n logLine(`[daemon] uncaughtException: ${err.message}`);\n captureException(err);\n });\n process.on('unhandledRejection', (reason) => {\n logLine(`[daemon] unhandledRejection: ${String(reason)}`);\n captureException(reason);\n });\n\n const version = readVersion();\n logLine(`[daemon] starting threatcrushd v${version} mode=${PATHS.mode}`);\n\n try {\n initStateDB(PATHS.stateDb);\n } catch (err) {\n logLine(`[daemon] state db unavailable: ${(err as Error).message}`);\n }\n\n const config = loadConfig(existsSync(PATHS.configFile) ? PATHS.configFile : undefined);\n\n bus.on('event', (event: ThreatEvent) => {\n logLine(`[event] ${event.severity} ${event.module} ${event.message}`);\n });\n\n const moduleHost = new ModuleHost(bus);\n await moduleHost.start();\n\n // Detection rule engine (PRD 01)\n const ruleEngine = new RuleEngine((detection) => {\n const event: ThreatEvent = {\n timestamp: new Date(),\n module: 'rule-engine',\n category: (detection.raw_metadata?.category as any) || 'system',\n severity: detection.severity,\n message: `[DETECTION] ${detection.title}`,\n source_ip: detection.source_ip,\n details: {\n rule_id: detection.rule_id,\n username: detection.username,\n ...detection.raw_metadata,\n },\n };\n bus.publish(event);\n });\n ruleEngine.loadRules(loadAllRules());\n bus.on('event', (event) => {\n if (event.module !== 'rule-engine') ruleEngine.evaluate(event);\n });\n logLine(`[daemon] rule engine loaded ${ruleEngine.getRules().length} rules`);\n setInterval(() => ruleEngine.cleanup(), 300_000);\n\n // Firewall auto-remediation (PRD 02)\n const firewallAdapter = detectFirewallAdapter();\n const remediation = new RemediationManager(firewallAdapter, bus, (config as any).remediation);\n bus.on('event', (event) => {\n if (event.module !== 'firewall-rules') {\n void remediation.handleDetection(event);\n }\n });\n logLine(`[daemon] firewall remediation active (backend=${firewallAdapter.name}, dry_run=${(config as any).remediation?.dry_run ?? true})`);\n\n new AlertDispatcher(bus, config);\n\n const runsWorker = new RunsWorker(bus);\n try {\n await runsWorker.start();\n } catch (err) {\n logLine(`[daemon] runs-worker failed to start: ${(err as Error).message}`);\n }\n\n const ipc = new IpcServer(version, moduleHost);\n await ipc.start();\n logLine(`[daemon] ipc listening on ${PATHS.socket}`);\n\n const shutdown = async (signal: string) => {\n logLine(`[daemon] received ${signal}, shutting down`);\n try { remediation.stop(); } catch {}\n try { runsWorker.stop(); } catch {}\n try { await moduleHost.stop(); } catch {}\n try { await ipc.stop(); } catch {}\n try { closeDB(); } catch {}\n try { await flushTelemetry(); } catch {}\n removePidFile();\n process.exit(0);\n };\n\n process.on('SIGINT', () => { void shutdown('SIGINT'); });\n process.on('SIGTERM', () => { void shutdown('SIGTERM'); });\n process.on('SIGHUP', () => { void shutdown('SIGHUP'); });\n\n // keep-alive\n setInterval(() => {}, 1 << 30);\n}\n\n// Note: auto-boot is handled by `src/daemon-entry.ts` so that importing this\n// module from the CLI bundle never accidentally starts a daemon.\n","import { createServer, Server, Socket } from 'node:net';\nimport { existsSync, unlinkSync } from 'node:fs';\nimport type { ThreatEvent } from '../types/events.js';\nimport { PATHS } from './paths.js';\nimport { bus } from './event-bus.js';\nimport { getRecentEvents, getTopSources, getEventCount, getThreatCount } from '../core/state.js';\nimport type {\n IpcRequest,\n IpcResponse,\n IpcPush,\n DaemonStatusReply,\n} from './ipc-protocol.js';\nimport type { ModuleHost } from './module-host.js';\n\ninterface ClientState {\n id: number;\n socket: Socket;\n buffer: string;\n subscriptions: Set<'event' | 'module'>;\n}\n\nexport class IpcServer {\n private server: Server | null = null;\n private clients = new Map<number, ClientState>();\n private nextClientId = 1;\n private startedAt = new Date();\n private counters = { events: 0, threats: 0, alerts: 0 };\n\n constructor(\n private version: string,\n private moduleHost: ModuleHost,\n ) {\n bus.on('event', (event: ThreatEvent) => {\n this.counters.events++;\n if (event.severity === 'medium' || event.severity === 'high' || event.severity === 'critical') {\n this.counters.threats++;\n }\n this.broadcast({ push: 'event', payload: event }, 'event');\n });\n bus.on('alert', () => {\n this.counters.alerts++;\n });\n bus.on('module', (info) => {\n this.broadcast({ push: 'module', payload: info }, 'module');\n });\n }\n\n async start(): Promise<void> {\n if (existsSync(PATHS.socket)) {\n try { unlinkSync(PATHS.socket); } catch {}\n }\n return new Promise((resolve, reject) => {\n this.server = createServer((sock) => this.handleClient(sock));\n this.server.on('error', reject);\n this.server.listen(PATHS.socket, () => {\n const nodeFs = require('node:fs') as typeof import('node:fs');\n try { nodeFs.chmodSync(PATHS.socket, 0o660); } catch {}\n // When the daemon runs as root (system mode under systemd), regroup\n // the socket to `adm` so users in that group can talk to the daemon\n // without sudo. We use this group because it's the same one that\n // already governs read access to /var/log/{auth,syslog,nginx} — the\n // intent is \"people who can already inspect logs can talk to the\n // agent that watches them.\"\n const isRoot = process.platform === 'linux'\n && typeof process.getuid === 'function'\n && process.getuid() === 0;\n if (isRoot) {\n try {\n const { gid } = nodeFs.statSync('/var/log/auth.log');\n nodeFs.chownSync(PATHS.socket, 0, gid);\n } catch {\n // adm group not present, or /var/log/auth.log missing — leave as root:root\n }\n }\n resolve();\n });\n });\n }\n\n async stop(): Promise<void> {\n for (const c of this.clients.values()) {\n try { c.socket.destroy(); } catch {}\n }\n this.clients.clear();\n return new Promise((resolve) => {\n if (!this.server) {\n try { if (existsSync(PATHS.socket)) unlinkSync(PATHS.socket); } catch {}\n return resolve();\n }\n this.server.close(() => {\n try { if (existsSync(PATHS.socket)) unlinkSync(PATHS.socket); } catch {}\n resolve();\n });\n });\n }\n\n private handleClient(socket: Socket): void {\n const id = this.nextClientId++;\n const state: ClientState = { id, socket, buffer: '', subscriptions: new Set() };\n this.clients.set(id, state);\n\n socket.setEncoding('utf-8');\n socket.on('data', (chunk) => {\n state.buffer += chunk.toString();\n let idx;\n while ((idx = state.buffer.indexOf('\\n')) >= 0) {\n const line = state.buffer.slice(0, idx);\n state.buffer = state.buffer.slice(idx + 1);\n if (!line.trim()) continue;\n this.handleLine(state, line).catch((err) => {\n this.send(state, { id: 0, ok: false, error: String(err?.message || err) });\n });\n }\n });\n\n socket.on('close', () => { this.clients.delete(id); });\n socket.on('error', () => { this.clients.delete(id); });\n }\n\n private async handleLine(client: ClientState, line: string): Promise<void> {\n let req: IpcRequest;\n try {\n req = JSON.parse(line) as IpcRequest;\n } catch {\n return this.send(client, { id: 0, ok: false, error: 'invalid json' });\n }\n\n switch (req.method) {\n case 'ping':\n return this.send(client, { id: req.id, ok: true, result: 'pong' });\n\n case 'status': {\n const status: DaemonStatusReply = {\n pid: process.pid,\n startedAt: this.startedAt.toISOString(),\n uptimeSeconds: Math.floor((Date.now() - this.startedAt.getTime()) / 1000),\n version: this.version,\n mode: PATHS.mode,\n paths: {\n config: PATHS.configFile,\n log: PATHS.logFile,\n state: PATHS.stateDb,\n socket: PATHS.socket,\n },\n modules: this.moduleHost.summary(),\n counters: { ...this.counters },\n };\n return this.send(client, { id: req.id, ok: true, result: status });\n }\n\n case 'recent_events': {\n const limit = req.params?.limit ?? 50;\n const events = getRecentEvents(limit);\n return this.send(client, { id: req.id, ok: true, result: events });\n }\n\n case 'top_sources': {\n const limit = req.params?.limit ?? 10;\n return this.send(client, { id: req.id, ok: true, result: getTopSources(limit) });\n }\n\n case 'counters': {\n return this.send(client, {\n id: req.id,\n ok: true,\n result: {\n total: getEventCount(),\n threats: getThreatCount(),\n last24h: getEventCount(new Date(Date.now() - 86400000)),\n threats24h: getThreatCount(new Date(Date.now() - 86400000)),\n },\n });\n }\n\n case 'module_list':\n return this.send(client, { id: req.id, ok: true, result: this.moduleHost.summary() });\n\n case 'subscribe':\n for (const ch of req.params.channels) client.subscriptions.add(ch);\n return this.send(client, { id: req.id, ok: true, result: { subscribed: [...client.subscriptions] } });\n\n case 'shutdown':\n this.send(client, { id: req.id, ok: true, result: 'shutting down' });\n setTimeout(() => process.emit('SIGTERM' as NodeJS.Signals), 50);\n return;\n }\n }\n\n private send(client: ClientState, msg: IpcResponse | IpcPush): void {\n try {\n client.socket.write(JSON.stringify(msg) + '\\n');\n } catch {\n // client gone\n }\n }\n\n private broadcast(msg: IpcPush, channel: 'event' | 'module'): void {\n for (const client of this.clients.values()) {\n if (!client.subscriptions.has(channel)) continue;\n this.send(client, msg);\n }\n }\n}\n","import { EventEmitter } from 'node:events';\nimport type { ThreatEvent } from '../types/events.js';\n\nexport interface DaemonEvents {\n event: (event: ThreatEvent) => void;\n alert: (event: ThreatEvent) => void;\n module: (info: { name: string; status: string; detail?: string }) => void;\n}\n\nexport class EventBus extends EventEmitter {\n publish(event: ThreatEvent): void {\n this.emit('event', event);\n if (event.severity === 'high' || event.severity === 'critical') {\n this.emit('alert', event);\n }\n }\n\n announceModule(name: string, status: string, detail?: string): void {\n this.emit('module', { name, status, detail });\n }\n}\n\nexport const bus = new EventBus();\nbus.setMaxListeners(50);\n","import { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport TOML from '@iarna/toml';\nimport type { EventBus } from './event-bus.js';\nimport { PATHS } from './paths.js';\nimport { LogWatcher } from './watchers/log-watcher.js';\nimport { JournalWatcher } from './watchers/journal-watcher.js';\nimport { NetworkMonitor } from '../modules/network-monitor/index.js';\nimport { DnsMonitor } from '../modules/dns-monitor/index.js';\nimport { loadModuleConfigs } from '../core/config.js';\nimport { getModuleState, setModuleState } from '../core/state.js';\nimport type { ModuleConfig, ModuleManifest } from '../types/config.js';\nimport type { ThreatEvent } from '../types/events.js';\nimport type { ModuleAlert, ThreatCrushModule } from '../types/module.js';\n\ninterface HostedModule {\n name: string;\n version: string;\n source: 'builtin' | 'installed';\n status: 'running' | 'loaded' | 'error' | 'disabled';\n events: number;\n detail?: string;\n path?: string;\n config?: ModuleConfig;\n instance?: ThreatCrushModule;\n}\n\nexport class ModuleHost {\n private modules = new Map<string, HostedModule>();\n private logWatcher: LogWatcher | null = null;\n private journalWatcher: JournalWatcher | null = null;\n private networkMonitor: NetworkMonitor | null = null;\n private dnsMonitor: DnsMonitor | null = null;\n\n constructor(private bus: EventBus) {\n bus.on('event', (event) => {\n const mod = this.modules.get(event.module);\n if (mod) mod.events++;\n for (const hosted of this.modules.values()) {\n if (hosted.status !== 'running' || !hosted.instance?.onEvent) continue;\n void hosted.instance.onEvent(event).catch((err) => {\n hosted.status = 'error';\n hosted.detail = `onEvent failed: ${String((err as Error).message || err)}`;\n this.bus.announceModule(hosted.name, 'error', hosted.detail);\n });\n }\n });\n }\n\n async start(): Promise<void> {\n this.registerBuiltins();\n await this.discoverAndStartInstalled();\n\n this.logWatcher = new LogWatcher(this.bus);\n const watched = this.logWatcher.start();\n\n for (const modName of this.logWatcher.activeModules()) {\n const mod = this.modules.get(modName);\n if (mod) {\n mod.status = 'running';\n mod.detail = `watching ${watched.length} log source(s)`;\n this.bus.announceModule(modName, 'running', mod.detail);\n }\n }\n\n this.journalWatcher = new JournalWatcher(this.bus);\n if (this.journalWatcher.start()) {\n const mod = this.modules.get('user-journal');\n if (mod) {\n mod.status = 'running';\n mod.detail = `tailing ${JournalWatcher.scopeArgs().includes('--user') ? 'user journal' : 'system journal'}`;\n this.bus.announceModule('user-journal', 'running', mod.detail);\n }\n }\n\n // Network monitor (PRD 04)\n this.networkMonitor = new NetworkMonitor(this.bus);\n if (this.networkMonitor.start()) {\n const nmod = this.modules.get('network-monitor');\n if (nmod) {\n nmod.status = 'running';\n nmod.detail = 'monitoring connections via conntrack/ss';\n this.bus.announceModule('network-monitor', 'running', nmod.detail);\n }\n }\n\n // DNS monitor (PRD 05)\n this.dnsMonitor = new DnsMonitor(this.bus);\n if (this.dnsMonitor.start()) {\n const dmod = this.modules.get('dns-monitor');\n if (dmod) {\n dmod.status = 'running';\n dmod.detail = 'monitoring DNS queries';\n this.bus.announceModule('dns-monitor', 'running', dmod.detail);\n }\n }\n }\n\n async stop(): Promise<void> {\n this.logWatcher?.stop();\n this.journalWatcher?.stop();\n this.networkMonitor?.stop();\n this.dnsMonitor?.stop();\n for (const mod of this.modules.values()) {\n try {\n if (mod.instance && mod.status === 'running') {\n await mod.instance.stop();\n }\n } catch (err) {\n mod.status = 'error';\n mod.detail = `stop failed: ${String((err as Error).message || err)}`;\n this.bus.announceModule(mod.name, 'error', mod.detail);\n continue;\n }\n mod.status = 'loaded';\n this.bus.announceModule(mod.name, 'stopped');\n }\n }\n\n summary(): Array<{ name: string; status: string; events: number; detail?: string }> {\n return [...this.modules.values()].map((m) => ({\n name: m.name,\n status: m.status,\n events: m.events,\n detail: m.detail,\n }));\n }\n\n private registerBuiltins(): void {\n const builtins: HostedModule[] = [\n { name: 'log-watcher', version: '0.1.0', source: 'builtin', status: 'loaded', events: 0 },\n { name: 'ssh-guard', version: '0.1.0', source: 'builtin', status: 'loaded', events: 0 },\n { name: 'user-journal', version: '0.1.0', source: 'builtin', status: 'loaded', events: 0 },\n { name: 'network-monitor', version: '0.1.0', source: 'builtin', status: 'loaded', events: 0 },\n { name: 'dns-monitor', version: '0.1.0', source: 'builtin', status: 'loaded', events: 0 },\n ];\n for (const m of builtins) this.modules.set(m.name, m);\n }\n\n private async discoverAndStartInstalled(): Promise<void> {\n if (!existsSync(PATHS.moduleDir)) return;\n const configs = loadModuleConfigs(PATHS.confD);\n const entries = readdirSync(PATHS.moduleDir, { withFileTypes: true });\n for (const entry of entries) {\n if (!entry.isDirectory()) continue;\n const manifestPath = join(PATHS.moduleDir, entry.name, 'mod.toml');\n if (!existsSync(manifestPath)) continue;\n try {\n const manifest = TOML.parse(readFileSync(manifestPath, 'utf-8')) as unknown as ModuleManifest;\n const name = manifest.module?.name || entry.name;\n const defaults = manifest.module?.config?.defaults || {};\n const config = {\n enabled: true,\n ...defaults,\n ...(configs.get(name) || {}),\n } as ModuleConfig;\n const hosted: HostedModule = {\n name,\n version: manifest.module?.version || '0.0.0',\n source: 'installed',\n status: config.enabled === false ? 'disabled' : 'loaded',\n events: 0,\n path: join(PATHS.moduleDir, entry.name),\n config,\n };\n this.modules.set(name, hosted);\n if (config.enabled === false) continue;\n await this.startInstalled(hosted);\n } catch (err) {\n const name = entry.name;\n this.modules.set(name, {\n name,\n version: '0.0.0',\n source: 'installed',\n status: 'error',\n events: 0,\n detail: `manifest load failed: ${String((err as Error).message || err)}`,\n path: join(PATHS.moduleDir, entry.name),\n });\n }\n }\n }\n\n private async startInstalled(hosted: HostedModule): Promise<void> {\n const entrypoint = this.installedEntrypoint(hosted.path!);\n if (!entrypoint) {\n hosted.status = 'loaded';\n hosted.detail = 'no built entrypoint found; run npm install && npm run build in the module directory';\n return;\n }\n\n try {\n const imported = await import(pathToFileURL(entrypoint).href);\n const exported = imported.default || imported.module || imported;\n const instance = typeof exported === 'function' ? new exported() : exported;\n if (!this.isThreatCrushModule(instance)) {\n throw new Error('entrypoint does not export a ThreatCrush module');\n }\n\n hosted.instance = instance;\n await instance.init(this.contextFor(hosted));\n await instance.start();\n hosted.status = 'running';\n hosted.detail = `started from ${entrypoint}`;\n this.bus.announceModule(hosted.name, 'running', hosted.detail);\n } catch (err) {\n hosted.status = 'error';\n hosted.detail = String((err as Error).message || err);\n this.bus.announceModule(hosted.name, 'error', hosted.detail);\n }\n }\n\n private installedEntrypoint(modulePath: string): string | null {\n const packageJson = join(modulePath, 'package.json');\n const candidates: string[] = [];\n if (existsSync(packageJson)) {\n try {\n const pkg = JSON.parse(readFileSync(packageJson, 'utf-8')) as { main?: string };\n if (pkg.main) candidates.push(join(modulePath, pkg.main));\n } catch {\n // fall through to conventional paths\n }\n }\n candidates.push(join(modulePath, 'dist', 'index.js'), join(modulePath, 'index.js'));\n return candidates.find((candidate) => existsSync(candidate)) || null;\n }\n\n private isThreatCrushModule(value: unknown): value is ThreatCrushModule {\n return Boolean(\n value &&\n typeof value === 'object' &&\n typeof (value as ThreatCrushModule).init === 'function' &&\n typeof (value as ThreatCrushModule).start === 'function' &&\n typeof (value as ThreatCrushModule).stop === 'function',\n );\n }\n\n private contextFor(hosted: HostedModule) {\n return {\n config: hosted.config || { enabled: true },\n logger: this.loggerFor(hosted.name),\n emit: (event: ThreatEvent) => this.bus.publish(event),\n subscribe: (eventType: string, handler: (event: ThreatEvent) => void) => {\n this.bus.on('event', (event) => {\n if (event.category === eventType || event.module === eventType) handler(event);\n });\n },\n alert: (alert: ModuleAlert) => {\n this.bus.emit('alert', alert.event || {\n timestamp: new Date(),\n module: hosted.name,\n category: 'system',\n severity: alert.severity,\n message: alert.title,\n details: alert.body ? { body: alert.body } : undefined,\n });\n },\n getState: (key: string) => getModuleState(hosted.name, key),\n setState: (key: string, value: unknown) => setModuleState(hosted.name, key, value),\n };\n }\n\n private loggerFor(moduleName: string) {\n return {\n debug: (msg: string, ...args: unknown[]) => console.debug(`[${moduleName}] ${msg}`, ...args),\n info: (msg: string, ...args: unknown[]) => console.info(`[${moduleName}] ${msg}`, ...args),\n warn: (msg: string, ...args: unknown[]) => console.warn(`[${moduleName}] ${msg}`, ...args),\n error: (msg: string, ...args: unknown[]) => console.error(`[${moduleName}] ${msg}`, ...args),\n };\n }\n}\n","import { existsSync, statSync, createReadStream, accessSync, constants } from 'node:fs';\nimport { createInterface } from 'node:readline';\nimport type { EventBus } from '../event-bus.js';\nimport { autoDetectParser, detectAttackPattern, parseAuthLog, parseNginxLog } from '../../core/log-parser.js';\nimport { insertEvent } from '../../core/state.js';\nimport type { ThreatEvent, EventCategory, EventSeverity } from '../../types/events.js';\n\nexport interface LogSource {\n path: string;\n module: string;\n category: EventCategory;\n}\n\nexport const DEFAULT_SOURCES: LogSource[] = [\n { path: '/var/log/auth.log', module: 'ssh-guard', category: 'auth' },\n { path: '/var/log/secure', module: 'ssh-guard', category: 'auth' },\n { path: '/var/log/nginx/access.log', module: 'log-watcher', category: 'web' },\n { path: '/var/log/syslog', module: 'log-watcher', category: 'system' },\n];\n\nexport class LogWatcher {\n private timers = new Map<string, NodeJS.Timeout>();\n private positions = new Map<string, number>();\n private active = new Set<string>();\n\n constructor(private bus: EventBus, private sources: LogSource[] = DEFAULT_SOURCES) {}\n\n start(): string[] {\n const started: string[] = [];\n for (const src of this.sources) {\n if (!existsSync(src.path)) continue;\n try { accessSync(src.path, constants.R_OK); }\n catch { continue; }\n this.tail(src);\n started.push(src.path);\n }\n return started;\n }\n\n stop(): void {\n for (const t of this.timers.values()) clearInterval(t);\n this.timers.clear();\n this.positions.clear();\n this.active.clear();\n }\n\n activeModules(): string[] {\n return [...this.active];\n }\n\n private tail(src: LogSource): void {\n try {\n this.positions.set(src.path, statSync(src.path).size);\n } catch {\n this.positions.set(src.path, 0);\n }\n\n const timer = setInterval(() => this.poll(src), 1000);\n this.timers.set(src.path, timer);\n this.active.add(src.module);\n }\n\n private poll(src: LogSource): void {\n let stat;\n try { stat = statSync(src.path); } catch { return; }\n const prev = this.positions.get(src.path) ?? 0;\n\n if (stat.size < prev) {\n this.positions.set(src.path, 0); // rotated\n return;\n }\n if (stat.size === prev) return;\n\n const stream = createReadStream(src.path, { start: prev, encoding: 'utf-8' });\n stream.on('error', () => this.positions.set(src.path, stat.size));\n const rl = createInterface({ input: stream });\n rl.on('error', () => {});\n rl.on('line', (line) => {\n if (!line.trim()) return;\n this.process(line, src);\n });\n rl.on('close', () => this.positions.set(src.path, stat.size));\n }\n\n private process(line: string, src: LogSource): void {\n const parsed = autoDetectParser(line);\n if (!parsed) return;\n\n let severity: EventSeverity = 'info';\n let message = line;\n let sourceIp: string | undefined;\n\n if (parsed.source === 'auth') {\n const entry = parseAuthLog(line);\n if (!entry) return;\n sourceIp = entry.fields.ip;\n const msg = entry.fields.message;\n if (/failed password/i.test(msg)) {\n severity = 'high';\n message = `Failed SSH login for ${entry.fields.user || 'unknown'} from ${entry.fields.ip || 'unknown'}`;\n } else if (/invalid user/i.test(msg)) {\n severity = 'high';\n message = `Invalid SSH user: ${entry.fields.user || 'unknown'} from ${entry.fields.ip || 'unknown'}`;\n } else if (/accepted/i.test(msg)) {\n severity = 'info';\n message = `SSH login accepted for ${entry.fields.user || 'unknown'}`;\n } else {\n return;\n }\n } else if (parsed.source === 'nginx') {\n const entry = parseNginxLog(line);\n if (!entry) return;\n sourceIp = entry.fields.ip;\n const status = parseInt(entry.fields.status, 10);\n const attack = detectAttackPattern(entry.fields.path);\n if (attack) {\n severity = 'critical';\n message = `Attack [${attack.toUpperCase()}]: ${entry.fields.method} ${entry.fields.path}`;\n } else if (status >= 500) {\n severity = 'medium';\n message = `Server error ${status}: ${entry.fields.method} ${entry.fields.path}`;\n } else if (status >= 400) {\n severity = 'low';\n message = `Client error ${status}: ${entry.fields.method} ${entry.fields.path}`;\n } else {\n return;\n }\n } else {\n return;\n }\n\n const event: ThreatEvent = {\n timestamp: new Date(),\n module: src.module,\n category: src.category,\n severity,\n message,\n source_ip: sourceIp,\n };\n\n try { insertEvent(event); } catch { /* db optional */ }\n this.bus.publish(event);\n }\n}\n","import { spawn, type ChildProcess, spawnSync } from 'node:child_process';\nimport type { EventBus } from '../event-bus.js';\nimport { insertEvent } from '../../core/state.js';\nimport type { ThreatEvent, EventSeverity } from '../../types/events.js';\n\n// Wraps `journalctl --user -o json -f` so threatcrushd can pick up user-session\n// events without needing to belong to the `adm` or `systemd-journal` group.\n// On systems without journalctl this watcher is a no-op.\nexport class JournalWatcher {\n private proc: ChildProcess | null = null;\n private buffer = '';\n private moduleName = 'user-journal';\n private active = false;\n\n constructor(private bus: EventBus) {}\n\n // When the daemon runs as root (system mode), tail the SYSTEM journal so\n // we pick up sshd / sudo / kernel / UFW events. Falling back to --user\n // would give us root's mostly-empty per-user journal. Otherwise we use\n // --user so the daemon can run unprivileged on a workstation.\n static scopeArgs(): string[] {\n const isRoot = process.platform === 'linux'\n && typeof process.getuid === 'function'\n && process.getuid() === 0;\n return isRoot ? [] : ['--user'];\n }\n\n static isAvailable(): boolean {\n const probe = spawnSync('journalctl', [...this.scopeArgs(), '-n', '0', '--no-pager'], {\n stdio: ['ignore', 'ignore', 'ignore'],\n });\n return probe.status === 0;\n }\n\n start(): boolean {\n if (!JournalWatcher.isAvailable()) return false;\n\n const child = spawn(\n 'journalctl',\n [...JournalWatcher.scopeArgs(), '-o', 'json', '-f', '--since', 'now'],\n { stdio: ['ignore', 'pipe', 'pipe'] },\n );\n if (!child.stdout) return false;\n child.stdout.setEncoding('utf-8');\n child.stdout.on('data', (chunk: string) => this.onData(chunk));\n child.on('exit', () => {\n this.proc = null;\n this.active = false;\n });\n this.proc = child;\n\n this.active = true;\n return true;\n }\n\n stop(): void {\n if (this.proc) {\n try { this.proc.kill('SIGTERM'); } catch {}\n this.proc = null;\n }\n this.active = false;\n }\n\n isActive(): boolean {\n return this.active;\n }\n\n moduleNameValue(): string {\n return this.moduleName;\n }\n\n private onData(chunk: string): void {\n this.buffer += chunk;\n let idx;\n while ((idx = this.buffer.indexOf('\\n')) >= 0) {\n const line = this.buffer.slice(0, idx);\n this.buffer = this.buffer.slice(idx + 1);\n if (!line.trim()) continue;\n this.handleLine(line);\n }\n }\n\n private handleLine(line: string): void {\n let entry: Record<string, string>;\n try {\n entry = JSON.parse(line) as Record<string, string>;\n } catch {\n return;\n }\n\n const message = entry.MESSAGE;\n if (!message) return;\n\n const priority = parseInt(entry.PRIORITY ?? '6', 10);\n const severity = priorityToSeverity(priority);\n\n // Surface a couple of common suspicious-looking sources at a higher\n // severity even if the kernel disagrees with us.\n const ident = entry.SYSLOG_IDENTIFIER || entry._COMM || 'journal';\n const bumpedSeverity = bumpForIdent(ident, message, severity);\n\n const event: ThreatEvent = {\n timestamp: realtimeToDate(entry.__REALTIME_TIMESTAMP) || new Date(),\n module: this.moduleName,\n category: 'system',\n severity: bumpedSeverity,\n message: `[${ident}] ${message}`.slice(0, 500),\n };\n\n try { insertEvent(event); } catch { /* db optional */ }\n this.bus.publish(event);\n }\n}\n\nfunction priorityToSeverity(priority: number): EventSeverity {\n // syslog priorities: 0 emerg, 1 alert, 2 crit, 3 err, 4 warning, 5 notice, 6 info, 7 debug\n if (priority <= 2) return 'critical';\n if (priority === 3) return 'high';\n if (priority === 4) return 'medium';\n if (priority === 5) return 'low';\n return 'info';\n}\n\nfunction bumpForIdent(ident: string, message: string, base: EventSeverity): EventSeverity {\n if (/sudo/i.test(ident) && /authentication failure|incorrect password|FAILED/i.test(message)) {\n return 'high';\n }\n if (/sshd/i.test(ident) && /failed|invalid user|break-in/i.test(message)) {\n return 'high';\n }\n return base;\n}\n\nfunction realtimeToDate(rt: string | undefined): Date | null {\n if (!rt) return null;\n const us = parseInt(rt, 10);\n if (!Number.isFinite(us)) return null;\n return new Date(Math.floor(us / 1000));\n}\n","/**\n * Network Monitor Module (PRD 04)\n *\n * Observes TCP/UDP connections via conntrack / ss / /proc/net.\n * Detects port scans and SYN-flood-style patterns.\n * Emits detections through the event bus for the rule engine.\n */\n\nimport { spawnSync } from 'node:child_process';\nimport { existsSync } from 'node:fs';\nimport type { EventBus } from '../../daemon/event-bus.js';\nimport { insertEvent } from '../../core/state.js';\nimport type { ThreatEvent, EventSeverity } from '../../types/events.js';\n\ninterface ConnectionRecord {\n source_ip: string;\n dest_port: number;\n timestamp: number;\n}\n\ninterface ScanTracker {\n ports: Set<number>;\n firstSeen: number;\n lastSeen: number;\n count: number;\n}\n\nexport class NetworkMonitor {\n private active = false;\n private pollTimer: NodeJS.Timeout | null = null;\n private scanTrackers = new Map<string, ScanTracker>();\n private halfOpenTrackers = new Map<string, { count: number; firstSeen: number }>();\n private lastConnections = new Set<string>();\n\n // Config\n private pollIntervalMs = 5000;\n private portScanThreshold = 10; // unique ports in window\n private portScanWindowMs = 30_000;\n private synFloodThreshold = 50; // half-open connections\n private synFloodWindowMs = 10_000;\n\n constructor(private bus: EventBus) {}\n\n start(): boolean {\n if (!this.hasConntrackOrSs()) {\n return false;\n }\n this.active = true;\n this.pollTimer = setInterval(() => this.poll(), this.pollIntervalMs);\n return true;\n }\n\n stop(): void {\n if (this.pollTimer) clearInterval(this.pollTimer);\n this.pollTimer = null;\n this.active = false;\n }\n\n isActive(): boolean { return this.active; }\n\n private hasConntrackOrSs(): boolean {\n const ss = spawnSync('ss', ['--version'], { stdio: 'pipe' });\n if (ss.status === 0) return true;\n // Try /proc/net/tcp\n return existsSync('/proc/net/tcp');\n }\n\n private poll(): void {\n try {\n const connections = this.getConnections();\n this.analyzePortScans(connections);\n this.analyzeSynFlood(connections);\n this.cleanupTrackers();\n } catch {\n // Graceful degradation\n }\n }\n\n private getConnections(): ConnectionRecord[] {\n const records: ConnectionRecord[] = [];\n const now = Date.now();\n\n try {\n // Try conntrack first\n const ct = spawnSync('conntrack', ['-L', '-p', 'tcp', '-o', 'extended'], {\n encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 3000,\n });\n if (ct.status === 0 && ct.stdout) {\n for (const line of ct.stdout.split('\\n')) {\n const srcMatch = line.match(/src=(\\d+\\.\\d+\\.\\d+\\.\\d+)/);\n const dportMatch = line.match(/dport=(\\d+)/);\n if (srcMatch && dportMatch) {\n records.push({ source_ip: srcMatch[1], dest_port: parseInt(dportMatch[1]), timestamp: now });\n }\n }\n if (records.length > 0) return records;\n }\n } catch { /* fallthrough */ }\n\n try {\n // Fallback to ss\n const ss = spawnSync('ss', ['-tnp', '-H'], {\n encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 3000,\n });\n if (ss.status === 0 && ss.stdout) {\n for (const line of ss.stdout.split('\\n')) {\n // ss output: State Recv-Q Send-Q Local:Port Peer:Port Process\n const parts = line.trim().split(/\\s+/);\n if (parts.length < 5) continue;\n const peerParts = parts[4].split(':');\n const localParts = parts[3].split(':');\n if (peerParts.length >= 2 && localParts.length >= 2) {\n const sourceIp = peerParts.slice(0, -1).join(':');\n const destPort = parseInt(localParts[localParts.length - 1]);\n if (sourceIp && !isNaN(destPort) && !this.isLocalIp(sourceIp)) {\n records.push({ source_ip: sourceIp, dest_port: destPort, timestamp: now });\n }\n }\n }\n }\n } catch { /* fallthrough */ }\n\n return records;\n }\n\n private analyzePortScans(connections: ConnectionRecord[]): void {\n const now = Date.now();\n\n for (const conn of connections) {\n const key = conn.source_ip;\n let tracker = this.scanTrackers.get(key);\n\n if (!tracker) {\n tracker = { ports: new Set(), firstSeen: now, lastSeen: now, count: 0 };\n this.scanTrackers.set(key, tracker);\n }\n\n tracker.ports.add(conn.dest_port);\n tracker.lastSeen = now;\n tracker.count++;\n\n // Check threshold within window\n if (tracker.ports.size >= this.portScanThreshold &&\n (now - tracker.firstSeen) <= this.portScanWindowMs) {\n this.emitEvent(\n 'high',\n `Port scan detected: ${conn.source_ip} probed ${tracker.ports.size} ports in ${Math.round((now - tracker.firstSeen) / 1000)}s`,\n conn.source_ip,\n { ports_scanned: tracker.ports.size, window_seconds: Math.round((now - tracker.firstSeen) / 1000) },\n );\n // Reset tracker after alert\n this.scanTrackers.delete(key);\n }\n }\n }\n\n private analyzeSynFlood(connections: ConnectionRecord[]): void {\n // Count SYN_RECV (half-open) states via ss\n try {\n const ss = spawnSync('ss', ['-tn', 'state', 'syn-recv', '-H'], {\n encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: 3000,\n });\n if (ss.status !== 0 || !ss.stdout) return;\n\n const perSource = new Map<string, number>();\n\n for (const line of ss.stdout.split('\\n')) {\n const parts = line.trim().split(/\\s+/);\n if (parts.length < 5) continue;\n const peer = parts[4].split(':');\n const ip = peer.slice(0, -1).join(':');\n if (ip) perSource.set(ip, (perSource.get(ip) || 0) + 1);\n }\n\n for (const [ip, count] of perSource) {\n if (count >= this.synFloodThreshold) {\n this.emitEvent(\n 'critical',\n `SYN flood indicators: ${count} half-open connections from ${ip}`,\n ip,\n { half_open_count: count },\n );\n }\n }\n } catch { /* graceful */ }\n }\n\n private emitEvent(severity: EventSeverity, message: string, sourceIp?: string, details?: Record<string, unknown>): void {\n const event: ThreatEvent = {\n timestamp: new Date(),\n module: 'network-monitor',\n category: 'network',\n severity,\n message,\n source_ip: sourceIp,\n details,\n };\n try { insertEvent(event); } catch { /* db optional */ }\n this.bus.publish(event);\n }\n\n private cleanupTrackers(): void {\n const now = Date.now();\n for (const [key, tracker] of this.scanTrackers) {\n if (now - tracker.lastSeen > this.portScanWindowMs * 2) {\n this.scanTrackers.delete(key);\n }\n }\n }\n\n private isLocalIp(ip: string): boolean {\n return ip === '127.0.0.1' || ip === '::1' || ip === '0.0.0.0' || ip.startsWith('::ffff:127.');\n }\n}\n","/**\n * DNS Monitor Module (PRD 05)\n *\n * Observes DNS query activity for tunneling and DGA indicators.\n * Sources: resolver logs, systemd-resolved, dnsmasq logs, passive :53 observation.\n */\n\nimport { existsSync, statSync, createReadStream, accessSync, constants } from 'node:fs';\nimport { createInterface } from 'node:readline';\nimport type { EventBus } from '../../daemon/event-bus.js';\nimport { insertEvent } from '../../core/state.js';\nimport type { ThreatEvent, EventSeverity } from '../../types/events.js';\n\ninterface DnsQuery {\n domain: string;\n type: string;\n source_ip?: string;\n timestamp: number;\n}\n\nconst DNS_LOG_SOURCES = [\n '/var/log/syslog', // systemd-resolved logs here\n '/var/log/dnsmasq.log', // dnsmasq\n '/var/log/named/queries.log', // bind9\n '/var/log/pihole.log', // Pi-hole\n];\n\nexport class DnsMonitor {\n private active = false;\n private timers = new Map<string, NodeJS.Timeout>();\n private positions = new Map<string, number>();\n\n // Tracking windows\n private txtQueryCounts = new Map<string, { count: number; firstSeen: number }>();\n private domainBuffer: DnsQuery[] = [];\n\n // Config\n private txtRateThreshold = 20; // TXT queries per source per window\n private txtWindowMs = 60_000;\n private dgaBurstThreshold = 15; // unique high-entropy domains per window\n private dgaWindowMs = 60_000;\n private entropyThreshold = 3.5; // Shannon entropy threshold for DGA\n\n constructor(private bus: EventBus) {}\n\n start(): boolean {\n const sources = DNS_LOG_SOURCES.filter(p => {\n if (!existsSync(p)) return false;\n try { accessSync(p, constants.R_OK); return true; }\n catch { return false; }\n });\n\n if (sources.length === 0) return false;\n\n this.active = true;\n for (const src of sources) {\n this.tailLog(src);\n }\n\n // Periodic analysis\n setInterval(() => this.analyzeBuffer(), 10_000);\n return true;\n }\n\n stop(): void {\n for (const t of this.timers.values()) clearInterval(t);\n this.timers.clear();\n this.active = false;\n }\n\n isActive(): boolean { return this.active; }\n\n private tailLog(path: string): void {\n try {\n this.positions.set(path, statSync(path).size);\n } catch {\n this.positions.set(path, 0);\n }\n\n const timer = setInterval(() => this.pollLog(path), 2000);\n this.timers.set(path, timer);\n }\n\n private pollLog(path: string): void {\n let stat;\n try { stat = statSync(path); } catch { return; }\n const prev = this.positions.get(path) ?? 0;\n\n if (stat.size < prev) { this.positions.set(path, 0); return; }\n if (stat.size === prev) return;\n\n const stream = createReadStream(path, { start: prev, encoding: 'utf-8' });\n stream.on('error', () => this.positions.set(path, stat.size));\n const rl = createInterface({ input: stream });\n rl.on('line', (line) => this.parseDnsLine(line));\n rl.on('close', () => this.positions.set(path, stat.size));\n }\n\n private parseDnsLine(line: string): void {\n // systemd-resolved pattern: \"query[TXT] suspicious.domain.com from 192.168.1.1\"\n const resolvedMatch = line.match(/query\\[(\\w+)\\]\\s+(\\S+)\\s+from\\s+(\\S+)/i);\n if (resolvedMatch) {\n this.domainBuffer.push({\n type: resolvedMatch[1],\n domain: resolvedMatch[2],\n source_ip: resolvedMatch[3],\n timestamp: Date.now(),\n });\n return;\n }\n\n // dnsmasq pattern: \"query[TXT] suspicious.domain.com from 192.168.1.1\"\n const dnsmasqMatch = line.match(/query\\[(\\w+)\\]\\s+(\\S+)\\s+from\\s+(\\S+)/i);\n if (dnsmasqMatch) {\n this.domainBuffer.push({\n type: dnsmasqMatch[1],\n domain: dnsmasqMatch[2],\n source_ip: dnsmasqMatch[3],\n timestamp: Date.now(),\n });\n return;\n }\n\n // Generic DNS query log pattern\n const genericMatch = line.match(/(?:query|lookup|resolve)[:\\s]+(\\S+)/i);\n if (genericMatch) {\n const typeMatch = line.match(/type[:\\s]+(\\w+)/i);\n this.domainBuffer.push({\n type: typeMatch?.[1] || 'A',\n domain: genericMatch[1],\n timestamp: Date.now(),\n });\n }\n }\n\n private analyzeBuffer(): void {\n const now = Date.now();\n const cutoff = now - this.txtWindowMs;\n\n // Prune old entries\n this.domainBuffer = this.domainBuffer.filter(q => q.timestamp > cutoff);\n\n this.detectTunneling();\n this.detectDga();\n }\n\n private detectTunneling(): void {\n // Check for high TXT query volume from single source\n const txtBySource = new Map<string, number>();\n const longLabelDomains: string[] = [];\n\n for (const q of this.domainBuffer) {\n if (q.type === 'TXT') {\n const key = q.source_ip || 'unknown';\n txtBySource.set(key, (txtBySource.get(key) || 0) + 1);\n }\n\n // DNS tunneling uses abnormally long subdomain labels\n const labels = q.domain.split('.');\n const maxLabel = Math.max(...labels.map(l => l.length));\n if (maxLabel > 50) {\n longLabelDomains.push(q.domain);\n }\n }\n\n for (const [source, count] of txtBySource) {\n if (count >= this.txtRateThreshold) {\n this.emitEvent(\n 'high',\n `DNS tunneling indicators: ${count} TXT queries from ${source} in ${this.txtWindowMs / 1000}s`,\n source !== 'unknown' ? source : undefined,\n { txt_query_count: count, type: 'tunneling' },\n );\n }\n }\n\n if (longLabelDomains.length >= 5) {\n this.emitEvent(\n 'high',\n `DNS tunneling: ${longLabelDomains.length} queries with abnormally long labels detected`,\n undefined,\n { domains: longLabelDomains.slice(0, 5), type: 'tunneling-labels' },\n );\n }\n }\n\n private detectDga(): void {\n // Find domains with high entropy (DGA-like)\n const highEntropyDomains: string[] = [];\n\n for (const q of this.domainBuffer) {\n const domain = q.domain.toLowerCase();\n // Extract the second-level domain\n const parts = domain.split('.');\n if (parts.length < 2) continue;\n const sld = parts[parts.length - 2];\n\n if (sld.length >= 8 && this.shannonEntropy(sld) >= this.entropyThreshold) {\n highEntropyDomains.push(domain);\n }\n }\n\n // Deduplicate\n const unique = [...new Set(highEntropyDomains)];\n if (unique.length >= this.dgaBurstThreshold) {\n this.emitEvent(\n 'critical',\n `DGA-like domain burst: ${unique.length} unique high-entropy domains detected`,\n undefined,\n { sample_domains: unique.slice(0, 10), type: 'dga', unique_count: unique.length },\n );\n }\n }\n\n private shannonEntropy(str: string): number {\n const freq = new Map<string, number>();\n for (const ch of str) {\n freq.set(ch, (freq.get(ch) || 0) + 1);\n }\n let entropy = 0;\n for (const count of freq.values()) {\n const p = count / str.length;\n if (p > 0) entropy -= p * Math.log2(p);\n }\n return entropy;\n }\n\n private emitEvent(severity: EventSeverity, message: string, sourceIp?: string, details?: Record<string, unknown>): void {\n const event: ThreatEvent = {\n timestamp: new Date(),\n module: 'dns-monitor',\n category: 'network',\n severity,\n message,\n source_ip: sourceIp,\n details,\n };\n try { insertEvent(event); } catch { /* db optional */ }\n this.bus.publish(event);\n }\n}\n","import type { ThreatEvent } from '../../types/events.js';\n\ntype Mailer = {\n sendMail: (opts: Record<string, unknown>) => Promise<unknown>;\n};\n\nlet transporter: Mailer | null = null;\n// Lazy-load nodemailer so the CLI build doesn't pull it in when alerts are off.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet nodemailer: any = null;\n\nexport interface SmtpConfig {\n host?: string;\n port?: number;\n secure?: boolean;\n user?: string;\n pass?: string;\n from?: string;\n to?: string[] | string;\n min_severity?: 'low' | 'medium' | 'high' | 'critical';\n}\n\nconst SEVERITY_RANK: Record<string, number> = {\n info: 0,\n low: 1,\n medium: 2,\n high: 3,\n critical: 4,\n};\n\nasync function ensureTransporter(config: SmtpConfig): Promise<Mailer | null> {\n if (!config.host || !config.from) return null;\n if (transporter) return transporter;\n\n if (!nodemailer) {\n try {\n nodemailer = await import('nodemailer');\n } catch {\n return null;\n }\n }\n\n transporter = nodemailer.createTransport({\n host: config.host,\n port: config.port ?? 587,\n secure: config.secure ?? false,\n auth: config.user && config.pass ? { user: config.user, pass: config.pass } : undefined,\n });\n return transporter;\n}\n\nfunction meetsSeverity(event: ThreatEvent, min?: SmtpConfig['min_severity']): boolean {\n if (!min) return true;\n return (SEVERITY_RANK[event.severity] ?? 0) >= (SEVERITY_RANK[min] ?? 0);\n}\n\nfunction renderBody(event: ThreatEvent): { text: string; html: string } {\n const ts = event.timestamp.toISOString();\n const ip = event.source_ip ? `\\nSource IP: ${event.source_ip}` : '';\n const text =\n `[${event.severity.toUpperCase()}] ${event.module}\\n\\n` +\n `${event.message}${ip}\\n\\n` +\n `When: ${ts}\\nCategory: ${event.category}`;\n const html =\n `<div style=\"font-family:system-ui,sans-serif;line-height:1.5\">` +\n `<h2 style=\"margin:0 0 8px\">⚠ ${event.severity.toUpperCase()} — ${event.module}</h2>` +\n `<p>${event.message}</p>` +\n (event.source_ip ? `<p><strong>Source IP:</strong> <code>${event.source_ip}</code></p>` : '') +\n `<p style=\"color:#888;margin-top:16px\"><small>${ts} · ${event.category}</small></p>` +\n `</div>`;\n return { text, html };\n}\n\nexport function smtpChannel(config: SmtpConfig): (event: ThreatEvent) => Promise<void> {\n return async (event) => {\n if (!meetsSeverity(event, config.min_severity)) return;\n const t = await ensureTransporter(config);\n if (!t) return;\n\n const to = Array.isArray(config.to) ? config.to.join(', ') : config.to;\n if (!to) return;\n\n const { text, html } = renderBody(event);\n await t.sendMail({\n from: config.from,\n to,\n subject: `[ThreatCrush ${event.severity}] ${event.module} — ${event.message.slice(0, 60)}`,\n text,\n html,\n });\n };\n}\n","import type { ThreatEvent } from '../../types/events.js';\n\nexport interface DiscordConfig {\n webhook_url: string;\n min_severity?: 'low' | 'medium' | 'high' | 'critical';\n}\n\nconst SEVERITY_RANK: Record<string, number> = {\n info: 0, low: 1, medium: 2, high: 3, critical: 4,\n};\n\nconst SEVERITY_COLORS: Record<string, number> = {\n info: 0x2ecc71, // green\n low: 0x3498db, // blue\n medium: 0xf39c12, // orange\n high: 0xe74c3c, // red\n critical: 0x9b59b6, // purple\n};\n\nexport function discordChannel(config: DiscordConfig): (event: ThreatEvent) => Promise<void> {\n return async (event) => {\n if (config.min_severity) {\n const eventRank = SEVERITY_RANK[event.severity] ?? 0;\n const minRank = SEVERITY_RANK[config.min_severity] ?? 0;\n if (eventRank < minRank) return;\n }\n\n const embed = {\n title: `${event.severity === 'critical' ? '🚨' : '⚠️'} [${event.severity.toUpperCase()}] ${event.module}`,\n description: event.message,\n color: SEVERITY_COLORS[event.severity] ?? 0xffffff,\n fields: [\n ...(event.source_ip ? [{ name: 'Source IP', value: `\\`${event.source_ip}\\``, inline: true }] : []),\n { name: 'Category', value: event.category, inline: true },\n { name: 'Time', value: event.timestamp.toISOString(), inline: true },\n ],\n footer: { text: 'ThreatCrush Security Alert' },\n };\n\n await fetch(config.webhook_url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ embeds: [embed] }),\n });\n };\n}\n","import type { ThreatEvent } from '../../types/events.js';\n\nexport interface PagerDutyConfig {\n routing_key: string;\n min_severity?: 'low' | 'medium' | 'high' | 'critical';\n}\n\nconst SEVERITY_RANK: Record<string, number> = {\n info: 0, low: 1, medium: 2, high: 3, critical: 4,\n};\n\n// Map ThreatCrush severity to PagerDuty severity\nconst PD_SEVERITY: Record<string, string> = {\n info: 'info',\n low: 'info',\n medium: 'warning',\n high: 'error',\n critical: 'critical',\n};\n\nexport function pagerdutyChannel(config: PagerDutyConfig): (event: ThreatEvent) => Promise<void> {\n return async (event) => {\n if (config.min_severity) {\n const eventRank = SEVERITY_RANK[event.severity] ?? 0;\n const minRank = SEVERITY_RANK[config.min_severity] ?? 0;\n if (eventRank < minRank) return;\n }\n\n const payload = {\n routing_key: config.routing_key,\n event_action: 'trigger',\n payload: {\n summary: `[${event.severity.toUpperCase()}] ${event.module}: ${event.message}`,\n source: 'threatcrush',\n severity: PD_SEVERITY[event.severity] || 'warning',\n timestamp: event.timestamp.toISOString(),\n custom_details: {\n module: event.module,\n category: event.category,\n source_ip: event.source_ip,\n details: event.details,\n },\n },\n };\n\n await fetch('https://events.pagerduty.com/v2/enqueue', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(payload),\n });\n };\n}\n","import type { ThreatCrushConfig, AlertChannelConfig } from '../../types/config.js';\nimport type { ThreatEvent } from '../../types/events.js';\nimport type { EventBus } from '../event-bus.js';\nimport { smtpChannel, type SmtpConfig } from './smtp.js';\nimport { discordChannel, type DiscordConfig } from './discord.js';\nimport { pagerdutyChannel, type PagerDutyConfig } from './pagerduty.js';\n\ntype Channel = (event: ThreatEvent) => Promise<void>;\n\nexport class AlertDispatcher {\n private channels: Channel[] = [];\n private rateLimits = new Map<string, number[]>();\n\n constructor(private bus: EventBus, private config: ThreatCrushConfig) {\n this.bindChannels();\n bus.on('alert', (event) => { void this.dispatch(event); });\n }\n\n private bindChannels(): void {\n const alerts = this.config.alerts || {};\n for (const [name, raw] of Object.entries(alerts)) {\n const cfg = raw as AlertChannelConfig;\n if (!cfg.enabled) continue;\n if (name === 'webhook' && typeof cfg.url === 'string') {\n this.channels.push(webhookChannel(cfg.url, cfg.secret as string | undefined));\n }\n if (name === 'slack' && typeof cfg.webhook_url === 'string') {\n this.channels.push(slackChannel(cfg.webhook_url));\n }\n if (name === 'email' && typeof cfg.host === 'string' && typeof cfg.from === 'string') {\n this.channels.push(smtpChannel(cfg as unknown as SmtpConfig));\n }\n if (name === 'discord' && typeof cfg.webhook_url === 'string') {\n this.channels.push(discordChannel(cfg as unknown as DiscordConfig));\n }\n if (name === 'pagerduty' && typeof cfg.routing_key === 'string') {\n this.channels.push(pagerdutyChannel(cfg as unknown as PagerDutyConfig));\n }\n }\n }\n\n private checkRateLimit(channelIdx: number, maxPerHour: number = 60): boolean {\n const key = String(channelIdx);\n const now = Date.now();\n const hour = 3600_000;\n let timestamps = this.rateLimits.get(key) || [];\n timestamps = timestamps.filter(t => t > now - hour);\n if (timestamps.length >= maxPerHour) return false;\n timestamps.push(now);\n this.rateLimits.set(key, timestamps);\n return true;\n }\n\n private async dispatch(event: ThreatEvent): Promise<void> {\n await Promise.all(this.channels.map((ch, idx) => {\n if (!this.checkRateLimit(idx)) return Promise.resolve();\n return ch(event).catch(() => {});\n }));\n }\n}\n\nfunction webhookChannel(url: string, secret?: string): Channel {\n return async (event) => {\n const body = JSON.stringify({ event });\n const headers: Record<string, string> = { 'Content-Type': 'application/json' };\n if (secret) headers['X-Threatcrush-Signature'] = secret;\n await fetch(url, { method: 'POST', headers, body });\n };\n}\n\nfunction slackChannel(webhookUrl: string): Channel {\n return async (event) => {\n const emoji = event.severity === 'critical' ? ':rotating_light:' : ':warning:';\n const text = `${emoji} *[${event.severity.toUpperCase()}]* \\`${event.module}\\` — ${event.message}${event.source_ip ? ` (from ${event.source_ip})` : ''}`;\n await fetch(webhookUrl, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ text }),\n });\n };\n}\n","import type { EventBus } from '../event-bus.js';\nimport { readCliConfig, authHeaders, isLoggedIn } from '../../core/cli-config.js';\nimport { runScan } from '../../commands/scan.js';\nimport { runPentest } from '../../commands/pentest.js';\nimport { workerId, type RunResult } from '../../core/run-result.js';\n\nconst API_URL = process.env.THREATCRUSH_API_URL || 'https://threatcrush.com';\nconst POLL_INTERVAL_MS = 30_000;\nconst SCHEDULE_INTERVAL_MS = 120_000;\n\ninterface ClaimedRun {\n id: string;\n org_id: string;\n property_id: string;\n type: 'scan' | 'pentest';\n property: { id: string; name: string; kind: string; target: string } | null;\n}\n\n/**\n * Polls the server for queued property runs belonging to orgs the logged-in\n * user is a member of, claims them atomically, executes them locally, and\n * posts the result back.\n *\n * No-op unless `~/.threatcrush/config.json` contains a valid bearer token.\n */\nexport class RunsWorker {\n private pollTimer: NodeJS.Timeout | null = null;\n private scheduleTimer: NodeJS.Timeout | null = null;\n private running = false;\n private orgIds: string[] = [];\n\n constructor(private bus: EventBus) {}\n\n async start(): Promise<void> {\n if (!isLoggedIn()) return;\n\n try {\n await this.refreshOrgs();\n } catch {\n // First fetch may fail if the network is down; the tick loop will retry.\n }\n\n this.bus.announceModule('runs-worker', 'running', `poll ${POLL_INTERVAL_MS / 1000}s`);\n this.tick();\n this.scheduleTick();\n this.pollTimer = setInterval(() => this.tick(), POLL_INTERVAL_MS);\n this.scheduleTimer = setInterval(() => this.scheduleTick(), SCHEDULE_INTERVAL_MS);\n }\n\n stop(): void {\n if (this.pollTimer) clearInterval(this.pollTimer);\n if (this.scheduleTimer) clearInterval(this.scheduleTimer);\n this.pollTimer = null;\n this.scheduleTimer = null;\n this.bus.announceModule('runs-worker', 'stopped');\n }\n\n private async scheduleTick(): Promise<void> {\n if (!isLoggedIn()) return;\n try {\n if (this.orgIds.length === 0) await this.refreshOrgs();\n for (const orgId of this.orgIds) {\n try {\n await fetch(`${API_URL}/api/orgs/${orgId}/schedules/tick`, {\n method: 'POST',\n headers: authHeaders(),\n });\n } catch {\n // ignore transient network errors\n }\n }\n } catch {\n // swallow — retry next interval\n }\n }\n\n private async tick(): Promise<void> {\n if (this.running) return;\n if (!isLoggedIn()) return;\n\n this.running = true;\n try {\n if (this.orgIds.length === 0) await this.refreshOrgs();\n for (const orgId of this.orgIds) {\n const claimed = await this.claimOne(orgId);\n if (!claimed) continue;\n\n const result = await this.execute(claimed);\n await this.finalize(orgId, claimed, result);\n }\n } catch {\n // swallow — we'll try again on the next tick\n } finally {\n this.running = false;\n }\n }\n\n private async refreshOrgs(): Promise<void> {\n const res = await fetch(`${API_URL}/api/orgs`, { headers: authHeaders() });\n if (!res.ok) return;\n const data = await res.json() as { organizations?: Array<{ id: string }> };\n this.orgIds = (data.organizations || []).map((o) => o.id);\n }\n\n private async claimOne(orgId: string): Promise<ClaimedRun | null> {\n try {\n const res = await fetch(`${API_URL}/api/orgs/${orgId}/runs/pending`, {\n method: 'POST',\n headers: authHeaders(),\n body: JSON.stringify({ worker_id: workerId() }),\n });\n if (!res.ok) return null;\n const data = await res.json() as { run?: ClaimedRun | null };\n return data.run ?? null;\n } catch {\n return null;\n }\n }\n\n private async execute(run: ClaimedRun): Promise<RunResult> {\n const target = run.property?.target;\n if (!target) {\n return {\n type: run.type,\n target: '',\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: 'property target missing',\n error: 'property target missing',\n };\n }\n\n this.bus.announceModule('runs-worker', 'running', `${run.type} ${run.property?.name || target}`);\n\n try {\n if (run.type === 'scan') return await runScan(target);\n return await runPentest(target);\n } catch (err) {\n return {\n type: run.type,\n target,\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: `failed: ${(err as Error).message}`,\n error: (err as Error).message,\n };\n }\n }\n\n private async finalize(orgId: string, claimed: ClaimedRun, result: RunResult): Promise<void> {\n try {\n await fetch(\n `${API_URL}/api/orgs/${orgId}/properties/${claimed.property_id}/runs/${claimed.id}`,\n {\n method: 'PATCH',\n headers: authHeaders(),\n body: JSON.stringify({\n status: result.error ? 'failed' : 'succeeded',\n findings_count: result.findings.length,\n severity_summary: result.severity_summary,\n summary: result.summary,\n findings: result.findings,\n error: result.error,\n source: 'daemon',\n worker_id: workerId(),\n }),\n },\n );\n } catch {\n // best-effort\n } finally {\n this.bus.announceModule('runs-worker', 'idle');\n }\n }\n}\n","import type { ThreatEvent, EventSeverity } from '../../types/events.js';\n\nexport interface DetectionRule {\n id: string;\n title: string;\n description: string;\n version: string;\n category: string;\n severity: EventSeverity;\n source_types: string[];\n match: RuleMatch;\n threshold: number;\n window_seconds: number;\n cooldown_seconds: number;\n tags: string[];\n remediation?: {\n action?: string;\n ttl_seconds?: number;\n description?: string;\n };\n enabled: boolean;\n}\n\nexport interface RuleMatch {\n field: string;\n operator: 'contains' | 'regex' | 'equals' | 'starts_with' | 'ends_with';\n value: string;\n and?: RuleMatch[];\n or?: RuleMatch[];\n}\n\ninterface EventWindow {\n events: Array<{ timestamp: number; event: ThreatEvent }>;\n lastAlert: number;\n}\n\nexport class RuleEngine {\n private rules: DetectionRule[] = [];\n private windows = new Map<string, EventWindow>();\n\n constructor(private onDetection: (detection: {\n rule_id: string;\n severity: EventSeverity;\n title: string;\n description: string;\n source_ip?: string;\n username?: string;\n raw_metadata?: Record<string, unknown>;\n }) => void) {}\n\n loadRules(rules: DetectionRule[]): void {\n this.rules = rules.filter(r => r.enabled !== false);\n }\n\n getRules(): DetectionRule[] {\n return [...this.rules];\n }\n\n evaluate(event: ThreatEvent): void {\n const now = Date.now();\n\n for (const rule of this.rules) {\n // Check source type match\n if (rule.source_types.length > 0 && !rule.source_types.includes(event.module) && !rule.source_types.includes(event.category)) {\n continue;\n }\n\n // Check match conditions\n if (!this.matchesCondition(event, rule.match)) continue;\n\n // Window key: rule_id + source_ip (or 'global')\n const windowKey = `${rule.id}:${event.source_ip || 'global'}`;\n let window = this.windows.get(windowKey);\n if (!window) {\n window = { events: [], lastAlert: 0 };\n this.windows.set(windowKey, window);\n }\n\n // Add event to window\n window.events.push({ timestamp: now, event });\n\n // Prune old events outside window\n const cutoff = now - (rule.window_seconds * 1000);\n window.events = window.events.filter(e => e.timestamp >= cutoff);\n\n // Check threshold\n if (window.events.length < rule.threshold) continue;\n\n // Check cooldown\n if (window.lastAlert > 0 && (now - window.lastAlert) < (rule.cooldown_seconds * 1000)) continue;\n\n // Fire detection\n window.lastAlert = now;\n window.events = []; // Reset window after detection\n\n this.onDetection({\n rule_id: rule.id,\n severity: rule.severity,\n title: rule.title,\n description: `${rule.description} (${rule.threshold} events in ${rule.window_seconds}s)`,\n source_ip: event.source_ip,\n username: event.details?.user as string || undefined,\n raw_metadata: {\n rule_version: rule.version,\n tags: rule.tags,\n category: rule.category,\n remediation: rule.remediation,\n },\n });\n }\n }\n\n private matchesCondition(event: ThreatEvent, match: RuleMatch): boolean {\n const fieldValue = this.getFieldValue(event, match.field);\n if (fieldValue === undefined) return false;\n\n const strValue = String(fieldValue);\n let result = false;\n\n switch (match.operator) {\n case 'contains':\n result = strValue.toLowerCase().includes(String(match.value).toLowerCase());\n break;\n case 'regex':\n try { result = new RegExp(String(match.value), 'i').test(strValue); } catch { result = false; }\n break;\n case 'equals':\n result = strValue === String(match.value);\n break;\n case 'starts_with':\n result = strValue.startsWith(String(match.value));\n break;\n case 'ends_with':\n result = strValue.endsWith(String(match.value));\n break;\n }\n\n // AND conditions\n if (result && match.and) {\n result = match.and.every(m => this.matchesCondition(event, m));\n }\n\n // OR conditions\n if (!result && match.or) {\n result = match.or.some(m => this.matchesCondition(event, m));\n }\n\n return result;\n }\n\n private getFieldValue(event: ThreatEvent, field: string): unknown {\n switch (field) {\n case 'message': return event.message;\n case 'severity': return event.severity;\n case 'module': return event.module;\n case 'category': return event.category;\n case 'source_ip': return event.source_ip;\n default:\n return event.details?.[field];\n }\n }\n\n // Periodic cleanup of stale windows\n cleanup(): void {\n const now = Date.now();\n for (const [key, window] of this.windows.entries()) {\n if (window.events.length === 0 && (now - window.lastAlert) > 3600_000) {\n this.windows.delete(key);\n }\n }\n }\n}\n","import { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { DetectionRule } from './engine.js';\nimport { DEFAULT_RULES } from './default-rules.js';\n\nconst RULES_DIR = '/etc/threatcrush/rules.d';\n\nexport function loadAllRules(customDir?: string): DetectionRule[] {\n const rules = [...DEFAULT_RULES];\n const dir = customDir || RULES_DIR;\n\n if (existsSync(dir)) {\n const files = readdirSync(dir).filter(f => f.endsWith('.json'));\n for (const file of files) {\n try {\n const raw = readFileSync(join(dir, file), 'utf-8');\n const parsed = JSON.parse(raw);\n const customRules: DetectionRule[] = Array.isArray(parsed) ? parsed : [parsed];\n for (const rule of customRules) {\n if (!rule.id || !rule.title || !rule.match) {\n console.warn(`[rules] skipping invalid rule in ${file}: missing required fields`);\n continue;\n }\n const existingIdx = rules.findIndex(r => r.id === rule.id);\n if (existingIdx >= 0) {\n rules[existingIdx] = { ...rules[existingIdx], ...rule };\n } else {\n rules.push(rule);\n }\n }\n } catch (err) {\n console.warn(`[rules] failed to load ${file}: ${(err as Error).message}`);\n }\n }\n }\n\n return rules;\n}\n","import type { DetectionRule } from './engine.js';\n\nexport const DEFAULT_RULES: DetectionRule[] = [\n {\n id: 'ssh-brute-force',\n title: 'SSH Brute Force Detected',\n description: 'Multiple failed SSH login attempts from the same source',\n version: '1.0.0',\n category: 'auth',\n severity: 'high',\n source_types: ['ssh-guard', 'auth'],\n match: {\n field: 'message',\n operator: 'regex',\n value: 'failed ssh login|invalid ssh user',\n },\n threshold: 5,\n window_seconds: 300,\n cooldown_seconds: 600,\n tags: ['ssh', 'brute-force', 'credential-stuffing'],\n remediation: {\n action: 'block',\n ttl_seconds: 3600,\n description: 'Block source IP for 1 hour',\n },\n enabled: true,\n },\n {\n id: 'ssh-success-after-failures',\n title: 'SSH Login After Failed Attempts',\n description: 'Successful SSH login from an IP that had recent failures',\n version: '1.0.0',\n category: 'auth',\n severity: 'critical',\n source_types: ['ssh-guard', 'auth'],\n match: {\n field: 'message',\n operator: 'contains',\n value: 'SSH login accepted',\n },\n threshold: 1,\n window_seconds: 60,\n cooldown_seconds: 300,\n tags: ['ssh', 'compromise-indicator'],\n enabled: true,\n },\n {\n id: 'ssh-root-login',\n title: 'Root SSH Login Attempt',\n description: 'Direct root login via SSH detected',\n version: '1.0.0',\n category: 'auth',\n severity: 'high',\n source_types: ['ssh-guard', 'auth'],\n match: {\n field: 'message',\n operator: 'regex',\n value: '(failed|accepted).*\\\\broot\\\\b',\n },\n threshold: 1,\n window_seconds: 60,\n cooldown_seconds: 300,\n tags: ['ssh', 'root-access'],\n remediation: {\n action: 'block',\n ttl_seconds: 7200,\n description: 'Block source IP attempting root login',\n },\n enabled: true,\n },\n {\n id: 'ssh-user-enumeration',\n title: 'SSH User Enumeration',\n description: 'Multiple SSH attempts with different usernames from same source',\n version: '1.0.0',\n category: 'auth',\n severity: 'high',\n source_types: ['ssh-guard', 'auth'],\n match: {\n field: 'message',\n operator: 'contains',\n value: 'Invalid SSH user',\n },\n threshold: 3,\n window_seconds: 120,\n cooldown_seconds: 600,\n tags: ['ssh', 'enumeration', 'reconnaissance'],\n remediation: {\n action: 'block',\n ttl_seconds: 3600,\n description: 'Block source IP performing user enumeration',\n },\n enabled: true,\n },\n {\n id: 'sudo-abuse',\n title: 'Sudo Authentication Failure',\n description: 'Repeated sudo authentication failures',\n version: '1.0.0',\n category: 'auth',\n severity: 'high',\n source_types: ['user-journal', 'system'],\n match: {\n field: 'message',\n operator: 'regex',\n value: 'sudo.*authentication failure|sudo.*incorrect password|sudo.*FAILED',\n },\n threshold: 3,\n window_seconds: 300,\n cooldown_seconds: 600,\n tags: ['sudo', 'privilege-escalation'],\n enabled: true,\n },\n {\n id: 'web-sqli-attack',\n title: 'SQL Injection Attack Detected',\n description: 'HTTP request with SQL injection patterns',\n version: '1.0.0',\n category: 'web',\n severity: 'critical',\n source_types: ['log-watcher', 'web'],\n match: {\n field: 'message',\n operator: 'contains',\n value: 'Attack detected [SQLI]',\n },\n threshold: 1,\n window_seconds: 60,\n cooldown_seconds: 300,\n tags: ['web', 'sqli', 'injection'],\n remediation: {\n action: 'block',\n ttl_seconds: 3600,\n description: 'Block source IP performing SQL injection',\n },\n enabled: true,\n },\n {\n id: 'web-path-traversal',\n title: 'Path Traversal Attack Detected',\n description: 'HTTP request with path traversal patterns',\n version: '1.0.0',\n category: 'web',\n severity: 'critical',\n source_types: ['log-watcher', 'web'],\n match: {\n field: 'message',\n operator: 'contains',\n value: 'Attack detected [PATH_TRAVERSAL]',\n },\n threshold: 1,\n window_seconds: 60,\n cooldown_seconds: 300,\n tags: ['web', 'path-traversal', 'lfi'],\n remediation: {\n action: 'block',\n ttl_seconds: 3600,\n description: 'Block source IP performing path traversal',\n },\n enabled: true,\n },\n {\n id: 'web-xss-attack',\n title: 'XSS Attack Detected',\n description: 'HTTP request with cross-site scripting patterns',\n version: '1.0.0',\n category: 'web',\n severity: 'high',\n source_types: ['log-watcher', 'web'],\n match: {\n field: 'message',\n operator: 'regex',\n value: 'Attack detected \\\\[XSS\\\\]',\n },\n threshold: 1,\n window_seconds: 60,\n cooldown_seconds: 300,\n tags: ['web', 'xss', 'injection'],\n remediation: {\n action: 'block',\n ttl_seconds: 3600,\n description: 'Block source IP performing XSS attack',\n },\n enabled: true,\n },\n {\n id: 'web-scanner-detection',\n title: 'Web Vulnerability Scanner Detected',\n description: 'High volume of 4xx errors suggesting automated scanning',\n version: '1.0.0',\n category: 'web',\n severity: 'medium',\n source_types: ['log-watcher', 'web'],\n match: {\n field: 'message',\n operator: 'regex',\n value: 'Client error 4\\\\d{2}:',\n },\n threshold: 20,\n window_seconds: 60,\n cooldown_seconds: 600,\n tags: ['web', 'scanner', 'reconnaissance'],\n remediation: {\n action: 'block',\n ttl_seconds: 1800,\n description: 'Block automated scanner',\n },\n enabled: true,\n },\n {\n id: 'port-scan-indicator',\n title: 'Port Scan Indicators',\n description: 'Connection attempts to many ports from a single source',\n version: '1.0.0',\n category: 'network',\n severity: 'medium',\n source_types: ['network-monitor', 'network'],\n match: {\n field: 'message',\n operator: 'contains',\n value: 'port scan',\n },\n threshold: 1,\n window_seconds: 60,\n cooldown_seconds: 300,\n tags: ['network', 'port-scan', 'reconnaissance'],\n remediation: {\n action: 'block',\n ttl_seconds: 3600,\n description: 'Block port scanner',\n },\n enabled: true,\n },\n {\n id: 'system-critical-error',\n title: 'Critical System Error',\n description: 'Critical or emergency level system log message',\n version: '1.0.0',\n category: 'system',\n severity: 'critical',\n source_types: ['user-journal', 'system'],\n match: {\n field: 'severity',\n operator: 'equals',\n value: 'critical',\n },\n threshold: 1,\n window_seconds: 60,\n cooldown_seconds: 300,\n tags: ['system', 'critical'],\n enabled: true,\n },\n {\n id: 'exploit-probe-pattern',\n title: 'Exploit Probe Pattern',\n description: 'HTTP requests matching common exploit probe patterns',\n version: '1.0.0',\n category: 'web',\n severity: 'high',\n source_types: ['log-watcher', 'web'],\n match: {\n field: 'message',\n operator: 'regex',\n value: 'Attack detected \\\\[(CMD_INJECTION|RCE|SSRF|XXE)\\\\]',\n },\n threshold: 1,\n window_seconds: 60,\n cooldown_seconds: 300,\n tags: ['web', 'exploit', 'probe'],\n remediation: {\n action: 'block',\n ttl_seconds: 7200,\n description: 'Block source IP performing exploit probes',\n },\n enabled: true,\n },\n];\n","import { execSync, spawnSync } from 'node:child_process';\nimport { isIP } from 'node:net';\n\nexport interface FirewallAdapter {\n name: string;\n isAvailable(): boolean;\n block(ip: string): Promise<void>;\n unblock(ip: string): Promise<void>;\n isBlocked(ip: string): Promise<boolean>;\n listBlocked(): Promise<string[]>;\n}\n\nfunction assertValidFirewallIp(ip: string): void {\n if (isIP(ip) !== 4) {\n throw new Error(`Invalid IPv4 address: ${ip}`);\n }\n}\n\nexport class NftablesAdapter implements FirewallAdapter {\n name = 'nftables';\n private table = 'threatcrush';\n private set = 'blocklist';\n\n isAvailable(): boolean {\n const result = spawnSync('nft', ['--version'], { stdio: 'pipe' });\n return result.status === 0;\n }\n\n private ensureSetup(): void {\n try {\n execSync(`nft list table inet ${this.table} 2>/dev/null`, { stdio: 'pipe' });\n } catch {\n execSync(`nft add table inet ${this.table}`);\n execSync(`nft add set inet ${this.table} ${this.set} '{ type ipv4_addr; flags timeout; }'`);\n execSync(`nft add chain inet ${this.table} input '{ type filter hook input priority -1; policy accept; }'`);\n execSync(`nft add rule inet ${this.table} input ip saddr @${this.set} drop`);\n }\n }\n\n async block(ip: string): Promise<void> {\n assertValidFirewallIp(ip);\n this.ensureSetup();\n execSync(`nft add element inet ${this.table} ${this.set} '{ ${ip} }'`);\n }\n\n async unblock(ip: string): Promise<void> {\n assertValidFirewallIp(ip);\n try {\n execSync(`nft delete element inet ${this.table} ${this.set} '{ ${ip} }'`);\n } catch { /* element may not exist */ }\n }\n\n async isBlocked(ip: string): Promise<boolean> {\n assertValidFirewallIp(ip);\n try {\n const output = execSync(`nft list set inet ${this.table} ${this.set}`, { encoding: 'utf-8' });\n return output.includes(ip);\n } catch { return false; }\n }\n\n async listBlocked(): Promise<string[]> {\n try {\n const output = execSync(`nft list set inet ${this.table} ${this.set}`, { encoding: 'utf-8' });\n const match = output.match(/elements\\s*=\\s*\\{([^}]*)\\}/);\n if (!match) return [];\n return match[1].split(',').map(s => s.trim().split(/\\s/)[0]).filter(Boolean);\n } catch { return []; }\n }\n}\n\nexport class IptablesAdapter implements FirewallAdapter {\n name = 'iptables';\n private chain = 'THREATCRUSH';\n\n isAvailable(): boolean {\n const result = spawnSync('iptables', ['--version'], { stdio: 'pipe' });\n return result.status === 0;\n }\n\n private ensureChain(): void {\n try {\n execSync(`iptables -n -L ${this.chain} 2>/dev/null`, { stdio: 'pipe' });\n } catch {\n execSync(`iptables -N ${this.chain}`);\n execSync(`iptables -I INPUT 1 -j ${this.chain}`);\n }\n }\n\n async block(ip: string): Promise<void> {\n assertValidFirewallIp(ip);\n this.ensureChain();\n if (await this.isBlocked(ip)) return;\n execSync(`iptables -A ${this.chain} -s ${ip} -j DROP`);\n }\n\n async unblock(ip: string): Promise<void> {\n assertValidFirewallIp(ip);\n try { execSync(`iptables -D ${this.chain} -s ${ip} -j DROP`); }\n catch { /* rule may not exist */ }\n }\n\n async isBlocked(ip: string): Promise<boolean> {\n assertValidFirewallIp(ip);\n try {\n const output = execSync(`iptables -n -L ${this.chain}`, { encoding: 'utf-8' });\n return output.includes(ip);\n } catch { return false; }\n }\n\n async listBlocked(): Promise<string[]> {\n try {\n const output = execSync(`iptables -n -L ${this.chain}`, { encoding: 'utf-8' });\n const ips: string[] = [];\n for (const line of output.split('\\n')) {\n const match = line.match(/DROP\\s+all\\s+--\\s+(\\d+\\.\\d+\\.\\d+\\.\\d+)/);\n if (match) ips.push(match[1]);\n }\n return ips;\n } catch { return []; }\n }\n}\n\nexport class DryRunAdapter implements FirewallAdapter {\n name = 'dry-run';\n private blocked = new Set<string>();\n\n isAvailable(): boolean { return true; }\n async block(ip: string): Promise<void> { assertValidFirewallIp(ip); this.blocked.add(ip); }\n async unblock(ip: string): Promise<void> { assertValidFirewallIp(ip); this.blocked.delete(ip); }\n async isBlocked(ip: string): Promise<boolean> { assertValidFirewallIp(ip); return this.blocked.has(ip); }\n async listBlocked(): Promise<string[]> { return [...this.blocked]; }\n}\n\nexport function detectFirewallAdapter(): FirewallAdapter {\n const nft = new NftablesAdapter();\n if (nft.isAvailable()) return nft;\n const ipt = new IptablesAdapter();\n if (ipt.isAvailable()) return ipt;\n return new DryRunAdapter();\n}\n","import { appendFileSync } from 'node:fs';\nimport type { FirewallAdapter } from './adapters.js';\nimport type { EventBus } from '../event-bus.js';\nimport { getModuleState, setModuleState } from '../../core/state.js';\nimport { PATHS } from '../paths.js';\nimport type { ThreatEvent } from '../../types/events.js';\n\ninterface BlockEntry {\n ip: string;\n reason: string;\n rule_id?: string;\n blocked_at: number;\n expires_at?: number;\n dry_run: boolean;\n}\n\ninterface RemediationConfig {\n enabled: boolean;\n dry_run: boolean;\n default_ttl_seconds: number;\n min_severity: string;\n allowlist: string[];\n}\n\nconst DEFAULT_CONFIG: RemediationConfig = {\n enabled: true,\n dry_run: true,\n default_ttl_seconds: 3600,\n min_severity: 'high',\n allowlist: ['127.0.0.1', '::1'],\n};\n\nconst SEVERITY_RANK: Record<string, number> = {\n info: 0, low: 1, medium: 2, high: 3, critical: 4,\n};\n\nexport class RemediationManager {\n private config: RemediationConfig;\n private blocklist: BlockEntry[] = [];\n private expiryTimer: NodeJS.Timeout | null = null;\n\n constructor(\n private adapter: FirewallAdapter,\n private bus: EventBus,\n config?: Partial<RemediationConfig>,\n ) {\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.loadState();\n this.startExpiryWorker();\n }\n\n async handleDetection(event: ThreatEvent): Promise<void> {\n if (!this.config.enabled) return;\n\n const eventRank = SEVERITY_RANK[event.severity] ?? 0;\n const minRank = SEVERITY_RANK[this.config.min_severity] ?? 3;\n if (eventRank < minRank) return;\n\n const ip = event.source_ip;\n if (!ip) return;\n if (this.isAllowlisted(ip)) return;\n if (this.blocklist.some(b => b.ip === ip)) return;\n\n const ruleRemediation = event.details?.remediation as Record<string, unknown> | undefined;\n const ttl = (ruleRemediation?.ttl_seconds as number) || this.config.default_ttl_seconds;\n const ruleId = event.details?.rule_id as string | undefined;\n\n await this.blockIp(ip, event.message, ruleId, ttl);\n }\n\n async blockIp(ip: string, reason: string, ruleId?: string, ttlSeconds?: number): Promise<boolean> {\n if (this.isAllowlisted(ip)) return false;\n\n const entry: BlockEntry = {\n ip,\n reason,\n rule_id: ruleId,\n blocked_at: Date.now(),\n expires_at: ttlSeconds ? Date.now() + (ttlSeconds * 1000) : undefined,\n dry_run: this.config.dry_run,\n };\n\n if (!this.config.dry_run) {\n try {\n await this.adapter.block(ip);\n } catch (err) {\n this.logLine(`[firewall] EACCES or error blocking ${ip}: ${(err as Error).message}`);\n this.bus.publish({\n timestamp: new Date(),\n module: 'firewall-rules',\n category: 'system',\n severity: 'medium',\n message: `Failed to block ${ip}: ${(err as Error).message}. Ensure daemon has CAP_NET_ADMIN.`,\n });\n return false;\n }\n }\n\n this.blocklist.push(entry);\n this.saveState();\n\n const mode = this.config.dry_run ? '[DRY-RUN] ' : '';\n const expiryMsg = ttlSeconds ? ` (expires in ${ttlSeconds}s)` : ' (permanent)';\n this.logLine(`[firewall] ${mode}Blocked ${ip}: ${reason}${expiryMsg}`);\n\n this.bus.publish({\n timestamp: new Date(),\n module: 'firewall-rules',\n category: 'system',\n severity: 'info',\n message: `${mode}Blocked ${ip}: ${reason}${expiryMsg}`,\n source_ip: ip,\n details: { action: 'block', rule_id: ruleId, dry_run: this.config.dry_run, ttl_seconds: ttlSeconds },\n });\n\n return true;\n }\n\n async unblockIp(ip: string): Promise<boolean> {\n const idx = this.blocklist.findIndex(b => b.ip === ip);\n if (idx < 0) return false;\n\n const entry = this.blocklist[idx];\n if (!entry.dry_run) {\n try {\n await this.adapter.unblock(ip);\n } catch (err) {\n this.logLine(`[firewall] Error unblocking ${ip}: ${(err as Error).message}`);\n return false;\n }\n }\n\n this.blocklist.splice(idx, 1);\n this.saveState();\n\n this.logLine(`[firewall] Unblocked ${ip}`);\n this.bus.publish({\n timestamp: new Date(),\n module: 'firewall-rules',\n category: 'system',\n severity: 'info',\n message: `Unblocked ${ip}`,\n source_ip: ip,\n details: { action: 'unblock' },\n });\n\n return true;\n }\n\n isAllowlisted(ip: string): boolean {\n return this.config.allowlist.includes(ip);\n }\n\n addToAllowlist(ip: string): void {\n if (!this.config.allowlist.includes(ip)) {\n this.config.allowlist.push(ip);\n }\n }\n\n removeFromAllowlist(ip: string): void {\n this.config.allowlist = this.config.allowlist.filter(a => a !== ip);\n }\n\n getBlocklist(): BlockEntry[] { return [...this.blocklist]; }\n getAllowlist(): string[] { return [...this.config.allowlist]; }\n\n stop(): void {\n if (this.expiryTimer) clearInterval(this.expiryTimer);\n this.expiryTimer = null;\n }\n\n private startExpiryWorker(): void {\n this.expiryTimer = setInterval(() => void this.processExpiries(), 30_000);\n }\n\n private async processExpiries(): Promise<void> {\n const now = Date.now();\n const expired = this.blocklist.filter(b => b.expires_at && b.expires_at <= now);\n for (const entry of expired) {\n await this.unblockIp(entry.ip);\n }\n }\n\n private loadState(): void {\n try {\n const saved = getModuleState('firewall-rules', 'blocklist') as BlockEntry[] | undefined;\n if (Array.isArray(saved)) this.blocklist = saved;\n } catch { /* State DB may not be available */ }\n }\n\n private saveState(): void {\n try { setModuleState('firewall-rules', 'blocklist', this.blocklist); }\n catch { /* State DB may not be available */ }\n }\n\n private logLine(line: string): void {\n try { appendFileSync(PATHS.logFile, `${new Date().toISOString()} ${line}\\n`); }\n catch { /* best-effort */ }\n }\n}\n","/**\n * Opt-in error reporting for the CLI + daemon.\n *\n * Enabled only when `SENTRY_DSN` is set in the environment. Safe to call\n * from both short-lived CLI invocations and the long-running daemon.\n */\n\nlet ready = false;\n// Keep the import lazy so the CLI doesn't pay the Sentry bundle cost when\n// reporting is disabled.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet sentry: any = null;\n\nasync function loadSentry(): Promise<void> {\n if (sentry) return;\n try {\n sentry = await import('@sentry/node');\n } catch {\n sentry = null;\n }\n}\n\nexport async function initTelemetry(context: 'cli' | 'daemon'): Promise<void> {\n if (ready) return;\n const dsn = process.env.SENTRY_DSN;\n if (!dsn) return;\n\n await loadSentry();\n if (!sentry) return;\n\n sentry.init({\n dsn,\n environment: process.env.NODE_ENV || 'production',\n release: process.env.SENTRY_RELEASE,\n serverName: context,\n tracesSampleRate: 0,\n beforeSend(event: Record<string, unknown>) {\n const req = (event as { request?: { headers?: Record<string, string> } }).request;\n if (req?.headers) {\n delete req.headers.authorization;\n delete req.headers.cookie;\n }\n return event;\n },\n });\n\n ready = true;\n}\n\nexport function captureException(err: unknown): void {\n if (!ready || !sentry) return;\n sentry.captureException(err);\n}\n\nexport async function flushTelemetry(timeoutMs = 2000): Promise<void> {\n if (!ready || !sentry) return;\n try { await sentry.flush(timeoutMs); } catch { /* ignore */ }\n}\n","import { execSync } from 'node:child_process';\nimport { chmodSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport chalk from 'chalk';\nimport { banner } from '../core/logger.js';\n\nconst UNIT_PATH = '/etc/systemd/system/threatcrushd.service';\n\nfunction resolveTemplate(): string {\n const templatePath = join(__dirname, 'systemd', 'threatcrushd.service');\n if (!existsSync(templatePath)) {\n throw new Error(`systemd unit template not found at ${templatePath}`);\n }\n return readFileSync(templatePath, 'utf-8');\n}\n\nfunction resolveBinPath(): string {\n // When installed globally the script path is the CLI bin.\n const arg = process.argv[1];\n if (arg && existsSync(arg)) return arg;\n try {\n return execSync('command -v threatcrush', { encoding: 'utf-8' }).trim();\n } catch {\n return 'threatcrush';\n }\n}\n\nfunction isRoot(): boolean {\n return typeof process.getuid === 'function' && process.getuid() === 0;\n}\n\nexport async function installServiceCommand(): Promise<void> {\n banner();\n\n if (process.platform !== 'linux') {\n console.log(chalk.yellow(' systemd install is only supported on Linux.'));\n return;\n }\n\n if (!isRoot()) {\n console.log(chalk.red(' Must run as root (try `sudo threatcrush install-service`).'));\n return;\n }\n\n const unit = resolveTemplate().replace('{{BIN_PATH}}', resolveBinPath());\n writeFileSync(UNIT_PATH, unit, { mode: 0o644 });\n console.log(chalk.green(` ✓ Installed unit file: ${UNIT_PATH}`));\n\n ensureSystemDirs();\n\n try {\n execSync('systemctl daemon-reload', { stdio: 'inherit' });\n execSync('systemctl enable threatcrushd.service', { stdio: 'inherit' });\n console.log(chalk.green(' ✓ Service enabled on boot.'));\n console.log(chalk.dim(' Start now with: systemctl start threatcrushd'));\n console.log(chalk.dim(' View logs with: journalctl -u threatcrushd -f'));\n } catch (err) {\n console.log(chalk.yellow(` ! systemctl error: ${(err as Error).message}`));\n }\n}\n\n// systemd `ReadWritePaths=` requires these to exist before the unit starts,\n// and we want module installs / config edits to be writable by `adm` group\n// members (same boundary used for log read access and IPC socket access).\nfunction ensureSystemDirs(): void {\n const dirs: Array<{ path: string; sticky?: boolean }> = [\n { path: '/etc/threatcrush' },\n { path: '/etc/threatcrush/modules', sticky: true },\n { path: '/etc/threatcrush/threatcrushd.conf.d' },\n { path: '/var/log/threatcrush' },\n { path: '/var/lib/threatcrush' },\n { path: '/var/run/threatcrush' },\n ];\n let admGid: number | null = null;\n try {\n admGid = statSync('/var/log/auth.log').gid;\n } catch {\n // adm group not present — leave permissions as root-only\n }\n\n for (const { path, sticky } of dirs) {\n try { mkdirSync(path, { recursive: true }); } catch {}\n if (admGid !== null) {\n try {\n // 2775 = setgid + group writable; setgid makes new files inherit `adm`.\n // 0775 for the non-module dirs.\n chmodSync(path, sticky ? 0o2775 : 0o775);\n execSync(`chgrp adm ${path}`, { stdio: 'ignore' });\n } catch { /* best-effort */ }\n }\n }\n console.log(chalk.green(' ✓ Runtime dirs prepared (group `adm` may install modules / edit config without sudo).'));\n}\n\nexport async function uninstallServiceCommand(): Promise<void> {\n banner();\n\n if (process.platform !== 'linux') {\n console.log(chalk.yellow(' systemd uninstall is only supported on Linux.'));\n return;\n }\n if (!isRoot()) {\n console.log(chalk.red(' Must run as root (try `sudo threatcrush uninstall-service`).'));\n return;\n }\n\n try { execSync('systemctl stop threatcrushd.service', { stdio: 'inherit' }); } catch {}\n try { execSync('systemctl disable threatcrushd.service', { stdio: 'inherit' }); } catch {}\n try {\n if (existsSync(UNIT_PATH)) {\n execSync(`rm -f ${UNIT_PATH}`);\n console.log(chalk.green(` ✓ Removed unit file: ${UNIT_PATH}`));\n }\n } catch {}\n try { execSync('systemctl daemon-reload', { stdio: 'inherit' }); } catch {}\n\n console.log(chalk.green(' ✓ threatcrushd service removed.'));\n}\n","import chalk from 'chalk';\nimport { isLoggedIn, readCliConfig } from '../core/cli-config.js';\nimport { findRunningDaemon } from '../daemon/pidfile.js';\nimport { PATHS } from '../daemon/paths.js';\n\nconst LOGO = chalk.green(`\n ████████╗██╗ ██╗██████╗ ███████╗ █████╗ ████████╗\n ╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗╚══██╔══╝\n ██║ ███████║██████╔╝█████╗ ███████║ ██║\n ██║ ██╔══██║██╔══██╗██╔══╝ ██╔══██║ ██║\n ██║ ██║ ██║██║ ██║███████╗██║ ██║ ██║\n ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝`) + chalk.dim(`\n C R U S H\n`);\n\ninterface Step {\n heading: string;\n hint?: string;\n cmd: string;\n}\n\nfunction nextSteps(): Step[] {\n const steps: Step[] = [];\n const loggedIn = isLoggedIn();\n const daemonRunning = !!findRunningDaemon();\n\n if (!loggedIn) {\n steps.push({\n heading: 'Sign in to threatcrush.com',\n hint: 'Stores your license, orgs, and property list.',\n cmd: 'threatcrush login',\n });\n }\n\n if (!daemonRunning) {\n steps.push({\n heading: 'Start the daemon',\n hint: `Runs in background, exposes an IPC socket at ${PATHS.socket}.`,\n cmd: 'threatcrush start',\n });\n }\n\n if (loggedIn) {\n steps.push({\n heading: 'Add a target to scan or pentest',\n hint: 'A URL, API, domain, IP, or repo that ThreatCrush will watch.',\n cmd: 'threatcrush properties add <name> <target>',\n });\n steps.push({\n heading: 'Run it now',\n hint: 'Auto-detects scan vs pentest based on the property kind.',\n cmd: 'threatcrush properties run',\n });\n } else {\n steps.push({\n heading: 'Scan a local codebase',\n hint: 'Fast static analysis for secrets and common vulnerabilities.',\n cmd: 'threatcrush scan .',\n });\n steps.push({\n heading: 'Pentest a URL',\n hint: 'Basic automated checks (SQLi / XSS / traversal / headers).',\n cmd: 'threatcrush pentest https://example.com',\n });\n }\n\n steps.push({\n heading: 'Open the live dashboard',\n hint: 'react-blessed TUI — subscribes to events from the daemon.',\n cmd: 'threatcrush tui',\n });\n\n return steps;\n}\n\nexport function welcomeCommand(): void {\n console.log(LOGO);\n\n const cfg = readCliConfig();\n const loggedIn = isLoggedIn();\n const daemonRunning = !!findRunningDaemon();\n\n const signedInLine = loggedIn\n ? `${chalk.green('● signed in')} ${chalk.dim('as')} ${chalk.white(cfg.email || cfg.user_id || 'unknown')}`\n : `${chalk.gray('○ not signed in')}`;\n const daemonLine = daemonRunning\n ? `${chalk.green('● daemon running')} ${chalk.dim('at')} ${chalk.gray(PATHS.socket)}`\n : `${chalk.gray('○ daemon stopped')}`;\n\n console.log(` ${signedInLine}`);\n console.log(` ${daemonLine}\\n`);\n\n console.log(chalk.green.bold(' Suggested next steps'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n\n const steps = nextSteps();\n steps.forEach((step, i) => {\n const num = chalk.green(` ${i + 1}.`);\n console.log(`${num} ${chalk.white.bold(step.heading)}`);\n if (step.hint) console.log(` ${chalk.dim(step.hint)}`);\n console.log(` ${chalk.green('$')} ${chalk.white(step.cmd)}\\n`);\n });\n\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(chalk.dim(' Run ') + chalk.white('threatcrush help') + chalk.dim(' to see every command.'));\n console.log(chalk.dim(' Docs: ') + chalk.white('https://threatcrush.com\\n'));\n}\n","import { readFileSync } from 'node:fs';\nimport { extname } from 'node:path';\nimport readline from 'node:readline';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { banner } from '../core/logger.js';\nimport { authHeaders, isLoggedIn, readCliConfig } from '../core/cli-config.js';\nimport { runScan } from './scan.js';\nimport { runPentest } from './pentest.js';\nimport { workerId, type RunResult } from '../core/run-result.js';\n\nconst API_URL = process.env.THREATCRUSH_API_URL || 'https://threatcrush.com';\n\nconst KINDS = ['url', 'api', 'domain', 'ip', 'repo'] as const;\ntype Kind = typeof KINDS[number];\n\ninterface Property {\n id: string;\n name: string;\n kind: Kind;\n target: string;\n description: string | null;\n tags: string[];\n enabled: boolean;\n last_run_at: string | null;\n last_run_status: string | null;\n created_at: string;\n}\n\ninterface Org {\n id: string;\n slug: string;\n name: string;\n}\n\nfunction prompt(question: string): Promise<string> {\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n return new Promise((resolve) => rl.question(question, (answer) => {\n rl.close();\n resolve(answer.trim());\n }));\n}\n\nasync function requireAuth(): Promise<boolean> {\n if (isLoggedIn()) return true;\n console.log(chalk.red(' You must be logged in.'));\n console.log(chalk.dim(` Run ${chalk.white('threatcrush login')}\\n`));\n return false;\n}\n\nasync function resolveOrgId(orgFlag?: string): Promise<{ org: Org } | null> {\n const cfg = readCliConfig();\n\n if (!orgFlag && cfg.current_org_id && cfg.current_org_slug) {\n return { org: { id: cfg.current_org_id, slug: cfg.current_org_slug, name: cfg.current_org_slug } };\n }\n\n let orgs: Org[] = [];\n try {\n const res = await fetch(`${API_URL}/api/orgs`, { headers: authHeaders() });\n if (!res.ok) {\n console.log(chalk.red(` Failed to list organizations (${res.status})\\n`));\n return null;\n }\n const data = await res.json() as { organizations?: Org[] };\n orgs = data.organizations || [];\n } catch (err) {\n console.log(chalk.red(` ${(err as Error).message}\\n`));\n return null;\n }\n\n if (orgs.length === 0) {\n console.log(chalk.yellow(' You are not a member of any organization yet.'));\n console.log(chalk.dim(` Create one: ${chalk.white('threatcrush orgs create <name>')}\\n`));\n return null;\n }\n\n const slug = orgFlag || cfg.current_org_slug;\n const org = slug ? orgs.find((o) => o.slug === slug) : orgs[0];\n if (!org) {\n console.log(chalk.red(` Organization not found: ${slug}\\n`));\n return null;\n }\n return { org };\n}\n\nasync function fetchProperties(orgId: string, kind?: Kind): Promise<Property[] | null> {\n const qs = kind ? `?kind=${kind}` : '';\n const res = await fetch(`${API_URL}/api/orgs/${orgId}/properties${qs}`, { headers: authHeaders() });\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: res.statusText }));\n console.log(chalk.red(` ${body.error || 'Failed to load properties'}\\n`));\n return null;\n }\n const data = await res.json() as { properties?: Property[] };\n return data.properties || [];\n}\n\nconst KIND_COLOR: Record<Kind, (s: string) => string> = {\n url: chalk.blue,\n api: chalk.magenta,\n domain: chalk.cyan,\n ip: chalk.yellow,\n repo: chalk.hex('#f78cc6'),\n};\n\nfunction printList(props: Property[], org: Org): void {\n console.log(chalk.green.bold(` Properties in ${chalk.white(org.slug)}`));\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n if (props.length === 0) {\n console.log(chalk.gray(' No properties yet.'));\n console.log();\n console.log(chalk.dim(` Add one with: ${chalk.white('threatcrush properties add <name> <target> --kind url')}`));\n console.log();\n return;\n }\n console.log(\n chalk.gray(' ') +\n chalk.white.bold('Name'.padEnd(20)) +\n chalk.white.bold('Kind'.padEnd(8)) +\n chalk.white.bold('Status'.padEnd(10)) +\n chalk.white.bold('Target'),\n );\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n for (const p of props) {\n const color = KIND_COLOR[p.kind] || chalk.white;\n const status = p.enabled ? chalk.green('● enabled ') : chalk.gray('○ disabled');\n console.log(\n chalk.gray(' ') +\n chalk.white(p.name.padEnd(20)) +\n color(p.kind.padEnd(8)) +\n status.padEnd(19) +\n chalk.dim(p.target),\n );\n if (p.tags.length > 0) {\n console.log(chalk.gray(' ' + ' '.repeat(28)) + chalk.gray('tags: ' + p.tags.join(', ')));\n }\n }\n console.log();\n}\n\nexport async function propertiesListCommand(opts: { org?: string; kind?: Kind }): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n const props = await fetchProperties(resolved.org.id, opts.kind);\n if (props === null) return;\n printList(props, resolved.org);\n}\n\nexport async function propertiesAddCommand(\n name: string,\n target: string,\n opts: { org?: string; kind?: Kind; tag?: string; description?: string; disabled?: boolean },\n): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n\n let kind = opts.kind;\n if (kind && !KINDS.includes(kind)) {\n console.log(chalk.red(` Invalid kind: ${kind}. Must be one of: ${KINDS.join(', ')}\\n`));\n return;\n }\n if (!kind) {\n // infer from target\n if (target.startsWith('http://') || target.startsWith('https://')) kind = 'url';\n else if (target.includes('/') && !target.startsWith('/') && !target.match(/^\\d/)) kind = 'repo';\n else if (/^\\d{1,3}(\\.\\d{1,3}){3}(\\/\\d{1,2})?$/.test(target)) kind = 'ip';\n else kind = 'domain';\n console.log(chalk.dim(` (auto-detected kind: ${kind})`));\n }\n\n const tags = opts.tag\n ? opts.tag.split(',').map((t) => t.trim()).filter(Boolean)\n : [];\n\n const body = {\n name,\n kind,\n target,\n description: opts.description,\n tags,\n enabled: !opts.disabled,\n };\n\n const spinner = ora({ text: `Creating property ${chalk.white(name)}...`, color: 'green' }).start();\n try {\n const res = await fetch(`${API_URL}/api/orgs/${resolved.org.id}/properties`, {\n method: 'POST',\n headers: authHeaders(),\n body: JSON.stringify(body),\n });\n const data = await res.json().catch(() => ({ error: res.statusText })) as {\n property?: Property;\n error?: string;\n };\n if (!res.ok || !data.property) {\n spinner.fail(`${data.error || 'Failed to create property'}`);\n return;\n }\n spinner.succeed(`Added ${chalk.white(data.property.name)} (${data.property.kind}) → ${data.property.target}`);\n console.log();\n } catch (err) {\n spinner.fail((err as Error).message);\n }\n}\n\nexport async function propertiesRemoveCommand(nameOrId: string, opts: { org?: string; yes?: boolean }): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n\n const props = await fetchProperties(resolved.org.id);\n if (props === null) return;\n const match = props.find((p) => p.id === nameOrId || p.name === nameOrId);\n if (!match) {\n console.log(chalk.red(` No property named \"${nameOrId}\" in ${resolved.org.slug}\\n`));\n return;\n }\n\n if (!opts.yes) {\n const answer = (await prompt(chalk.yellow(` Delete property \"${match.name}\"? (y/N): `))).toLowerCase();\n if (answer !== 'y' && answer !== 'yes') {\n console.log(chalk.dim(' Cancelled.\\n'));\n return;\n }\n }\n\n const res = await fetch(`${API_URL}/api/orgs/${resolved.org.id}/properties/${match.id}`, {\n method: 'DELETE',\n headers: authHeaders(),\n });\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: res.statusText }));\n console.log(chalk.red(` ${body.error || 'Failed to delete'}\\n`));\n return;\n }\n console.log(chalk.green(` ✓ Deleted ${chalk.white(match.name)}\\n`));\n}\n\ntype RunType = 'scan' | 'pentest';\n\nasync function enqueueRun(orgId: string, propertyId: string, type: RunType, trigger: 'cli' | 'manual' = 'cli'): Promise<string | null> {\n try {\n const res = await fetch(`${API_URL}/api/orgs/${orgId}/properties/${propertyId}/runs`, {\n method: 'POST',\n headers: authHeaders(),\n body: JSON.stringify({ type, trigger }),\n });\n const data = await res.json().catch(() => ({})) as { run?: { id: string } };\n return data.run?.id || null;\n } catch {\n return null;\n }\n}\n\nasync function finalizeRun(\n orgId: string,\n propertyId: string,\n runId: string,\n result: RunResult,\n): Promise<void> {\n try {\n await fetch(`${API_URL}/api/orgs/${orgId}/properties/${propertyId}/runs/${runId}`, {\n method: 'PATCH',\n headers: authHeaders(),\n body: JSON.stringify({\n status: result.error ? 'failed' : 'succeeded',\n findings_count: result.findings.length,\n severity_summary: result.severity_summary,\n summary: result.summary,\n findings: result.findings,\n error: result.error,\n source: 'local',\n worker_id: workerId(),\n }),\n });\n } catch {\n // best-effort\n }\n}\n\nexport async function propertiesRunCommand(\n opts: { org?: string; type?: RunType; kind?: Kind; name?: string },\n): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n\n const type: RunType = opts.type || 'pentest';\n const allProps = await fetchProperties(resolved.org.id);\n if (allProps === null) return;\n\n let targets = allProps.filter((p) => p.enabled);\n if (opts.kind) targets = targets.filter((p) => p.kind === opts.kind);\n if (opts.name) targets = targets.filter((p) => p.name === opts.name);\n\n if (!opts.kind && !opts.name) {\n if (type === 'pentest') targets = targets.filter((p) => p.kind === 'url' || p.kind === 'api');\n else if (type === 'scan') targets = targets.filter((p) => p.kind === 'repo');\n }\n\n if (targets.length === 0) {\n console.log(chalk.yellow(' No enabled properties match the filter.\\n'));\n console.log(chalk.dim(` List them: ${chalk.white('threatcrush properties list')}\\n`));\n return;\n }\n\n console.log(chalk.green.bold(` Running ${type} against ${targets.length} property(s) in ${resolved.org.slug}`));\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n for (const t of targets) {\n console.log(` ${KIND_COLOR[t.kind](`[${t.kind}]`)} ${chalk.white(t.name)} ${chalk.dim(t.target)}`);\n }\n console.log();\n\n let failures = 0;\n for (const t of targets) {\n console.log(chalk.green(`→ ${type} ${t.name} (${t.target})\\n`));\n const runId = await enqueueRun(resolved.org.id, t.id, type);\n let result: RunResult;\n try {\n result = type === 'pentest' ? await runPentest(t.target) : await runScan(t.target);\n } catch (err) {\n result = {\n type,\n target: t.target,\n findings: [],\n severity_summary: { critical: 0, high: 0, medium: 0, low: 0, info: 0 },\n summary: `Execution failed: ${(err as Error).message}`,\n error: (err as Error).message,\n };\n }\n\n const c = result.severity_summary;\n const line = ` ${result.error ? chalk.red('✗ failed') : chalk.green('✓ done')} ${chalk.white(t.name)} — ${result.summary}`;\n console.log(line);\n if (!result.error && result.findings.length > 0) {\n console.log(chalk.gray(` critical:${c.critical} high:${c.high} medium:${c.medium} low:${c.low}`));\n }\n if (result.error) failures++;\n\n if (runId) await finalizeRun(resolved.org.id, t.id, runId, result);\n }\n\n console.log();\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n if (failures === 0) {\n console.log(chalk.green(` ✓ Completed ${targets.length} run(s)\\n`));\n } else {\n console.log(chalk.yellow(` Completed with ${failures} failure(s) out of ${targets.length} run(s)\\n`));\n }\n}\n\ninterface PropertyRun {\n id: string;\n property_id: string;\n type: RunType;\n status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';\n trigger: string;\n source: string | null;\n queued_at: string;\n started_at: string | null;\n completed_at: string | null;\n findings_count: number;\n severity_summary: Record<string, number> | null;\n summary: string | null;\n error: string | null;\n}\n\nexport async function propertiesRunsCommand(opts: { org?: string; property?: string; limit?: number }): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n\n const props = await fetchProperties(resolved.org.id);\n if (props === null) return;\n\n let propsToShow = props;\n if (opts.property) {\n const match = props.find((p) => p.name === opts.property || p.id === opts.property);\n if (!match) {\n console.log(chalk.red(` Property \"${opts.property}\" not found.\\n`));\n return;\n }\n propsToShow = [match];\n }\n\n const limit = opts.limit || 10;\n console.log(chalk.green.bold(` Recent runs in ${chalk.white(resolved.org.slug)}`));\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n\n let total = 0;\n for (const prop of propsToShow) {\n const res = await fetch(\n `${API_URL}/api/orgs/${resolved.org.id}/properties/${prop.id}/runs?limit=${limit}`,\n { headers: authHeaders() },\n );\n if (!res.ok) continue;\n const data = await res.json() as { runs?: PropertyRun[] };\n const runs = data.runs || [];\n if (runs.length === 0) continue;\n\n console.log(` ${chalk.white.bold(prop.name)} ${KIND_COLOR[prop.kind](`[${prop.kind}]`)}`);\n for (const run of runs) {\n const statusColor =\n run.status === 'succeeded' ? chalk.green :\n run.status === 'failed' ? chalk.red :\n run.status === 'running' ? chalk.yellow :\n run.status === 'cancelled' ? chalk.gray :\n chalk.cyan;\n const when = (run.completed_at || run.started_at || run.queued_at).slice(0, 19).replace('T', ' ');\n const sev = run.severity_summary as Record<string, number> | null;\n const sevStr = sev\n ? chalk.dim(`[${sev.critical || 0}C/${sev.high || 0}H/${sev.medium || 0}M/${sev.low || 0}L]`)\n : chalk.dim('[–]');\n console.log(` ${chalk.gray(when)} ${statusColor(run.status.padEnd(10))} ${chalk.dim(run.type.padEnd(8))} ${sevStr} ${chalk.gray(run.summary || '')}`);\n total++;\n }\n console.log();\n }\n\n if (total === 0) {\n console.log(chalk.gray(' No runs recorded yet.'));\n console.log(chalk.dim(` Kick one off with: ${chalk.white('threatcrush properties run')}\\n`));\n }\n}\n\ninterface ImportRecord {\n name: string;\n target: string;\n kind?: Kind;\n description?: string;\n tags?: string[] | string;\n enabled?: boolean;\n}\n\nfunction parseImportFile(path: string): ImportRecord[] {\n const ext = extname(path).toLowerCase();\n const raw = readFileSync(path, 'utf-8');\n if (ext === '.json') {\n const parsed = JSON.parse(raw);\n if (!Array.isArray(parsed)) throw new Error('JSON must be an array of objects');\n return parsed as ImportRecord[];\n }\n if (ext === '.csv' || ext === '.tsv') {\n const delim = ext === '.tsv' ? '\\t' : ',';\n const lines = raw.split(/\\r?\\n/).filter((l) => l.trim().length > 0);\n if (lines.length < 1) return [];\n const header = lines[0].split(delim).map((h) => h.trim().toLowerCase());\n const idx = {\n name: header.indexOf('name'),\n target: header.indexOf('target'),\n kind: header.indexOf('kind'),\n description: header.indexOf('description'),\n tags: header.indexOf('tags'),\n enabled: header.indexOf('enabled'),\n };\n if (idx.name < 0 || idx.target < 0) {\n throw new Error('CSV must have at least \"name\" and \"target\" columns');\n }\n return lines.slice(1).map((line) => {\n const cols = line.split(delim).map((c) => c.trim());\n const rec: ImportRecord = {\n name: cols[idx.name] || '',\n target: cols[idx.target] || '',\n };\n if (idx.kind >= 0 && cols[idx.kind]) rec.kind = cols[idx.kind] as Kind;\n if (idx.description >= 0 && cols[idx.description]) rec.description = cols[idx.description];\n if (idx.tags >= 0 && cols[idx.tags]) rec.tags = cols[idx.tags].split('|').map((t) => t.trim()).filter(Boolean);\n if (idx.enabled >= 0 && cols[idx.enabled]) rec.enabled = /^(true|1|yes)$/i.test(cols[idx.enabled]);\n return rec;\n });\n }\n throw new Error(`Unsupported file type: ${ext}. Use .json, .csv, or .tsv.`);\n}\n\nfunction inferKind(target: string): Kind {\n if (/^https?:\\/\\//.test(target)) return 'url';\n if (/^\\d{1,3}(\\.\\d{1,3}){3}(\\/\\d{1,2})?$/.test(target)) return 'ip';\n if (target.includes('/') && !target.startsWith('/')) return 'repo';\n return 'domain';\n}\n\nexport async function propertiesImportCommand(filePath: string, opts: { org?: string; dryRun?: boolean }): Promise<void> {\n banner();\n if (!(await requireAuth())) return;\n const resolved = await resolveOrgId(opts.org);\n if (!resolved) return;\n\n let records: ImportRecord[];\n try {\n records = parseImportFile(filePath);\n } catch (err) {\n console.log(chalk.red(` ✗ ${(err as Error).message}\\n`));\n return;\n }\n\n if (records.length === 0) {\n console.log(chalk.yellow(' No records to import.\\n'));\n return;\n }\n\n console.log(chalk.green.bold(` Importing ${records.length} property(s) into ${resolved.org.slug}`));\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n\n let created = 0;\n let skipped = 0;\n let failed = 0;\n\n for (const rec of records) {\n if (!rec.name || !rec.target) {\n console.log(chalk.yellow(` ! skipped (missing name or target): ${JSON.stringify(rec)}`));\n skipped++;\n continue;\n }\n const kind = (rec.kind && KINDS.includes(rec.kind)) ? rec.kind : inferKind(rec.target);\n const tags = Array.isArray(rec.tags) ? rec.tags : (typeof rec.tags === 'string' ? rec.tags.split(',').map((t) => t.trim()).filter(Boolean) : []);\n\n if (opts.dryRun) {\n console.log(` ${chalk.dim('[dry-run]')} ${chalk.white(rec.name.padEnd(24))} ${KIND_COLOR[kind](`[${kind}]`)} ${chalk.dim(rec.target)}`);\n continue;\n }\n\n try {\n const res = await fetch(`${API_URL}/api/orgs/${resolved.org.id}/properties`, {\n method: 'POST',\n headers: authHeaders(),\n body: JSON.stringify({\n name: rec.name,\n target: rec.target,\n kind,\n description: rec.description,\n tags,\n enabled: rec.enabled !== false,\n }),\n });\n if (res.status === 409) {\n console.log(` ${chalk.yellow('!')} ${chalk.white(rec.name.padEnd(24))} already exists — skipped`);\n skipped++;\n continue;\n }\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: res.statusText }));\n console.log(` ${chalk.red('✗')} ${chalk.white(rec.name.padEnd(24))} ${chalk.red(body.error || 'failed')}`);\n failed++;\n continue;\n }\n console.log(` ${chalk.green('✓')} ${chalk.white(rec.name.padEnd(24))} ${KIND_COLOR[kind](`[${kind}]`)} ${chalk.dim(rec.target)}`);\n created++;\n } catch (err) {\n console.log(` ${chalk.red('✗')} ${chalk.white(rec.name.padEnd(24))} ${chalk.red((err as Error).message)}`);\n failed++;\n }\n }\n\n console.log();\n console.log(chalk.gray(' ' + '─'.repeat(76)));\n console.log(` ${chalk.green(`${created} created`)} ${chalk.yellow(`${skipped} skipped`)} ${chalk.red(`${failed} failed`)}\\n`);\n}\n","import chalk from 'chalk';\nimport { banner } from '../core/logger.js';\nimport { loadAllRules } from '../daemon/rules/loader.js';\n\nexport async function rulesListCommand(): Promise<void> {\n banner();\n\n const rules = loadAllRules();\n\n console.log(chalk.green.bold(' Detection Rules'));\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n console.log(\n chalk.gray(' ') +\n chalk.white.bold('ID'.padEnd(28)) +\n chalk.white.bold('Severity'.padEnd(12)) +\n chalk.white.bold('Category'.padEnd(12)) +\n chalk.white.bold('Threshold'.padEnd(12)) +\n chalk.white.bold('Title'),\n );\n console.log(chalk.gray(' ' + '─'.repeat(70)));\n\n for (const rule of rules) {\n const sevColor = rule.severity === 'critical' ? chalk.red :\n rule.severity === 'high' ? chalk.red :\n rule.severity === 'medium' ? chalk.yellow : chalk.green;\n\n console.log(\n chalk.gray(' ') +\n chalk.white(rule.id.padEnd(28)) +\n sevColor(rule.severity.padEnd(12)) +\n chalk.gray(rule.category.padEnd(12)) +\n chalk.white(String(rule.threshold).padEnd(12)) +\n chalk.gray(rule.title),\n );\n }\n\n console.log();\n console.log(chalk.gray(` ${rules.length} rule(s) loaded`));\n console.log(chalk.gray(` Custom rules: /etc/threatcrush/rules.d/*.json`));\n console.log();\n}\n\nexport async function rulesShowCommand(ruleId: string): Promise<void> {\n banner();\n\n const rules = loadAllRules();\n const rule = rules.find(r => r.id === ruleId);\n\n if (!rule) {\n console.log(chalk.red(` Rule not found: ${ruleId}`));\n console.log(chalk.gray(' Run `threatcrush rules list` to see available rules.\\n'));\n return;\n }\n\n console.log(chalk.green.bold(` Rule: ${rule.id}`));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(` Title: ${chalk.white(rule.title)}`);\n console.log(` Description: ${chalk.gray(rule.description)}`);\n console.log(` Version: ${chalk.gray(rule.version)}`);\n console.log(` Category: ${chalk.gray(rule.category)}`);\n console.log(` Severity: ${chalk.yellow(rule.severity)}`);\n console.log(` Source types: ${chalk.gray(rule.source_types.join(', '))}`);\n console.log(` Threshold: ${chalk.white(String(rule.threshold))} events in ${chalk.white(String(rule.window_seconds))}s`);\n console.log(` Cooldown: ${chalk.gray(String(rule.cooldown_seconds))}s`);\n console.log(` Tags: ${chalk.gray(rule.tags.join(', '))}`);\n console.log(` Enabled: ${rule.enabled ? chalk.green('yes') : chalk.red('no')}`);\n if (rule.remediation) {\n console.log(` Remediation: ${chalk.gray(rule.remediation.description || rule.remediation.action || 'none')}`);\n if (rule.remediation.ttl_seconds) {\n console.log(` Block TTL: ${chalk.gray(String(rule.remediation.ttl_seconds))}s`);\n }\n }\n console.log();\n console.log(chalk.gray(' Match condition:'));\n console.log(chalk.gray(` ${rule.match.field} ${rule.match.operator} \"${rule.match.value}\"`));\n console.log();\n}\n\nexport async function rulesCommand(opts: { action?: string; id?: string }): Promise<void> {\n const action = opts.action || 'list';\n switch (action) {\n case 'list':\n case 'ls':\n await rulesListCommand();\n break;\n case 'show':\n case 'info':\n if (!opts.id) {\n console.log(chalk.red(' Rule ID required. Usage: threatcrush rules show <rule-id>\\n'));\n return;\n }\n await rulesShowCommand(opts.id);\n break;\n default:\n console.log(chalk.yellow(` Unknown action: ${action}`));\n console.log(chalk.gray(' Available: list, show\\n'));\n break;\n }\n}\n","import { existsSync, readFileSync } from 'node:fs';\nimport { execSync } from 'node:child_process';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport { banner, logger } from '../core/logger.js';\n\ninterface HardeningResult {\n key: string;\n status: 'pass' | 'warn' | 'fail';\n severity: 'info' | 'low' | 'medium' | 'high' | 'critical';\n title: string;\n explanation: string;\n recommendation?: string;\n}\n\nfunction tryExec(cmd: string): string | null {\n try { return execSync(cmd, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }); }\n catch { return null; }\n}\n\nfunction tryRead(path: string): string | null {\n try { return readFileSync(path, 'utf-8'); }\n catch { return null; }\n}\n\n// ─── Individual Checks ───\n\nfunction checkSshPasswordAuth(): HardeningResult {\n const config = tryRead('/etc/ssh/sshd_config');\n if (!config) {\n return {\n key: 'ssh-password-auth', status: 'warn', severity: 'medium',\n title: 'SSH Password Auth',\n explanation: 'Could not read /etc/ssh/sshd_config to check password authentication setting.',\n recommendation: 'Ensure PasswordAuthentication is set to no in sshd_config.',\n };\n }\n const match = config.match(/^\\s*PasswordAuthentication\\s+(yes|no)/mi);\n if (!match || match[1] === 'yes') {\n return {\n key: 'ssh-password-auth', status: 'fail', severity: 'high',\n title: 'SSH Password Authentication Enabled',\n explanation: 'Password authentication is enabled for SSH, making it vulnerable to brute-force attacks.',\n recommendation: 'Set \"PasswordAuthentication no\" in /etc/ssh/sshd_config and restart sshd. Use key-based auth instead.',\n };\n }\n return {\n key: 'ssh-password-auth', status: 'pass', severity: 'high',\n title: 'SSH Password Authentication Disabled',\n explanation: 'Password authentication is disabled for SSH. Key-based auth is enforced.',\n };\n}\n\nfunction checkSshRootLogin(): HardeningResult {\n const config = tryRead('/etc/ssh/sshd_config');\n if (!config) {\n return {\n key: 'ssh-root-login', status: 'warn', severity: 'high',\n title: 'SSH Root Login',\n explanation: 'Could not read sshd_config.',\n recommendation: 'Set \"PermitRootLogin no\" in /etc/ssh/sshd_config.',\n };\n }\n const match = config.match(/^\\s*PermitRootLogin\\s+(\\S+)/mi);\n if (!match || match[1] === 'yes') {\n return {\n key: 'ssh-root-login', status: 'fail', severity: 'high',\n title: 'Root SSH Login Enabled',\n explanation: 'Direct root login via SSH is permitted. Attackers frequently target root.',\n recommendation: 'Set \"PermitRootLogin no\" or \"PermitRootLogin prohibit-password\" in /etc/ssh/sshd_config.',\n };\n }\n return {\n key: 'ssh-root-login', status: 'pass', severity: 'high',\n title: 'Root SSH Login Restricted',\n explanation: `PermitRootLogin is set to \"${match[1]}\".`,\n };\n}\n\nfunction checkSshWeakConfig(): HardeningResult {\n const config = tryRead('/etc/ssh/sshd_config');\n if (!config) {\n return {\n key: 'ssh-weak-config', status: 'warn', severity: 'medium',\n title: 'SSH Configuration', explanation: 'Could not read sshd_config.',\n };\n }\n const issues: string[] = [];\n if (!/^\\s*Protocol\\s+2/mi.test(config) && !/^\\s*#\\s*Protocol/mi.test(config)) {\n // Modern OpenSSH defaults to protocol 2, so only flag if explicitly set to 1\n if (/^\\s*Protocol\\s+1/mi.test(config)) issues.push('Protocol 1 is enabled');\n }\n if (/^\\s*X11Forwarding\\s+yes/mi.test(config)) issues.push('X11 forwarding is enabled');\n const maxAuth = config.match(/^\\s*MaxAuthTries\\s+(\\d+)/mi);\n if (maxAuth && parseInt(maxAuth[1]) > 6) issues.push(`MaxAuthTries is high (${maxAuth[1]})`);\n\n if (issues.length > 0) {\n return {\n key: 'ssh-weak-config', status: 'warn', severity: 'medium',\n title: 'SSH Configuration Weaknesses',\n explanation: `Found: ${issues.join('; ')}.`,\n recommendation: 'Review and harden sshd_config. Disable unused features.',\n };\n }\n return {\n key: 'ssh-weak-config', status: 'pass', severity: 'medium',\n title: 'SSH Configuration', explanation: 'No obvious SSH config weaknesses found.',\n };\n}\n\nfunction checkAutoUpdates(): HardeningResult {\n // Check for unattended-upgrades (Debian/Ubuntu)\n const unattended = existsSync('/etc/apt/apt.conf.d/20auto-upgrades') ||\n existsSync('/etc/apt/apt.conf.d/50unattended-upgrades');\n // Check for dnf-automatic (RHEL/Fedora)\n const dnfAuto = existsSync('/etc/dnf/automatic.conf');\n\n if (unattended || dnfAuto) {\n return {\n key: 'auto-updates', status: 'pass', severity: 'high',\n title: 'Automatic Security Updates',\n explanation: 'Automatic security updates appear to be configured.',\n };\n }\n return {\n key: 'auto-updates', status: 'fail', severity: 'high',\n title: 'No Automatic Security Updates',\n explanation: 'No automatic security update mechanism detected.',\n recommendation: 'Install and enable unattended-upgrades (Debian/Ubuntu) or dnf-automatic (RHEL/Fedora).',\n };\n}\n\nfunction checkFirewallActive(): HardeningResult {\n const ufw = tryExec('ufw status');\n if (ufw && ufw.includes('active')) {\n return {\n key: 'firewall-active', status: 'pass', severity: 'high',\n title: 'Firewall Active (UFW)',\n explanation: 'UFW firewall is active.',\n };\n }\n\n const nft = tryExec('nft list tables');\n if (nft && nft.trim().length > 0) {\n return {\n key: 'firewall-active', status: 'pass', severity: 'high',\n title: 'Firewall Active (nftables)',\n explanation: 'nftables has active tables.',\n };\n }\n\n const ipt = tryExec('iptables -L -n');\n if (ipt) {\n const rules = ipt.split('\\n').filter(l => l.trim() && !l.startsWith('Chain') && !l.startsWith('target'));\n if (rules.length > 0) {\n return {\n key: 'firewall-active', status: 'pass', severity: 'high',\n title: 'Firewall Active (iptables)',\n explanation: `iptables has ${rules.length} rules.`,\n };\n }\n }\n\n return {\n key: 'firewall-active', status: 'fail', severity: 'high',\n title: 'No Firewall Detected',\n explanation: 'No active firewall (UFW, nftables, or iptables) detected.',\n recommendation: 'Enable a firewall: `ufw enable` or configure nftables/iptables.',\n };\n}\n\nfunction checkExposedPorts(): HardeningResult {\n const ss = tryExec('ss -tlnp');\n if (!ss) {\n return {\n key: 'exposed-ports', status: 'warn', severity: 'medium',\n title: 'Exposed Ports', explanation: 'Could not check listening ports.',\n };\n }\n\n const riskyPorts = ['3306', '5432', '6379', '27017', '9200', '11211', '2375'];\n const exposed: string[] = [];\n for (const line of ss.split('\\n')) {\n if (!line.includes('LISTEN')) continue;\n // Check if listening on 0.0.0.0 or :: (all interfaces)\n if (line.includes('0.0.0.0:') || line.includes(':::')) {\n for (const port of riskyPorts) {\n if (line.includes(`:${port} `) || line.includes(`:${port}\\t`)) {\n exposed.push(port);\n }\n }\n }\n }\n\n if (exposed.length > 0) {\n const portNames: Record<string, string> = {\n '3306': 'MySQL', '5432': 'PostgreSQL', '6379': 'Redis',\n '27017': 'MongoDB', '9200': 'Elasticsearch', '11211': 'Memcached', '2375': 'Docker',\n };\n const desc = exposed.map(p => `${portNames[p] || p} (:${p})`).join(', ');\n return {\n key: 'exposed-ports', status: 'fail', severity: 'high',\n title: 'Risky Ports Exposed',\n explanation: `Services exposed on all interfaces: ${desc}.`,\n recommendation: 'Bind database/cache services to 127.0.0.1 only, or restrict with firewall rules.',\n };\n }\n return {\n key: 'exposed-ports', status: 'pass', severity: 'high',\n title: 'No Risky Ports Exposed',\n explanation: 'No common database/cache ports are listening on all interfaces.',\n };\n}\n\nfunction checkFail2ban(): HardeningResult {\n const checkKey = 'fail2ban-present'; // gitleaks:allow\n const sev = 'medium' as const;\n const f2bStatus = tryExec('fail2ban-client status');\n if (f2bStatus && f2bStatus.includes('Number of jail')) {\n return {\n key: checkKey, status: 'pass', severity: sev,\n title: 'fail2ban Active',\n explanation: 'fail2ban is installed and running.',\n };\n }\n if (existsSync('/etc/fail2ban/fail2ban.conf')) {\n return {\n key: checkKey, status: 'warn', severity: sev,\n title: 'fail2ban Installed but Not Running',\n explanation: 'fail2ban is installed but does not appear to be running.',\n recommendation: 'Start and enable fail2ban: `systemctl enable --now fail2ban`.',\n };\n }\n return {\n key: checkKey, status: 'warn', severity: sev,\n title: 'fail2ban Not Installed',\n explanation: 'fail2ban is not installed. ThreatCrush provides similar protection, but fail2ban adds defense in depth.',\n recommendation: 'Consider installing fail2ban: `apt install fail2ban` or `dnf install fail2ban`.',\n };\n}\n\nfunction checkWorldWritableDirs(): HardeningResult {\n const sensitive = ['/etc', '/usr', '/var/log', '/boot'];\n const worldWritable: string[] = [];\n\n for (const dir of sensitive) {\n const result = tryExec(`find ${dir} -maxdepth 2 -type d -perm -0002 -not -path '*/tmp*' 2>/dev/null | head -5`);\n if (result && result.trim()) {\n worldWritable.push(...result.trim().split('\\n'));\n }\n }\n\n if (worldWritable.length > 0) {\n return {\n key: 'world-writable-dirs', status: 'fail', severity: 'medium',\n title: 'World-Writable Directories Found',\n explanation: `Found ${worldWritable.length} world-writable directories in sensitive locations: ${worldWritable.slice(0, 3).join(', ')}${worldWritable.length > 3 ? '...' : ''}`,\n recommendation: 'Remove world-writable permission: `chmod o-w <dir>`.',\n };\n }\n return {\n key: 'world-writable-dirs', status: 'pass', severity: 'medium',\n title: 'No World-Writable Directories',\n explanation: 'No world-writable directories found in sensitive locations.',\n };\n}\n\nfunction checkRiskyServices(): HardeningResult {\n const risky = ['telnet', 'rsh', 'rlogin', 'rexec', 'tftp'];\n const found: string[] = [];\n\n for (const svc of risky) {\n const result = tryExec(`systemctl is-active ${svc}.socket ${svc}.service 2>/dev/null`);\n if (result && result.trim() === 'active') {\n found.push(svc);\n }\n }\n\n if (found.length > 0) {\n return {\n key: 'risky-services', status: 'fail', severity: 'critical',\n title: 'Risky Services Running',\n explanation: `Insecure services are active: ${found.join(', ')}.`,\n recommendation: `Disable and remove insecure services: \\`systemctl disable --now ${found.join(' ')}\\`.`,\n };\n }\n return {\n key: 'risky-services', status: 'pass', severity: 'critical',\n title: 'No Risky Services',\n explanation: 'No known insecure services (telnet, rsh, etc.) are running.',\n };\n}\n\n// ─── Main ───\n\nfunction runAllChecks(): HardeningResult[] {\n return [\n checkSshPasswordAuth(),\n checkSshRootLogin(),\n checkSshWeakConfig(),\n checkAutoUpdates(),\n checkFirewallActive(),\n checkExposedPorts(),\n checkFail2ban(),\n checkWorldWritableDirs(),\n checkRiskyServices(),\n ];\n}\n\nfunction computeScore(results: HardeningResult[]): number {\n if (results.length === 0) return 100;\n const weights: Record<string, number> = { info: 0, low: 1, medium: 2, high: 3, critical: 4 };\n let maxScore = 0;\n let deductions = 0;\n for (const r of results) {\n const w = weights[r.severity] || 1;\n maxScore += w;\n if (r.status === 'fail') deductions += w;\n else if (r.status === 'warn') deductions += w * 0.5;\n }\n if (maxScore === 0) return 100;\n return Math.max(0, Math.round(((maxScore - deductions) / maxScore) * 100));\n}\n\nexport async function hardenCommand(opts: { json?: boolean }): Promise<void> {\n if (!opts.json) {\n banner();\n logger.info('Running hardening scan...\\n');\n }\n\n const spinner = opts.json ? null : ora({ text: 'Scanning system configuration...', color: 'green' }).start();\n\n const results = runAllChecks();\n const score = computeScore(results);\n\n if (spinner) spinner.succeed('Hardening scan complete\\n');\n\n if (opts.json) {\n console.log(JSON.stringify({ score, findings: results }, null, 2));\n return;\n }\n\n // Score display\n const scoreColor = score >= 80 ? chalk.green : score >= 60 ? chalk.yellow : chalk.red;\n console.log(` ${chalk.white.bold('Hardening Score:')} ${scoreColor.bold(String(score) + '/100')}`);\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log();\n\n // Group by status\n const fails = results.filter(r => r.status === 'fail');\n const warns = results.filter(r => r.status === 'warn');\n const passes = results.filter(r => r.status === 'pass');\n\n if (fails.length > 0) {\n console.log(chalk.red.bold(' FAIL'));\n for (const r of fails) {\n console.log(` ${chalk.red('✗')} ${chalk.white.bold(r.title)}`);\n console.log(` ${chalk.gray(r.explanation)}`);\n if (r.recommendation) console.log(` ${chalk.yellow('Fix:')} ${r.recommendation}`);\n console.log();\n }\n }\n\n if (warns.length > 0) {\n console.log(chalk.yellow.bold(' WARNING'));\n for (const r of warns) {\n console.log(` ${chalk.yellow('!')} ${chalk.white.bold(r.title)}`);\n console.log(` ${chalk.gray(r.explanation)}`);\n if (r.recommendation) console.log(` ${chalk.yellow('Fix:')} ${r.recommendation}`);\n console.log();\n }\n }\n\n if (passes.length > 0) {\n console.log(chalk.green.bold(' PASS'));\n for (const r of passes) {\n console.log(` ${chalk.green('✓')} ${chalk.white(r.title)}`);\n }\n console.log();\n }\n\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(` ${chalk.white.bold(`${results.length} checks:`)} ${chalk.green(`${passes.length} pass`)} ${chalk.yellow(`${warns.length} warn`)} ${chalk.red(`${fails.length} fail`)}`);\n console.log();\n}\n\n// Export for daemon use\nexport { runAllChecks, computeScore };\nexport type { HardeningResult };\n","import chalk from 'chalk';\nimport { banner } from '../core/logger.js';\n\nexport async function blockCommand(ip: string, opts: { ttl?: string }): Promise<void> {\n banner();\n console.log(chalk.green.bold(' Firewall Block'));\n console.log(chalk.gray(' ' + '─'.repeat(50)));\n\n let ttlSeconds: number | undefined;\n if (opts.ttl) {\n const match = opts.ttl.match(/^(\\d+)(s|m|h|d)?$/);\n if (match) {\n const value = parseInt(match[1]);\n const unit = match[2] || 's';\n const multipliers: Record<string, number> = { s: 1, m: 60, h: 3600, d: 86400 };\n ttlSeconds = value * (multipliers[unit] || 1);\n }\n }\n\n console.log(` Blocking ${chalk.red(ip)}${ttlSeconds ? ` for ${opts.ttl}` : ' permanently'}...`);\n console.log(chalk.gray(' Note: Requires running daemon with CAP_NET_ADMIN'));\n console.log(chalk.gray(' Configure in /etc/threatcrush/threatcrushd.conf under [remediation]'));\n console.log();\n}\n\nexport async function unblockCommand(ip: string): Promise<void> {\n banner();\n console.log(chalk.green.bold(' Firewall Unblock'));\n console.log(chalk.gray(' ' + '─'.repeat(50)));\n console.log(` Unblocking ${chalk.white(ip)}...`);\n console.log(chalk.gray(' Note: Requires running daemon'));\n console.log();\n}\n\nexport async function blocklistCommand(): Promise<void> {\n banner();\n console.log(chalk.green.bold(' Active Blocklist'));\n console.log(chalk.gray(' ' + '─'.repeat(60)));\n console.log(chalk.gray(' Connect to running daemon for live blocklist data.'));\n console.log(chalk.gray(' Configure via /etc/threatcrush/threatcrushd.conf [remediation]'));\n console.log();\n console.log(chalk.gray(' Remediation config options:'));\n console.log(chalk.gray(' enabled = true'));\n console.log(chalk.gray(' dry_run = true # Log only, no actual blocks'));\n console.log(chalk.gray(' default_ttl = \"1h\" # Default block duration'));\n console.log(chalk.gray(' min_severity = \"high\" # Minimum severity to auto-block'));\n console.log();\n}\n\nexport async function allowlistCommand(opts: { action?: string; value?: string }): Promise<void> {\n banner();\n const action = opts.action || 'list';\n\n console.log(chalk.green.bold(' Allowlist'));\n console.log(chalk.gray(' ' + '─'.repeat(50)));\n\n switch (action) {\n case 'list':\n case 'ls':\n console.log(chalk.gray(' Allowlisted IPs/CIDRs (from config):'));\n console.log(chalk.gray(' 127.0.0.1'));\n console.log(chalk.gray(' ::1'));\n console.log();\n console.log(chalk.gray(' Add more via /etc/threatcrush/threatcrushd.conf [remediation] allowlist'));\n break;\n case 'add':\n if (!opts.value) {\n console.log(chalk.red(' IP/CIDR required. Usage: threatcrush allowlist add <ip>'));\n break;\n }\n console.log(chalk.green(` Added ${opts.value} to allowlist`));\n break;\n case 'remove':\n if (!opts.value) {\n console.log(chalk.red(' IP/CIDR required. Usage: threatcrush allowlist remove <ip>'));\n break;\n }\n console.log(chalk.green(` Removed ${opts.value} from allowlist`));\n break;\n default:\n console.log(chalk.yellow(` Unknown action: ${action}`));\n console.log(chalk.gray(' Available: list, add, remove'));\n }\n console.log();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,kFAAAA,UAAA;AAAA;AAGA,QAAMC,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,cAAM,GAAG,6BAA6B,OAAO;AAE7C,cAAM,kBAAkB,MAAM,KAAK,WAAW;AAC9C,aAAK,OAAO,KAAK,YAAY;AAAA,MAC/B;AAAA,IACF;AAEA,IAAAD,SAAQ,iBAAiBC;AACzB,IAAAD,SAAQ,uBAAuBE;AAAA;AAAA;;;ACtC/B;AAAA,qFAAAC,UAAA;AAAA;AAAA,QAAM,EAAE,sBAAAC,sBAAqB,IAAI;AAEjC,QAAMC,YAAN,MAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUb,YAAY,MAAM,aAAa;AAC7B,aAAK,cAAc,eAAe;AAClC,aAAK,WAAW;AAChB,aAAK,WAAW;AAChB,aAAK,eAAe;AACpB,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AA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,OAAS;AAAA,QACR,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,OAAS;AAAA,QACR,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,OAAS;AAAA,QACR,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,OAAS;AAAA,QACR,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD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A;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,QAAU;AAAA,QACT,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,UAAY;AAAA,QACX,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,MAAQ;AAAA,QACP,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,U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D;AAAA,MACA,OAAS;AAAA,QACR,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,UAAY;AAAA,QACX,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,MAAQ;AAAA,QACP,UAAY;AAAA,QACZ,QAAU;A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A;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,MACA,eAAiB;AAAA,QAChB,UAAY;AAAA,QACZ,QAAU;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,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V,MAAM,KAAK;AAAA,IACX,MAAM,KAAK;AAAA,IACX,UAAU,KAAK;AAAA,EACjB,CAAC;AACH,CAAC;AAEHA,SACG,QAAQ,MAAM,EACd,YAAY,iDAAiD,EAC7D,SAAS,aAAa,0BAA0B,EAChD,OAAO,CAAC,gBAAyB;AAChC,MAAI,CAAC,aAAa;AAChB,YAAQ,IAAIE,KAAI;AAChB,IAAAF,SAAQ,WAAW;AACnB;AAAA,EACF;AACA,QAAM,MAAMA,SAAQ,SAAS;AAAA,IAC3B,CAAC,MAAM,EAAE,KAAK,MAAM,eAAe,EAAE,QAAQ,EAAE,SAAS,WAAW;AAAA,EACrE;AACA,MAAI,CAAC,KAAK;AACR,YAAQ,IAAI,eAAM,OAAO,sBAAsB,WAAW;AAAA,CAAI,CAAC;AAC/D,IAAAA,SAAQ,WAAW;AACnB;AAAA,EACF;AACA,MAAI,WAAW;AACjB,CAAC;AAGHA,SAAQ,OAAO,MAAM;AACnB,iBAAe;AACjB,CAAC;AAEDA,SAAQ,MAAM;","names":["exports","CommanderError","InvalidArgumentError","exports","InvalidArgumentError","Argument","exports","Help","cmd","exports","InvalidArgumentError","Option","str","exports","editDistance","exports","EventEmitter","process","Argument","CommanderError","Help","Option","Command","regex","signals","option","path","exports","Argument","Command","CommanderError","InvalidArgumentError","Help","Option","Database","module","severityColor","onExit","React","import_node_os","import_node_fs","resolve","import_node_fs","blessed","React","import_react","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","exports","module","Date","exports","module","exports","module","exports","module","exports","module","resolve","index","blocksize","exports","module","resolve","exports","module","exports","module","tomlType","str","exports","commander","process","os","tty","styles","chalk","styles","import_node_child_process","import_node_fs","import_node_path","import_node_os","import_node_fs","module","startDashboard","import_node_fs","import_node_path","import_node_process","import_node_process","import_node_process","onetime","process","global","process","process","import_node_process","process","import_node_process","isUnicodeSupported","env","process","import_node_process","process","import_cli_spinners","process","isUnicodeSupported","cliSpinners","import_node_os","os","import_node_fs","import_node_path","import_node_fs","import_node_path","import_node_path","import_node_fs","import_node_readline","import_node_fs","import_node_path","TOML","import_node_fs","import_node_path","import_node_os","import_node_readline","readline","resolve","fallback","readline","resolve","import_node_fs","import_node_path","import_toml","TOML","import_node_child_process","import_node_fs","import_node_path","import_toml","API_URL","TOML","dest","spinner","import_node_os","import_node_fs","import_node_path","API_URL","import_node_os","import_node_fs","import_node_path","API_URL","CONFIG_PATH","readConfig","getAuthHeaders","import_node_os","import_node_fs","import_node_path","import_node_child_process","API_URL","CONFIG_PATH","readConfig","getAuthHeaders","import_node_child_process","import_node_fs","import_node_path","import_node_fs","import_node_path","import_node_net","import_node_fs","resolve","isRoot","import_node_fs","import_node_path","import_toml","import_node_fs","import_node_readline","bus","import_node_child_process","bus","isRoot","import_node_child_process","import_node_fs","bus","import_node_fs","import_node_readline","bus","bus","TOML","SEVERITY_RANK","SEVERITY_COLORS","SEVERITY_RANK","bus","API_URL","bus","import_node_fs","import_node_path","import_node_child_process","import_node_net","import_node_fs","DEFAULT_CONFIG","SEVERITY_RANK","bus","readVersion","import_node_child_process","import_node_fs","import_node_path","isRoot","import_node_fs","import_node_path","import_node_readline","API_URL","prompt","readline","resolve","import_node_fs","import_node_child_process","PKG_VERSION","LOGO","API_URL","program","PKG_VERSION","LOGO","readline","resolve","API_URL","pm","commands","rl"]}
|