From 917ee660ab39dc27861d580b0e1123203930ae3f Mon Sep 17 00:00:00 2001 From: Shayan SalehiRad <167648493+CodeinScrubs@users.noreply.github.com> Date: Thu, 13 Aug 2026 13:35:28 +0330 Subject: [PATCH 1/2] fix(core): preserve natural-language direction evidence --- .changeset/natural-language-evidence-bias.md | 29 ++++++++ CHANGELOG.md | 10 ++- IMPACT.md | 2 +- README.md | 6 +- action/dist/index.cjs | 24 +++++- action/dist/index.cjs.map | 4 +- android/README.md | 4 +- .../bidilens/core/TechnicalTokens.kt | 59 +++++++++++++-- .../bidilens/core/BidiCoreTest.kt | 20 +++++ .../bidilens/core/GeneratedCorpusFixtures.kt | 16 ++++ apple/Sources/BidiLens/BidiAnalyzer.swift | 49 ++++++++++-- apple/Tests/BidiLensTests/BidiLensTests.swift | 19 ++++- .../Tests/BidiLensTests/Resources/cases.json | 74 +++++++++++++++++++ corpus/cases.json | 74 +++++++++++++++++++ docs/ARCHITECTURE.md | 4 +- docs/LIMITATIONS.md | 8 ++ docs/OUTREACH.md | 2 +- docs/PROJECT_COMPARISON.md | 8 +- docs/REQUIREMENT_MATRIX.md | 14 ++-- docs/ROADMAP.md | 10 +-- packages/cli/corpus/cases.json | 74 +++++++++++++++++++ packages/core/src/core.test.ts | 40 ++++++++++ packages/core/src/detect.ts | 60 +++++++++++++-- packages/core/src/stream.ts | 31 +++++++- rust/BUILD_REPORT.md | 4 +- rust/README.md | 2 +- rust/src/technical.rs | 62 +++++++++++++--- rust/tests/conformance.rs | 29 +++++++- scripts/generate-corpus.ts | 31 ++++++++ scripts/release-check.ts | 7 +- windows/src/BidiLens.Core/BidiAnalyzer.cs | 48 ++++++++++-- windows/tests/BidiLens.Tests/Program.cs | 15 ++++ 32 files changed, 760 insertions(+), 79 deletions(-) create mode 100644 .changeset/natural-language-evidence-bias.md diff --git a/.changeset/natural-language-evidence-bias.md b/.changeset/natural-language-evidence-bias.md new file mode 100644 index 0000000..e8ff3c8 --- /dev/null +++ b/.changeset/natural-language-evidence-bias.md @@ -0,0 +1,29 @@ +--- +'@bidilens/core': patch +--- + +Stop treating ordinary English words as technical tokens, which biased mixed +blocks toward RTL. + +`isTechnicalIdentifier` excluded any word containing a hyphen and any all-capital +word from natural-language evidence. Because only tokens beginning with an ASCII +letter reach that test, every false exclusion removed LTR evidence and never RTL +evidence, so English-majority prose could resolve RTL — the mirror of the +`dir="auto"` failure this project exists to fix. `The well-known +state-of-the-art open-source کتابخانه` resolved `rtl` with zero LTR evidence +counted, and `PLEASE READ THIS IMPORTANT WARNING کتاب` resolved `rtl` after every +English word was discarded. + +A hyphen is now ordinary English compounding: a hyphenated token is technical +only when one of its segments is itself a known technical word, so +`react-markdown` and `web-app` stay excluded while `well-known`, +`state-of-the-art`, and `e-mail` remain direction evidence. Capitals are read per +block: a short all-capital token is an acronym inside mixed-case prose (`HTTP`, +`API`), but when capitals are the block's prose style the words stay evidence. +Digits, underscores, and dots remain structural identifier syntax. + +The incremental streaming classifier mirrors the same rules, and defers to the +exact batch policy when a block contains an all-capital word, since that decision +depends on the whole block. The Kotlin, Swift, .NET, and Rust cores carried the +same biased rule and are fixed in step. Two exact cross-platform fixtures keep +all five implementations aligned. diff --git a/CHANGELOG.md b/CHANGELOG.md index 48271a2..2d80eb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ is published under the public `@bidilens` npm scope. ## Unreleased +### Direction correctness + +- Kept ordinary hyphenated English compounds and block-level ALL-CAPS prose as + natural-language direction evidence while continuing to exclude technical + identifiers such as `react-markdown`, `GPT-5`, and mixed-case acronyms. +- Added shared cross-platform regressions for both evidence classes, bringing + the canonical direction corpus to 932 cases. + ### Release and verification - Pinned the supported CI runtimes to exact Node 22.12.0 and 24.15.0 releases @@ -44,7 +52,7 @@ is published under the public `@bidilens` npm scope. - Kept paragraph direction independent from physical alignment in Android Views, including immediate restoration of the caller's original gravity when content-driven alignment is disabled. -- Expanded Kotlin parity to the 930-case canonical corpus and added Views and +- Expanded Kotlin parity to the 932-case canonical corpus and added Views and Compose regressions for physical-left RTL rendering and pure-LTR no-op behavior. - Aligned the root and standalone-consumer Compose compiler plugins on Kotlin diff --git a/IMPACT.md b/IMPACT.md index 0f74fbd..53b0f06 100644 --- a/IMPACT.md +++ b/IMPACT.md @@ -4,7 +4,7 @@ - 12 public JavaScript packages with implementations, declarations, README, license, runnable example, and package-local assertion coverage; -- 930 schema-validated direction fixtures with numbered logical words; +- 932 schema-validated direction fixtures with numbered logical words; - 0 fixtures currently certified by a native-language reviewer; - property-based stream/source/range checks; - 396 unit/property/action tests with 94.80% overall and 95.81% core line coverage, diff --git a/README.md b/README.md index 7c81511..c55c9c7 100644 --- a/README.md +++ b/README.md @@ -122,16 +122,16 @@ reordering and shaping; BidiLens supplies the application structure they need. - safe HTML, DOM, unified/remark/rehype, markdown-it, React, Vue, Svelte, and Web Component adapters; - a conservative terminal adapter and a scriptable CLI; -- 930 schema-validated direction fixtures plus property-based random chunking; +- 932 schema-validated direction fixtures plus property-based random chunking; - native Android pure-Kotlin core, non-destructive Views adapter, Compose display/editable components, and a runnable photographed-case sample; - Android JVM, Robolectric, lint, APK/AAR, and API 35/36 device gates using the - same generated 930-case corpus; + same generated 932-case corpus; - a Swift Package with UIKit `UILabel`, `UITextView`, and `UITextField` adapters, a UIKit-backed SwiftUI `BidiText` view, and a .NET 8 core with WPF `TextBlock`/`TextBox` adapters; - a native Rust core with generated Unicode 17 tables, byte/UTF-16/code-point - ranges, all 930 direction fixtures, declared isolation/security conformance, + ranges, all 932 direction fixtures, declared isolation/security conformance, and Linux/macOS/Windows CI; - explicit alignment policy on native adapters, allowing an RTL paragraph to remain physically left-aligned without changing its base direction; diff --git a/action/dist/index.cjs b/action/dist/index.cjs index 4181e69..25399e7 100644 --- a/action/dist/index.cjs +++ b/action/dist/index.cjs @@ -6305,9 +6305,24 @@ function customTechnicalIdentifiers(values) { if (cacheable) CUSTOM_TECHNICAL_IDENTIFIER_CACHE.set(values, identifiers); return identifiers; } -function isTechnicalIdentifier(token, custom) { - const normalized = token.toLowerCase(); - return KNOWN_TECHNICAL_TOKENS.has(normalized) || custom.has(normalized) || /[0-9_.-]/u.test(token) || /^[A-Z]{2,}$/u.test(token) || /[a-z][A-Z]/u.test(token); +var ACRONYM_MAXIMUM_LENGTH = 5; +function isKnownTechnicalWord(value, custom) { + const normalized = value.toLowerCase(); + return KNOWN_TECHNICAL_TOKENS.has(normalized) || custom.has(normalized); +} +function usesUppercaseProse(text) { + const words = text.match(/\b[A-Za-z]{2,}\b/gu); + if (words === null || words.length < 2) return false; + let capitalized = 0; + for (const word of words) if (!/[a-z]/u.test(word)) capitalized += 1; + return capitalized * 2 > words.length; +} +function isTechnicalIdentifier(token, custom, uppercaseProse) { + if (isKnownTechnicalWord(token, custom)) return true; + if (token.includes("-") && token.split("-").some((segment) => segment !== "" && isKnownTechnicalWord(segment, custom))) { + return true; + } + return /[0-9_.]/u.test(token) || /[a-z][A-Z]/u.test(token) || !uppercaseProse && token.length <= ACRONYM_MAXIMUM_LENGTH && /^[A-Z]{2,}$/u.test(token); } function findTechnicalTokenRanges(text, technicalIdentifiers = []) { const ranges = []; @@ -6364,10 +6379,11 @@ function findTechnicalTokenRanges(text, technicalIdentifiers = []) { addMatches(text, ranges, /(? {\n try {\n const result = await runAction();\n process.exitCode = result.exitCode;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n process.stderr.write(`${workflowError(message)}\\n`);\n process.exitCode = 1;\n }\n}\n\nvoid main();\n", "import { appendFile, mkdir, writeFile } from 'node:fs/promises';\nimport { randomUUID } from 'node:crypto';\nimport { dirname, isAbsolute, relative, resolve } from 'node:path';\nimport process from 'node:process';\nimport { runCli } from '../../packages/cli/src/index.js';\n\nexport type ActionCommand = 'audit' | 'test';\nexport type ActionFormat = 'human' | 'json' | 'sarif';\nexport type ActionMode = 'off' | 'audit' | 'warn' | 'strict';\nexport type ActionRisk = 'low' | 'medium' | 'high';\n\nexport interface ActionInputs {\n command: ActionCommand;\n paths: string[];\n corpus: string;\n mode: ActionMode;\n failOn: ActionRisk;\n format: ActionFormat;\n sarifFile: string;\n}\n\nexport interface ActionContext {\n env?: NodeJS.ProcessEnv;\n cwd?: string;\n log?: (value: string) => void;\n error?: (value: string) => void;\n}\n\nexport interface ActionResult {\n exitCode: number;\n report: string;\n stdout: string;\n stderr: string;\n}\n\nfunction input(env: NodeJS.ProcessEnv, name: string): string {\n return env[`INPUT_${name.toUpperCase()}`]?.trim() ?? '';\n}\n\nfunction choice(\n name: string,\n value: string,\n fallback: Value,\n allowed: readonly Value[]\n): Value {\n const candidate = value || fallback;\n if (!allowed.includes(candidate as Value)) {\n throw new Error(`${name} must be one of ${allowed.join(', ')}; received ${JSON.stringify(candidate)}.`);\n }\n return candidate as Value;\n}\n\nexport function readActionInputs(env: NodeJS.ProcessEnv = process.env): ActionInputs {\n return {\n command: choice('command', input(env, 'COMMAND'), 'audit', ['audit', 'test']),\n paths: (input(env, 'PATHS') || '.').split(/\\r?\\n/u).map((path) => path.trim()).filter(Boolean),\n corpus: input(env, 'CORPUS'),\n mode: choice('mode', input(env, 'MODE'), 'audit', ['off', 'audit', 'warn', 'strict']),\n failOn: choice('fail-on', input(env, 'FAIL-ON'), 'high', ['low', 'medium', 'high']),\n format: choice('format', input(env, 'FORMAT'), 'human', ['human', 'json', 'sarif']),\n sarifFile: input(env, 'SARIF-FILE') || 'bidilens.sarif'\n };\n}\n\nexport function buildCliArguments(inputs: ActionInputs, env: NodeJS.ProcessEnv = process.env): string[] {\n if (inputs.command === 'test') {\n if (inputs.format === 'sarif') throw new Error('SARIF output is available only for the audit command.');\n const actionPath = env.GITHUB_ACTION_PATH\n ? resolve(env.GITHUB_ACTION_PATH)\n : resolve(env.GITHUB_WORKSPACE ?? process.cwd(), 'action');\n const corpus = inputs.corpus || resolve(actionPath, '..', 'corpus', 'cases.json');\n return ['node', 'bidilens', 'test', '--corpus', corpus, ...(inputs.format === 'json' ? ['--json'] : [])];\n }\n\n const format = inputs.format === 'json' ? ['--json'] : inputs.format === 'sarif' ? ['--sarif'] : [];\n return [\n 'node', 'bidilens', 'audit', ...inputs.paths,\n '--mode', inputs.mode,\n '--fail-on', inputs.failOn,\n ...format\n ];\n}\n\nfunction workspaceFile(cwd: string, requested: string): { absolute: string; relative: string } {\n const absolute = resolve(cwd, requested);\n const local = relative(cwd, absolute);\n if (!local || local.startsWith('..') || isAbsolute(local)) {\n throw new Error('sarif-file must resolve to a file inside GITHUB_WORKSPACE.');\n }\n return { absolute, relative: local.replaceAll('\\\\', '/') };\n}\n\nasync function setOutput(path: string | undefined, name: string, value: string): Promise {\n if (!path) return;\n const delimiter = `bidilens_${randomUUID()}`;\n await appendFile(path, `${name}<<${delimiter}\\n${value}\\n${delimiter}\\n`, 'utf8');\n}\n\n/** Executes the bundled CLI without a shell and propagates its real exit code. */\nexport async function runAction(context: ActionContext = {}): Promise {\n const env = context.env ?? process.env;\n const cwd = resolve(context.cwd ?? env.GITHUB_WORKSPACE ?? process.cwd());\n const log = context.log ?? console.log;\n const error = context.error ?? console.error;\n const inputs = readActionInputs(env);\n const stdout: string[] = [];\n const stderr: string[] = [];\n const exitCode = await runCli(buildCliArguments(inputs, env), {\n cwd,\n stdout: (value) => stdout.push(value),\n stderr: (value) => stderr.push(value)\n });\n const stdoutText = stdout.join('');\n const stderrText = stderr.join('');\n let report = '';\n\n if (inputs.format === 'sarif') {\n const target = workspaceFile(cwd, inputs.sarifFile);\n await mkdir(dirname(target.absolute), { recursive: true });\n await writeFile(target.absolute, stdoutText, 'utf8');\n report = target.relative;\n log(`BidiLens SARIF report written to ${report}.`);\n } else if (stdoutText) {\n log(stdoutText.trimEnd());\n }\n if (stderrText) error(stderrText.trimEnd());\n\n await setOutput(env.GITHUB_OUTPUT, 'exit-code', String(exitCode));\n await setOutput(env.GITHUB_OUTPUT, 'report', report);\n if (exitCode !== 0) error(`BidiLens ${inputs.command} failed with exit code ${exitCode}.`);\n return { exitCode, report, stdout: stdoutText, stderr: stderrText };\n}\n\nexport function workflowError(message: string): string {\n const escaped = message\n .replaceAll('%', '%25')\n .replaceAll('\\r', '%0D')\n .replaceAll('\\n', '%0A');\n return `::error title=BidiLens::${escaped}`;\n}\n", "#!/usr/bin/env node\nimport { lstat, readFile, readdir, writeFile } from 'node:fs/promises';\nimport { basename, extname, isAbsolute, relative, resolve } from 'node:path';\nimport process from 'node:process';\nimport { pathToFileURL } from 'node:url';\nimport { Command, CommanderError } from 'commander';\nimport { renderBidiHtml } from '@bidilens/html';\nimport packageManifest from '../package.json' with { type: 'json' };\nimport {\n analyzeText,\n findBidiControls,\n sanitizeBidiControls,\n scanBidiSecurity,\n visibleBidiControls,\n type BidiControlRisk,\n type BidiInterventionMode,\n type BidiSecurityFinding,\n type BidiSecurityMode\n} from '@bidilens/core';\n\nconst SUPPORTED_EXTENSIONS = new Set([\n '.md', '.mdx', '.txt', '.html', '.htm', '.json', '.yaml', '.yml',\n '.js', '.jsx', '.ts', '.tsx', '.css', '.scss', '.py', '.go', '.rs',\n '.java', '.kt', '.swift', '.c', '.cc', '.cpp', '.h', '.hpp', '.toml',\n '.vue', '.svelte', '.astro', '.dart', '.xml', '.svg', '.sh', '.bash',\n '.zsh', '.fish', '.cs', '.fs', '.fsx', '.vb', '.rb', '.php', '.sql',\n '.ini', '.conf', '.properties', '.gradle', '.groovy', '.lua', '.pl', '.r',\n '.ex', '.exs', '.erl', '.hrl'\n]);\n\nconst SUPPORTED_BASENAMES = new Set([\n 'dockerfile', 'makefile', 'gemfile', 'podfile', 'rakefile', 'cmakelists.txt',\n 'build', 'workspace', '.env'\n]);\n\nconst IGNORED_DIRECTORIES = new Set([\n 'node_modules', '.git', 'dist', 'build', 'coverage', 'test-results',\n 'playwright-report', '.vite', '.next', '.nuxt', '.svelte-kit', '.output'\n]);\n\nconst RISK_ORDER: Record = { low: 1, medium: 2, high: 3 };\nconst CLI_VERSION = packageManifest.version;\n\ninterface CorpusCase {\n id: string;\n text: string;\n expected: 'ltr' | 'rtl' | 'neutral';\n}\n\nexport interface CliRuntime {\n cwd?: string;\n stdout?: (value: string) => void;\n stderr?: (value: string) => void;\n}\n\ninterface RuntimeState {\n cwd: string;\n stdout: (value: string) => void;\n stderr: (value: string) => void;\n exitCode: number;\n}\n\nfunction createRuntime(runtime: CliRuntime): RuntimeState {\n return {\n cwd: resolve(runtime.cwd ?? process.cwd()),\n stdout: runtime.stdout ?? ((value) => process.stdout.write(value)),\n stderr: runtime.stderr ?? ((value) => process.stderr.write(value)),\n exitCode: 0\n };\n}\n\nfunction line(writer: (value: string) => void, value = ''): void {\n writer(`${value}\\n`);\n}\n\nasync function collectFiles(inputs: string[], cwd: string): Promise {\n const files: string[] = [];\n async function visitPath(input: string, explicitlyNamed: boolean): Promise {\n const absolute = resolve(cwd, input);\n const info = await lstat(absolute);\n if (info.isSymbolicLink()) return;\n if (info.isDirectory()) {\n const entries = await readdir(absolute, { withFileTypes: true });\n entries.sort((a, b) => a.name.localeCompare(b.name));\n for (const entry of entries) {\n if (IGNORED_DIRECTORIES.has(entry.name.toLowerCase())) continue;\n if (entry.isSymbolicLink()) continue;\n await visitPath(resolve(absolute, entry.name), false);\n }\n return;\n }\n const name = basename(absolute).toLowerCase();\n const supportedName = SUPPORTED_BASENAMES.has(name) || name.startsWith('.env.');\n if (info.isFile() && (explicitlyNamed || supportedName || SUPPORTED_EXTENSIONS.has(extname(absolute).toLowerCase()))) {\n files.push(absolute);\n }\n }\n for (const input of inputs) await visitPath(input, true);\n return files.sort((a, b) => a.localeCompare(b));\n}\n\nfunction parseCorpus(source: string, location: string): CorpusCase[] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(source);\n } catch (error) {\n throw new Error(`${location} is not valid JSON. ${String(error)}`, { cause: error });\n }\n if (!Array.isArray(parsed)) throw new Error(`${location} must contain a JSON array.`);\n const ids = new Set();\n return parsed.map((item: unknown, index) => {\n if (typeof item !== 'object' || item === null) {\n throw new Error(`${location}: case ${index + 1} must be an object.`);\n }\n const candidate = item as Record;\n if (typeof candidate.id !== 'string' || candidate.id.length === 0) {\n throw new Error(`${location}: case ${index + 1} must have a non-empty string id.`);\n }\n if (ids.has(candidate.id)) throw new Error(`${location}: duplicate case id \"${candidate.id}\".`);\n ids.add(candidate.id);\n if (typeof candidate.text !== 'string') {\n throw new Error(`${location}: case \"${candidate.id}\" must have string text.`);\n }\n if (candidate.expected !== 'ltr' && candidate.expected !== 'rtl' && candidate.expected !== 'neutral') {\n throw new Error(`${location}: case \"${candidate.id}\" has invalid expected direction.`);\n }\n return { id: candidate.id, text: candidate.text, expected: candidate.expected };\n });\n}\n\nasync function readCorpus(cwd: string, explicitPath?: string): Promise {\n if (explicitPath !== undefined) {\n const location = resolve(cwd, explicitPath);\n return parseCorpus(await readFile(location, 'utf8'), location);\n }\n const candidates: Array = [\n resolve(cwd, 'corpus/cases.json'),\n new URL('../corpus/cases.json', import.meta.url),\n new URL('../../../corpus/cases.json', import.meta.url)\n ];\n let lastError: unknown;\n for (const candidate of candidates) {\n let source: string;\n try {\n source = await readFile(candidate, 'utf8');\n } catch (error) {\n lastError = error;\n continue;\n }\n // An existing, malformed higher-priority corpus is a configuration error,\n // not a reason to silently fall back to a different data set.\n return parseCorpus(source, String(candidate));\n }\n throw new Error(`Unable to locate corpus/cases.json. Pass --corpus . ${String(lastError)}`);\n}\n\nfunction parseRisk(value: string): BidiControlRisk {\n if (value === 'low' || value === 'medium' || value === 'high') return value;\n throw new Error(`Invalid risk level: ${value}`);\n}\n\nfunction parseSecurityMode(value: string): BidiSecurityMode {\n if (value === 'off' || value === 'audit' || value === 'warn' || value === 'strict') return value;\n throw new Error(`Invalid security mode: ${value}`);\n}\n\nfunction parseIntervention(value: string): BidiInterventionMode {\n if (value === 'auto' || value === 'always') return value;\n throw new Error(`Invalid intervention mode: ${value}`);\n}\n\nfunction riskForFinding(finding: BidiSecurityFinding): BidiControlRisk {\n if (finding.severity === 'high') return 'high';\n if (finding.severity === 'warning') return 'medium';\n return 'low';\n}\n\nfunction highestFindingRisk(findings: readonly BidiSecurityFinding[]): BidiControlRisk | null {\n if (findings.some((finding) => finding.severity === 'high')) return 'high';\n if (findings.some((finding) => finding.severity === 'warning')) return 'medium';\n if (findings.length) return 'low';\n return null;\n}\n\nfunction sourcePosition(text: string, utf16Offset: number): { line: number; column: number } {\n let lineNumber = 1;\n let lineStart = 0;\n const newline = /\\r\\n|\\n|\\r/gu;\n let match: RegExpExecArray | null;\n while ((match = newline.exec(text)) !== null && match.index < utf16Offset) {\n lineNumber += 1;\n lineStart = match.index + match[0].length;\n }\n return { line: lineNumber, column: utf16Offset - lineStart + 1 };\n}\n\nfunction artifactUri(file: string, cwd: string): string {\n const local = relative(cwd, file);\n if (local && !local.startsWith('..') && !isAbsolute(local)) return local.replaceAll('\\\\', '/');\n return pathToFileURL(file).href;\n}\n\ninterface SecurityFileReport {\n file: string;\n text: string;\n findings: BidiSecurityFinding[];\n highestRisk: BidiControlRisk | null;\n}\n\nasync function readTextInput(\n options: { text?: string; file?: string },\n cwd: string\n): Promise {\n if (options.text === undefined && options.file === undefined) {\n throw new Error('Provide --text or --file.');\n }\n if (options.text !== undefined && options.file !== undefined) {\n throw new Error('Choose either --text or --file, not both.');\n }\n return options.file !== undefined\n ? readFile(resolve(cwd, options.file), 'utf8')\n : options.text!;\n}\n\nfunction sarifForReports(reports: readonly SecurityFileReport[], cwd: string): object {\n return {\n version: '2.1.0',\n $schema: 'https://json.schemastore.org/sarif-2.1.0.json',\n runs: [{\n columnKind: 'utf16CodeUnits',\n tool: { driver: { name: 'BidiLens', semanticVersion: CLI_VERSION } },\n results: reports.flatMap((report) => report.findings.map((finding) => {\n const start = sourcePosition(report.text, finding.sourceRange.utf16.start);\n const end = sourcePosition(report.text, finding.sourceRange.utf16.end);\n return {\n ruleId: finding.code,\n level: finding.severity === 'high' ? 'error' : finding.severity === 'warning' ? 'warning' : 'note',\n message: { text: `${finding.message} ${finding.remediation}` },\n locations: [{\n physicalLocation: {\n artifactLocation: { uri: artifactUri(report.file, cwd) },\n region: {\n startLine: start.line,\n startColumn: start.column,\n endLine: end.line,\n endColumn: end.column\n }\n }\n }]\n };\n }))\n }]\n };\n}\n\nfunction createCliProgram(state: RuntimeState): Command {\n const program = new Command();\n program\n .name('bidilens')\n .description('Inspect and secure mixed bidirectional text')\n .version(CLI_VERSION)\n .exitOverride()\n .configureOutput({ writeOut: state.stdout, writeErr: state.stderr });\n\n program.command('inspect')\n .description('Analyze a string or file')\n .option('-t, --text ', 'text to inspect')\n .option('-f, --file ', 'file to inspect')\n .option('--json', 'emit JSON')\n .action(async (options: { text?: string; file?: string; json?: boolean }) => {\n const text = await readTextInput(options, state.cwd);\n const analysis = analyzeText(text, { strategy: 'content-majority', fallback: 'neutral' });\n const controls = findBidiControls(text);\n const report = { analysis, controls, visible: controls.length ? visibleBidiControls(text) : text };\n if (options.json) line(state.stdout, JSON.stringify(report, null, 2));\n else {\n line(state.stdout, `Direction: ${analysis.direction}`);\n line(state.stdout, `Confidence: ${analysis.confidence}`);\n line(state.stdout, `Strong characters: RTL ${analysis.counts.rtl}, LTR ${analysis.counts.ltr}`);\n line(state.stdout, `Paragraphs: ${analysis.paragraphs.length}`);\n line(state.stdout, `Bidi controls: ${controls.length}`);\n if (controls.length) line(state.stdout, report.visible);\n }\n });\n\n program.command('render')\n .description('Render plain text as escaped, semantic direction-aware HTML')\n .option('-t, --text ', 'text to render')\n .option('-f, --file ', 'file to render')\n .option('--intervention ', 'auto or always', parseIntervention, 'auto')\n .option('--json', 'emit analysis and HTML as JSON')\n .action(async (options: {\n text?: string;\n file?: string;\n intervention: BidiInterventionMode;\n json?: boolean;\n }) => {\n const text = await readTextInput(options, state.cwd);\n const result = renderBidiHtml(text, { intervention: options.intervention });\n line(state.stdout, options.json\n ? JSON.stringify({ analysis: result.analysis, html: result.html }, null, 2)\n : result.html);\n });\n\n program.command('audit')\n .aliases(['security-scan', 'lint'])\n .description('Audit files for hidden and unbalanced bidi controls')\n .argument('', 'files or directories')\n .option('--json', 'emit JSON')\n .option('--sarif', 'emit SARIF 2.1.0')\n .option('--mode ', 'off, audit, warn, or strict', parseSecurityMode, 'audit')\n .option('--fail-on ', 'minimum risk that exits non-zero', parseRisk, 'high')\n .action(async (paths: string[], options: {\n json?: boolean;\n sarif?: boolean;\n mode: BidiSecurityMode;\n failOn: BidiControlRisk;\n }) => {\n if (options.json && options.sarif) throw new Error('Choose either --json or --sarif, not both.');\n const files = await collectFiles(paths, state.cwd);\n const reports: SecurityFileReport[] = [];\n let shouldFail = false;\n\n for (const file of files) {\n const text = await readFile(file, 'utf8');\n const security = scanBidiSecurity(text, { mode: options.mode });\n if (!security.findings.length) continue;\n const highestRisk = highestFindingRisk(security.findings);\n reports.push({ file, text, findings: security.findings, highestRisk });\n if (security.shouldBlock || (highestRisk && RISK_ORDER[highestRisk] >= RISK_ORDER[options.failOn])) shouldFail = true;\n }\n\n if (options.sarif) line(state.stdout, JSON.stringify(sarifForReports(reports, state.cwd), null, 2));\n else if (options.json) {\n line(state.stdout, JSON.stringify({\n scanned: files.length,\n reports: reports.map((report) => ({\n file: report.file,\n findings: report.findings,\n highestRisk: report.highestRisk\n }))\n }, null, 2));\n } else if (!reports.length) line(state.stdout, `No bidi security findings in ${files.length} files.`);\n else {\n for (const report of reports) {\n line(state.stdout, `\\n${report.file} (${report.highestRisk ?? 'unknown'})`);\n for (const finding of report.findings) {\n const position = sourcePosition(report.text, finding.sourceRange.utf16.start);\n line(state.stdout, ` ${finding.code} at ${position.line}:${position.column} [${riskForFinding(finding)}] ${finding.message}`);\n }\n }\n }\n if (shouldFail) state.exitCode = Math.max(state.exitCode, 2);\n });\n\n program.command('test')\n .description('Run the direction conformance corpus')\n .option('--json', 'emit failures as JSON')\n .option('--corpus ', 'corpus JSON path; defaults to the bundled corpus or repository corpus')\n .action(async (options: { json?: boolean; corpus?: string }) => {\n const corpus = await readCorpus(state.cwd, options.corpus);\n const failures = corpus.flatMap((item) => {\n const actual = analyzeText(item.text, { strategy: 'content-majority', fallback: 'neutral' }).direction;\n return actual === item.expected ? [] : [{ id: item.id, expected: item.expected, actual }];\n });\n if (options.json) line(state.stdout, JSON.stringify({ total: corpus.length, failures }, null, 2));\n else line(state.stdout, `Corpus: ${corpus.length - failures.length}/${corpus.length} passed`);\n if (failures.length) state.exitCode = Math.max(state.exitCode, 1);\n });\n\n program.command('sanitize')\n .description('Remove bidi controls from one file')\n .argument('', 'input file')\n .option('-o, --output ', 'output path; defaults to stdout')\n .option('--keep-low', 'preserve low-risk ALM/LRM/RLM marks')\n .action(async (file: string, options: { output?: string; keepLow?: boolean }) => {\n const text = await readFile(resolve(state.cwd, file), 'utf8');\n const remove: BidiControlRisk[] = options.keepLow ? ['high', 'medium'] : ['high', 'medium', 'low'];\n const result = sanitizeBidiControls(text, { remove });\n if (options.output) {\n const output = resolve(state.cwd, options.output);\n await writeFile(output, result.text, 'utf8');\n line(state.stderr, `Removed ${result.removed.length} controls and wrote ${output}.`);\n } else {\n state.stdout(result.text);\n }\n });\n\n return program;\n}\n\nexport async function runCli(argv: readonly string[] = process.argv, runtime: CliRuntime = {}): Promise {\n const state = createRuntime(runtime);\n const program = createCliProgram(state);\n try {\n await program.parseAsync([...argv], { from: 'node' });\n } catch (error) {\n if (error instanceof CommanderError) return Math.max(state.exitCode, error.exitCode);\n const message = error instanceof Error ? error.message : String(error);\n line(state.stderr, `bidilens: ${message}`);\n return Math.max(state.exitCode, 1);\n }\n return state.exitCode;\n}\n", "/**\n * CommanderError class\n */\nexport class 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 */\nexport class 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", "import { InvalidArgumentError } from './error.js';\n\nexport class 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. \n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.endsWith('...')) {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nexport function humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n", "import { EventEmitter } from 'node:events';\nimport childProcess from 'node:child_process';\nimport path from 'node:path';\nimport fs from 'node:fs';\nimport process from 'node:process';\nimport { stripVTControlCharacters } from 'node:util';\n\nimport { Argument, humanReadableArgName } from './argument.js';\nimport { CommanderError } from './error.js';\nimport { Help } from './help.js';\nimport { Option, DualOptions } from './option.js';\nimport { suggestSimilar } from './suggestSimilar.js';\n\nexport class 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) => stripVTControlCharacters(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n /** @type {string | undefined} */\n this._helpGroupHeading = undefined; // soft initialised when added to parent\n /** @type {string | undefined} */\n this._defaultCommandGroup = undefined;\n /** @type {string | undefined} */\n this._defaultOptionGroup = undefined;\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone [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 ', '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 `` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n this._outputConfiguration = {\n ...this._outputConfiguration,\n ...configuration,\n };\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom argument processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, parseArg, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof parseArg === 'function') {\n argument.default(defaultValue).argParser(parseArg);\n } else {\n argument.default(parseArg);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments(' [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument?.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n if (enableOrNameAndArgs && this._defaultCommandGroup) {\n // make the command to store the group\n this._initCommandGroup(this._getHelpCommand());\n }\n return this;\n }\n\n const nameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = nameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n // init group unless lazy create\n if (enableOrNameAndArgs || description) this._initCommandGroup(helpCommand);\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n this._initCommandGroup(helpCommand);\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this._initOptionGroup(option);\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this._initCommandGroup(command);\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._collectValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type ', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip ', '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 // Save the state the first time, then restore the state before each subsequent parse.\n if (this._savedState === null) {\n // Do the special default of lone negated option to true, now that we have all the options.\n // Filter for negated options that have not been processed already.\n this.options\n .filter(\n (option) =>\n option.negate &&\n option.defaultValue === undefined &&\n this.getOptionValue(option.attributeName()) === undefined,\n )\n .forEach((option) => {\n // check for lone negated option: --no-foo without a --foo option\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n option.attributeName(),\n true,\n 'default',\n );\n }\n });\n\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 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 const launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise?.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent?.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} args\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(args) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n const negativeNumberArg = (arg) => {\n // return false if not a negative number\n if (!/^-(\\d+|\\d*\\.\\d+)(e[+-]?\\d+)?$/.test(arg)) return false;\n // negative number is ok unless digit used as an option in command hierarchy\n return !this._getCommandAndAncestors().some((cmd) =>\n cmd.options\n .map((opt) => opt.short)\n .some((short) => /^-\\d$/.test(short)),\n );\n };\n\n // parse options\n let activeVariadicOption = null;\n let activeGroup = null; // working through group of short options, like -abc\n let i = 0;\n while (i < args.length || activeGroup) {\n const arg = activeGroup ?? args[i++];\n activeGroup = null;\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args.slice(i));\n break;\n }\n\n if (\n activeVariadicOption &&\n (!maybeOption(arg) || negativeNumberArg(arg))\n ) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args[i++];\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (\n i < args.length &&\n (!maybeOption(args[i]) || negativeNumberArg(args[i]))\n ) {\n value = args[i++];\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option\n this.emit(`option:${option.name()}`);\n // remove the processed option and keep processing group\n activeGroup = `-${arg.slice(2)}`;\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n // A negative number in a leaf command is not an unknown option.\n if (\n dest === operands &&\n maybeOption(arg) &&\n !(this.commands.length === 0 && negativeNumberArg(arg))\n ) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n unknown.push(...args.slice(i));\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg, ...args.slice(i));\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg, ...args.slice(i));\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg, ...args.slice(i));\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const received = receivedArgs.length;\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const details = receivedArgs.join(', ');\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${received}: ${details}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set/get the help group heading for this subcommand in parent command's help.\n *\n * @param {string} [heading]\n * @return {Command | string}\n */\n\n helpGroup(heading) {\n if (heading === undefined) return this._helpGroupHeading ?? '';\n this._helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n commandsGroup(heading) {\n if (heading === undefined) return this._defaultCommandGroup ?? '';\n this._defaultCommandGroup = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n optionsGroup(heading) {\n if (heading === undefined) return this._defaultOptionGroup ?? '';\n this._defaultOptionGroup = heading;\n return this;\n }\n\n /**\n * @param {Option} option\n * @private\n */\n _initOptionGroup(option) {\n if (this._defaultOptionGroup && !option.helpGroupHeading)\n option.helpGroup(this._defaultOptionGroup);\n }\n\n /**\n * @param {Command} cmd\n * @private\n */\n _initCommandGroup(cmd) {\n if (this._defaultCommandGroup && !cmd.helpGroup())\n cmd.helpGroup(this._defaultCommandGroup);\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or import.meta.filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(import.meta.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(import.meta.dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support enabling/disabling built-in help option.\n if (typeof flags === 'boolean') {\n if (flags) {\n if (this._helpOption === null) this._helpOption = undefined; // reenable\n if (this._defaultOptionGroup) {\n // make the option to store the group\n this._initOptionGroup(this._getHelpOption());\n }\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n this._helpOption = this.createOption(\n flags ?? '-h, --help',\n description ?? 'display help for command',\n );\n // init group unless lazy create\n if (flags || description) this._initOptionGroup(this._helpOption);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n this._initOptionGroup(option);\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * Exported for using from tests, not otherwise used outside this file.\n *\n * @returns {boolean | undefined}\n * @package\n */\nexport function 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", "import { humanReadableArgName } from './argument.js';\nimport { stripVTControlCharacters } from 'node:util';\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.\nexport class Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (option.description) {\n return `${option.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n *\n * @param {string} heading\n * @param {string[]} items\n * @param {Help} helper\n * @returns string[]\n */\n formatItemList(heading, items, helper) {\n if (items.length === 0) return [];\n\n return [helper.styleTitle(heading), ...items, ''];\n }\n\n /**\n * Group items by their help group heading.\n *\n * @param {Command[] | Option[]} unsortedItems\n * @param {Command[] | Option[]} visibleItems\n * @param {Function} getGroup\n * @returns {Map}\n */\n groupItems(unsortedItems, visibleItems, getGroup) {\n const result = new Map();\n // Add groups in order of appearance in unsortedItems.\n unsortedItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) result.set(group, []);\n });\n // Add items in order of appearance in visibleItems.\n visibleItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) {\n result.set(group, []);\n }\n result.get(group).push(item);\n });\n return result;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n output = output.concat(\n this.formatItemList('Arguments:', argumentList, helper),\n );\n\n // Options\n const optionGroups = this.groupItems(\n cmd.options,\n helper.visibleOptions(cmd),\n (option) => option.helpGroupHeading ?? 'Options:',\n );\n optionGroups.forEach((options, group) => {\n const optionList = options.map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(this.formatItemList(group, optionList, helper));\n });\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(\n this.formatItemList('Global Options:', globalOptionList, helper),\n );\n }\n\n // Commands\n const commandGroups = this.groupItems(\n cmd.commands,\n helper.visibleCommands(cmd),\n (sub) => sub.helpGroup() || 'Commands:',\n );\n commandGroups.forEach((commands, group) => {\n const commandList = commands.map((sub) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(sub)),\n helper.styleSubcommandDescription(helper.subcommandDescription(sub)),\n );\n });\n output = output.concat(this.formatItemList(group, commandList, helper));\n });\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripVTControlCharacters(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] [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] [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", "import { InvalidArgumentError } from './error.js';\n\nexport class 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 et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n this.helpGroupHeading = undefined; // soft initialised when option added to command\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Set the help group heading.\n *\n * @param {string} heading\n * @return {Option}\n */\n helpGroup(heading) {\n this.helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nexport class 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 '\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", "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau\u2013Levenshtein_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;\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\nexport function 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", "import { Argument } from './lib/argument.js';\nimport { Command } from './lib/command.js';\nimport { CommanderError, InvalidArgumentError } from './lib/error.js';\nimport { Help } from './lib/help.js';\nimport { Option } from './lib/option.js';\n\nexport const program = new Command();\n\nexport const createCommand = (name) => new Command(name);\nexport const createOption = (flags, description) =>\n new Option(flags, description);\nexport const createArgument = (name, description) =>\n new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexport { Command, Option, Argument, Help };\nexport { CommanderError, InvalidArgumentError };\nexport { InvalidArgumentError as InvalidOptionArgumentError }; // Deprecated\n", "// Generated by scripts/generate-bidi-data.ts. Do not edit by hand.\n// Source: https://www.unicode.org/Public/17.0.0/ucd/extracted/DerivedBidiClass.txt\n// SHA-256: 4867b4b7f0731ed1bfcd34cc6251211ff1542541fce0734b6fbda139ee80b3a4\n// Source: https://www.unicode.org/Public/17.0.0/ucd/extracted/DerivedGeneralCategory.txt\n// SHA-256: d62e5bab70ca74f099343f71224fa051cb1fdd61a1ab45c0488c44cfc0b6102e\n\nexport const UNICODE_BIDI_VERSION = '17.0.0';\nexport const UNICODE_BIDI_SHA256 = '4867b4b7f0731ed1bfcd34cc6251211ff1542541fce0734b6fbda139ee80b3a4';\nexport const UNICODE_GENERAL_CATEGORY_SHA256 = 'd62e5bab70ca74f099343f71224fa051cb1fdd61a1ab45c0488c44cfc0b6102e';\n\nexport const RTL_BIDI_RANGES: ReadonlyArray = [\n 0x590, 0x590,\n 0x5be, 0x5be,\n 0x5c0, 0x5c0,\n 0x5c3, 0x5c3,\n 0x5c6, 0x5c6,\n 0x5c8, 0x5ff,\n 0x608, 0x608,\n 0x60b, 0x60b,\n 0x60d, 0x60d,\n 0x61b, 0x64a,\n 0x66d, 0x66f,\n 0x671, 0x6d5,\n 0x6e5, 0x6e6,\n 0x6ee, 0x6ef,\n 0x6fa, 0x710,\n 0x712, 0x72f,\n 0x74b, 0x7a5,\n 0x7b1, 0x7ea,\n 0x7f4, 0x7f5,\n 0x7fa, 0x7fc,\n 0x7fe, 0x815,\n 0x81a, 0x81a,\n 0x824, 0x824,\n 0x828, 0x828,\n 0x82e, 0x858,\n 0x85c, 0x88f,\n 0x892, 0x896,\n 0x8a0, 0x8c9,\n 0x200f, 0x200f,\n 0xfb1d, 0xfb1d,\n 0xfb1f, 0xfb28,\n 0xfb2a, 0xfbc2,\n 0xfbd3, 0xfd3d,\n 0xfd50, 0xfd8f,\n 0xfd92, 0xfdc7,\n 0xfdf0, 0xfdfc,\n 0xfe70, 0xfefe,\n 0x10800, 0x1091e,\n 0x10920, 0x10a00,\n 0x10a04, 0x10a04,\n 0x10a07, 0x10a0b,\n 0x10a10, 0x10a37,\n 0x10a3b, 0x10a3e,\n 0x10a40, 0x10ae4,\n 0x10ae7, 0x10b38,\n 0x10b40, 0x10d23,\n 0x10d28, 0x10d2f,\n 0x10d3a, 0x10d3f,\n 0x10d4a, 0x10d68,\n 0x10d6f, 0x10e5f,\n 0x10e7f, 0x10eaa,\n 0x10ead, 0x10ecf,\n 0x10ed9, 0x10ef9,\n 0x10f00, 0x10f45,\n 0x10f51, 0x10f81,\n 0x10f86, 0x10fff,\n 0x1e800, 0x1e8cf,\n 0x1e8d7, 0x1e943,\n 0x1e94b, 0x1eeef,\n 0x1eef2, 0x1efff\n];\n\nexport const NON_STRONG_BIDI_RANGES: ReadonlyArray = [\n 0x0, 0x40,\n 0x5b, 0x60,\n 0x7b, 0xa9,\n 0xab, 0xb4,\n 0xb6, 0xb9,\n 0xbb, 0xbf,\n 0xd7, 0xd7,\n 0xf7, 0xf7,\n 0x2b9, 0x2ba,\n 0x2c2, 0x2cf,\n 0x2d2, 0x2df,\n 0x2e5, 0x2ed,\n 0x2ef, 0x36f,\n 0x374, 0x375,\n 0x37e, 0x37e,\n 0x384, 0x385,\n 0x387, 0x387,\n 0x3f6, 0x3f6,\n 0x483, 0x489,\n 0x58a, 0x58a,\n 0x58d, 0x58f,\n 0x591, 0x5bd,\n 0x5bf, 0x5bf,\n 0x5c1, 0x5c2,\n 0x5c4, 0x5c5,\n 0x5c7, 0x5c7,\n 0x600, 0x607,\n 0x609, 0x60a,\n 0x60c, 0x60c,\n 0x60e, 0x61a,\n 0x64b, 0x66c,\n 0x670, 0x670,\n 0x6d6, 0x6e4,\n 0x6e7, 0x6ed,\n 0x6f0, 0x6f9,\n 0x711, 0x711,\n 0x730, 0x74a,\n 0x7a6, 0x7b0,\n 0x7eb, 0x7f3,\n 0x7f6, 0x7f9,\n 0x7fd, 0x7fd,\n 0x816, 0x819,\n 0x81b, 0x823,\n 0x825, 0x827,\n 0x829, 0x82d,\n 0x859, 0x85b,\n 0x890, 0x891,\n 0x897, 0x89f,\n 0x8ca, 0x902,\n 0x93a, 0x93a,\n 0x93c, 0x93c,\n 0x941, 0x948,\n 0x94d, 0x94d,\n 0x951, 0x957,\n 0x962, 0x963,\n 0x981, 0x981,\n 0x9bc, 0x9bc,\n 0x9c1, 0x9c4,\n 0x9cd, 0x9cd,\n 0x9e2, 0x9e3,\n 0x9f2, 0x9f3,\n 0x9fb, 0x9fb,\n 0x9fe, 0x9fe,\n 0xa01, 0xa02,\n 0xa3c, 0xa3c,\n 0xa41, 0xa42,\n 0xa47, 0xa48,\n 0xa4b, 0xa4d,\n 0xa51, 0xa51,\n 0xa70, 0xa71,\n 0xa75, 0xa75,\n 0xa81, 0xa82,\n 0xabc, 0xabc,\n 0xac1, 0xac5,\n 0xac7, 0xac8,\n 0xacd, 0xacd,\n 0xae2, 0xae3,\n 0xaf1, 0xaf1,\n 0xafa, 0xaff,\n 0xb01, 0xb01,\n 0xb3c, 0xb3c,\n 0xb3f, 0xb3f,\n 0xb41, 0xb44,\n 0xb4d, 0xb4d,\n 0xb55, 0xb56,\n 0xb62, 0xb63,\n 0xb82, 0xb82,\n 0xbc0, 0xbc0,\n 0xbcd, 0xbcd,\n 0xbf3, 0xbfa,\n 0xc00, 0xc00,\n 0xc04, 0xc04,\n 0xc3c, 0xc3c,\n 0xc3e, 0xc40,\n 0xc46, 0xc48,\n 0xc4a, 0xc4d,\n 0xc55, 0xc56,\n 0xc62, 0xc63,\n 0xc78, 0xc7e,\n 0xc81, 0xc81,\n 0xcbc, 0xcbc,\n 0xccc, 0xccd,\n 0xce2, 0xce3,\n 0xd00, 0xd01,\n 0xd3b, 0xd3c,\n 0xd41, 0xd44,\n 0xd4d, 0xd4d,\n 0xd62, 0xd63,\n 0xd81, 0xd81,\n 0xdca, 0xdca,\n 0xdd2, 0xdd4,\n 0xdd6, 0xdd6,\n 0xe31, 0xe31,\n 0xe34, 0xe3a,\n 0xe3f, 0xe3f,\n 0xe47, 0xe4e,\n 0xeb1, 0xeb1,\n 0xeb4, 0xebc,\n 0xec8, 0xece,\n 0xf18, 0xf19,\n 0xf35, 0xf35,\n 0xf37, 0xf37,\n 0xf39, 0xf3d,\n 0xf71, 0xf7e,\n 0xf80, 0xf84,\n 0xf86, 0xf87,\n 0xf8d, 0xf97,\n 0xf99, 0xfbc,\n 0xfc6, 0xfc6,\n 0x102d, 0x1030,\n 0x1032, 0x1037,\n 0x1039, 0x103a,\n 0x103d, 0x103e,\n 0x1058, 0x1059,\n 0x105e, 0x1060,\n 0x1071, 0x1074,\n 0x1082, 0x1082,\n 0x1085, 0x1086,\n 0x108d, 0x108d,\n 0x109d, 0x109d,\n 0x135d, 0x135f,\n 0x1390, 0x1399,\n 0x1400, 0x1400,\n 0x1680, 0x1680,\n 0x169b, 0x169c,\n 0x1712, 0x1714,\n 0x1732, 0x1733,\n 0x1752, 0x1753,\n 0x1772, 0x1773,\n 0x17b4, 0x17b5,\n 0x17b7, 0x17bd,\n 0x17c6, 0x17c6,\n 0x17c9, 0x17d3,\n 0x17db, 0x17db,\n 0x17dd, 0x17dd,\n 0x17f0, 0x17f9,\n 0x1800, 0x180f,\n 0x1885, 0x1886,\n 0x18a9, 0x18a9,\n 0x1920, 0x1922,\n 0x1927, 0x1928,\n 0x1932, 0x1932,\n 0x1939, 0x193b,\n 0x1940, 0x1940,\n 0x1944, 0x1945,\n 0x19de, 0x19ff,\n 0x1a17, 0x1a18,\n 0x1a1b, 0x1a1b,\n 0x1a56, 0x1a56,\n 0x1a58, 0x1a5e,\n 0x1a60, 0x1a60,\n 0x1a62, 0x1a62,\n 0x1a65, 0x1a6c,\n 0x1a73, 0x1a7c,\n 0x1a7f, 0x1a7f,\n 0x1ab0, 0x1add,\n 0x1ae0, 0x1aeb,\n 0x1b00, 0x1b03,\n 0x1b34, 0x1b34,\n 0x1b36, 0x1b3a,\n 0x1b3c, 0x1b3c,\n 0x1b42, 0x1b42,\n 0x1b6b, 0x1b73,\n 0x1b80, 0x1b81,\n 0x1ba2, 0x1ba5,\n 0x1ba8, 0x1ba9,\n 0x1bab, 0x1bad,\n 0x1be6, 0x1be6,\n 0x1be8, 0x1be9,\n 0x1bed, 0x1bed,\n 0x1bef, 0x1bf1,\n 0x1c2c, 0x1c33,\n 0x1c36, 0x1c37,\n 0x1cd0, 0x1cd2,\n 0x1cd4, 0x1ce0,\n 0x1ce2, 0x1ce8,\n 0x1ced, 0x1ced,\n 0x1cf4, 0x1cf4,\n 0x1cf8, 0x1cf9,\n 0x1dc0, 0x1dff,\n 0x1fbd, 0x1fbd,\n 0x1fbf, 0x1fc1,\n 0x1fcd, 0x1fcf,\n 0x1fdd, 0x1fdf,\n 0x1fed, 0x1fef,\n 0x1ffd, 0x1ffe,\n 0x2000, 0x200d,\n 0x2010, 0x2070,\n 0x2074, 0x207e,\n 0x2080, 0x208e,\n 0x20a0, 0x20f0,\n 0x2100, 0x2101,\n 0x2103, 0x2106,\n 0x2108, 0x2109,\n 0x2114, 0x2114,\n 0x2116, 0x2118,\n 0x211e, 0x2123,\n 0x2125, 0x2125,\n 0x2127, 0x2127,\n 0x2129, 0x2129,\n 0x212e, 0x212e,\n 0x213a, 0x213b,\n 0x2140, 0x2144,\n 0x214a, 0x214d,\n 0x2150, 0x215f,\n 0x2189, 0x218b,\n 0x2190, 0x2335,\n 0x237b, 0x2394,\n 0x2396, 0x2429,\n 0x2440, 0x244a,\n 0x2460, 0x249b,\n 0x24ea, 0x26ab,\n 0x26ad, 0x27ff,\n 0x2900, 0x2b73,\n 0x2b76, 0x2bff,\n 0x2ce5, 0x2cea,\n 0x2cef, 0x2cf1,\n 0x2cf9, 0x2cff,\n 0x2d7f, 0x2d7f,\n 0x2de0, 0x2e5d,\n 0x2e80, 0x2e99,\n 0x2e9b, 0x2ef3,\n 0x2f00, 0x2fd5,\n 0x2ff0, 0x3004,\n 0x3008, 0x3020,\n 0x302a, 0x302d,\n 0x3030, 0x3030,\n 0x3036, 0x3037,\n 0x303d, 0x303f,\n 0x3099, 0x309c,\n 0x30a0, 0x30a0,\n 0x30fb, 0x30fb,\n 0x31c0, 0x31e5,\n 0x31ef, 0x31ef,\n 0x321d, 0x321e,\n 0x3250, 0x325f,\n 0x327c, 0x327e,\n 0x32b1, 0x32bf,\n 0x32cc, 0x32cf,\n 0x3377, 0x337a,\n 0x33de, 0x33df,\n 0x33ff, 0x33ff,\n 0x4dc0, 0x4dff,\n 0xa490, 0xa4c6,\n 0xa60d, 0xa60f,\n 0xa66f, 0xa67f,\n 0xa69e, 0xa69f,\n 0xa6f0, 0xa6f1,\n 0xa700, 0xa721,\n 0xa788, 0xa788,\n 0xa802, 0xa802,\n 0xa806, 0xa806,\n 0xa80b, 0xa80b,\n 0xa825, 0xa826,\n 0xa828, 0xa82c,\n 0xa838, 0xa839,\n 0xa874, 0xa877,\n 0xa8c4, 0xa8c5,\n 0xa8e0, 0xa8f1,\n 0xa8ff, 0xa8ff,\n 0xa926, 0xa92d,\n 0xa947, 0xa951,\n 0xa980, 0xa982,\n 0xa9b3, 0xa9b3,\n 0xa9b6, 0xa9b9,\n 0xa9bc, 0xa9bd,\n 0xa9e5, 0xa9e5,\n 0xaa29, 0xaa2e,\n 0xaa31, 0xaa32,\n 0xaa35, 0xaa36,\n 0xaa43, 0xaa43,\n 0xaa4c, 0xaa4c,\n 0xaa7c, 0xaa7c,\n 0xaab0, 0xaab0,\n 0xaab2, 0xaab4,\n 0xaab7, 0xaab8,\n 0xaabe, 0xaabf,\n 0xaac1, 0xaac1,\n 0xaaec, 0xaaed,\n 0xaaf6, 0xaaf6,\n 0xab6a, 0xab6b,\n 0xabe5, 0xabe5,\n 0xabe8, 0xabe8,\n 0xabed, 0xabed,\n 0xfb1e, 0xfb1e,\n 0xfb29, 0xfb29,\n 0xfbc3, 0xfbd2,\n 0xfd3e, 0xfd4f,\n 0xfd90, 0xfd91,\n 0xfdc8, 0xfdef,\n 0xfdfd, 0xfe19,\n 0xfe20, 0xfe52,\n 0xfe54, 0xfe66,\n 0xfe68, 0xfe6b,\n 0xfeff, 0xfeff,\n 0xff01, 0xff20,\n 0xff3b, 0xff40,\n 0xff5b, 0xff65,\n 0xffe0, 0xffe6,\n 0xffe8, 0xffee,\n 0xfff0, 0xffff,\n 0x10101, 0x10101,\n 0x10140, 0x1018c,\n 0x10190, 0x1019c,\n 0x101a0, 0x101a0,\n 0x101fd, 0x101fd,\n 0x102e0, 0x102fb,\n 0x10376, 0x1037a,\n 0x1091f, 0x1091f,\n 0x10a01, 0x10a03,\n 0x10a05, 0x10a06,\n 0x10a0c, 0x10a0f,\n 0x10a38, 0x10a3a,\n 0x10a3f, 0x10a3f,\n 0x10ae5, 0x10ae6,\n 0x10b39, 0x10b3f,\n 0x10d24, 0x10d27,\n 0x10d30, 0x10d39,\n 0x10d40, 0x10d49,\n 0x10d69, 0x10d6e,\n 0x10e60, 0x10e7e,\n 0x10eab, 0x10eac,\n 0x10ed0, 0x10ed8,\n 0x10efa, 0x10eff,\n 0x10f46, 0x10f50,\n 0x10f82, 0x10f85,\n 0x11001, 0x11001,\n 0x11038, 0x11046,\n 0x11052, 0x11065,\n 0x11070, 0x11070,\n 0x11073, 0x11074,\n 0x1107f, 0x11081,\n 0x110b3, 0x110b6,\n 0x110b9, 0x110ba,\n 0x110c2, 0x110c2,\n 0x11100, 0x11102,\n 0x11127, 0x1112b,\n 0x1112d, 0x11134,\n 0x11173, 0x11173,\n 0x11180, 0x11181,\n 0x111b6, 0x111be,\n 0x111c9, 0x111cc,\n 0x111cf, 0x111cf,\n 0x1122f, 0x11231,\n 0x11234, 0x11234,\n 0x11236, 0x11237,\n 0x1123e, 0x1123e,\n 0x11241, 0x11241,\n 0x112df, 0x112df,\n 0x112e3, 0x112ea,\n 0x11300, 0x11301,\n 0x1133b, 0x1133c,\n 0x11340, 0x11340,\n 0x11366, 0x1136c,\n 0x11370, 0x11374,\n 0x113bb, 0x113c0,\n 0x113ce, 0x113ce,\n 0x113d0, 0x113d0,\n 0x113d2, 0x113d2,\n 0x113e1, 0x113e2,\n 0x11438, 0x1143f,\n 0x11442, 0x11444,\n 0x11446, 0x11446,\n 0x1145e, 0x1145e,\n 0x114b3, 0x114b8,\n 0x114ba, 0x114ba,\n 0x114bf, 0x114c0,\n 0x114c2, 0x114c3,\n 0x115b2, 0x115b5,\n 0x115bc, 0x115bd,\n 0x115bf, 0x115c0,\n 0x115dc, 0x115dd,\n 0x11633, 0x1163a,\n 0x1163d, 0x1163d,\n 0x1163f, 0x11640,\n 0x11660, 0x1166c,\n 0x116ab, 0x116ab,\n 0x116ad, 0x116ad,\n 0x116b0, 0x116b5,\n 0x116b7, 0x116b7,\n 0x1171d, 0x1171d,\n 0x1171f, 0x1171f,\n 0x11722, 0x11725,\n 0x11727, 0x1172b,\n 0x1182f, 0x11837,\n 0x11839, 0x1183a,\n 0x1193b, 0x1193c,\n 0x1193e, 0x1193e,\n 0x11943, 0x11943,\n 0x119d4, 0x119d7,\n 0x119da, 0x119db,\n 0x119e0, 0x119e0,\n 0x11a01, 0x11a06,\n 0x11a09, 0x11a0a,\n 0x11a33, 0x11a38,\n 0x11a3b, 0x11a3e,\n 0x11a47, 0x11a47,\n 0x11a51, 0x11a56,\n 0x11a59, 0x11a5b,\n 0x11a8a, 0x11a96,\n 0x11a98, 0x11a99,\n 0x11b60, 0x11b60,\n 0x11b62, 0x11b64,\n 0x11b66, 0x11b66,\n 0x11c30, 0x11c36,\n 0x11c38, 0x11c3d,\n 0x11c92, 0x11ca7,\n 0x11caa, 0x11cb0,\n 0x11cb2, 0x11cb3,\n 0x11cb5, 0x11cb6,\n 0x11d31, 0x11d36,\n 0x11d3a, 0x11d3a,\n 0x11d3c, 0x11d3d,\n 0x11d3f, 0x11d45,\n 0x11d47, 0x11d47,\n 0x11d90, 0x11d91,\n 0x11d95, 0x11d95,\n 0x11d97, 0x11d97,\n 0x11ef3, 0x11ef4,\n 0x11f00, 0x11f01,\n 0x11f36, 0x11f3a,\n 0x11f40, 0x11f40,\n 0x11f42, 0x11f42,\n 0x11f5a, 0x11f5a,\n 0x11fd5, 0x11ff1,\n 0x13440, 0x13440,\n 0x13447, 0x13455,\n 0x1611e, 0x16129,\n 0x1612d, 0x1612f,\n 0x16af0, 0x16af4,\n 0x16b30, 0x16b36,\n 0x16f4f, 0x16f4f,\n 0x16f8f, 0x16f92,\n 0x16fe2, 0x16fe2,\n 0x16fe4, 0x16fe4,\n 0x1bc9d, 0x1bc9e,\n 0x1bca0, 0x1bca3,\n 0x1cc00, 0x1ccd5,\n 0x1ccf0, 0x1ccfc,\n 0x1cd00, 0x1ceb3,\n 0x1ceba, 0x1ced0,\n 0x1cee0, 0x1cef0,\n 0x1cf00, 0x1cf2d,\n 0x1cf30, 0x1cf46,\n 0x1d167, 0x1d169,\n 0x1d173, 0x1d182,\n 0x1d185, 0x1d18b,\n 0x1d1aa, 0x1d1ad,\n 0x1d1e9, 0x1d1ea,\n 0x1d200, 0x1d245,\n 0x1d300, 0x1d356,\n 0x1d6c1, 0x1d6c1,\n 0x1d6db, 0x1d6db,\n 0x1d6fb, 0x1d6fb,\n 0x1d715, 0x1d715,\n 0x1d735, 0x1d735,\n 0x1d74f, 0x1d74f,\n 0x1d76f, 0x1d76f,\n 0x1d789, 0x1d789,\n 0x1d7a9, 0x1d7a9,\n 0x1d7c3, 0x1d7c3,\n 0x1d7ce, 0x1d7ff,\n 0x1da00, 0x1da36,\n 0x1da3b, 0x1da6c,\n 0x1da75, 0x1da75,\n 0x1da84, 0x1da84,\n 0x1da9b, 0x1da9f,\n 0x1daa1, 0x1daaf,\n 0x1e000, 0x1e006,\n 0x1e008, 0x1e018,\n 0x1e01b, 0x1e021,\n 0x1e023, 0x1e024,\n 0x1e026, 0x1e02a,\n 0x1e08f, 0x1e08f,\n 0x1e130, 0x1e136,\n 0x1e2ae, 0x1e2ae,\n 0x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 0x9ffff,\n 0xafffe, 0xaffff,\n 0xbfffe, 0xbffff,\n 0xcfffe, 0xcffff,\n 0xdfffe, 0xe0fff,\n 0xefffe, 0xeffff,\n 0xffffe, 0xfffff,\n 0x10fffe, 0x10ffff\n];\n\nexport const NATURAL_LETTER_RANGES: ReadonlyArray = [\n 0x41, 0x5a,\n 0x61, 0x7a,\n 0xaa, 0xaa,\n 0xb5, 0xb5,\n 0xba, 0xba,\n 0xc0, 0xd6,\n 0xd8, 0xf6,\n 0xf8, 0x2c1,\n 0x2c6, 0x2d1,\n 0x2e0, 0x2e4,\n 0x2ec, 0x2ec,\n 0x2ee, 0x2ee,\n 0x370, 0x374,\n 0x376, 0x377,\n 0x37a, 0x37d,\n 0x37f, 0x37f,\n 0x386, 0x386,\n 0x388, 0x38a,\n 0x38c, 0x38c,\n 0x38e, 0x3a1,\n 0x3a3, 0x3f5,\n 0x3f7, 0x481,\n 0x48a, 0x52f,\n 0x531, 0x556,\n 0x559, 0x559,\n 0x560, 0x588,\n 0x5d0, 0x5ea,\n 0x5ef, 0x5f2,\n 0x620, 0x64a,\n 0x66e, 0x66f,\n 0x671, 0x6d3,\n 0x6d5, 0x6d5,\n 0x6e5, 0x6e6,\n 0x6ee, 0x6ef,\n 0x6fa, 0x6fc,\n 0x6ff, 0x6ff,\n 0x710, 0x710,\n 0x712, 0x72f,\n 0x74d, 0x7a5,\n 0x7b1, 0x7b1,\n 0x7ca, 0x7ea,\n 0x7f4, 0x7f5,\n 0x7fa, 0x7fa,\n 0x800, 0x815,\n 0x81a, 0x81a,\n 0x824, 0x824,\n 0x828, 0x828,\n 0x840, 0x858,\n 0x860, 0x86a,\n 0x870, 0x887,\n 0x889, 0x88f,\n 0x8a0, 0x8c9,\n 0x904, 0x939,\n 0x93d, 0x93d,\n 0x950, 0x950,\n 0x958, 0x961,\n 0x971, 0x980,\n 0x985, 0x98c,\n 0x98f, 0x990,\n 0x993, 0x9a8,\n 0x9aa, 0x9b0,\n 0x9b2, 0x9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xd12, 0xd3a,\n 0xd3d, 0xd3d,\n 0xd4e, 0xd4e,\n 0xd54, 0xd56,\n 0xd5f, 0xd61,\n 0xd7a, 0xd7f,\n 0xd85, 0xd96,\n 0xd9a, 0xdb1,\n 0xdb3, 0xdbb,\n 0xdbd, 0xdbd,\n 0xdc0, 0xdc6,\n 0xe01, 0xe30,\n 0xe32, 0xe33,\n 0xe40, 0xe46,\n 0xe81, 0xe82,\n 0xe84, 0xe84,\n 0xe86, 0xe8a,\n 0xe8c, 0xea3,\n 0xea5, 0xea5,\n 0xea7, 0xeb0,\n 0xeb2, 0xeb3,\n 0xebd, 0xebd,\n 0xec0, 0xec4,\n 0xec6, 0xec6,\n 0xedc, 0xedf,\n 0xf00, 0xf00,\n 0xf40, 0xf47,\n 0xf49, 0xf6c,\n 0xf88, 0xf8c,\n 0x1000, 0x102a,\n 0x103f, 0x103f,\n 0x1050, 0x1055,\n 0x105a, 0x105d,\n 0x1061, 0x1061,\n 0x1065, 0x1066,\n 0x106e, 0x1070,\n 0x1075, 0x1081,\n 0x108e, 0x108e,\n 0x10a0, 0x10c5,\n 0x10c7, 0x10c7,\n 0x10cd, 0x10cd,\n 0x10d0, 0x10fa,\n 0x10fc, 0x1248,\n 0x124a, 0x124d,\n 0x1250, 0x1256,\n 0x1258, 0x1258,\n 0x125a, 0x125d,\n 0x1260, 0x1288,\n 0x128a, 0x128d,\n 0x1290, 0x12b0,\n 0x12b2, 0x12b5,\n 0x12b8, 0x12be,\n 0x12c0, 0x12c0,\n 0x12c2, 0x12c5,\n 0x12c8, 0x12d6,\n 0x12d8, 0x1310,\n 0x1312, 0x1315,\n 0x1318, 0x135a,\n 0x1380, 0x138f,\n 0x13a0, 0x13f5,\n 0x13f8, 0x13fd,\n 0x1401, 0x166c,\n 0x166f, 0x167f,\n 0x1681, 0x169a,\n 0x16a0, 0x16ea,\n 0x16f1, 0x16f8,\n 0x1700, 0x1711,\n 0x171f, 0x1731,\n 0x1740, 0x1751,\n 0x1760, 0x176c,\n 0x176e, 0x1770,\n 0x1780, 0x17b3,\n 0x17d7, 0x17d7,\n 0x17dc, 0x17dc,\n 0x1820, 0x1878,\n 0x1880, 0x1884,\n 0x1887, 0x18a8,\n 0x18aa, 0x18aa,\n 0x18b0, 0x18f5,\n 0x1900, 0x191e,\n 0x1950, 0x196d,\n 0x1970, 0x1974,\n 0x1980, 0x19ab,\n 0x19b0, 0x19c9,\n 0x1a00, 0x1a16,\n 0x1a20, 0x1a54,\n 0x1aa7, 0x1aa7,\n 0x1b05, 0x1b33,\n 0x1b45, 0x1b4c,\n 0x1b83, 0x1ba0,\n 0x1bae, 0x1baf,\n 0x1bba, 0x1be5,\n 0x1c00, 0x1c23,\n 0x1c4d, 0x1c4f,\n 0x1c5a, 0x1c7d,\n 0x1c80, 0x1c8a,\n 0x1c90, 0x1cba,\n 0x1cbd, 0x1cbf,\n 0x1ce9, 0x1cec,\n 0x1cee, 0x1cf3,\n 0x1cf5, 0x1cf6,\n 0x1cfa, 0x1cfa,\n 0x1d00, 0x1dbf,\n 0x1e00, 0x1f15,\n 0x1f18, 0x1f1d,\n 0x1f20, 0x1f45,\n 0x1f48, 0x1f4d,\n 0x1f50, 0x1f57,\n 0x1f59, 0x1f59,\n 0x1f5b, 0x1f5b,\n 0x1f5d, 0x1f5d,\n 0x1f5f, 0x1f7d,\n 0x1f80, 0x1fb4,\n 0x1fb6, 0x1fbc,\n 0x1fbe, 0x1fbe,\n 0x1fc2, 0x1fc4,\n 0x1fc6, 0x1fcc,\n 0x1fd0, 0x1fd3,\n 0x1fd6, 0x1fdb,\n 0x1fe0, 0x1fec,\n 0x1ff2, 0x1ff4,\n 0x1ff6, 0x1ffc,\n 0x2071, 0x2071,\n 0x207f, 0x207f,\n 0x2090, 0x209c,\n 0x2102, 0x2102,\n 0x2107, 0x2107,\n 0x210a, 0x2113,\n 0x2115, 0x2115,\n 0x2119, 0x211d,\n 0x2124, 0x2124,\n 0x2126, 0x2126,\n 0x2128, 0x2128,\n 0x212a, 0x212d,\n 0x212f, 0x2139,\n 0x213c, 0x213f,\n 0x2145, 0x2149,\n 0x214e, 0x214e,\n 0x2183, 0x2184,\n 0x2c00, 0x2ce4,\n 0x2ceb, 0x2cee,\n 0x2cf2, 0x2cf3,\n 0x2d00, 0x2d25,\n 0x2d27, 0x2d27,\n 0x2d2d, 0x2d2d,\n 0x2d30, 0x2d67,\n 0x2d6f, 0x2d6f,\n 0x2d80, 0x2d96,\n 0x2da0, 0x2da6,\n 0x2da8, 0x2dae,\n 0x2db0, 0x2db6,\n 0x2db8, 0x2dbe,\n 0x2dc0, 0x2dc6,\n 0x2dc8, 0x2dce,\n 0x2dd0, 0x2dd6,\n 0x2dd8, 0x2dde,\n 0x2e2f, 0x2e2f,\n 0x3005, 0x3006,\n 0x3031, 0x3035,\n 0x303b, 0x303c,\n 0x3041, 0x3096,\n 0x309d, 0x309f,\n 0x30a1, 0x30fa,\n 0x30fc, 0x30ff,\n 0x3105, 0x312f,\n 0x3131, 0x318e,\n 0x31a0, 0x31bf,\n 0x31f0, 0x31ff,\n 0x3400, 0x4dbf,\n 0x4e00, 0xa48c,\n 0xa4d0, 0xa4fd,\n 0xa500, 0xa60c,\n 0xa610, 0xa61f,\n 0xa62a, 0xa62b,\n 0xa640, 0xa66e,\n 0xa67f, 0xa69d,\n 0xa6a0, 0xa6e5,\n 0xa717, 0xa71f,\n 0xa722, 0xa788,\n 0xa78b, 0xa7dc,\n 0xa7f1, 0xa801,\n 0xa803, 0xa805,\n 0xa807, 0xa80a,\n 0xa80c, 0xa822,\n 0xa840, 0xa873,\n 0xa882, 0xa8b3,\n 0xa8f2, 0xa8f7,\n 0xa8fb, 0xa8fb,\n 0xa8fd, 0xa8fe,\n 0xa90a, 0xa925,\n 0xa930, 0xa946,\n 0xa960, 0xa97c,\n 0xa984, 0xa9b2,\n 0xa9cf, 0xa9cf,\n 0xa9e0, 0xa9e4,\n 0xa9e6, 0xa9ef,\n 0xa9fa, 0xa9fe,\n 0xaa00, 0xaa28,\n 0xaa40, 0xaa42,\n 0xaa44, 0xaa4b,\n 0xaa60, 0xaa76,\n 0xaa7a, 0xaa7a,\n 0xaa7e, 0xaaaf,\n 0xaab1, 0xaab1,\n 0xaab5, 0xaab6,\n 0xaab9, 0xaabd,\n 0xaac0, 0xaac0,\n 0xaac2, 0xaac2,\n 0xaadb, 0xaadd,\n 0xaae0, 0xaaea,\n 0xaaf2, 0xaaf4,\n 0xab01, 0xab06,\n 0xab09, 0xab0e,\n 0xab11, 0xab16,\n 0xab20, 0xab26,\n 0xab28, 0xab2e,\n 0xab30, 0xab5a,\n 0xab5c, 0xab69,\n 0xab70, 0xabe2,\n 0xac00, 0xd7a3,\n 0xd7b0, 0xd7c6,\n 0xd7cb, 0xd7fb,\n 0xf900, 0xfa6d,\n 0xfa70, 0xfad9,\n 0xfb00, 0xfb06,\n 0xfb13, 0xfb17,\n 0xfb1d, 0xfb1d,\n 0xfb1f, 0xfb28,\n 0xfb2a, 0xfb36,\n 0xfb38, 0xfb3c,\n 0xfb3e, 0xfb3e,\n 0xfb40, 0xfb41,\n 0xfb43, 0xfb44,\n 0xfb46, 0xfbb1,\n 0xfbd3, 0xfd3d,\n 0xfd50, 0xfd8f,\n 0xfd92, 0xfdc7,\n 0xfdf0, 0xfdfb,\n 0xfe70, 0xfe74,\n 0xfe76, 0xfefc,\n 0xff21, 0xff3a,\n 0xff41, 0xff5a,\n 0xff66, 0xffbe,\n 0xffc2, 0xffc7,\n 0xffca, 0xffcf,\n 0xffd2, 0xffd7,\n 0xffda, 0xffdc,\n 0x10000, 0x1000b,\n 0x1000d, 0x10026,\n 0x10028, 0x1003a,\n 0x1003c, 0x1003d,\n 0x1003f, 0x1004d,\n 0x10050, 0x1005d,\n 0x10080, 0x100fa,\n 0x10280, 0x1029c,\n 0x102a0, 0x102d0,\n 0x10300, 0x1031f,\n 0x1032d, 0x10340,\n 0x10342, 0x10349,\n 0x10350, 0x10375,\n 0x10380, 0x1039d,\n 0x103a0, 0x103c3,\n 0x103c8, 0x103cf,\n 0x10400, 0x1049d,\n 0x104b0, 0x104d3,\n 0x104d8, 0x104fb,\n 0x10500, 0x10527,\n 0x10530, 0x10563,\n 0x10570, 0x1057a,\n 0x1057c, 0x1058a,\n 0x1058c, 0x10592,\n 0x10594, 0x10595,\n 0x10597, 0x105a1,\n 0x105a3, 0x105b1,\n 0x105b3, 0x105b9,\n 0x105bb, 0x105bc,\n 0x105c0, 0x105f3,\n 0x10600, 0x10736,\n 0x10740, 0x10755,\n 0x10760, 0x10767,\n 0x10780, 0x10785,\n 0x10787, 0x107b0,\n 0x107b2, 0x107ba,\n 0x10800, 0x10805,\n 0x10808, 0x10808,\n 0x1080a, 0x10835,\n 0x10837, 0x10838,\n 0x1083c, 0x1083c,\n 0x1083f, 0x10855,\n 0x10860, 0x10876,\n 0x10880, 0x1089e,\n 0x108e0, 0x108f2,\n 0x108f4, 0x108f5,\n 0x10900, 0x10915,\n 0x10920, 0x10939,\n 0x10940, 0x10959,\n 0x10980, 0x109b7,\n 0x109be, 0x109bf,\n 0x10a00, 0x10a00,\n 0x10a10, 0x10a13,\n 0x10a15, 0x10a17,\n 0x10a19, 0x10a35,\n 0x10a60, 0x10a7c,\n 0x10a80, 0x10a9c,\n 0x10ac0, 0x10ac7,\n 0x10ac9, 0x10ae4,\n 0x10b00, 0x10b35,\n 0x10b40, 0x10b55,\n 0x10b60, 0x10b72,\n 0x10b80, 0x10b91,\n 0x10c00, 0x10c48,\n 0x10c80, 0x10cb2,\n 0x10cc0, 0x10cf2,\n 0x10d00, 0x10d23,\n 0x10d4a, 0x10d65,\n 0x10d6f, 0x10d85,\n 0x10e80, 0x10ea9,\n 0x10eb0, 0x10eb1,\n 0x10ec2, 0x10ec7,\n 0x10f00, 0x10f1c,\n 0x10f27, 0x10f27,\n 0x10f30, 0x10f45,\n 0x10f70, 0x10f81,\n 0x10fb0, 0x10fc4,\n 0x10fe0, 0x10ff6,\n 0x11003, 0x11037,\n 0x11071, 0x11072,\n 0x11075, 0x11075,\n 0x11083, 0x110af,\n 0x110d0, 0x110e8,\n 0x11103, 0x11126,\n 0x11144, 0x11144,\n 0x11147, 0x11147,\n 0x11150, 0x11172,\n 0x11176, 0x11176,\n 0x11183, 0x111b2,\n 0x111c1, 0x111c4,\n 0x111da, 0x111da,\n 0x111dc, 0x111dc,\n 0x11200, 0x11211,\n 0x11213, 0x1122b,\n 0x1123f, 0x11240,\n 0x11280, 0x11286,\n 0x11288, 0x11288,\n 0x1128a, 0x1128d,\n 0x1128f, 0x1129d,\n 0x1129f, 0x112a8,\n 0x112b0, 0x112de,\n 0x11305, 0x1130c,\n 0x1130f, 0x11310,\n 0x11313, 0x11328,\n 0x1132a, 0x11330,\n 0x11332, 0x11333,\n 0x11335, 0x11339,\n 0x1133d, 0x1133d,\n 0x11350, 0x11350,\n 0x1135d, 0x11361,\n 0x11380, 0x11389,\n 0x1138b, 0x1138b,\n 0x1138e, 0x1138e,\n 0x11390, 0x113b5,\n 0x113b7, 0x113b7,\n 0x113d1, 0x113d1,\n 0x113d3, 0x113d3,\n 0x11400, 0x11434,\n 0x11447, 0x1144a,\n 0x1145f, 0x11461,\n 0x11480, 0x114af,\n 0x114c4, 0x114c5,\n 0x114c7, 0x114c7,\n 0x11580, 0x115ae,\n 0x115d8, 0x115db,\n 0x11600, 0x1162f,\n 0x11644, 0x11644,\n 0x11680, 0x116aa,\n 0x116b8, 0x116b8,\n 0x11700, 0x1171a,\n 0x11740, 0x11746,\n 0x11800, 0x1182b,\n 0x118a0, 0x118df,\n 0x118ff, 0x11906,\n 0x11909, 0x11909,\n 0x1190c, 0x11913,\n 0x11915, 0x11916,\n 0x11918, 0x1192f,\n 0x1193f, 0x1193f,\n 0x11941, 0x11941,\n 0x119a0, 0x119a7,\n 0x119aa, 0x119d0,\n 0x119e1, 0x119e1,\n 0x119e3, 0x119e3,\n 0x11a00, 0x11a00,\n 0x11a0b, 0x11a32,\n 0x11a3a, 0x11a3a,\n 0x11a50, 0x11a50,\n 0x11a5c, 0x11a89,\n 0x11a9d, 0x11a9d,\n 0x11ab0, 0x11af8,\n 0x11bc0, 0x11be0,\n 0x11c00, 0x11c08,\n 0x11c0a, 0x11c2e,\n 0x11c40, 0x11c40,\n 0x11c72, 0x11c8f,\n 0x11d00, 0x11d06,\n 0x11d08, 0x11d09,\n 0x11d0b, 0x11d30,\n 0x11d46, 0x11d46,\n 0x11d60, 0x11d65,\n 0x11d67, 0x11d68,\n 0x11d6a, 0x11d89,\n 0x11d98, 0x11d98,\n 0x11db0, 0x11ddb,\n 0x11ee0, 0x11ef2,\n 0x11f02, 0x11f02,\n 0x11f04, 0x11f10,\n 0x11f12, 0x11f33,\n 0x11fb0, 0x11fb0,\n 0x12000, 0x12399,\n 0x12480, 0x12543,\n 0x12f90, 0x12ff0,\n 0x13000, 0x1342f,\n 0x13441, 0x13446,\n 0x13460, 0x143fa,\n 0x14400, 0x14646,\n 0x16100, 0x1611d,\n 0x16800, 0x16a38,\n 0x16a40, 0x16a5e,\n 0x16a70, 0x16abe,\n 0x16ad0, 0x16aed,\n 0x16b00, 0x16b2f,\n 0x16b40, 0x16b43,\n 0x16b63, 0x16b77,\n 0x16b7d, 0x16b8f,\n 0x16d40, 0x16d6c,\n 0x16e40, 0x16e7f,\n 0x16ea0, 0x16eb8,\n 0x16ebb, 0x16ed3,\n 0x16f00, 0x16f4a,\n 0x16f50, 0x16f50,\n 0x16f93, 0x16f9f,\n 0x16fe0, 0x16fe1,\n 0x16fe3, 0x16fe3,\n 0x16ff2, 0x16ff3,\n 0x17000, 0x18cd5,\n 0x18cff, 0x18d1e,\n 0x18d80, 0x18df2,\n 0x1aff0, 0x1aff3,\n 0x1aff5, 0x1affb,\n 0x1affd, 0x1affe,\n 0x1b000, 0x1b122,\n 0x1b132, 0x1b132,\n 0x1b150, 0x1b152,\n 0x1b155, 0x1b155,\n 0x1b164, 0x1b167,\n 0x1b170, 0x1b2fb,\n 0x1bc00, 0x1bc6a,\n 0x1bc70, 0x1bc7c,\n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x1e94b,\n 0x1ee00, 0x1ee03,\n 0x1ee05, 0x1ee1f,\n 0x1ee21, 0x1ee22,\n 0x1ee24, 0x1ee24,\n 0x1ee27, 0x1ee27,\n 0x1ee29, 0x1ee32,\n 0x1ee34, 0x1ee37,\n 0x1ee39, 0x1ee39,\n 0x1ee3b, 0x1ee3b,\n 0x1ee42, 0x1ee42,\n 0x1ee47, 0x1ee47,\n 0x1ee49, 0x1ee49,\n 0x1ee4b, 0x1ee4b,\n 0x1ee4d, 0x1ee4f,\n 0x1ee51, 0x1ee52,\n 0x1ee54, 0x1ee54,\n 0x1ee57, 0x1ee57,\n 0x1ee59, 0x1ee59,\n 0x1ee5b, 0x1ee5b,\n 0x1ee5d, 0x1ee5d,\n 0x1ee5f, 0x1ee5f,\n 0x1ee61, 0x1ee62,\n 0x1ee64, 0x1ee64,\n 0x1ee67, 0x1ee6a,\n 0x1ee6c, 0x1ee72,\n 0x1ee74, 0x1ee77,\n 0x1ee79, 0x1ee7c,\n 0x1ee7e, 0x1ee7e,\n 0x1ee80, 0x1ee89,\n 0x1ee8b, 0x1ee9b,\n 0x1eea1, 0x1eea3,\n 0x1eea5, 0x1eea9,\n 0x1eeab, 0x1eebb,\n 0x20000, 0x2a6df,\n 0x2a700, 0x2b81d,\n 0x2b820, 0x2cead,\n 0x2ceb0, 0x2ebe0,\n 0x2ebf0, 0x2ee5d,\n 0x2f800, 0x2fa1d,\n 0x30000, 0x3134a,\n 0x31350, 0x33479\n];\n", "import type { Direction } from './types.js';\nimport {\n NON_STRONG_BIDI_RANGES,\n NATURAL_LETTER_RANGES,\n RTL_BIDI_RANGES,\n UNICODE_BIDI_SHA256,\n UNICODE_GENERAL_CATEGORY_SHA256,\n UNICODE_BIDI_VERSION\n} from './generated/bidi-ranges.js';\n\nfunction isInRanges(codePoint: number, ranges: ReadonlyArray): boolean {\n let low = 0;\n let high = ranges.length / 2 - 1;\n while (low <= high) {\n const middle = (low + high) >> 1;\n const start = ranges[middle * 2]!;\n const end = ranges[middle * 2 + 1]!;\n if (codePoint < start) high = middle - 1;\n else if (codePoint > end) low = middle + 1;\n else return true;\n }\n return false;\n}\n\nexport function isRtlCodePoint(codePoint: number): boolean {\n return isInRanges(codePoint, RTL_BIDI_RANGES);\n}\n\n/** Returns the Unicode Bidi_Class strong direction, including LRM/RLM/ALM. */\nexport function classifyBidiStrongCharacter(character: string): Direction {\n const codePoint = character.codePointAt(0);\n if (codePoint === undefined || isInRanges(codePoint, NON_STRONG_BIDI_RANGES)) return 'neutral';\n return isRtlCodePoint(codePoint) ? 'rtl' : 'ltr';\n}\n\n/** Classifies natural-language letters while leaving numbers and punctuation neutral. */\nexport function classifyCharacter(character: string): Direction {\n const codePoint = character.codePointAt(0);\n if (codePoint === undefined) return 'neutral';\n return isInRanges(codePoint, NATURAL_LETTER_RANGES) ? classifyBidiStrongCharacter(character) : 'neutral';\n}\n\nexport const UNICODE_DATA_VERSION = UNICODE_BIDI_VERSION;\nexport const UNICODE_DATA_SHA256 = UNICODE_BIDI_SHA256;\nexport const UNICODE_LETTER_DATA_SHA256 = UNICODE_GENERAL_CATEGORY_SHA256;\n", "import { classifyBidiStrongCharacter, classifyCharacter } from './classify.js';\nimport type {\n DetectionOptions,\n Direction,\n ParagraphAnalysis,\n StrongCharacterCounts,\n TextAnalysis\n} from './types.js';\n\nexport interface TechnicalTokenRange {\n text: string;\n start: number;\n end: number;\n kind: 'code' | 'url' | 'email' | 'path' | 'version' | 'hash' | 'identifier' | 'number' | 'command' | 'math' | 'html';\n}\n\nconst DEFAULT_OPTIONS: Required = {\n strategy: 'content-majority',\n fallback: 'neutral',\n inheritedDirection: 'ltr',\n minimumStrongCharacters: 1,\n majorityThreshold: 0.5,\n excludeTechnicalTokens: true,\n technicalIdentifiers: []\n};\n\nexport const DEFAULT_TECHNICAL_IDENTIFIERS = Object.freeze([\n 'ai', 'api', 'anthropic', 'chatgpt', 'claude', 'cli', 'codex', 'copilot', 'cursor',\n 'deepseek', 'electron', 'gemini', 'github', 'gitlab', 'grok', 'huggingface',\n 'javascript', 'json', 'llama', 'markdown', 'mistral', 'node', 'npm', 'openai',\n 'python', 'qwen', 'react', 'rust', 'svelte', 'typescript', 'url', 'version',\n 'vscode', 'vue', 'web', 'webpack', 'yaml',\n 'angular', 'astro', 'chrome', 'docker', 'esbuild', 'eslint', 'firefox',\n 'kubernetes', 'kubectl', 'nuxt', 'playwright', 'pnpm', 'preact', 'remix',\n 'rollup', 'safari', 'stencil', 'storybook', 'tailwind', 'turbopack', 'vite',\n 'vitest'\n] as const);\nconst KNOWN_TECHNICAL_TOKENS = new Set(DEFAULT_TECHNICAL_IDENTIFIERS);\nconst CUSTOM_TECHNICAL_IDENTIFIER_CACHE = new WeakMap>();\n\nfunction normalizeOptions(options: DetectionOptions = {}): Required {\n const strategy = options.strategy ?? DEFAULT_OPTIONS.strategy;\n const majorityStrategy = strategy === 'content-majority'\n || strategy === 'semantic-dominant'\n || strategy === 'majority';\n return {\n strategy,\n fallback: options.fallback ?? options.inheritedDirection ?? DEFAULT_OPTIONS.fallback,\n inheritedDirection: options.inheritedDirection ?? DEFAULT_OPTIONS.inheritedDirection,\n minimumStrongCharacters: Math.max(1, options.minimumStrongCharacters ?? DEFAULT_OPTIONS.minimumStrongCharacters),\n majorityThreshold: Math.min(1, Math.max(0.5, options.majorityThreshold ?? DEFAULT_OPTIONS.majorityThreshold)),\n // Compatibility/strict first-strong modes must see the real first strong\n // character (including a leading technical identifier), like dir=\"auto\".\n excludeTechnicalTokens: options.excludeTechnicalTokens ?? majorityStrategy,\n technicalIdentifiers: options.technicalIdentifiers ?? DEFAULT_OPTIONS.technicalIdentifiers\n };\n}\n\nfunction addRange(\n ranges: TechnicalTokenRange[],\n text: string,\n start: number,\n end: number,\n kind: TechnicalTokenRange['kind']\n): void {\n if (end > start) ranges.push({ text: text.slice(start, end), start, end, kind });\n}\n\nfunction addMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const value = match[group];\n if (value === undefined) continue;\n const start = match.index + match[0].indexOf(value);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction trimTechnicalPunctuation(value: string): string {\n let end = value.length;\n while (end > 0 && /[.,;:!?\u060C\u061B\u061F\u3002\u0964\u06D4]/u.test(value[end - 1]!)) end -= 1;\n return end === value.length ? value : value.slice(0, end);\n}\n\nfunction addValidatedMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n validate: (value: string) => boolean,\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const value = match[group];\n if (value === undefined || !validate(value)) continue;\n const start = match.index + match[0].indexOf(value);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction addNormalizedMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n normalize: (value: string) => string,\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const original = match[group];\n if (original === undefined) continue;\n const value = normalize(original);\n if (!value) continue;\n const start = match.index + match[0].indexOf(original);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction isIpv4(value: string): boolean {\n const parts = value.split('.');\n return parts.length === 4 && parts.every((part) => /^\\d{1,3}$/u.test(part) && Number(part) <= 255);\n}\n\nfunction isIpv6(value: string): boolean {\n if (!/^[0-9A-F:]+$/iu.test(value) || !value.includes(':')) return false;\n const compression = value.indexOf('::');\n if (compression !== value.lastIndexOf('::')) return false;\n const sides = compression >= 0 ? value.split('::') : [value];\n const groups = sides.flatMap((side) => side ? side.split(':') : []);\n if (!groups.every((group) => /^[0-9A-F]{1,4}$/iu.test(group))) return false;\n return compression >= 0 ? groups.length < 8 : groups.length === 8;\n}\n\nfunction addCodeRanges(text: string, ranges: TechnicalTokenRange[]): void {\n let fence: { marker: '`' | '~'; length: number; start: number } | undefined;\n const closedFences: Array<{ start: number; end: number }> = [];\n let lineStart = 0;\n while (lineStart < text.length) {\n let lineEnd = lineStart;\n while (lineEnd < text.length && text[lineEnd] !== '\\r' && text[lineEnd] !== '\\n') lineEnd += 1;\n let nextLine = lineEnd;\n if (text[nextLine] === '\\r') nextLine += 1;\n if (text[nextLine] === '\\n') nextLine += 1;\n const line = text.slice(lineStart, lineEnd);\n if (!fence) {\n const openerMatch = /^ {0,3}(`{3,}|~{3,})(.*)$/u.exec(line);\n const opener = openerMatch?.[1];\n const info = openerMatch?.[2] ?? '';\n if (opener && !(opener[0] === '`' && info.includes('`'))) fence = {\n marker: opener[0] as '`' | '~',\n length: opener.length,\n start: lineStart\n };\n } else {\n const closer = /^ {0,3}(`+|~+)[ \\t]*$/u.exec(line)?.[1];\n if (closer?.[0] === fence.marker && closer.length >= fence.length) {\n closedFences.push({ start: fence.start, end: nextLine });\n fence = undefined;\n }\n }\n lineStart = nextLine;\n }\n // Decide once over the union of all closed spans. Scanning each fence's\n // complementary text separately would be quadratic and would mistake code\n // inside a second standalone fence for prose outside the first.\n let fenceIndex = 0;\n let utf16Index = 0;\n let hasOutsideNaturalText = false;\n for (const character of text) {\n while (fenceIndex < closedFences.length && utf16Index >= closedFences[fenceIndex]!.end) {\n fenceIndex += 1;\n }\n const span = closedFences[fenceIndex];\n const insideFence = span !== undefined && utf16Index >= span.start && utf16Index < span.end;\n if (!insideFence && classifyCharacter(character) !== 'neutral') {\n hasOutsideNaturalText = true;\n break;\n }\n utf16Index += character.length;\n }\n // Standalone fenced code keeps its historical raw-text direction evidence.\n // Parser-aware Markdown adapters force code blocks LTR. Excluding complete\n // fences is useful when surrounding prose\u2014not code literals\u2014must decide the\n // containing raw block's natural direction.\n if (hasOutsideNaturalText) {\n for (const span of closedFences) addRange(ranges, text, span.start, span.end, 'code');\n }\n\n const lineExpression = /[^\\r\\n]*/gu;\n let lineMatch: RegExpExecArray | null;\n while ((lineMatch = lineExpression.exec(text)) !== null) {\n const line = lineMatch[0];\n const lineStart = lineMatch.index;\n const runs: Array<{ start: number; length: number }> = [];\n for (let index = 0; index < line.length;) {\n if (line[index] !== '`') {\n index += 1;\n continue;\n }\n const start = index;\n while (index < line.length && line[index] === '`') index += 1;\n runs.push({ start, length: index - start });\n }\n const suffixMaximum = new Array(runs.length + 1).fill(0);\n for (let index = runs.length - 1; index >= 0; index -= 1) {\n suffixMaximum[index] = Math.max(runs[index]!.length, suffixMaximum[index + 1]!);\n }\n let runIndex = 0;\n let cursor = runs[0]?.start ?? 0;\n while (runIndex < runs.length) {\n const opener = runs[runIndex]!;\n const openerEnd = opener.start + opener.length;\n if (cursor >= openerEnd) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n const available = openerEnd - cursor;\n const delimiterLength = Math.min(\n available,\n Math.max(Math.floor(available / 2), suffixMaximum[runIndex + 1]!)\n );\n if (delimiterLength === 0) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n let closingRunIndex = runIndex;\n let closingStart = cursor + delimiterLength;\n if (available - delimiterLength < delimiterLength) {\n closingRunIndex += 1;\n while (closingRunIndex < runs.length\n && runs[closingRunIndex]!.length < delimiterLength) closingRunIndex += 1;\n if (closingRunIndex >= runs.length) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n closingStart = runs[closingRunIndex]!.start;\n }\n const end = closingStart + delimiterLength;\n addRange(ranges, text, lineStart + cursor, lineStart + end, 'code');\n runIndex = closingRunIndex;\n cursor = end;\n }\n if (lineMatch[0].length === 0) lineExpression.lastIndex += 1;\n }\n}\n\nfunction customTechnicalIdentifiers(values: readonly string[]): ReadonlySet {\n const cacheable = Object.isFrozen(values);\n const cached = cacheable ? CUSTOM_TECHNICAL_IDENTIFIER_CACHE.get(values) : undefined;\n if (cached) return cached;\n const identifiers = new Set();\n for (const value of values) {\n if (/^[A-Za-z][A-Za-z0-9_.-]*$/u.test(value)) identifiers.add(value.toLowerCase());\n }\n if (cacheable) CUSTOM_TECHNICAL_IDENTIFIER_CACHE.set(values, identifiers);\n return identifiers;\n}\n\nfunction isTechnicalIdentifier(token: string, custom: ReadonlySet): boolean {\n const normalized = token.toLowerCase();\n return KNOWN_TECHNICAL_TOKENS.has(normalized)\n || custom.has(normalized)\n || /[0-9_.-]/u.test(token)\n || /^[A-Z]{2,}$/u.test(token)\n || /[a-z][A-Z]/u.test(token);\n}\n\n/** Finds ranges that should not decide the natural-language base direction. */\nexport function findTechnicalTokenRanges(\n text: string,\n technicalIdentifiers: readonly string[] = []\n): TechnicalTokenRange[] {\n const ranges: TechnicalTokenRange[] = [];\n addCodeRanges(text, ranges);\n addMatches(text, ranges, /<\\/?[A-Za-z][^<>\\r\\n]*>/gu, 'html');\n addMatches(text, ranges, /(?:\\$\\$[^\\r\\n]*?\\$\\$|\\$[^$\\r\\n]+\\$|\\\\\\([^\\r\\n]*?\\\\\\))/gu, 'math');\n\n const urls = /\\b(?:https?|ftp):\\/\\/[^\\s<>{}\"']+/giu;\n let urlMatch: RegExpExecArray | null;\n while ((urlMatch = urls.exec(text)) !== null) {\n let value = urlMatch[0];\n value = trimTechnicalPunctuation(value);\n for (const [open, close] of [['(', ')'], ['[', ']'], ['{', '}']] as const) {\n if (!value.endsWith(close)) continue;\n let balance = 0;\n for (const character of value) {\n if (character === open) balance += 1;\n else if (character === close) balance -= 1;\n }\n if (balance >= 0) continue;\n let end = value.length;\n while (balance < 0 && end > 0 && value[end - 1] === close) {\n balance += 1;\n end -= 1;\n }\n if (end !== value.length) value = value.slice(0, end);\n }\n addRange(ranges, text, urlMatch.index, urlMatch.index + value.length, 'url');\n }\n addMatches(text, ranges, /\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}\\b/giu, 'email');\n addNormalizedMatches(\n text,\n ranges,\n /(?()\\x5B\\x5D{}]+/gu,\n 'path',\n trimTechnicalPunctuation\n );\n addMatches(text, ranges, /\\b(?:[A-Za-z0-9_.-]+[\\\\/])+(?:[A-Za-z0-9_.-]+)\\b/gu, 'path');\n addMatches(text, ranges, /(? a.start - b.start || b.end - a.end);\n const merged: TechnicalTokenRange[] = [];\n for (const range of ranges) {\n const previous = merged.at(-1);\n if (previous && range.start <= previous.end) {\n previous.end = Math.max(previous.end, range.end);\n previous.text = text.slice(previous.start, previous.end);\n } else {\n merged.push({ ...range });\n }\n }\n return merged;\n}\n\nexport function countStrongCharacters(\n text: string,\n options: DetectionOptions = {}\n): StrongCharacterCounts & { firstStrong: Direction; technicalTokens: TechnicalTokenRange[] } {\n const normalized = normalizeOptions(options);\n return countStrongCharactersNormalized(text, normalized);\n}\n\nfunction countStrongCharactersNormalized(\n text: string,\n normalized: Required\n): StrongCharacterCounts & { firstStrong: Direction; technicalTokens: TechnicalTokenRange[] } {\n const technicalTokens = normalized.excludeTechnicalTokens\n ? findTechnicalTokenRanges(text, normalized.technicalIdentifiers)\n : [];\n let ltr = 0;\n let rtl = 0;\n let firstStrong: Direction = 'neutral';\n let index = 0;\n let technicalIndex = 0;\n const classify = normalized.strategy === 'first-strong' || normalized.strategy === 'strict-uax9'\n ? classifyBidiStrongCharacter\n : classifyCharacter;\n\n for (const character of text) {\n // Technical ranges are sorted and merged, so advance one cursor instead\n // of rescanning every range for every code point. This keeps detection\n // linear even for long transcripts containing many URLs/identifiers.\n while (technicalIndex < technicalTokens.length && index >= technicalTokens[technicalIndex]!.end) {\n technicalIndex += 1;\n }\n const technicalRange = technicalTokens[technicalIndex];\n const isTechnical = technicalRange !== undefined\n && index >= technicalRange.start\n && index < technicalRange.end;\n if (!isTechnical) {\n const direction = classify(character);\n if (direction === 'ltr') ltr += 1;\n if (direction === 'rtl') rtl += 1;\n if (firstStrong === 'neutral' && direction !== 'neutral') firstStrong = direction;\n }\n index += character.length;\n }\n\n return { ltr, rtl, total: ltr + rtl, firstStrong, technicalTokens };\n}\n\nfunction fallbackDirection(options: Required): Direction {\n return options.fallback;\n}\n\nfunction directionFromCounts(\n counts: StrongCharacterCounts & { firstStrong: Direction },\n normalized: Required\n): Direction {\n if (normalized.strategy === 'ltr' || normalized.strategy === 'rtl') return normalized.strategy;\n if (normalized.strategy === 'inherit') return normalized.inheritedDirection;\n if (counts.total < normalized.minimumStrongCharacters) return fallbackDirection(normalized);\n\n if (normalized.strategy === 'first-strong' || normalized.strategy === 'strict-uax9') {\n return counts.firstStrong === 'neutral' ? fallbackDirection(normalized) : counts.firstStrong;\n }\n\n if (counts.rtl > counts.ltr && counts.rtl / counts.total >= normalized.majorityThreshold) return 'rtl';\n if (counts.ltr > counts.rtl && counts.ltr / counts.total >= normalized.majorityThreshold) return 'ltr';\n return counts.firstStrong === 'neutral' ? fallbackDirection(normalized) : counts.firstStrong;\n}\n\nexport function detectDirection(text: string, options: DetectionOptions = {}): Direction {\n const normalized = normalizeOptions(options);\n if (normalized.strategy === 'ltr' || normalized.strategy === 'rtl') return normalized.strategy;\n if (normalized.strategy === 'inherit') return normalized.inheritedDirection;\n return directionFromCounts(countStrongCharactersNormalized(text, normalized), normalized);\n}\n\nfunction confidenceFor(counts: StrongCharacterCounts, direction: Direction): number {\n if (counts.total === 0 || direction === 'neutral') return 0;\n const matching = direction === 'rtl' ? counts.rtl : counts.ltr;\n return Number((matching / counts.total).toFixed(4));\n}\n\nfunction firstBidiStrongCharacter(text: string): Direction {\n for (const character of text) {\n const direction = classifyBidiStrongCharacter(character);\n if (direction !== 'neutral') return direction;\n }\n return 'neutral';\n}\n\nfunction splitParagraphs(text: string): Array<{ text: string; start: number; end: number }> {\n const paragraphs: Array<{ text: string; start: number; end: number }> = [];\n const separator = /\\r\\n|\\n|\\r|\\u2029/gu;\n let start = 0;\n let match: RegExpExecArray | null;\n\n while ((match = separator.exec(text)) !== null) {\n paragraphs.push({ text: text.slice(start, match.index), start, end: match.index });\n start = match.index + match[0].length;\n }\n paragraphs.push({ text: text.slice(start), start, end: text.length });\n return paragraphs;\n}\n\nexport function analyzeParagraph(text: string, start = 0, options: DetectionOptions = {}): ParagraphAnalysis {\n const normalized = normalizeOptions(options);\n const countsWithFirst = countStrongCharactersNormalized(text, normalized);\n const counts: StrongCharacterCounts = {\n ltr: countsWithFirst.ltr,\n rtl: countsWithFirst.rtl,\n total: countsWithFirst.total\n };\n const direction = directionFromCounts(countsWithFirst, normalized);\n return {\n text,\n start,\n end: start + text.length,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n confidence: confidenceFor(counts, direction),\n counts\n };\n}\n\nexport function analyzeText(text: string, options: DetectionOptions = {}): TextAnalysis {\n const normalized = normalizeOptions(options);\n const countsWithFirst = countStrongCharactersNormalized(text, normalized);\n const counts: StrongCharacterCounts = {\n ltr: countsWithFirst.ltr,\n rtl: countsWithFirst.rtl,\n total: countsWithFirst.total\n };\n const direction = directionFromCounts(countsWithFirst, normalized);\n const rawCountsWithFirst = countStrongCharactersNormalized(text, normalizeOptions({\n ...normalized,\n strategy: 'content-majority',\n excludeTechnicalTokens: false\n }));\n const rawCounts: StrongCharacterCounts = {\n ltr: rawCountsWithFirst.ltr,\n rtl: rawCountsWithFirst.rtl,\n total: rawCountsWithFirst.total\n };\n const split = splitParagraphs(text);\n const paragraphs = split.length === 1\n ? [{\n text,\n start: 0,\n end: text.length,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n confidence: confidenceFor(counts, direction),\n counts\n }]\n : split.map((paragraph) => analyzeParagraph(paragraph.text, paragraph.start, normalized));\n return {\n text,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n rawFirstStrong: firstBidiStrongCharacter(text),\n confidence: confidenceFor(counts, direction),\n counts,\n rawCounts,\n paragraphs,\n mixed: rawCounts.ltr > 0 && rawCounts.rtl > 0\n };\n}\n", "import type {\n BidiControlFinding,\n BidiControlRisk,\n BidiControlSanitizationGroup,\n BidiSecurityFinding,\n BidiSecurityMode,\n BidiSecurityReport,\n BidiSecuritySeverity\n} from './types.js';\n\nconst CONTROL_METADATA = new Map>([\n [0x061c, { name: 'ARABIC LETTER MARK', risk: 'low', category: 'mark' }],\n [0x200e, { name: 'LEFT-TO-RIGHT MARK', risk: 'low', category: 'mark' }],\n [0x200f, { name: 'RIGHT-TO-LEFT MARK', risk: 'low', category: 'mark' }],\n [0x202a, { name: 'LEFT-TO-RIGHT EMBEDDING', risk: 'high', category: 'embedding' }],\n [0x202b, { name: 'RIGHT-TO-LEFT EMBEDDING', risk: 'high', category: 'embedding' }],\n [0x202c, { name: 'POP DIRECTIONAL FORMATTING', risk: 'medium', category: 'pop' }],\n [0x202d, { name: 'LEFT-TO-RIGHT OVERRIDE', risk: 'high', category: 'override' }],\n [0x202e, { name: 'RIGHT-TO-LEFT OVERRIDE', risk: 'high', category: 'override' }],\n [0x2066, { name: 'LEFT-TO-RIGHT ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2067, { name: 'RIGHT-TO-LEFT ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2068, { name: 'FIRST STRONG ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2069, { name: 'POP DIRECTIONAL ISOLATE', risk: 'medium', category: 'pop' }],\n [0x206a, { name: 'INHIBIT SYMMETRIC SWAPPING', risk: 'medium', category: 'deprecated' }],\n [0x206b, { name: 'ACTIVATE SYMMETRIC SWAPPING', risk: 'medium', category: 'deprecated' }],\n [0x206c, { name: 'INHIBIT ARABIC FORM SHAPING', risk: 'medium', category: 'deprecated' }],\n [0x206d, { name: 'ACTIVATE ARABIC FORM SHAPING', risk: 'medium', category: 'deprecated' }],\n [0x206e, { name: 'NATIONAL DIGIT SHAPES', risk: 'medium', category: 'deprecated' }],\n [0x206f, { name: 'NOMINAL DIGIT SHAPES', risk: 'medium', category: 'deprecated' }]\n]);\n\nconst REMEDIATION = 'Remove the control unless a documented plain-text protocol requires it; prefer semantic markup and isolation.';\n\nfunction severityForRisk(risk: BidiControlRisk): BidiSecuritySeverity {\n if (risk === 'high') return 'high';\n if (risk === 'medium') return 'warning';\n return 'info';\n}\n\nfunction rangeFor(control: BidiControlFinding): BidiSecurityFinding['sourceRange'] {\n return {\n utf16: { start: control.index, end: control.end },\n codePoint: { start: control.codePointIndex, end: control.codePointIndex + 1 }\n };\n}\n\nfunction codeForControl(control: BidiControlFinding): string {\n if (control.category === 'override') return 'BIDI_OVERRIDE_CONTROL';\n if (control.category === 'embedding') return 'BIDI_EMBEDDING_CONTROL';\n if (control.category === 'isolate') return 'BIDI_ISOLATE_CONTROL';\n if (control.category === 'mark') return 'BIDI_DIRECTIONAL_MARK';\n if (control.category === 'deprecated') return 'BIDI_DEPRECATED_CONTROL';\n return 'BIDI_POP_CONTROL';\n}\n\nfunction controlFinding(control: BidiControlFinding): BidiSecurityFinding {\n return {\n code: codeForControl(control),\n severity: severityForRisk(control.risk),\n message: `${control.name} (${control.codePoint}) is invisible and changes bidirectional interpretation.`,\n sourceRange: rangeFor(control),\n remediation: REMEDIATION,\n control\n };\n}\n\nexport function findBidiControls(text: string): BidiControlFinding[] {\n const findings: BidiControlFinding[] = [];\n let utf16Index = 0;\n let codePointIndex = 0;\n\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const metadata = CONTROL_METADATA.get(codePoint);\n if (metadata) {\n findings.push({\n character,\n codePoint: `U+${codePoint.toString(16).toUpperCase().padStart(4, '0')}`,\n index: utf16Index,\n end: utf16Index + character.length,\n codePointIndex,\n ...metadata\n });\n }\n utf16Index += character.length;\n codePointIndex += 1;\n }\n return findings;\n}\n\nexport function visibleBidiControls(text: string): string {\n const namesByCodePoint = new Map([...CONTROL_METADATA].map(([codePoint, metadata]) => [codePoint, metadata.name]));\n let result = '';\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const name = namesByCodePoint.get(codePoint);\n result += name ? `\u27E6${name}\u27E7` : character;\n }\n return result;\n}\n\nexport function highestControlRisk(findings: readonly BidiControlFinding[]): BidiControlRisk | null {\n if (findings.some((finding) => finding.risk === 'high')) return 'high';\n if (findings.some((finding) => finding.risk === 'medium')) return 'medium';\n if (findings.some((finding) => finding.risk === 'low')) return 'low';\n return null;\n}\n\ninterface FormattingFrame {\n kind: 'embedding' | 'isolate';\n control: BidiControlFinding;\n}\n\nfunction lastFrameIndex(stack: readonly FormattingFrame[], kind: FormattingFrame['kind']): number {\n for (let index = stack.length - 1; index >= 0; index -= 1) {\n if (stack[index]?.kind === kind) return index;\n }\n return -1;\n}\n\nfunction balanceFindings(controls: readonly BidiControlFinding[]): BidiSecurityFinding[] {\n const findings: BidiSecurityFinding[] = [];\n const stack: FormattingFrame[] = [];\n\n for (const control of controls) {\n const codePoint = control.codePoint;\n if (codePoint === 'U+202A' || codePoint === 'U+202B' || codePoint === 'U+202D' || codePoint === 'U+202E') {\n stack.push({ kind: 'embedding', control });\n continue;\n }\n if (codePoint === 'U+2066' || codePoint === 'U+2067' || codePoint === 'U+2068') {\n stack.push({ kind: 'isolate', control });\n continue;\n }\n if (codePoint === 'U+202C') {\n const isolateIndex = lastFrameIndex(stack, 'isolate');\n const embeddingIndex = lastFrameIndex(stack, 'embedding');\n if (embeddingIndex <= isolateIndex) {\n findings.push({\n code: 'BIDI_UNMATCHED_PDF',\n severity: 'high',\n message: 'POP DIRECTIONAL FORMATTING has no matching active embedding or override.',\n sourceRange: rangeFor(control),\n remediation: 'Remove the unmatched PDF or add the intended opener within the same isolate.',\n control\n });\n } else {\n stack.splice(embeddingIndex, 1);\n }\n continue;\n }\n if (codePoint === 'U+2069') {\n const isolateIndex = lastFrameIndex(stack, 'isolate');\n if (isolateIndex < 0) {\n findings.push({\n code: 'BIDI_UNMATCHED_PDI',\n severity: 'high',\n message: 'POP DIRECTIONAL ISOLATE has no matching isolate opener.',\n sourceRange: rangeFor(control),\n remediation: 'Remove the unmatched PDI or add the intended LRI, RLI, or FSI opener.',\n control\n });\n } else {\n const crossing = stack.slice(isolateIndex + 1).filter((frame) => frame.kind === 'embedding');\n for (const frame of crossing) {\n findings.push({\n code: 'BIDI_FORMAT_CROSSES_ISOLATE_BOUNDARY',\n severity: 'high',\n message: `${frame.control.name} is not closed before the containing isolate ends.`,\n sourceRange: rangeFor(frame.control),\n remediation: 'Close the embedding or override with PDF before PDI.',\n control: frame.control\n });\n }\n stack.splice(isolateIndex);\n }\n }\n }\n\n for (const frame of stack) {\n findings.push({\n code: frame.kind === 'isolate' ? 'BIDI_UNCLOSED_ISOLATE' : 'BIDI_UNCLOSED_EMBEDDING',\n severity: 'high',\n message: `${frame.control.name} is not terminated before the end of the text.`,\n sourceRange: rangeFor(frame.control),\n remediation: frame.kind === 'isolate'\n ? 'Add the matching PDI or remove the isolate opener.'\n : 'Add the matching PDF or remove the embedding/override opener.',\n control: frame.control\n });\n }\n return findings;\n}\n\nfunction isAsciiIdentifierCharacter(value: string | undefined): boolean {\n return value !== undefined && /^[A-Za-z0-9_$]$/u.test(value);\n}\n\nfunction invisibleCharacterFindings(text: string): BidiSecurityFinding[] {\n const findings: BidiSecurityFinding[] = [];\n const characters = [...text];\n let utf16Index = 0;\n for (let codePointIndex = 0; codePointIndex < characters.length; codePointIndex += 1) {\n const character = characters[codePointIndex]!;\n const sourceRange = {\n utf16: { start: utf16Index, end: utf16Index + character.length },\n codePoint: { start: codePointIndex, end: codePointIndex + 1 }\n };\n if (character === '\\u200B') {\n findings.push({\n code: 'HIDDEN_ZERO_WIDTH_SPACE',\n severity: 'warning',\n message: 'ZERO WIDTH SPACE (U+200B) is hidden and can disguise identifiers, links, or filenames.',\n sourceRange,\n remediation: 'Remove it from identifiers and source-like content unless its use is explicitly required.'\n });\n }\n if ((character === '\\u200C' || character === '\\u200D')\n && isAsciiIdentifierCharacter(characters[codePointIndex - 1])\n && isAsciiIdentifierCharacter(characters[codePointIndex + 1])) {\n const name = character === '\\u200C' ? 'ZERO WIDTH NON-JOINER' : 'ZERO WIDTH JOINER';\n findings.push({\n code: 'HIDDEN_IDENTIFIER_JOINER',\n severity: 'warning',\n message: `${name} is hidden inside an ASCII identifier-like token.`,\n sourceRange,\n remediation: 'Remove the joiner from machine identifiers, or document and validate the identifier protocol that requires it.'\n });\n }\n if (character === '\\u2060') {\n findings.push({\n code: 'HIDDEN_WORD_JOINER',\n severity: 'info',\n message: 'WORD JOINER (U+2060) is invisible and can disguise token boundaries.',\n sourceRange,\n remediation: 'Confirm that non-breaking behavior is required; remove it from identifiers and source-like content.'\n });\n }\n // A leading U+FEFF can represent a decoded byte-order signature. The same\n // character midstream is invisible content and deserves an explicit finding.\n if (character === '\\uFEFF' && codePointIndex > 0) {\n findings.push({\n code: 'HIDDEN_MIDSTREAM_BOM',\n severity: 'warning',\n message: 'ZERO WIDTH NO-BREAK SPACE/BOM (U+FEFF) appears inside the text.',\n sourceRange,\n remediation: 'Remove the midstream BOM unless a documented protocol explicitly requires it.'\n });\n }\n utf16Index += character.length;\n }\n return findings;\n}\n\n/** Audits hidden bidi formatting without mutating the source string. */\nexport function scanBidiSecurity(\n text: string,\n options: { mode?: BidiSecurityMode } = {}\n): BidiSecurityReport {\n const mode = options.mode ?? 'audit';\n if (mode === 'off') return { mode, safe: true, shouldBlock: false, controls: [], findings: [] };\n const controls = findBidiControls(text);\n const findings = [\n ...controls.map(controlFinding),\n ...balanceFindings(controls),\n ...invisibleCharacterFindings(text)\n ].sort((a, b) => a.sourceRange.utf16.start - b.sourceRange.utf16.start || a.code.localeCompare(b.code));\n const hasHigh = findings.some((finding) => finding.severity === 'high');\n return {\n mode,\n safe: !hasHigh,\n shouldBlock: mode === 'strict' ? findings.length > 0 : mode === 'warn' && hasHigh,\n controls,\n findings\n };\n}\n\nexport interface SanitizeBidiControlsOptions {\n /** Remove controls with these risk levels. Defaults to every level. */\n remove?: BidiControlRisk[];\n /**\n * Remove only these semantic control groups. PDF follows embedding/override;\n * PDI follows isolate, so preserved isolate pairs stay structurally intact.\n */\n removeGroups?: BidiControlSanitizationGroup[];\n}\n\nconst ALL_SANITIZATION_GROUPS: readonly BidiControlSanitizationGroup[] = [\n 'mark', 'embedding-override', 'isolate', 'deprecated'\n];\n\nconst SANITIZATION_GROUP_RISK: Readonly> = {\n mark: 'low',\n 'embedding-override': 'high',\n isolate: 'medium',\n deprecated: 'medium'\n};\n\nfunction sanitizationGroup(codePoint: number, category: BidiControlFinding['category']): BidiControlSanitizationGroup {\n if (codePoint === 0x202c || category === 'embedding' || category === 'override') {\n return 'embedding-override';\n }\n if (codePoint === 0x2069 || category === 'isolate') return 'isolate';\n if (category === 'mark' || category === 'deprecated') return category;\n // Every recognized pop is handled above; keep an explicit defensive\n // fallback so future metadata cannot silently escape the default sanitizer.\n return 'deprecated';\n}\n\nexport function sanitizeBidiControls(\n text: string,\n options: SanitizeBidiControlsOptions = {}\n): { text: string; removed: BidiControlFinding[] } {\n const remove = new Set(options.remove ?? ['high', 'medium', 'low']);\n const removeGroups = new Set(options.removeGroups ?? ALL_SANITIZATION_GROUPS);\n const grouped = options.removeGroups !== undefined;\n const removed: BidiControlFinding[] = [];\n let output = '';\n let utf16Index = 0;\n let codePointIndex = 0;\n\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const metadata = CONTROL_METADATA.get(codePoint);\n const group = metadata && sanitizationGroup(codePoint, metadata.category);\n const selected = metadata && group && removeGroups.has(group)\n && remove.has(grouped ? SANITIZATION_GROUP_RISK[group] : metadata.risk);\n if (metadata && selected) {\n removed.push({\n character,\n codePoint: `U+${codePoint.toString(16).toUpperCase().padStart(4, '0')}`,\n index: utf16Index,\n end: utf16Index + character.length,\n codePointIndex,\n ...metadata\n });\n } else {\n output += character;\n }\n utf16Index += character.length;\n codePointIndex += 1;\n }\n\n return { text: output, removed };\n}\n", "import { classifyBidiStrongCharacter } from './classify.js';\nimport { findBidiControls } from './security.js';\nimport type { ResolvedDirection } from './types.js';\n\n/**\n * `auto` is the non-interference default: ordinary LTR content in an LTR\n * context receives no BidiLens markup or DOM mutation. `always` retains the\n * explicit-annotation behavior for integrations that require stable markers.\n */\nexport type BidiInterventionMode = 'auto' | 'always';\n\nexport interface BidiInterventionOptions {\n intervention?: BidiInterventionMode | undefined;\n inheritedDirection?: ResolvedDirection | undefined;\n}\n\n/**\n * Reports whether rendering metadata is needed for a string in its host\n * context. Hidden bidi controls deliberately disable the LTR fast path so an\n * apparently English string cannot bypass bidi-aware handling.\n */\nexport function needsBidiIntervention(\n text: string,\n options: BidiInterventionOptions = {}\n): boolean {\n if (options.intervention === 'always') return true;\n if (findBidiControls(text).length > 0) return true;\n\n let hasLtr = false;\n for (const character of text) {\n const direction = classifyBidiStrongCharacter(character);\n if (direction === 'rtl') return true;\n if (direction === 'ltr') hasLtr = true;\n }\n\n return options.inheritedDirection === 'rtl' && (hasLtr || text.length > 0);\n}\n", "import { classifyCharacter } from './classify.js';\nimport { isolateText } from './controls.js';\nimport { findTechnicalTokenRanges } from './detect.js';\nimport { needsBidiIntervention } from './intervention.js';\nimport type { BidiInterventionMode } from './intervention.js';\nimport type { Direction, DirectionalRun, InlineIsolation } from './types.js';\n\ntype PlannedIsolation = Omit;\n\nfunction attachSourceRanges(text: string, isolations: Omit[]): InlineIsolation[] {\n const codePointAtUtf16 = new Uint32Array(text.length + 1);\n let utf16Offset = 0;\n let codePointOffset = 0;\n for (const character of text) {\n codePointAtUtf16[utf16Offset] = codePointOffset;\n if (character.length === 2) codePointAtUtf16[utf16Offset + 1] = codePointOffset;\n utf16Offset += character.length;\n codePointOffset += 1;\n codePointAtUtf16[utf16Offset] = codePointOffset;\n }\n return isolations.map((isolation) => ({\n ...isolation,\n sourceRange: {\n utf16: { start: isolation.start, end: isolation.end },\n codePoint: {\n start: codePointAtUtf16[isolation.start]!,\n end: codePointAtUtf16[isolation.end]!\n }\n }\n }));\n}\n\nfunction resolveNeutralRuns(runs: DirectionalRun[]): DirectionalRun[] {\n const previousStrong: Direction[] = new Array(runs.length).fill('neutral');\n const nextStrong: Direction[] = new Array(runs.length).fill('neutral');\n let previous: Direction = 'neutral';\n let next: Direction = 'neutral';\n\n for (let index = 0; index < runs.length; index += 1) {\n previousStrong[index] = previous;\n const direction = runs[index]!.direction;\n if (direction !== 'neutral') previous = direction;\n }\n\n for (let index = runs.length - 1; index >= 0; index -= 1) {\n nextStrong[index] = next;\n const direction = runs[index]!.direction;\n if (direction !== 'neutral') next = direction;\n }\n\n return runs.map((run, index) => {\n if (run.direction !== 'neutral') return run;\n const before = previousStrong[index] ?? 'neutral';\n const after = nextStrong[index] ?? 'neutral';\n const direction: Direction = before === after && before !== 'neutral'\n ? before\n : before !== 'neutral'\n ? before\n : after;\n return { ...run, direction };\n });\n}\n\nfunction mergeAdjacent(runs: DirectionalRun[]): DirectionalRun[] {\n const merged: DirectionalRun[] = [];\n for (const run of runs) {\n const previous = merged.at(-1);\n if (previous && previous.direction === run.direction) {\n previous.text += run.text;\n previous.end = run.end;\n } else {\n merged.push({ ...run });\n }\n }\n return merged;\n}\n\nfunction trimNeutralBoundaries(text: string, start: number, end: number): { start: number; end: number } {\n while (start < end) {\n const character = text.slice(start).match(/^./su)?.[0];\n if (!character || classifyCharacter(character) !== 'neutral') break;\n start += character.length;\n }\n while (end > start) {\n const character = text.slice(0, end).match(/.$/su)?.[0];\n if (!character || classifyCharacter(character) !== 'neutral') break;\n end -= character.length;\n }\n return { start, end };\n}\n\nconst HARD_FRAGMENT_SEPARATOR = /[,\u060C;\u061B:!?\u061F|]/u;\n\n/**\n * Punctuation separates semantic LTR fragments in an RTL paragraph, while\n * whitespace joins adjacent fragments into one ordered phrase. Without this\n * normalization, two neighboring isolates such as `page` and `97` are\n * reordered as independent RTL atoms.\n */\nfunction normalizeIsolationPlan(text: string, isolations: PlannedIsolation[]): PlannedIsolation[] {\n const split: PlannedIsolation[] = [];\n for (const isolation of isolations) {\n if (isolation.kind !== 'opposite-direction-run') {\n split.push(isolation);\n continue;\n }\n let pieceStart = isolation.start;\n let cursor = isolation.start;\n for (const character of text.slice(isolation.start, isolation.end)) {\n const index = cursor;\n cursor += character.length;\n if (HARD_FRAGMENT_SEPARATOR.test(character)) {\n const trimmed = trimNeutralBoundaries(text, pieceStart, index);\n if (trimmed.start < trimmed.end) {\n split.push({\n ...isolation,\n text: text.slice(trimmed.start, trimmed.end),\n start: trimmed.start,\n end: trimmed.end\n });\n }\n pieceStart = cursor;\n }\n }\n const trimmed = trimNeutralBoundaries(text, pieceStart, isolation.end);\n if (trimmed.start < trimmed.end) {\n split.push({\n ...isolation,\n text: text.slice(trimmed.start, trimmed.end),\n start: trimmed.start,\n end: trimmed.end\n });\n }\n }\n\n const ordered = split.sort((a, b) => a.start - b.start || a.end - b.end);\n const merged: PlannedIsolation[] = [];\n for (const isolation of ordered) {\n const previous = merged.at(-1);\n if (\n previous &&\n previous.direction === isolation.direction &&\n previous.end <= isolation.start &&\n /^\\s*$/u.test(text.slice(previous.end, isolation.start))\n ) {\n previous.end = isolation.end;\n previous.text = text.slice(previous.start, previous.end);\n if (previous.kind !== isolation.kind) previous.kind = 'opposite-direction-run';\n } else {\n merged.push({ ...isolation });\n }\n }\n return merged;\n}\n\nexport function segmentDirectionalRuns(text: string): DirectionalRun[] {\n if (!text) return [];\n const runs: DirectionalRun[] = [];\n let currentDirection: Direction | null = null;\n let currentText = '';\n let start = 0;\n let index = 0;\n\n for (const character of text) {\n const direction = classifyCharacter(character);\n if (currentDirection === null) {\n currentDirection = direction;\n currentText = character;\n start = index;\n } else if (direction === currentDirection) {\n currentText += character;\n } else {\n runs.push({ text: currentText, direction: currentDirection, start, end: index });\n currentDirection = direction;\n currentText = character;\n start = index;\n }\n index += character.length;\n }\n\n if (currentDirection !== null) {\n runs.push({ text: currentText, direction: currentDirection, start, end: index });\n }\n\n return mergeAdjacent(resolveNeutralRuns(runs));\n}\n\nexport function isolateDirectionalRuns(text: string): string {\n return segmentDirectionalRuns(text)\n .map((run) => isolateText(run.text, run.direction))\n .join('');\n}\n\n/**\n * Plans semantic inline boundaries without changing the stored source text.\n * Technical ranges are isolated first; opposite natural-language runs are\n * then isolated only when they differ from the block's base direction.\n */\nexport function planInlineIsolation(\n text: string,\n blockDirection: Exclude,\n options: {\n excludeTechnicalTokens?: boolean;\n isolateOppositeRuns?: boolean;\n intervention?: BidiInterventionMode | undefined;\n technicalIdentifiers?: readonly string[] | undefined;\n } = {}\n): InlineIsolation[] {\n if (!needsBidiIntervention(text, {\n intervention: options.intervention,\n inheritedDirection: blockDirection\n })) return [];\n const technical = options.excludeTechnicalTokens === false\n ? []\n : findTechnicalTokenRanges(text, options.technicalIdentifiers);\n const isolations: Omit[] = technical.map((range) => ({\n text: range.text,\n direction: 'ltr',\n start: range.start,\n end: range.end,\n kind: range.kind\n }));\n\n if (options.isolateOppositeRuns === false) {\n return attachSourceRanges(text, normalizeIsolationPlan(text, isolations));\n }\n\n let technicalIndex = 0;\n for (const run of segmentDirectionalRuns(text)) {\n if (run.direction === 'neutral' || run.direction === blockDirection) continue;\n while (technicalIndex < technical.length && technical[technicalIndex]!.end <= run.start) {\n technicalIndex += 1;\n }\n let cursor = run.start;\n for (let index = technicalIndex; index < technical.length; index += 1) {\n const range = technical[index]!;\n if (range.end <= cursor) continue;\n if (range.start >= run.end) break;\n const partEnd = Math.min(range.start, run.end);\n if (cursor < partEnd) {\n const trimmed = trimNeutralBoundaries(text, cursor, partEnd);\n if (trimmed.start < trimmed.end) isolations.push({\n text: text.slice(trimmed.start, trimmed.end),\n direction: run.direction,\n start: trimmed.start,\n end: trimmed.end,\n kind: 'opposite-direction-run'\n });\n }\n cursor = Math.max(cursor, range.end);\n if (cursor >= run.end) break;\n }\n if (cursor < run.end) {\n const trimmed = trimNeutralBoundaries(text, cursor, run.end);\n if (trimmed.start < trimmed.end) isolations.push({\n text: text.slice(trimmed.start, trimmed.end),\n direction: run.direction,\n start: trimmed.start,\n end: trimmed.end,\n kind: 'opposite-direction-run'\n });\n }\n }\n\n return attachSourceRanges(text, normalizeIsolationPlan(text, isolations));\n}\n", "import {\n analyzeText,\n needsBidiIntervention,\n planInlineIsolation,\n type BidiInterventionMode,\n type DetectionOptions,\n type ResolvedDirection,\n type TextAnalysis\n} from '@bidilens/core';\n\nexport interface RenderHtmlOptions extends DetectionOptions {\n blockTag?: string;\n containerTag?: string | false;\n blockClassName?: string;\n containerClassName?: string;\n includeDataAttributes?: boolean;\n /** Skip BidiLens markup for LTR-only text in an LTR context. */\n intervention?: BidiInterventionMode;\n}\n\nexport interface RenderedHtmlBlock {\n text: string;\n html: string;\n direction: ResolvedDirection;\n start: number;\n end: number;\n}\n\nexport interface RenderedBidiHtml {\n source: string;\n html: string;\n analysis: TextAnalysis;\n blocks: RenderedHtmlBlock[];\n}\n\nconst SAFE_TAG = /^[a-z][a-z0-9-]*$/u;\nconst SAFE_BLOCK_TAGS = new Set([\n 'address', 'article', 'aside', 'blockquote', 'dd', 'div', 'dt', 'figcaption',\n 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'li', 'main', 'nav',\n 'p', 'pre', 'section', 'span', 'td', 'th'\n]);\nconst SAFE_CONTAINER_TAGS = new Set([\n 'article', 'aside', 'blockquote', 'div', 'footer', 'header', 'main', 'nav', 'section', 'span'\n]);\n\nexport function escapeHtml(value: string): string {\n return value.replace(/[&<>\"']/gu, (character) => ({\n '&': '&', '<': '<', '>': '>', '\"': '"', \"'\": '''\n }[character] ?? character));\n}\n\nfunction checkedTag(value: string, option: string, allowed: ReadonlySet): string {\n const normalized = value.toLowerCase();\n if (!SAFE_TAG.test(normalized) || !allowed.has(normalized)) {\n throw new Error(`${option} must be an allowed non-executable HTML container tag.`);\n }\n return normalized;\n}\n\nfunction classAttribute(value: string | undefined): string {\n return value ? ` class=\"${escapeHtml(value)}\"` : '';\n}\n\nexport function renderInlineBidiHtml(\n source: string,\n direction: ResolvedDirection,\n options: {\n includeDataAttributes?: boolean;\n intervention?: BidiInterventionMode | undefined;\n technicalIdentifiers?: readonly string[] | undefined;\n } = {}\n): string {\n const includeData = options.includeDataAttributes ?? true;\n const isolations = planInlineIsolation(source, direction, {\n intervention: options.intervention,\n technicalIdentifiers: options.technicalIdentifiers\n });\n let html = '';\n let cursor = 0;\n for (const isolation of isolations) {\n html += escapeHtml(source.slice(cursor, isolation.start));\n const tag = isolation.kind === 'code' ? 'code' : 'bdi';\n const data = includeData\n ? ` data-bidilens-isolate=\"\" data-bidilens-kind=\"${isolation.kind}\"${isolation.kind === 'code' ? ' data-bidilens-code=\"\"' : ''}`\n : '';\n html += `<${tag} dir=\"${isolation.direction}\"${data}>${escapeHtml(isolation.text)}`;\n cursor = isolation.end;\n }\n return html + escapeHtml(source.slice(cursor));\n}\n\n/** Serializes untrusted plain text; it never accepts or emits unescaped source HTML. */\nexport function renderBidiHtml(source: string, options: RenderHtmlOptions = {}): RenderedBidiHtml {\n const detection: DetectionOptions = {\n ...options,\n fallback: options.fallback ?? options.inheritedDirection ?? 'ltr'\n };\n const analysis = analyzeText(source, detection);\n const blockTag = checkedTag(options.blockTag ?? 'p', 'blockTag', SAFE_BLOCK_TAGS);\n const includeData = options.includeDataAttributes ?? true;\n const intervene = analysis.paragraphs.some((paragraph) => paragraph.direction === 'rtl')\n || needsBidiIntervention(source, {\n intervention: options.intervention,\n inheritedDirection: options.inheritedDirection\n });\n const blocks = analysis.paragraphs.map((paragraph) => {\n const direction = paragraph.direction === 'neutral'\n ? (options.inheritedDirection ?? 'ltr')\n : paragraph.direction;\n const data = intervene && includeData ? ' data-bidilens-block=\"\"' : '';\n const directionAttribute = intervene ? ` dir=\"${direction}\"` : '';\n const blockClass = classAttribute(options.blockClassName);\n const inline = intervene\n ? renderInlineBidiHtml(paragraph.text, direction, {\n includeDataAttributes: includeData,\n intervention: options.intervention,\n technicalIdentifiers: options.technicalIdentifiers\n })\n : escapeHtml(paragraph.text);\n const html = `<${blockTag}${directionAttribute}${data}${blockClass}>${inline}`;\n return { text: paragraph.text, html, direction, start: paragraph.start, end: paragraph.end };\n });\n\n const serializedBlocks = blocks.map((block, index) => {\n const next = blocks[index + 1];\n const separator = next ? source.slice(block.end, next.start) : '';\n return `${block.html}${escapeHtml(separator)}`;\n }).join('');\n const automaticContainer = blocks.length > 1 ? 'div' : false;\n const container = options.containerTag === undefined ? automaticContainer : options.containerTag;\n const html = container === false\n ? serializedBlocks\n : (() => {\n const tag = checkedTag(container, 'containerTag', SAFE_CONTAINER_TAGS);\n const data = intervene && includeData ? ' data-bidilens-document=\"\"' : '';\n const containerClass = classAttribute(options.containerClassName);\n return `<${tag}${data}${containerClass}>${serializedBlocks}`;\n })();\n return { source, html, analysis, blocks };\n}\n", "{\n \"name\": \"@bidilens/cli\",\n \"version\": \"0.3.0\",\n \"description\": \"CLI for inspecting direction and auditing hidden Unicode bidi controls.\",\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Shayan SalehiRad\",\n \"url\": \"https://github.com/CodeinScrubs\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/CodeinScrubs/BidiLens.git\",\n \"directory\": \"packages/cli\"\n },\n \"homepage\": \"https://github.com/CodeinScrubs/BidiLens#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/CodeinScrubs/BidiLens/issues\"\n },\n \"type\": \"module\",\n \"sideEffects\": false,\n \"keywords\": [\n \"bidi\",\n \"rtl\",\n \"ltr\",\n \"unicode\",\n \"cli\",\n \"security\"\n ],\n \"files\": [\n \"dist\",\n \"README.md\",\n \"LICENSE\",\n \"CHANGELOG.md\",\n \"THIRD_PARTY_NOTICES.md\",\n \"corpus\",\n \"examples\"\n ],\n \"bin\": {\n \"bidilens\": \"./dist/bin.js\"\n },\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/bin.ts --format esm --dts --clean --sourcemap\",\n \"prepack\": \"pnpm run build\",\n \"example\": \"node examples/basic.mjs\"\n },\n \"dependencies\": {\n \"@bidilens/core\": \"workspace:*\",\n \"@bidilens/html\": \"workspace:*\",\n \"commander\": \"^15.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C1B;AACA,MAAI,WAAY,OAAM,WAAW,QAAQ,CAAC;AAE1C,QAAM,UAAU,IAAI,eAAe,aAAa,OAAO,QAAQ,CAAC;AAChE,QAAM,UAAU,IAAI,eAAe,UAAU,MAAM;AACnD,MAAI,aAAa,EAAG,OAAM,YAAY,OAAO,OAAO,0BAA0B,QAAQ,GAAG;AACzF,SAAO,EAAE,UAAU,QAAQ,QAAQ,YAAY,QAAQ,WAAW;AACpE;AAEO,SAAS,cAAc,SAAyB;AACrD,QAAM,UAAU,QACb,WAAW,KAAK,KAAK,EACrB,WAAW,MAAM,KAAK,EACtB,WAAW,MAAM,KAAK;AACzB,SAAO,2BAA2B,OAAO;AAC3C;;;ADxIA,eAAe,OAAsB;AACnC,MAAI;AACF,UAAM,SAAS,MAAM,UAAU;AAC/B,yBAAAE,QAAQ,WAAW,OAAO;AAAA,EAC5B,SAAS,OAAO;AACd,UAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,yBAAAA,QAAQ,OAAO,MAAM,GAAG,cAAc,OAAO,CAAC;AAAA,CAAI;AAClD,yBAAAA,QAAQ,WAAW;AAAA,EACrB;AACF;AAEA,KAAK,KAAK;", + "sourcesContent": ["import process from 'node:process';\nimport { runAction, workflowError } from './index.js';\n\nasync function main(): Promise {\n try {\n const result = await runAction();\n process.exitCode = result.exitCode;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n process.stderr.write(`${workflowError(message)}\\n`);\n process.exitCode = 1;\n }\n}\n\nvoid main();\n", "import { appendFile, mkdir, writeFile } from 'node:fs/promises';\nimport { randomUUID } from 'node:crypto';\nimport { dirname, isAbsolute, relative, resolve } from 'node:path';\nimport process from 'node:process';\nimport { runCli } from '../../packages/cli/src/index.js';\n\nexport type ActionCommand = 'audit' | 'test';\nexport type ActionFormat = 'human' | 'json' | 'sarif';\nexport type ActionMode = 'off' | 'audit' | 'warn' | 'strict';\nexport type ActionRisk = 'low' | 'medium' | 'high';\n\nexport interface ActionInputs {\n command: ActionCommand;\n paths: string[];\n corpus: string;\n mode: ActionMode;\n failOn: ActionRisk;\n format: ActionFormat;\n sarifFile: string;\n}\n\nexport interface ActionContext {\n env?: NodeJS.ProcessEnv;\n cwd?: string;\n log?: (value: string) => void;\n error?: (value: string) => void;\n}\n\nexport interface ActionResult {\n exitCode: number;\n report: string;\n stdout: string;\n stderr: string;\n}\n\nfunction input(env: NodeJS.ProcessEnv, name: string): string {\n return env[`INPUT_${name.toUpperCase()}`]?.trim() ?? '';\n}\n\nfunction choice(\n name: string,\n value: string,\n fallback: Value,\n allowed: readonly Value[]\n): Value {\n const candidate = value || fallback;\n if (!allowed.includes(candidate as Value)) {\n throw new Error(`${name} must be one of ${allowed.join(', ')}; received ${JSON.stringify(candidate)}.`);\n }\n return candidate as Value;\n}\n\nexport function readActionInputs(env: NodeJS.ProcessEnv = process.env): ActionInputs {\n return {\n command: choice('command', input(env, 'COMMAND'), 'audit', ['audit', 'test']),\n paths: (input(env, 'PATHS') || '.').split(/\\r?\\n/u).map((path) => path.trim()).filter(Boolean),\n corpus: input(env, 'CORPUS'),\n mode: choice('mode', input(env, 'MODE'), 'audit', ['off', 'audit', 'warn', 'strict']),\n failOn: choice('fail-on', input(env, 'FAIL-ON'), 'high', ['low', 'medium', 'high']),\n format: choice('format', input(env, 'FORMAT'), 'human', ['human', 'json', 'sarif']),\n sarifFile: input(env, 'SARIF-FILE') || 'bidilens.sarif'\n };\n}\n\nexport function buildCliArguments(inputs: ActionInputs, env: NodeJS.ProcessEnv = process.env): string[] {\n if (inputs.command === 'test') {\n if (inputs.format === 'sarif') throw new Error('SARIF output is available only for the audit command.');\n const actionPath = env.GITHUB_ACTION_PATH\n ? resolve(env.GITHUB_ACTION_PATH)\n : resolve(env.GITHUB_WORKSPACE ?? process.cwd(), 'action');\n const corpus = inputs.corpus || resolve(actionPath, '..', 'corpus', 'cases.json');\n return ['node', 'bidilens', 'test', '--corpus', corpus, ...(inputs.format === 'json' ? ['--json'] : [])];\n }\n\n const format = inputs.format === 'json' ? ['--json'] : inputs.format === 'sarif' ? ['--sarif'] : [];\n return [\n 'node', 'bidilens', 'audit', ...inputs.paths,\n '--mode', inputs.mode,\n '--fail-on', inputs.failOn,\n ...format\n ];\n}\n\nfunction workspaceFile(cwd: string, requested: string): { absolute: string; relative: string } {\n const absolute = resolve(cwd, requested);\n const local = relative(cwd, absolute);\n if (!local || local.startsWith('..') || isAbsolute(local)) {\n throw new Error('sarif-file must resolve to a file inside GITHUB_WORKSPACE.');\n }\n return { absolute, relative: local.replaceAll('\\\\', '/') };\n}\n\nasync function setOutput(path: string | undefined, name: string, value: string): Promise {\n if (!path) return;\n const delimiter = `bidilens_${randomUUID()}`;\n await appendFile(path, `${name}<<${delimiter}\\n${value}\\n${delimiter}\\n`, 'utf8');\n}\n\n/** Executes the bundled CLI without a shell and propagates its real exit code. */\nexport async function runAction(context: ActionContext = {}): Promise {\n const env = context.env ?? process.env;\n const cwd = resolve(context.cwd ?? env.GITHUB_WORKSPACE ?? process.cwd());\n const log = context.log ?? console.log;\n const error = context.error ?? console.error;\n const inputs = readActionInputs(env);\n const stdout: string[] = [];\n const stderr: string[] = [];\n const exitCode = await runCli(buildCliArguments(inputs, env), {\n cwd,\n stdout: (value) => stdout.push(value),\n stderr: (value) => stderr.push(value)\n });\n const stdoutText = stdout.join('');\n const stderrText = stderr.join('');\n let report = '';\n\n if (inputs.format === 'sarif') {\n const target = workspaceFile(cwd, inputs.sarifFile);\n await mkdir(dirname(target.absolute), { recursive: true });\n await writeFile(target.absolute, stdoutText, 'utf8');\n report = target.relative;\n log(`BidiLens SARIF report written to ${report}.`);\n } else if (stdoutText) {\n log(stdoutText.trimEnd());\n }\n if (stderrText) error(stderrText.trimEnd());\n\n await setOutput(env.GITHUB_OUTPUT, 'exit-code', String(exitCode));\n await setOutput(env.GITHUB_OUTPUT, 'report', report);\n if (exitCode !== 0) error(`BidiLens ${inputs.command} failed with exit code ${exitCode}.`);\n return { exitCode, report, stdout: stdoutText, stderr: stderrText };\n}\n\nexport function workflowError(message: string): string {\n const escaped = message\n .replaceAll('%', '%25')\n .replaceAll('\\r', '%0D')\n .replaceAll('\\n', '%0A');\n return `::error title=BidiLens::${escaped}`;\n}\n", "#!/usr/bin/env node\nimport { lstat, readFile, readdir, writeFile } from 'node:fs/promises';\nimport { basename, extname, isAbsolute, relative, resolve } from 'node:path';\nimport process from 'node:process';\nimport { pathToFileURL } from 'node:url';\nimport { Command, CommanderError } from 'commander';\nimport { renderBidiHtml } from '@bidilens/html';\nimport packageManifest from '../package.json' with { type: 'json' };\nimport {\n analyzeText,\n findBidiControls,\n sanitizeBidiControls,\n scanBidiSecurity,\n visibleBidiControls,\n type BidiControlRisk,\n type BidiInterventionMode,\n type BidiSecurityFinding,\n type BidiSecurityMode\n} from '@bidilens/core';\n\nconst SUPPORTED_EXTENSIONS = new Set([\n '.md', '.mdx', '.txt', '.html', '.htm', '.json', '.yaml', '.yml',\n '.js', '.jsx', '.ts', '.tsx', '.css', '.scss', '.py', '.go', '.rs',\n '.java', '.kt', '.swift', '.c', '.cc', '.cpp', '.h', '.hpp', '.toml',\n '.vue', '.svelte', '.astro', '.dart', '.xml', '.svg', '.sh', '.bash',\n '.zsh', '.fish', '.cs', '.fs', '.fsx', '.vb', '.rb', '.php', '.sql',\n '.ini', '.conf', '.properties', '.gradle', '.groovy', '.lua', '.pl', '.r',\n '.ex', '.exs', '.erl', '.hrl'\n]);\n\nconst SUPPORTED_BASENAMES = new Set([\n 'dockerfile', 'makefile', 'gemfile', 'podfile', 'rakefile', 'cmakelists.txt',\n 'build', 'workspace', '.env'\n]);\n\nconst IGNORED_DIRECTORIES = new Set([\n 'node_modules', '.git', 'dist', 'build', 'coverage', 'test-results',\n 'playwright-report', '.vite', '.next', '.nuxt', '.svelte-kit', '.output'\n]);\n\nconst RISK_ORDER: Record = { low: 1, medium: 2, high: 3 };\nconst CLI_VERSION = packageManifest.version;\n\ninterface CorpusCase {\n id: string;\n text: string;\n expected: 'ltr' | 'rtl' | 'neutral';\n}\n\nexport interface CliRuntime {\n cwd?: string;\n stdout?: (value: string) => void;\n stderr?: (value: string) => void;\n}\n\ninterface RuntimeState {\n cwd: string;\n stdout: (value: string) => void;\n stderr: (value: string) => void;\n exitCode: number;\n}\n\nfunction createRuntime(runtime: CliRuntime): RuntimeState {\n return {\n cwd: resolve(runtime.cwd ?? process.cwd()),\n stdout: runtime.stdout ?? ((value) => process.stdout.write(value)),\n stderr: runtime.stderr ?? ((value) => process.stderr.write(value)),\n exitCode: 0\n };\n}\n\nfunction line(writer: (value: string) => void, value = ''): void {\n writer(`${value}\\n`);\n}\n\nasync function collectFiles(inputs: string[], cwd: string): Promise {\n const files: string[] = [];\n async function visitPath(input: string, explicitlyNamed: boolean): Promise {\n const absolute = resolve(cwd, input);\n const info = await lstat(absolute);\n if (info.isSymbolicLink()) return;\n if (info.isDirectory()) {\n const entries = await readdir(absolute, { withFileTypes: true });\n entries.sort((a, b) => a.name.localeCompare(b.name));\n for (const entry of entries) {\n if (IGNORED_DIRECTORIES.has(entry.name.toLowerCase())) continue;\n if (entry.isSymbolicLink()) continue;\n await visitPath(resolve(absolute, entry.name), false);\n }\n return;\n }\n const name = basename(absolute).toLowerCase();\n const supportedName = SUPPORTED_BASENAMES.has(name) || name.startsWith('.env.');\n if (info.isFile() && (explicitlyNamed || supportedName || SUPPORTED_EXTENSIONS.has(extname(absolute).toLowerCase()))) {\n files.push(absolute);\n }\n }\n for (const input of inputs) await visitPath(input, true);\n return files.sort((a, b) => a.localeCompare(b));\n}\n\nfunction parseCorpus(source: string, location: string): CorpusCase[] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(source);\n } catch (error) {\n throw new Error(`${location} is not valid JSON. ${String(error)}`, { cause: error });\n }\n if (!Array.isArray(parsed)) throw new Error(`${location} must contain a JSON array.`);\n const ids = new Set();\n return parsed.map((item: unknown, index) => {\n if (typeof item !== 'object' || item === null) {\n throw new Error(`${location}: case ${index + 1} must be an object.`);\n }\n const candidate = item as Record;\n if (typeof candidate.id !== 'string' || candidate.id.length === 0) {\n throw new Error(`${location}: case ${index + 1} must have a non-empty string id.`);\n }\n if (ids.has(candidate.id)) throw new Error(`${location}: duplicate case id \"${candidate.id}\".`);\n ids.add(candidate.id);\n if (typeof candidate.text !== 'string') {\n throw new Error(`${location}: case \"${candidate.id}\" must have string text.`);\n }\n if (candidate.expected !== 'ltr' && candidate.expected !== 'rtl' && candidate.expected !== 'neutral') {\n throw new Error(`${location}: case \"${candidate.id}\" has invalid expected direction.`);\n }\n return { id: candidate.id, text: candidate.text, expected: candidate.expected };\n });\n}\n\nasync function readCorpus(cwd: string, explicitPath?: string): Promise {\n if (explicitPath !== undefined) {\n const location = resolve(cwd, explicitPath);\n return parseCorpus(await readFile(location, 'utf8'), location);\n }\n const candidates: Array = [\n resolve(cwd, 'corpus/cases.json'),\n new URL('../corpus/cases.json', import.meta.url),\n new URL('../../../corpus/cases.json', import.meta.url)\n ];\n let lastError: unknown;\n for (const candidate of candidates) {\n let source: string;\n try {\n source = await readFile(candidate, 'utf8');\n } catch (error) {\n lastError = error;\n continue;\n }\n // An existing, malformed higher-priority corpus is a configuration error,\n // not a reason to silently fall back to a different data set.\n return parseCorpus(source, String(candidate));\n }\n throw new Error(`Unable to locate corpus/cases.json. Pass --corpus . ${String(lastError)}`);\n}\n\nfunction parseRisk(value: string): BidiControlRisk {\n if (value === 'low' || value === 'medium' || value === 'high') return value;\n throw new Error(`Invalid risk level: ${value}`);\n}\n\nfunction parseSecurityMode(value: string): BidiSecurityMode {\n if (value === 'off' || value === 'audit' || value === 'warn' || value === 'strict') return value;\n throw new Error(`Invalid security mode: ${value}`);\n}\n\nfunction parseIntervention(value: string): BidiInterventionMode {\n if (value === 'auto' || value === 'always') return value;\n throw new Error(`Invalid intervention mode: ${value}`);\n}\n\nfunction riskForFinding(finding: BidiSecurityFinding): BidiControlRisk {\n if (finding.severity === 'high') return 'high';\n if (finding.severity === 'warning') return 'medium';\n return 'low';\n}\n\nfunction highestFindingRisk(findings: readonly BidiSecurityFinding[]): BidiControlRisk | null {\n if (findings.some((finding) => finding.severity === 'high')) return 'high';\n if (findings.some((finding) => finding.severity === 'warning')) return 'medium';\n if (findings.length) return 'low';\n return null;\n}\n\nfunction sourcePosition(text: string, utf16Offset: number): { line: number; column: number } {\n let lineNumber = 1;\n let lineStart = 0;\n const newline = /\\r\\n|\\n|\\r/gu;\n let match: RegExpExecArray | null;\n while ((match = newline.exec(text)) !== null && match.index < utf16Offset) {\n lineNumber += 1;\n lineStart = match.index + match[0].length;\n }\n return { line: lineNumber, column: utf16Offset - lineStart + 1 };\n}\n\nfunction artifactUri(file: string, cwd: string): string {\n const local = relative(cwd, file);\n if (local && !local.startsWith('..') && !isAbsolute(local)) return local.replaceAll('\\\\', '/');\n return pathToFileURL(file).href;\n}\n\ninterface SecurityFileReport {\n file: string;\n text: string;\n findings: BidiSecurityFinding[];\n highestRisk: BidiControlRisk | null;\n}\n\nasync function readTextInput(\n options: { text?: string; file?: string },\n cwd: string\n): Promise {\n if (options.text === undefined && options.file === undefined) {\n throw new Error('Provide --text or --file.');\n }\n if (options.text !== undefined && options.file !== undefined) {\n throw new Error('Choose either --text or --file, not both.');\n }\n return options.file !== undefined\n ? readFile(resolve(cwd, options.file), 'utf8')\n : options.text!;\n}\n\nfunction sarifForReports(reports: readonly SecurityFileReport[], cwd: string): object {\n return {\n version: '2.1.0',\n $schema: 'https://json.schemastore.org/sarif-2.1.0.json',\n runs: [{\n columnKind: 'utf16CodeUnits',\n tool: { driver: { name: 'BidiLens', semanticVersion: CLI_VERSION } },\n results: reports.flatMap((report) => report.findings.map((finding) => {\n const start = sourcePosition(report.text, finding.sourceRange.utf16.start);\n const end = sourcePosition(report.text, finding.sourceRange.utf16.end);\n return {\n ruleId: finding.code,\n level: finding.severity === 'high' ? 'error' : finding.severity === 'warning' ? 'warning' : 'note',\n message: { text: `${finding.message} ${finding.remediation}` },\n locations: [{\n physicalLocation: {\n artifactLocation: { uri: artifactUri(report.file, cwd) },\n region: {\n startLine: start.line,\n startColumn: start.column,\n endLine: end.line,\n endColumn: end.column\n }\n }\n }]\n };\n }))\n }]\n };\n}\n\nfunction createCliProgram(state: RuntimeState): Command {\n const program = new Command();\n program\n .name('bidilens')\n .description('Inspect and secure mixed bidirectional text')\n .version(CLI_VERSION)\n .exitOverride()\n .configureOutput({ writeOut: state.stdout, writeErr: state.stderr });\n\n program.command('inspect')\n .description('Analyze a string or file')\n .option('-t, --text ', 'text to inspect')\n .option('-f, --file ', 'file to inspect')\n .option('--json', 'emit JSON')\n .action(async (options: { text?: string; file?: string; json?: boolean }) => {\n const text = await readTextInput(options, state.cwd);\n const analysis = analyzeText(text, { strategy: 'content-majority', fallback: 'neutral' });\n const controls = findBidiControls(text);\n const report = { analysis, controls, visible: controls.length ? visibleBidiControls(text) : text };\n if (options.json) line(state.stdout, JSON.stringify(report, null, 2));\n else {\n line(state.stdout, `Direction: ${analysis.direction}`);\n line(state.stdout, `Confidence: ${analysis.confidence}`);\n line(state.stdout, `Strong characters: RTL ${analysis.counts.rtl}, LTR ${analysis.counts.ltr}`);\n line(state.stdout, `Paragraphs: ${analysis.paragraphs.length}`);\n line(state.stdout, `Bidi controls: ${controls.length}`);\n if (controls.length) line(state.stdout, report.visible);\n }\n });\n\n program.command('render')\n .description('Render plain text as escaped, semantic direction-aware HTML')\n .option('-t, --text ', 'text to render')\n .option('-f, --file ', 'file to render')\n .option('--intervention ', 'auto or always', parseIntervention, 'auto')\n .option('--json', 'emit analysis and HTML as JSON')\n .action(async (options: {\n text?: string;\n file?: string;\n intervention: BidiInterventionMode;\n json?: boolean;\n }) => {\n const text = await readTextInput(options, state.cwd);\n const result = renderBidiHtml(text, { intervention: options.intervention });\n line(state.stdout, options.json\n ? JSON.stringify({ analysis: result.analysis, html: result.html }, null, 2)\n : result.html);\n });\n\n program.command('audit')\n .aliases(['security-scan', 'lint'])\n .description('Audit files for hidden and unbalanced bidi controls')\n .argument('', 'files or directories')\n .option('--json', 'emit JSON')\n .option('--sarif', 'emit SARIF 2.1.0')\n .option('--mode ', 'off, audit, warn, or strict', parseSecurityMode, 'audit')\n .option('--fail-on ', 'minimum risk that exits non-zero', parseRisk, 'high')\n .action(async (paths: string[], options: {\n json?: boolean;\n sarif?: boolean;\n mode: BidiSecurityMode;\n failOn: BidiControlRisk;\n }) => {\n if (options.json && options.sarif) throw new Error('Choose either --json or --sarif, not both.');\n const files = await collectFiles(paths, state.cwd);\n const reports: SecurityFileReport[] = [];\n let shouldFail = false;\n\n for (const file of files) {\n const text = await readFile(file, 'utf8');\n const security = scanBidiSecurity(text, { mode: options.mode });\n if (!security.findings.length) continue;\n const highestRisk = highestFindingRisk(security.findings);\n reports.push({ file, text, findings: security.findings, highestRisk });\n if (security.shouldBlock || (highestRisk && RISK_ORDER[highestRisk] >= RISK_ORDER[options.failOn])) shouldFail = true;\n }\n\n if (options.sarif) line(state.stdout, JSON.stringify(sarifForReports(reports, state.cwd), null, 2));\n else if (options.json) {\n line(state.stdout, JSON.stringify({\n scanned: files.length,\n reports: reports.map((report) => ({\n file: report.file,\n findings: report.findings,\n highestRisk: report.highestRisk\n }))\n }, null, 2));\n } else if (!reports.length) line(state.stdout, `No bidi security findings in ${files.length} files.`);\n else {\n for (const report of reports) {\n line(state.stdout, `\\n${report.file} (${report.highestRisk ?? 'unknown'})`);\n for (const finding of report.findings) {\n const position = sourcePosition(report.text, finding.sourceRange.utf16.start);\n line(state.stdout, ` ${finding.code} at ${position.line}:${position.column} [${riskForFinding(finding)}] ${finding.message}`);\n }\n }\n }\n if (shouldFail) state.exitCode = Math.max(state.exitCode, 2);\n });\n\n program.command('test')\n .description('Run the direction conformance corpus')\n .option('--json', 'emit failures as JSON')\n .option('--corpus ', 'corpus JSON path; defaults to the bundled corpus or repository corpus')\n .action(async (options: { json?: boolean; corpus?: string }) => {\n const corpus = await readCorpus(state.cwd, options.corpus);\n const failures = corpus.flatMap((item) => {\n const actual = analyzeText(item.text, { strategy: 'content-majority', fallback: 'neutral' }).direction;\n return actual === item.expected ? [] : [{ id: item.id, expected: item.expected, actual }];\n });\n if (options.json) line(state.stdout, JSON.stringify({ total: corpus.length, failures }, null, 2));\n else line(state.stdout, `Corpus: ${corpus.length - failures.length}/${corpus.length} passed`);\n if (failures.length) state.exitCode = Math.max(state.exitCode, 1);\n });\n\n program.command('sanitize')\n .description('Remove bidi controls from one file')\n .argument('', 'input file')\n .option('-o, --output ', 'output path; defaults to stdout')\n .option('--keep-low', 'preserve low-risk ALM/LRM/RLM marks')\n .action(async (file: string, options: { output?: string; keepLow?: boolean }) => {\n const text = await readFile(resolve(state.cwd, file), 'utf8');\n const remove: BidiControlRisk[] = options.keepLow ? ['high', 'medium'] : ['high', 'medium', 'low'];\n const result = sanitizeBidiControls(text, { remove });\n if (options.output) {\n const output = resolve(state.cwd, options.output);\n await writeFile(output, result.text, 'utf8');\n line(state.stderr, `Removed ${result.removed.length} controls and wrote ${output}.`);\n } else {\n state.stdout(result.text);\n }\n });\n\n return program;\n}\n\nexport async function runCli(argv: readonly string[] = process.argv, runtime: CliRuntime = {}): Promise {\n const state = createRuntime(runtime);\n const program = createCliProgram(state);\n try {\n await program.parseAsync([...argv], { from: 'node' });\n } catch (error) {\n if (error instanceof CommanderError) return Math.max(state.exitCode, error.exitCode);\n const message = error instanceof Error ? error.message : String(error);\n line(state.stderr, `bidilens: ${message}`);\n return Math.max(state.exitCode, 1);\n }\n return state.exitCode;\n}\n", "/**\n * CommanderError class\n */\nexport class 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 */\nexport class 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", "import { InvalidArgumentError } from './error.js';\n\nexport class 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. \n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.endsWith('...')) {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nexport function humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n", "import { EventEmitter } from 'node:events';\nimport childProcess from 'node:child_process';\nimport path from 'node:path';\nimport fs from 'node:fs';\nimport process from 'node:process';\nimport { stripVTControlCharacters } from 'node:util';\n\nimport { Argument, humanReadableArgName } from './argument.js';\nimport { CommanderError } from './error.js';\nimport { Help } from './help.js';\nimport { Option, DualOptions } from './option.js';\nimport { suggestSimilar } from './suggestSimilar.js';\n\nexport class 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) => stripVTControlCharacters(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n /** @type {string | undefined} */\n this._helpGroupHeading = undefined; // soft initialised when added to parent\n /** @type {string | undefined} */\n this._defaultCommandGroup = undefined;\n /** @type {string | undefined} */\n this._defaultOptionGroup = undefined;\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone [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 ', '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 `` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n this._outputConfiguration = {\n ...this._outputConfiguration,\n ...configuration,\n };\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom argument processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, parseArg, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof parseArg === 'function') {\n argument.default(defaultValue).argParser(parseArg);\n } else {\n argument.default(parseArg);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments(' [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument?.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n if (enableOrNameAndArgs && this._defaultCommandGroup) {\n // make the command to store the group\n this._initCommandGroup(this._getHelpCommand());\n }\n return this;\n }\n\n const nameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = nameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n // init group unless lazy create\n if (enableOrNameAndArgs || description) this._initCommandGroup(helpCommand);\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n this._initCommandGroup(helpCommand);\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this._initOptionGroup(option);\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this._initCommandGroup(command);\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._collectValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type ', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip ', '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 // Save the state the first time, then restore the state before each subsequent parse.\n if (this._savedState === null) {\n // Do the special default of lone negated option to true, now that we have all the options.\n // Filter for negated options that have not been processed already.\n this.options\n .filter(\n (option) =>\n option.negate &&\n option.defaultValue === undefined &&\n this.getOptionValue(option.attributeName()) === undefined,\n )\n .forEach((option) => {\n // check for lone negated option: --no-foo without a --foo option\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n option.attributeName(),\n true,\n 'default',\n );\n }\n });\n\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 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 const launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise?.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent?.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} args\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(args) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n const negativeNumberArg = (arg) => {\n // return false if not a negative number\n if (!/^-(\\d+|\\d*\\.\\d+)(e[+-]?\\d+)?$/.test(arg)) return false;\n // negative number is ok unless digit used as an option in command hierarchy\n return !this._getCommandAndAncestors().some((cmd) =>\n cmd.options\n .map((opt) => opt.short)\n .some((short) => /^-\\d$/.test(short)),\n );\n };\n\n // parse options\n let activeVariadicOption = null;\n let activeGroup = null; // working through group of short options, like -abc\n let i = 0;\n while (i < args.length || activeGroup) {\n const arg = activeGroup ?? args[i++];\n activeGroup = null;\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args.slice(i));\n break;\n }\n\n if (\n activeVariadicOption &&\n (!maybeOption(arg) || negativeNumberArg(arg))\n ) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args[i++];\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (\n i < args.length &&\n (!maybeOption(args[i]) || negativeNumberArg(args[i]))\n ) {\n value = args[i++];\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option\n this.emit(`option:${option.name()}`);\n // remove the processed option and keep processing group\n activeGroup = `-${arg.slice(2)}`;\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n // A negative number in a leaf command is not an unknown option.\n if (\n dest === operands &&\n maybeOption(arg) &&\n !(this.commands.length === 0 && negativeNumberArg(arg))\n ) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n unknown.push(...args.slice(i));\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg, ...args.slice(i));\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg, ...args.slice(i));\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg, ...args.slice(i));\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const received = receivedArgs.length;\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const details = receivedArgs.join(', ');\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${received}: ${details}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set/get the help group heading for this subcommand in parent command's help.\n *\n * @param {string} [heading]\n * @return {Command | string}\n */\n\n helpGroup(heading) {\n if (heading === undefined) return this._helpGroupHeading ?? '';\n this._helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n commandsGroup(heading) {\n if (heading === undefined) return this._defaultCommandGroup ?? '';\n this._defaultCommandGroup = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n optionsGroup(heading) {\n if (heading === undefined) return this._defaultOptionGroup ?? '';\n this._defaultOptionGroup = heading;\n return this;\n }\n\n /**\n * @param {Option} option\n * @private\n */\n _initOptionGroup(option) {\n if (this._defaultOptionGroup && !option.helpGroupHeading)\n option.helpGroup(this._defaultOptionGroup);\n }\n\n /**\n * @param {Command} cmd\n * @private\n */\n _initCommandGroup(cmd) {\n if (this._defaultCommandGroup && !cmd.helpGroup())\n cmd.helpGroup(this._defaultCommandGroup);\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or import.meta.filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(import.meta.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(import.meta.dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support enabling/disabling built-in help option.\n if (typeof flags === 'boolean') {\n if (flags) {\n if (this._helpOption === null) this._helpOption = undefined; // reenable\n if (this._defaultOptionGroup) {\n // make the option to store the group\n this._initOptionGroup(this._getHelpOption());\n }\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n this._helpOption = this.createOption(\n flags ?? '-h, --help',\n description ?? 'display help for command',\n );\n // init group unless lazy create\n if (flags || description) this._initOptionGroup(this._helpOption);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n this._initOptionGroup(option);\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * Exported for using from tests, not otherwise used outside this file.\n *\n * @returns {boolean | undefined}\n * @package\n */\nexport function 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", "import { humanReadableArgName } from './argument.js';\nimport { stripVTControlCharacters } from 'node:util';\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.\nexport class Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (option.description) {\n return `${option.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n *\n * @param {string} heading\n * @param {string[]} items\n * @param {Help} helper\n * @returns string[]\n */\n formatItemList(heading, items, helper) {\n if (items.length === 0) return [];\n\n return [helper.styleTitle(heading), ...items, ''];\n }\n\n /**\n * Group items by their help group heading.\n *\n * @param {Command[] | Option[]} unsortedItems\n * @param {Command[] | Option[]} visibleItems\n * @param {Function} getGroup\n * @returns {Map}\n */\n groupItems(unsortedItems, visibleItems, getGroup) {\n const result = new Map();\n // Add groups in order of appearance in unsortedItems.\n unsortedItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) result.set(group, []);\n });\n // Add items in order of appearance in visibleItems.\n visibleItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) {\n result.set(group, []);\n }\n result.get(group).push(item);\n });\n return result;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n output = output.concat(\n this.formatItemList('Arguments:', argumentList, helper),\n );\n\n // Options\n const optionGroups = this.groupItems(\n cmd.options,\n helper.visibleOptions(cmd),\n (option) => option.helpGroupHeading ?? 'Options:',\n );\n optionGroups.forEach((options, group) => {\n const optionList = options.map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(this.formatItemList(group, optionList, helper));\n });\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(\n this.formatItemList('Global Options:', globalOptionList, helper),\n );\n }\n\n // Commands\n const commandGroups = this.groupItems(\n cmd.commands,\n helper.visibleCommands(cmd),\n (sub) => sub.helpGroup() || 'Commands:',\n );\n commandGroups.forEach((commands, group) => {\n const commandList = commands.map((sub) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(sub)),\n helper.styleSubcommandDescription(helper.subcommandDescription(sub)),\n );\n });\n output = output.concat(this.formatItemList(group, commandList, helper));\n });\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripVTControlCharacters(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] [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] [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", "import { InvalidArgumentError } from './error.js';\n\nexport class 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 et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n this.helpGroupHeading = undefined; // soft initialised when option added to command\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Set the help group heading.\n *\n * @param {string} heading\n * @return {Option}\n */\n helpGroup(heading) {\n this.helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nexport class 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 '\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", "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau\u2013Levenshtein_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;\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\nexport function 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", "import { Argument } from './lib/argument.js';\nimport { Command } from './lib/command.js';\nimport { CommanderError, InvalidArgumentError } from './lib/error.js';\nimport { Help } from './lib/help.js';\nimport { Option } from './lib/option.js';\n\nexport const program = new Command();\n\nexport const createCommand = (name) => new Command(name);\nexport const createOption = (flags, description) =>\n new Option(flags, description);\nexport const createArgument = (name, description) =>\n new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexport { Command, Option, Argument, Help };\nexport { CommanderError, InvalidArgumentError };\nexport { InvalidArgumentError as InvalidOptionArgumentError }; // Deprecated\n", "// Generated by scripts/generate-bidi-data.ts. Do not edit by hand.\n// Source: https://www.unicode.org/Public/17.0.0/ucd/extracted/DerivedBidiClass.txt\n// SHA-256: 4867b4b7f0731ed1bfcd34cc6251211ff1542541fce0734b6fbda139ee80b3a4\n// Source: https://www.unicode.org/Public/17.0.0/ucd/extracted/DerivedGeneralCategory.txt\n// SHA-256: d62e5bab70ca74f099343f71224fa051cb1fdd61a1ab45c0488c44cfc0b6102e\n\nexport const UNICODE_BIDI_VERSION = '17.0.0';\nexport const UNICODE_BIDI_SHA256 = '4867b4b7f0731ed1bfcd34cc6251211ff1542541fce0734b6fbda139ee80b3a4';\nexport const UNICODE_GENERAL_CATEGORY_SHA256 = 'd62e5bab70ca74f099343f71224fa051cb1fdd61a1ab45c0488c44cfc0b6102e';\n\nexport const RTL_BIDI_RANGES: ReadonlyArray = [\n 0x590, 0x590,\n 0x5be, 0x5be,\n 0x5c0, 0x5c0,\n 0x5c3, 0x5c3,\n 0x5c6, 0x5c6,\n 0x5c8, 0x5ff,\n 0x608, 0x608,\n 0x60b, 0x60b,\n 0x60d, 0x60d,\n 0x61b, 0x64a,\n 0x66d, 0x66f,\n 0x671, 0x6d5,\n 0x6e5, 0x6e6,\n 0x6ee, 0x6ef,\n 0x6fa, 0x710,\n 0x712, 0x72f,\n 0x74b, 0x7a5,\n 0x7b1, 0x7ea,\n 0x7f4, 0x7f5,\n 0x7fa, 0x7fc,\n 0x7fe, 0x815,\n 0x81a, 0x81a,\n 0x824, 0x824,\n 0x828, 0x828,\n 0x82e, 0x858,\n 0x85c, 0x88f,\n 0x892, 0x896,\n 0x8a0, 0x8c9,\n 0x200f, 0x200f,\n 0xfb1d, 0xfb1d,\n 0xfb1f, 0xfb28,\n 0xfb2a, 0xfbc2,\n 0xfbd3, 0xfd3d,\n 0xfd50, 0xfd8f,\n 0xfd92, 0xfdc7,\n 0xfdf0, 0xfdfc,\n 0xfe70, 0xfefe,\n 0x10800, 0x1091e,\n 0x10920, 0x10a00,\n 0x10a04, 0x10a04,\n 0x10a07, 0x10a0b,\n 0x10a10, 0x10a37,\n 0x10a3b, 0x10a3e,\n 0x10a40, 0x10ae4,\n 0x10ae7, 0x10b38,\n 0x10b40, 0x10d23,\n 0x10d28, 0x10d2f,\n 0x10d3a, 0x10d3f,\n 0x10d4a, 0x10d68,\n 0x10d6f, 0x10e5f,\n 0x10e7f, 0x10eaa,\n 0x10ead, 0x10ecf,\n 0x10ed9, 0x10ef9,\n 0x10f00, 0x10f45,\n 0x10f51, 0x10f81,\n 0x10f86, 0x10fff,\n 0x1e800, 0x1e8cf,\n 0x1e8d7, 0x1e943,\n 0x1e94b, 0x1eeef,\n 0x1eef2, 0x1efff\n];\n\nexport const NON_STRONG_BIDI_RANGES: ReadonlyArray = [\n 0x0, 0x40,\n 0x5b, 0x60,\n 0x7b, 0xa9,\n 0xab, 0xb4,\n 0xb6, 0xb9,\n 0xbb, 0xbf,\n 0xd7, 0xd7,\n 0xf7, 0xf7,\n 0x2b9, 0x2ba,\n 0x2c2, 0x2cf,\n 0x2d2, 0x2df,\n 0x2e5, 0x2ed,\n 0x2ef, 0x36f,\n 0x374, 0x375,\n 0x37e, 0x37e,\n 0x384, 0x385,\n 0x387, 0x387,\n 0x3f6, 0x3f6,\n 0x483, 0x489,\n 0x58a, 0x58a,\n 0x58d, 0x58f,\n 0x591, 0x5bd,\n 0x5bf, 0x5bf,\n 0x5c1, 0x5c2,\n 0x5c4, 0x5c5,\n 0x5c7, 0x5c7,\n 0x600, 0x607,\n 0x609, 0x60a,\n 0x60c, 0x60c,\n 0x60e, 0x61a,\n 0x64b, 0x66c,\n 0x670, 0x670,\n 0x6d6, 0x6e4,\n 0x6e7, 0x6ed,\n 0x6f0, 0x6f9,\n 0x711, 0x711,\n 0x730, 0x74a,\n 0x7a6, 0x7b0,\n 0x7eb, 0x7f3,\n 0x7f6, 0x7f9,\n 0x7fd, 0x7fd,\n 0x816, 0x819,\n 0x81b, 0x823,\n 0x825, 0x827,\n 0x829, 0x82d,\n 0x859, 0x85b,\n 0x890, 0x891,\n 0x897, 0x89f,\n 0x8ca, 0x902,\n 0x93a, 0x93a,\n 0x93c, 0x93c,\n 0x941, 0x948,\n 0x94d, 0x94d,\n 0x951, 0x957,\n 0x962, 0x963,\n 0x981, 0x981,\n 0x9bc, 0x9bc,\n 0x9c1, 0x9c4,\n 0x9cd, 0x9cd,\n 0x9e2, 0x9e3,\n 0x9f2, 0x9f3,\n 0x9fb, 0x9fb,\n 0x9fe, 0x9fe,\n 0xa01, 0xa02,\n 0xa3c, 0xa3c,\n 0xa41, 0xa42,\n 0xa47, 0xa48,\n 0xa4b, 0xa4d,\n 0xa51, 0xa51,\n 0xa70, 0xa71,\n 0xa75, 0xa75,\n 0xa81, 0xa82,\n 0xabc, 0xabc,\n 0xac1, 0xac5,\n 0xac7, 0xac8,\n 0xacd, 0xacd,\n 0xae2, 0xae3,\n 0xaf1, 0xaf1,\n 0xafa, 0xaff,\n 0xb01, 0xb01,\n 0xb3c, 0xb3c,\n 0xb3f, 0xb3f,\n 0xb41, 0xb44,\n 0xb4d, 0xb4d,\n 0xb55, 0xb56,\n 0xb62, 0xb63,\n 0xb82, 0xb82,\n 0xbc0, 0xbc0,\n 0xbcd, 0xbcd,\n 0xbf3, 0xbfa,\n 0xc00, 0xc00,\n 0xc04, 0xc04,\n 0xc3c, 0xc3c,\n 0xc3e, 0xc40,\n 0xc46, 0xc48,\n 0xc4a, 0xc4d,\n 0xc55, 0xc56,\n 0xc62, 0xc63,\n 0xc78, 0xc7e,\n 0xc81, 0xc81,\n 0xcbc, 0xcbc,\n 0xccc, 0xccd,\n 0xce2, 0xce3,\n 0xd00, 0xd01,\n 0xd3b, 0xd3c,\n 0xd41, 0xd44,\n 0xd4d, 0xd4d,\n 0xd62, 0xd63,\n 0xd81, 0xd81,\n 0xdca, 0xdca,\n 0xdd2, 0xdd4,\n 0xdd6, 0xdd6,\n 0xe31, 0xe31,\n 0xe34, 0xe3a,\n 0xe3f, 0xe3f,\n 0xe47, 0xe4e,\n 0xeb1, 0xeb1,\n 0xeb4, 0xebc,\n 0xec8, 0xece,\n 0xf18, 0xf19,\n 0xf35, 0xf35,\n 0xf37, 0xf37,\n 0xf39, 0xf3d,\n 0xf71, 0xf7e,\n 0xf80, 0xf84,\n 0xf86, 0xf87,\n 0xf8d, 0xf97,\n 0xf99, 0xfbc,\n 0xfc6, 0xfc6,\n 0x102d, 0x1030,\n 0x1032, 0x1037,\n 0x1039, 0x103a,\n 0x103d, 0x103e,\n 0x1058, 0x1059,\n 0x105e, 0x1060,\n 0x1071, 0x1074,\n 0x1082, 0x1082,\n 0x1085, 0x1086,\n 0x108d, 0x108d,\n 0x109d, 0x109d,\n 0x135d, 0x135f,\n 0x1390, 0x1399,\n 0x1400, 0x1400,\n 0x1680, 0x1680,\n 0x169b, 0x169c,\n 0x1712, 0x1714,\n 0x1732, 0x1733,\n 0x1752, 0x1753,\n 0x1772, 0x1773,\n 0x17b4, 0x17b5,\n 0x17b7, 0x17bd,\n 0x17c6, 0x17c6,\n 0x17c9, 0x17d3,\n 0x17db, 0x17db,\n 0x17dd, 0x17dd,\n 0x17f0, 0x17f9,\n 0x1800, 0x180f,\n 0x1885, 0x1886,\n 0x18a9, 0x18a9,\n 0x1920, 0x1922,\n 0x1927, 0x1928,\n 0x1932, 0x1932,\n 0x1939, 0x193b,\n 0x1940, 0x1940,\n 0x1944, 0x1945,\n 0x19de, 0x19ff,\n 0x1a17, 0x1a18,\n 0x1a1b, 0x1a1b,\n 0x1a56, 0x1a56,\n 0x1a58, 0x1a5e,\n 0x1a60, 0x1a60,\n 0x1a62, 0x1a62,\n 0x1a65, 0x1a6c,\n 0x1a73, 0x1a7c,\n 0x1a7f, 0x1a7f,\n 0x1ab0, 0x1add,\n 0x1ae0, 0x1aeb,\n 0x1b00, 0x1b03,\n 0x1b34, 0x1b34,\n 0x1b36, 0x1b3a,\n 0x1b3c, 0x1b3c,\n 0x1b42, 0x1b42,\n 0x1b6b, 0x1b73,\n 0x1b80, 0x1b81,\n 0x1ba2, 0x1ba5,\n 0x1ba8, 0x1ba9,\n 0x1bab, 0x1bad,\n 0x1be6, 0x1be6,\n 0x1be8, 0x1be9,\n 0x1bed, 0x1bed,\n 0x1bef, 0x1bf1,\n 0x1c2c, 0x1c33,\n 0x1c36, 0x1c37,\n 0x1cd0, 0x1cd2,\n 0x1cd4, 0x1ce0,\n 0x1ce2, 0x1ce8,\n 0x1ced, 0x1ced,\n 0x1cf4, 0x1cf4,\n 0x1cf8, 0x1cf9,\n 0x1dc0, 0x1dff,\n 0x1fbd, 0x1fbd,\n 0x1fbf, 0x1fc1,\n 0x1fcd, 0x1fcf,\n 0x1fdd, 0x1fdf,\n 0x1fed, 0x1fef,\n 0x1ffd, 0x1ffe,\n 0x2000, 0x200d,\n 0x2010, 0x2070,\n 0x2074, 0x207e,\n 0x2080, 0x208e,\n 0x20a0, 0x20f0,\n 0x2100, 0x2101,\n 0x2103, 0x2106,\n 0x2108, 0x2109,\n 0x2114, 0x2114,\n 0x2116, 0x2118,\n 0x211e, 0x2123,\n 0x2125, 0x2125,\n 0x2127, 0x2127,\n 0x2129, 0x2129,\n 0x212e, 0x212e,\n 0x213a, 0x213b,\n 0x2140, 0x2144,\n 0x214a, 0x214d,\n 0x2150, 0x215f,\n 0x2189, 0x218b,\n 0x2190, 0x2335,\n 0x237b, 0x2394,\n 0x2396, 0x2429,\n 0x2440, 0x244a,\n 0x2460, 0x249b,\n 0x24ea, 0x26ab,\n 0x26ad, 0x27ff,\n 0x2900, 0x2b73,\n 0x2b76, 0x2bff,\n 0x2ce5, 0x2cea,\n 0x2cef, 0x2cf1,\n 0x2cf9, 0x2cff,\n 0x2d7f, 0x2d7f,\n 0x2de0, 0x2e5d,\n 0x2e80, 0x2e99,\n 0x2e9b, 0x2ef3,\n 0x2f00, 0x2fd5,\n 0x2ff0, 0x3004,\n 0x3008, 0x3020,\n 0x302a, 0x302d,\n 0x3030, 0x3030,\n 0x3036, 0x3037,\n 0x303d, 0x303f,\n 0x3099, 0x309c,\n 0x30a0, 0x30a0,\n 0x30fb, 0x30fb,\n 0x31c0, 0x31e5,\n 0x31ef, 0x31ef,\n 0x321d, 0x321e,\n 0x3250, 0x325f,\n 0x327c, 0x327e,\n 0x32b1, 0x32bf,\n 0x32cc, 0x32cf,\n 0x3377, 0x337a,\n 0x33de, 0x33df,\n 0x33ff, 0x33ff,\n 0x4dc0, 0x4dff,\n 0xa490, 0xa4c6,\n 0xa60d, 0xa60f,\n 0xa66f, 0xa67f,\n 0xa69e, 0xa69f,\n 0xa6f0, 0xa6f1,\n 0xa700, 0xa721,\n 0xa788, 0xa788,\n 0xa802, 0xa802,\n 0xa806, 0xa806,\n 0xa80b, 0xa80b,\n 0xa825, 0xa826,\n 0xa828, 0xa82c,\n 0xa838, 0xa839,\n 0xa874, 0xa877,\n 0xa8c4, 0xa8c5,\n 0xa8e0, 0xa8f1,\n 0xa8ff, 0xa8ff,\n 0xa926, 0xa92d,\n 0xa947, 0xa951,\n 0xa980, 0xa982,\n 0xa9b3, 0xa9b3,\n 0xa9b6, 0xa9b9,\n 0xa9bc, 0xa9bd,\n 0xa9e5, 0xa9e5,\n 0xaa29, 0xaa2e,\n 0xaa31, 0xaa32,\n 0xaa35, 0xaa36,\n 0xaa43, 0xaa43,\n 0xaa4c, 0xaa4c,\n 0xaa7c, 0xaa7c,\n 0xaab0, 0xaab0,\n 0xaab2, 0xaab4,\n 0xaab7, 0xaab8,\n 0xaabe, 0xaabf,\n 0xaac1, 0xaac1,\n 0xaaec, 0xaaed,\n 0xaaf6, 0xaaf6,\n 0xab6a, 0xab6b,\n 0xabe5, 0xabe5,\n 0xabe8, 0xabe8,\n 0xabed, 0xabed,\n 0xfb1e, 0xfb1e,\n 0xfb29, 0xfb29,\n 0xfbc3, 0xfbd2,\n 0xfd3e, 0xfd4f,\n 0xfd90, 0xfd91,\n 0xfdc8, 0xfdef,\n 0xfdfd, 0xfe19,\n 0xfe20, 0xfe52,\n 0xfe54, 0xfe66,\n 0xfe68, 0xfe6b,\n 0xfeff, 0xfeff,\n 0xff01, 0xff20,\n 0xff3b, 0xff40,\n 0xff5b, 0xff65,\n 0xffe0, 0xffe6,\n 0xffe8, 0xffee,\n 0xfff0, 0xffff,\n 0x10101, 0x10101,\n 0x10140, 0x1018c,\n 0x10190, 0x1019c,\n 0x101a0, 0x101a0,\n 0x101fd, 0x101fd,\n 0x102e0, 0x102fb,\n 0x10376, 0x1037a,\n 0x1091f, 0x1091f,\n 0x10a01, 0x10a03,\n 0x10a05, 0x10a06,\n 0x10a0c, 0x10a0f,\n 0x10a38, 0x10a3a,\n 0x10a3f, 0x10a3f,\n 0x10ae5, 0x10ae6,\n 0x10b39, 0x10b3f,\n 0x10d24, 0x10d27,\n 0x10d30, 0x10d39,\n 0x10d40, 0x10d49,\n 0x10d69, 0x10d6e,\n 0x10e60, 0x10e7e,\n 0x10eab, 0x10eac,\n 0x10ed0, 0x10ed8,\n 0x10efa, 0x10eff,\n 0x10f46, 0x10f50,\n 0x10f82, 0x10f85,\n 0x11001, 0x11001,\n 0x11038, 0x11046,\n 0x11052, 0x11065,\n 0x11070, 0x11070,\n 0x11073, 0x11074,\n 0x1107f, 0x11081,\n 0x110b3, 0x110b6,\n 0x110b9, 0x110ba,\n 0x110c2, 0x110c2,\n 0x11100, 0x11102,\n 0x11127, 0x1112b,\n 0x1112d, 0x11134,\n 0x11173, 0x11173,\n 0x11180, 0x11181,\n 0x111b6, 0x111be,\n 0x111c9, 0x111cc,\n 0x111cf, 0x111cf,\n 0x1122f, 0x11231,\n 0x11234, 0x11234,\n 0x11236, 0x11237,\n 0x1123e, 0x1123e,\n 0x11241, 0x11241,\n 0x112df, 0x112df,\n 0x112e3, 0x112ea,\n 0x11300, 0x11301,\n 0x1133b, 0x1133c,\n 0x11340, 0x11340,\n 0x11366, 0x1136c,\n 0x11370, 0x11374,\n 0x113bb, 0x113c0,\n 0x113ce, 0x113ce,\n 0x113d0, 0x113d0,\n 0x113d2, 0x113d2,\n 0x113e1, 0x113e2,\n 0x11438, 0x1143f,\n 0x11442, 0x11444,\n 0x11446, 0x11446,\n 0x1145e, 0x1145e,\n 0x114b3, 0x114b8,\n 0x114ba, 0x114ba,\n 0x114bf, 0x114c0,\n 0x114c2, 0x114c3,\n 0x115b2, 0x115b5,\n 0x115bc, 0x115bd,\n 0x115bf, 0x115c0,\n 0x115dc, 0x115dd,\n 0x11633, 0x1163a,\n 0x1163d, 0x1163d,\n 0x1163f, 0x11640,\n 0x11660, 0x1166c,\n 0x116ab, 0x116ab,\n 0x116ad, 0x116ad,\n 0x116b0, 0x116b5,\n 0x116b7, 0x116b7,\n 0x1171d, 0x1171d,\n 0x1171f, 0x1171f,\n 0x11722, 0x11725,\n 0x11727, 0x1172b,\n 0x1182f, 0x11837,\n 0x11839, 0x1183a,\n 0x1193b, 0x1193c,\n 0x1193e, 0x1193e,\n 0x11943, 0x11943,\n 0x119d4, 0x119d7,\n 0x119da, 0x119db,\n 0x119e0, 0x119e0,\n 0x11a01, 0x11a06,\n 0x11a09, 0x11a0a,\n 0x11a33, 0x11a38,\n 0x11a3b, 0x11a3e,\n 0x11a47, 0x11a47,\n 0x11a51, 0x11a56,\n 0x11a59, 0x11a5b,\n 0x11a8a, 0x11a96,\n 0x11a98, 0x11a99,\n 0x11b60, 0x11b60,\n 0x11b62, 0x11b64,\n 0x11b66, 0x11b66,\n 0x11c30, 0x11c36,\n 0x11c38, 0x11c3d,\n 0x11c92, 0x11ca7,\n 0x11caa, 0x11cb0,\n 0x11cb2, 0x11cb3,\n 0x11cb5, 0x11cb6,\n 0x11d31, 0x11d36,\n 0x11d3a, 0x11d3a,\n 0x11d3c, 0x11d3d,\n 0x11d3f, 0x11d45,\n 0x11d47, 0x11d47,\n 0x11d90, 0x11d91,\n 0x11d95, 0x11d95,\n 0x11d97, 0x11d97,\n 0x11ef3, 0x11ef4,\n 0x11f00, 0x11f01,\n 0x11f36, 0x11f3a,\n 0x11f40, 0x11f40,\n 0x11f42, 0x11f42,\n 0x11f5a, 0x11f5a,\n 0x11fd5, 0x11ff1,\n 0x13440, 0x13440,\n 0x13447, 0x13455,\n 0x1611e, 0x16129,\n 0x1612d, 0x1612f,\n 0x16af0, 0x16af4,\n 0x16b30, 0x16b36,\n 0x16f4f, 0x16f4f,\n 0x16f8f, 0x16f92,\n 0x16fe2, 0x16fe2,\n 0x16fe4, 0x16fe4,\n 0x1bc9d, 0x1bc9e,\n 0x1bca0, 0x1bca3,\n 0x1cc00, 0x1ccd5,\n 0x1ccf0, 0x1ccfc,\n 0x1cd00, 0x1ceb3,\n 0x1ceba, 0x1ced0,\n 0x1cee0, 0x1cef0,\n 0x1cf00, 0x1cf2d,\n 0x1cf30, 0x1cf46,\n 0x1d167, 0x1d169,\n 0x1d173, 0x1d182,\n 0x1d185, 0x1d18b,\n 0x1d1aa, 0x1d1ad,\n 0x1d1e9, 0x1d1ea,\n 0x1d200, 0x1d245,\n 0x1d300, 0x1d356,\n 0x1d6c1, 0x1d6c1,\n 0x1d6db, 0x1d6db,\n 0x1d6fb, 0x1d6fb,\n 0x1d715, 0x1d715,\n 0x1d735, 0x1d735,\n 0x1d74f, 0x1d74f,\n 0x1d76f, 0x1d76f,\n 0x1d789, 0x1d789,\n 0x1d7a9, 0x1d7a9,\n 0x1d7c3, 0x1d7c3,\n 0x1d7ce, 0x1d7ff,\n 0x1da00, 0x1da36,\n 0x1da3b, 0x1da6c,\n 0x1da75, 0x1da75,\n 0x1da84, 0x1da84,\n 0x1da9b, 0x1da9f,\n 0x1daa1, 0x1daaf,\n 0x1e000, 0x1e006,\n 0x1e008, 0x1e018,\n 0x1e01b, 0x1e021,\n 0x1e023, 0x1e024,\n 0x1e026, 0x1e02a,\n 0x1e08f, 0x1e08f,\n 0x1e130, 0x1e136,\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x8fffe, 0x8ffff,\n 0x9fffe, 0x9ffff,\n 0xafffe, 0xaffff,\n 0xbfffe, 0xbffff,\n 0xcfffe, 0xcffff,\n 0xdfffe, 0xe0fff,\n 0xefffe, 0xeffff,\n 0xffffe, 0xfffff,\n 0x10fffe, 0x10ffff\n];\n\nexport const NATURAL_LETTER_RANGES: ReadonlyArray = [\n 0x41, 0x5a,\n 0x61, 0x7a,\n 0xaa, 0xaa,\n 0xb5, 0xb5,\n 0xba, 0xba,\n 0xc0, 0xd6,\n 0xd8, 0xf6,\n 0xf8, 0x2c1,\n 0x2c6, 0x2d1,\n 0x2e0, 0x2e4,\n 0x2ec, 0x2ec,\n 0x2ee, 0x2ee,\n 0x370, 0x374,\n 0x376, 0x377,\n 0x37a, 0x37d,\n 0x37f, 0x37f,\n 0x386, 0x386,\n 0x388, 0x38a,\n 0x38c, 0x38c,\n 0x38e, 0x3a1,\n 0x3a3, 0x3f5,\n 0x3f7, 0x481,\n 0x48a, 0x52f,\n 0x531, 0x556,\n 0x559, 0x559,\n 0x560, 0x588,\n 0x5d0, 0x5ea,\n 0x5ef, 0x5f2,\n 0x620, 0x64a,\n 0x66e, 0x66f,\n 0x671, 0x6d3,\n 0x6d5, 0x6d5,\n 0x6e5, 0x6e6,\n 0x6ee, 0x6ef,\n 0x6fa, 0x6fc,\n 0x6ff, 0x6ff,\n 0x710, 0x710,\n 0x712, 0x72f,\n 0x74d, 0x7a5,\n 0x7b1, 0x7b1,\n 0x7ca, 0x7ea,\n 0x7f4, 0x7f5,\n 0x7fa, 0x7fa,\n 0x800, 0x815,\n 0x81a, 0x81a,\n 0x824, 0x824,\n 0x828, 0x828,\n 0x840, 0x858,\n 0x860, 0x86a,\n 0x870, 0x887,\n 0x889, 0x88f,\n 0x8a0, 0x8c9,\n 0x904, 0x939,\n 0x93d, 0x93d,\n 0x950, 0x950,\n 0x958, 0x961,\n 0x971, 0x980,\n 0x985, 0x98c,\n 0x98f, 0x990,\n 0x993, 0x9a8,\n 0x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xd0c,\n 0xd0e, 0xd10,\n 0xd12, 0xd3a,\n 0xd3d, 0xd3d,\n 0xd4e, 0xd4e,\n 0xd54, 0xd56,\n 0xd5f, 0xd61,\n 0xd7a, 0xd7f,\n 0xd85, 0xd96,\n 0xd9a, 0xdb1,\n 0xdb3, 0xdbb,\n 0xdbd, 0xdbd,\n 0xdc0, 0xdc6,\n 0xe01, 0xe30,\n 0xe32, 0xe33,\n 0xe40, 0xe46,\n 0xe81, 0xe82,\n 0xe84, 0xe84,\n 0xe86, 0xe8a,\n 0xe8c, 0xea3,\n 0xea5, 0xea5,\n 0xea7, 0xeb0,\n 0xeb2, 0xeb3,\n 0xebd, 0xebd,\n 0xec0, 0xec4,\n 0xec6, 0xec6,\n 0xedc, 0xedf,\n 0xf00, 0xf00,\n 0xf40, 0xf47,\n 0xf49, 0xf6c,\n 0xf88, 0xf8c,\n 0x1000, 0x102a,\n 0x103f, 0x103f,\n 0x1050, 0x1055,\n 0x105a, 0x105d,\n 0x1061, 0x1061,\n 0x1065, 0x1066,\n 0x106e, 0x1070,\n 0x1075, 0x1081,\n 0x108e, 0x108e,\n 0x10a0, 0x10c5,\n 0x10c7, 0x10c7,\n 0x10cd, 0x10cd,\n 0x10d0, 0x10fa,\n 0x10fc, 0x1248,\n 0x124a, 0x124d,\n 0x1250, 0x1256,\n 0x1258, 0x1258,\n 0x125a, 0x125d,\n 0x1260, 0x1288,\n 0x128a, 0x128d,\n 0x1290, 0x12b0,\n 0x12b2, 0x12b5,\n 0x12b8, 0x12be,\n 0x12c0, 0x12c0,\n 0x12c2, 0x12c5,\n 0x12c8, 0x12d6,\n 0x12d8, 0x1310,\n 0x1312, 0x1315,\n 0x1318, 0x135a,\n 0x1380, 0x138f,\n 0x13a0, 0x13f5,\n 0x13f8, 0x13fd,\n 0x1401, 0x166c,\n 0x166f, 0x167f,\n 0x1681, 0x169a,\n 0x16a0, 0x16ea,\n 0x16f1, 0x16f8,\n 0x1700, 0x1711,\n 0x171f, 0x1731,\n 0x1740, 0x1751,\n 0x1760, 0x176c,\n 0x176e, 0x1770,\n 0x1780, 0x17b3,\n 0x17d7, 0x17d7,\n 0x17dc, 0x17dc,\n 0x1820, 0x1878,\n 0x1880, 0x1884,\n 0x1887, 0x18a8,\n 0x18aa, 0x18aa,\n 0x18b0, 0x18f5,\n 0x1900, 0x191e,\n 0x1950, 0x196d,\n 0x1970, 0x1974,\n 0x1980, 0x19ab,\n 0x19b0, 0x19c9,\n 0x1a00, 0x1a16,\n 0x1a20, 0x1a54,\n 0x1aa7, 0x1aa7,\n 0x1b05, 0x1b33,\n 0x1b45, 0x1b4c,\n 0x1b83, 0x1ba0,\n 0x1bae, 0x1baf,\n 0x1bba, 0x1be5,\n 0x1c00, 0x1c23,\n 0x1c4d, 0x1c4f,\n 0x1c5a, 0x1c7d,\n 0x1c80, 0x1c8a,\n 0x1c90, 0x1cba,\n 0x1cbd, 0x1cbf,\n 0x1ce9, 0x1cec,\n 0x1cee, 0x1cf3,\n 0x1cf5, 0x1cf6,\n 0x1cfa, 0x1cfa,\n 0x1d00, 0x1dbf,\n 0x1e00, 0x1f15,\n 0x1f18, 0x1f1d,\n 0x1f20, 0x1f45,\n 0x1f48, 0x1f4d,\n 0x1f50, 0x1f57,\n 0x1f59, 0x1f59,\n 0x1f5b, 0x1f5b,\n 0x1f5d, 0x1f5d,\n 0x1f5f, 0x1f7d,\n 0x1f80, 0x1fb4,\n 0x1fb6, 0x1fbc,\n 0x1fbe, 0x1fbe,\n 0x1fc2, 0x1fc4,\n 0x1fc6, 0x1fcc,\n 0x1fd0, 0x1fd3,\n 0x1fd6, 0x1fdb,\n 0x1fe0, 0x1fec,\n 0x1ff2, 0x1ff4,\n 0x1ff6, 0x1ffc,\n 0x2071, 0x2071,\n 0x207f, 0x207f,\n 0x2090, 0x209c,\n 0x2102, 0x2102,\n 0x2107, 0x2107,\n 0x210a, 0x2113,\n 0x2115, 0x2115,\n 0x2119, 0x211d,\n 0x2124, 0x2124,\n 0x2126, 0x2126,\n 0x2128, 0x2128,\n 0x212a, 0x212d,\n 0x212f, 0x2139,\n 0x213c, 0x213f,\n 0x2145, 0x2149,\n 0x214e, 0x214e,\n 0x2183, 0x2184,\n 0x2c00, 0x2ce4,\n 0x2ceb, 0x2cee,\n 0x2cf2, 0x2cf3,\n 0x2d00, 0x2d25,\n 0x2d27, 0x2d27,\n 0x2d2d, 0x2d2d,\n 0x2d30, 0x2d67,\n 0x2d6f, 0x2d6f,\n 0x2d80, 0x2d96,\n 0x2da0, 0x2da6,\n 0x2da8, 0x2dae,\n 0x2db0, 0x2db6,\n 0x2db8, 0x2dbe,\n 0x2dc0, 0x2dc6,\n 0x2dc8, 0x2dce,\n 0x2dd0, 0x2dd6,\n 0x2dd8, 0x2dde,\n 0x2e2f, 0x2e2f,\n 0x3005, 0x3006,\n 0x3031, 0x3035,\n 0x303b, 0x303c,\n 0x3041, 0x3096,\n 0x309d, 0x309f,\n 0x30a1, 0x30fa,\n 0x30fc, 0x30ff,\n 0x3105, 0x312f,\n 0x3131, 0x318e,\n 0x31a0, 0x31bf,\n 0x31f0, 0x31ff,\n 0x3400, 0x4dbf,\n 0x4e00, 0xa48c,\n 0xa4d0, 0xa4fd,\n 0xa500, 0xa60c,\n 0xa610, 0xa61f,\n 0xa62a, 0xa62b,\n 0xa640, 0xa66e,\n 0xa67f, 0xa69d,\n 0xa6a0, 0xa6e5,\n 0xa717, 0xa71f,\n 0xa722, 0xa788,\n 0xa78b, 0xa7dc,\n 0xa7f1, 0xa801,\n 0xa803, 0xa805,\n 0xa807, 0xa80a,\n 0xa80c, 0xa822,\n 0xa840, 0xa873,\n 0xa882, 0xa8b3,\n 0xa8f2, 0xa8f7,\n 0xa8fb, 0xa8fb,\n 0xa8fd, 0xa8fe,\n 0xa90a, 0xa925,\n 0xa930, 0xa946,\n 0xa960, 0xa97c,\n 0xa984, 0xa9b2,\n 0xa9cf, 0xa9cf,\n 0xa9e0, 0xa9e4,\n 0xa9e6, 0xa9ef,\n 0xa9fa, 0xa9fe,\n 0xaa00, 0xaa28,\n 0xaa40, 0xaa42,\n 0xaa44, 0xaa4b,\n 0xaa60, 0xaa76,\n 0xaa7a, 0xaa7a,\n 0xaa7e, 0xaaaf,\n 0xaab1, 0xaab1,\n 0xaab5, 0xaab6,\n 0xaab9, 0xaabd,\n 0xaac0, 0xaac0,\n 0xaac2, 0xaac2,\n 0xaadb, 0xaadd,\n 0xaae0, 0xaaea,\n 0xaaf2, 0xaaf4,\n 0xab01, 0xab06,\n 0xab09, 0xab0e,\n 0xab11, 0xab16,\n 0xab20, 0xab26,\n 0xab28, 0xab2e,\n 0xab30, 0xab5a,\n 0xab5c, 0xab69,\n 0xab70, 0xabe2,\n 0xac00, 0xd7a3,\n 0xd7b0, 0xd7c6,\n 0xd7cb, 0xd7fb,\n 0xf900, 0xfa6d,\n 0xfa70, 0xfad9,\n 0xfb00, 0xfb06,\n 0xfb13, 0xfb17,\n 0xfb1d, 0xfb1d,\n 0xfb1f, 0xfb28,\n 0xfb2a, 0xfb36,\n 0xfb38, 0xfb3c,\n 0xfb3e, 0xfb3e,\n 0xfb40, 0xfb41,\n 0xfb43, 0xfb44,\n 0xfb46, 0xfbb1,\n 0xfbd3, 0xfd3d,\n 0xfd50, 0xfd8f,\n 0xfd92, 0xfdc7,\n 0xfdf0, 0xfdfb,\n 0xfe70, 0xfe74,\n 0xfe76, 0xfefc,\n 0xff21, 0xff3a,\n 0xff41, 0xff5a,\n 0xff66, 0xffbe,\n 0xffc2, 0xffc7,\n 0xffca, 0xffcf,\n 0xffd2, 0xffd7,\n 0xffda, 0xffdc,\n 0x10000, 0x1000b,\n 0x1000d, 0x10026,\n 0x10028, 0x1003a,\n 0x1003c, 0x1003d,\n 0x1003f, 0x1004d,\n 0x10050, 0x1005d,\n 0x10080, 0x100fa,\n 0x10280, 0x1029c,\n 0x102a0, 0x102d0,\n 0x10300, 0x1031f,\n 0x1032d, 0x10340,\n 0x10342, 0x10349,\n 0x10350, 0x10375,\n 0x10380, 0x1039d,\n 0x103a0, 0x103c3,\n 0x103c8, 0x103cf,\n 0x10400, 0x1049d,\n 0x104b0, 0x104d3,\n 0x104d8, 0x104fb,\n 0x10500, 0x10527,\n 0x10530, 0x10563,\n 0x10570, 0x1057a,\n 0x1057c, 0x1058a,\n 0x1058c, 0x10592,\n 0x10594, 0x10595,\n 0x10597, 0x105a1,\n 0x105a3, 0x105b1,\n 0x105b3, 0x105b9,\n 0x105bb, 0x105bc,\n 0x105c0, 0x105f3,\n 0x10600, 0x10736,\n 0x10740, 0x10755,\n 0x10760, 0x10767,\n 0x10780, 0x10785,\n 0x10787, 0x107b0,\n 0x107b2, 0x107ba,\n 0x10800, 0x10805,\n 0x10808, 0x10808,\n 0x1080a, 0x10835,\n 0x10837, 0x10838,\n 0x1083c, 0x1083c,\n 0x1083f, 0x10855,\n 0x10860, 0x10876,\n 0x10880, 0x1089e,\n 0x108e0, 0x108f2,\n 0x108f4, 0x108f5,\n 0x10900, 0x10915,\n 0x10920, 0x10939,\n 0x10940, 0x10959,\n 0x10980, 0x109b7,\n 0x109be, 0x109bf,\n 0x10a00, 0x10a00,\n 0x10a10, 0x10a13,\n 0x10a15, 0x10a17,\n 0x10a19, 0x10a35,\n 0x10a60, 0x10a7c,\n 0x10a80, 0x10a9c,\n 0x10ac0, 0x10ac7,\n 0x10ac9, 0x10ae4,\n 0x10b00, 0x10b35,\n 0x10b40, 0x10b55,\n 0x10b60, 0x10b72,\n 0x10b80, 0x10b91,\n 0x10c00, 0x10c48,\n 0x10c80, 0x10cb2,\n 0x10cc0, 0x10cf2,\n 0x10d00, 0x10d23,\n 0x10d4a, 0x10d65,\n 0x10d6f, 0x10d85,\n 0x10e80, 0x10ea9,\n 0x10eb0, 0x10eb1,\n 0x10ec2, 0x10ec7,\n 0x10f00, 0x10f1c,\n 0x10f27, 0x10f27,\n 0x10f30, 0x10f45,\n 0x10f70, 0x10f81,\n 0x10fb0, 0x10fc4,\n 0x10fe0, 0x10ff6,\n 0x11003, 0x11037,\n 0x11071, 0x11072,\n 0x11075, 0x11075,\n 0x11083, 0x110af,\n 0x110d0, 0x110e8,\n 0x11103, 0x11126,\n 0x11144, 0x11144,\n 0x11147, 0x11147,\n 0x11150, 0x11172,\n 0x11176, 0x11176,\n 0x11183, 0x111b2,\n 0x111c1, 0x111c4,\n 0x111da, 0x111da,\n 0x111dc, 0x111dc,\n 0x11200, 0x11211,\n 0x11213, 0x1122b,\n 0x1123f, 0x11240,\n 0x11280, 0x11286,\n 0x11288, 0x11288,\n 0x1128a, 0x1128d,\n 0x1128f, 0x1129d,\n 0x1129f, 0x112a8,\n 0x112b0, 0x112de,\n 0x11305, 0x1130c,\n 0x1130f, 0x11310,\n 0x11313, 0x11328,\n 0x1132a, 0x11330,\n 0x11332, 0x11333,\n 0x11335, 0x11339,\n 0x1133d, 0x1133d,\n 0x11350, 0x11350,\n 0x1135d, 0x11361,\n 0x11380, 0x11389,\n 0x1138b, 0x1138b,\n 0x1138e, 0x1138e,\n 0x11390, 0x113b5,\n 0x113b7, 0x113b7,\n 0x113d1, 0x113d1,\n 0x113d3, 0x113d3,\n 0x11400, 0x11434,\n 0x11447, 0x1144a,\n 0x1145f, 0x11461,\n 0x11480, 0x114af,\n 0x114c4, 0x114c5,\n 0x114c7, 0x114c7,\n 0x11580, 0x115ae,\n 0x115d8, 0x115db,\n 0x11600, 0x1162f,\n 0x11644, 0x11644,\n 0x11680, 0x116aa,\n 0x116b8, 0x116b8,\n 0x11700, 0x1171a,\n 0x11740, 0x11746,\n 0x11800, 0x1182b,\n 0x118a0, 0x118df,\n 0x118ff, 0x11906,\n 0x11909, 0x11909,\n 0x1190c, 0x11913,\n 0x11915, 0x11916,\n 0x11918, 0x1192f,\n 0x1193f, 0x1193f,\n 0x11941, 0x11941,\n 0x119a0, 0x119a7,\n 0x119aa, 0x119d0,\n 0x119e1, 0x119e1,\n 0x119e3, 0x119e3,\n 0x11a00, 0x11a00,\n 0x11a0b, 0x11a32,\n 0x11a3a, 0x11a3a,\n 0x11a50, 0x11a50,\n 0x11a5c, 0x11a89,\n 0x11a9d, 0x11a9d,\n 0x11ab0, 0x11af8,\n 0x11bc0, 0x11be0,\n 0x11c00, 0x11c08,\n 0x11c0a, 0x11c2e,\n 0x11c40, 0x11c40,\n 0x11c72, 0x11c8f,\n 0x11d00, 0x11d06,\n 0x11d08, 0x11d09,\n 0x11d0b, 0x11d30,\n 0x11d46, 0x11d46,\n 0x11d60, 0x11d65,\n 0x11d67, 0x11d68,\n 0x11d6a, 0x11d89,\n 0x11d98, 0x11d98,\n 0x11db0, 0x11ddb,\n 0x11ee0, 0x11ef2,\n 0x11f02, 0x11f02,\n 0x11f04, 0x11f10,\n 0x11f12, 0x11f33,\n 0x11fb0, 0x11fb0,\n 0x12000, 0x12399,\n 0x12480, 0x12543,\n 0x12f90, 0x12ff0,\n 0x13000, 0x1342f,\n 0x13441, 0x13446,\n 0x13460, 0x143fa,\n 0x14400, 0x14646,\n 0x16100, 0x1611d,\n 0x16800, 0x16a38,\n 0x16a40, 0x16a5e,\n 0x16a70, 0x16abe,\n 0x16ad0, 0x16aed,\n 0x16b00, 0x16b2f,\n 0x16b40, 0x16b43,\n 0x16b63, 0x16b77,\n 0x16b7d, 0x16b8f,\n 0x16d40, 0x16d6c,\n 0x16e40, 0x16e7f,\n 0x16ea0, 0x16eb8,\n 0x16ebb, 0x16ed3,\n 0x16f00, 0x16f4a,\n 0x16f50, 0x16f50,\n 0x16f93, 0x16f9f,\n 0x16fe0, 0x16fe1,\n 0x16fe3, 0x16fe3,\n 0x16ff2, 0x16ff3,\n 0x17000, 0x18cd5,\n 0x18cff, 0x18d1e,\n 0x18d80, 0x18df2,\n 0x1aff0, 0x1aff3,\n 0x1aff5, 0x1affb,\n 0x1affd, 0x1affe,\n 0x1b000, 0x1b122,\n 0x1b132, 0x1b132,\n 0x1b150, 0x1b152,\n 0x1b155, 0x1b155,\n 0x1b164, 0x1b167,\n 0x1b170, 0x1b2fb,\n 0x1bc00, 0x1bc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x1e900, 0x1e943,\n 0x1e94b, 0x1e94b,\n 0x1ee00, 0x1ee03,\n 0x1ee05, 0x1ee1f,\n 0x1ee21, 0x1ee22,\n 0x1ee24, 0x1ee24,\n 0x1ee27, 0x1ee27,\n 0x1ee29, 0x1ee32,\n 0x1ee34, 0x1ee37,\n 0x1ee39, 0x1ee39,\n 0x1ee3b, 0x1ee3b,\n 0x1ee42, 0x1ee42,\n 0x1ee47, 0x1ee47,\n 0x1ee49, 0x1ee49,\n 0x1ee4b, 0x1ee4b,\n 0x1ee4d, 0x1ee4f,\n 0x1ee51, 0x1ee52,\n 0x1ee54, 0x1ee54,\n 0x1ee57, 0x1ee57,\n 0x1ee59, 0x1ee59,\n 0x1ee5b, 0x1ee5b,\n 0x1ee5d, 0x1ee5d,\n 0x1ee5f, 0x1ee5f,\n 0x1ee61, 0x1ee62,\n 0x1ee64, 0x1ee64,\n 0x1ee67, 0x1ee6a,\n 0x1ee6c, 0x1ee72,\n 0x1ee74, 0x1ee77,\n 0x1ee79, 0x1ee7c,\n 0x1ee7e, 0x1ee7e,\n 0x1ee80, 0x1ee89,\n 0x1ee8b, 0x1ee9b,\n 0x1eea1, 0x1eea3,\n 0x1eea5, 0x1eea9,\n 0x1eeab, 0x1eebb,\n 0x20000, 0x2a6df,\n 0x2a700, 0x2b81d,\n 0x2b820, 0x2cead,\n 0x2ceb0, 0x2ebe0,\n 0x2ebf0, 0x2ee5d,\n 0x2f800, 0x2fa1d,\n 0x30000, 0x3134a,\n 0x31350, 0x33479\n];\n", "import type { Direction } from './types.js';\nimport {\n NON_STRONG_BIDI_RANGES,\n NATURAL_LETTER_RANGES,\n RTL_BIDI_RANGES,\n UNICODE_BIDI_SHA256,\n UNICODE_GENERAL_CATEGORY_SHA256,\n UNICODE_BIDI_VERSION\n} from './generated/bidi-ranges.js';\n\nfunction isInRanges(codePoint: number, ranges: ReadonlyArray): boolean {\n let low = 0;\n let high = ranges.length / 2 - 1;\n while (low <= high) {\n const middle = (low + high) >> 1;\n const start = ranges[middle * 2]!;\n const end = ranges[middle * 2 + 1]!;\n if (codePoint < start) high = middle - 1;\n else if (codePoint > end) low = middle + 1;\n else return true;\n }\n return false;\n}\n\nexport function isRtlCodePoint(codePoint: number): boolean {\n return isInRanges(codePoint, RTL_BIDI_RANGES);\n}\n\n/** Returns the Unicode Bidi_Class strong direction, including LRM/RLM/ALM. */\nexport function classifyBidiStrongCharacter(character: string): Direction {\n const codePoint = character.codePointAt(0);\n if (codePoint === undefined || isInRanges(codePoint, NON_STRONG_BIDI_RANGES)) return 'neutral';\n return isRtlCodePoint(codePoint) ? 'rtl' : 'ltr';\n}\n\n/** Classifies natural-language letters while leaving numbers and punctuation neutral. */\nexport function classifyCharacter(character: string): Direction {\n const codePoint = character.codePointAt(0);\n if (codePoint === undefined) return 'neutral';\n return isInRanges(codePoint, NATURAL_LETTER_RANGES) ? classifyBidiStrongCharacter(character) : 'neutral';\n}\n\nexport const UNICODE_DATA_VERSION = UNICODE_BIDI_VERSION;\nexport const UNICODE_DATA_SHA256 = UNICODE_BIDI_SHA256;\nexport const UNICODE_LETTER_DATA_SHA256 = UNICODE_GENERAL_CATEGORY_SHA256;\n", "import { classifyBidiStrongCharacter, classifyCharacter } from './classify.js';\nimport type {\n DetectionOptions,\n Direction,\n ParagraphAnalysis,\n StrongCharacterCounts,\n TextAnalysis\n} from './types.js';\n\nexport interface TechnicalTokenRange {\n text: string;\n start: number;\n end: number;\n kind: 'code' | 'url' | 'email' | 'path' | 'version' | 'hash' | 'identifier' | 'number' | 'command' | 'math' | 'html';\n}\n\nconst DEFAULT_OPTIONS: Required = {\n strategy: 'content-majority',\n fallback: 'neutral',\n inheritedDirection: 'ltr',\n minimumStrongCharacters: 1,\n majorityThreshold: 0.5,\n excludeTechnicalTokens: true,\n technicalIdentifiers: []\n};\n\nexport const DEFAULT_TECHNICAL_IDENTIFIERS = Object.freeze([\n 'ai', 'api', 'anthropic', 'chatgpt', 'claude', 'cli', 'codex', 'copilot', 'cursor',\n 'deepseek', 'electron', 'gemini', 'github', 'gitlab', 'grok', 'huggingface',\n 'javascript', 'json', 'llama', 'markdown', 'mistral', 'node', 'npm', 'openai',\n 'python', 'qwen', 'react', 'rust', 'svelte', 'typescript', 'url', 'version',\n 'vscode', 'vue', 'web', 'webpack', 'yaml',\n 'angular', 'astro', 'chrome', 'docker', 'esbuild', 'eslint', 'firefox',\n 'kubernetes', 'kubectl', 'nuxt', 'playwright', 'pnpm', 'preact', 'remix',\n 'rollup', 'safari', 'stencil', 'storybook', 'tailwind', 'turbopack', 'vite',\n 'vitest'\n] as const);\nconst KNOWN_TECHNICAL_TOKENS = new Set(DEFAULT_TECHNICAL_IDENTIFIERS);\nconst CUSTOM_TECHNICAL_IDENTIFIER_CACHE = new WeakMap>();\n\nfunction normalizeOptions(options: DetectionOptions = {}): Required {\n const strategy = options.strategy ?? DEFAULT_OPTIONS.strategy;\n const majorityStrategy = strategy === 'content-majority'\n || strategy === 'semantic-dominant'\n || strategy === 'majority';\n return {\n strategy,\n fallback: options.fallback ?? options.inheritedDirection ?? DEFAULT_OPTIONS.fallback,\n inheritedDirection: options.inheritedDirection ?? DEFAULT_OPTIONS.inheritedDirection,\n minimumStrongCharacters: Math.max(1, options.minimumStrongCharacters ?? DEFAULT_OPTIONS.minimumStrongCharacters),\n majorityThreshold: Math.min(1, Math.max(0.5, options.majorityThreshold ?? DEFAULT_OPTIONS.majorityThreshold)),\n // Compatibility/strict first-strong modes must see the real first strong\n // character (including a leading technical identifier), like dir=\"auto\".\n excludeTechnicalTokens: options.excludeTechnicalTokens ?? majorityStrategy,\n technicalIdentifiers: options.technicalIdentifiers ?? DEFAULT_OPTIONS.technicalIdentifiers\n };\n}\n\nfunction addRange(\n ranges: TechnicalTokenRange[],\n text: string,\n start: number,\n end: number,\n kind: TechnicalTokenRange['kind']\n): void {\n if (end > start) ranges.push({ text: text.slice(start, end), start, end, kind });\n}\n\nfunction addMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const value = match[group];\n if (value === undefined) continue;\n const start = match.index + match[0].indexOf(value);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction trimTechnicalPunctuation(value: string): string {\n let end = value.length;\n while (end > 0 && /[.,;:!?\u060C\u061B\u061F\u3002\u0964\u06D4]/u.test(value[end - 1]!)) end -= 1;\n return end === value.length ? value : value.slice(0, end);\n}\n\nfunction addValidatedMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n validate: (value: string) => boolean,\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const value = match[group];\n if (value === undefined || !validate(value)) continue;\n const start = match.index + match[0].indexOf(value);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction addNormalizedMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n normalize: (value: string) => string,\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const original = match[group];\n if (original === undefined) continue;\n const value = normalize(original);\n if (!value) continue;\n const start = match.index + match[0].indexOf(original);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction isIpv4(value: string): boolean {\n const parts = value.split('.');\n return parts.length === 4 && parts.every((part) => /^\\d{1,3}$/u.test(part) && Number(part) <= 255);\n}\n\nfunction isIpv6(value: string): boolean {\n if (!/^[0-9A-F:]+$/iu.test(value) || !value.includes(':')) return false;\n const compression = value.indexOf('::');\n if (compression !== value.lastIndexOf('::')) return false;\n const sides = compression >= 0 ? value.split('::') : [value];\n const groups = sides.flatMap((side) => side ? side.split(':') : []);\n if (!groups.every((group) => /^[0-9A-F]{1,4}$/iu.test(group))) return false;\n return compression >= 0 ? groups.length < 8 : groups.length === 8;\n}\n\nfunction addCodeRanges(text: string, ranges: TechnicalTokenRange[]): void {\n let fence: { marker: '`' | '~'; length: number; start: number } | undefined;\n const closedFences: Array<{ start: number; end: number }> = [];\n let lineStart = 0;\n while (lineStart < text.length) {\n let lineEnd = lineStart;\n while (lineEnd < text.length && text[lineEnd] !== '\\r' && text[lineEnd] !== '\\n') lineEnd += 1;\n let nextLine = lineEnd;\n if (text[nextLine] === '\\r') nextLine += 1;\n if (text[nextLine] === '\\n') nextLine += 1;\n const line = text.slice(lineStart, lineEnd);\n if (!fence) {\n const openerMatch = /^ {0,3}(`{3,}|~{3,})(.*)$/u.exec(line);\n const opener = openerMatch?.[1];\n const info = openerMatch?.[2] ?? '';\n if (opener && !(opener[0] === '`' && info.includes('`'))) fence = {\n marker: opener[0] as '`' | '~',\n length: opener.length,\n start: lineStart\n };\n } else {\n const closer = /^ {0,3}(`+|~+)[ \\t]*$/u.exec(line)?.[1];\n if (closer?.[0] === fence.marker && closer.length >= fence.length) {\n closedFences.push({ start: fence.start, end: nextLine });\n fence = undefined;\n }\n }\n lineStart = nextLine;\n }\n // Decide once over the union of all closed spans. Scanning each fence's\n // complementary text separately would be quadratic and would mistake code\n // inside a second standalone fence for prose outside the first.\n let fenceIndex = 0;\n let utf16Index = 0;\n let hasOutsideNaturalText = false;\n for (const character of text) {\n while (fenceIndex < closedFences.length && utf16Index >= closedFences[fenceIndex]!.end) {\n fenceIndex += 1;\n }\n const span = closedFences[fenceIndex];\n const insideFence = span !== undefined && utf16Index >= span.start && utf16Index < span.end;\n if (!insideFence && classifyCharacter(character) !== 'neutral') {\n hasOutsideNaturalText = true;\n break;\n }\n utf16Index += character.length;\n }\n // Standalone fenced code keeps its historical raw-text direction evidence.\n // Parser-aware Markdown adapters force code blocks LTR. Excluding complete\n // fences is useful when surrounding prose\u2014not code literals\u2014must decide the\n // containing raw block's natural direction.\n if (hasOutsideNaturalText) {\n for (const span of closedFences) addRange(ranges, text, span.start, span.end, 'code');\n }\n\n const lineExpression = /[^\\r\\n]*/gu;\n let lineMatch: RegExpExecArray | null;\n while ((lineMatch = lineExpression.exec(text)) !== null) {\n const line = lineMatch[0];\n const lineStart = lineMatch.index;\n const runs: Array<{ start: number; length: number }> = [];\n for (let index = 0; index < line.length;) {\n if (line[index] !== '`') {\n index += 1;\n continue;\n }\n const start = index;\n while (index < line.length && line[index] === '`') index += 1;\n runs.push({ start, length: index - start });\n }\n const suffixMaximum = new Array(runs.length + 1).fill(0);\n for (let index = runs.length - 1; index >= 0; index -= 1) {\n suffixMaximum[index] = Math.max(runs[index]!.length, suffixMaximum[index + 1]!);\n }\n let runIndex = 0;\n let cursor = runs[0]?.start ?? 0;\n while (runIndex < runs.length) {\n const opener = runs[runIndex]!;\n const openerEnd = opener.start + opener.length;\n if (cursor >= openerEnd) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n const available = openerEnd - cursor;\n const delimiterLength = Math.min(\n available,\n Math.max(Math.floor(available / 2), suffixMaximum[runIndex + 1]!)\n );\n if (delimiterLength === 0) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n let closingRunIndex = runIndex;\n let closingStart = cursor + delimiterLength;\n if (available - delimiterLength < delimiterLength) {\n closingRunIndex += 1;\n while (closingRunIndex < runs.length\n && runs[closingRunIndex]!.length < delimiterLength) closingRunIndex += 1;\n if (closingRunIndex >= runs.length) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n closingStart = runs[closingRunIndex]!.start;\n }\n const end = closingStart + delimiterLength;\n addRange(ranges, text, lineStart + cursor, lineStart + end, 'code');\n runIndex = closingRunIndex;\n cursor = end;\n }\n if (lineMatch[0].length === 0) lineExpression.lastIndex += 1;\n }\n}\n\nfunction customTechnicalIdentifiers(values: readonly string[]): ReadonlySet {\n const cacheable = Object.isFrozen(values);\n const cached = cacheable ? CUSTOM_TECHNICAL_IDENTIFIER_CACHE.get(values) : undefined;\n if (cached) return cached;\n const identifiers = new Set();\n for (const value of values) {\n if (/^[A-Za-z][A-Za-z0-9_.-]*$/u.test(value)) identifiers.add(value.toLowerCase());\n }\n if (cacheable) CUSTOM_TECHNICAL_IDENTIFIER_CACHE.set(values, identifiers);\n return identifiers;\n}\n\n/**\n * Acronyms are short. A longer all-capital word is emphasized prose, not an\n * identifier, and must keep deciding the natural-language base direction.\n */\nconst ACRONYM_MAXIMUM_LENGTH = 5;\n\nfunction isKnownTechnicalWord(value: string, custom: ReadonlySet): boolean {\n const normalized = value.toLowerCase();\n return KNOWN_TECHNICAL_TOKENS.has(normalized) || custom.has(normalized);\n}\n\n/**\n * Reports whether capitals are the block's prose style rather than an\n * identifier signal. `PLEASE READ THIS WARNING` is emphasized natural language;\n * the same `API` token inside mixed-case prose is an acronym. Deciding this per\n * block keeps the rule deterministic and needs no dictionary or language model.\n */\nfunction usesUppercaseProse(text: string): boolean {\n const words = text.match(/\\b[A-Za-z]{2,}\\b/gu);\n if (words === null || words.length < 2) return false;\n let capitalized = 0;\n // Every candidate is alphabetic, so \"contains no lowercase\" means all-capital.\n for (const word of words) if (!/[a-z]/u.test(word)) capitalized += 1;\n return capitalized * 2 > words.length;\n}\n\n/**\n * Only tokens starting with an ASCII letter reach this test, so every false\n * exclusion removes LTR evidence and never RTL evidence. An over-broad rule\n * therefore biases mixed blocks toward RTL \u2014 the mirror of the failure this\n * project exists to fix \u2014 which is why the hyphen is not a signal on its own.\n */\nfunction isTechnicalIdentifier(\n token: string,\n custom: ReadonlySet,\n uppercaseProse: boolean\n): boolean {\n if (isKnownTechnicalWord(token, custom)) return true;\n // A hyphenated token is technical when a segment is itself a known technical\n // word (`react-markdown`, `web-app`), not merely because it is hyphenated.\n if (token.includes('-')\n && token.split('-').some((segment) => segment !== '' && isKnownTechnicalWord(segment, custom))) {\n return true;\n }\n // Digits, underscores, and dots are structural identifier syntax.\n return /[0-9_.]/u.test(token)\n || /[a-z][A-Z]/u.test(token)\n || (!uppercaseProse\n && token.length <= ACRONYM_MAXIMUM_LENGTH\n && /^[A-Z]{2,}$/u.test(token));\n}\n\n/** Finds ranges that should not decide the natural-language base direction. */\nexport function findTechnicalTokenRanges(\n text: string,\n technicalIdentifiers: readonly string[] = []\n): TechnicalTokenRange[] {\n const ranges: TechnicalTokenRange[] = [];\n addCodeRanges(text, ranges);\n addMatches(text, ranges, /<\\/?[A-Za-z][^<>\\r\\n]*>/gu, 'html');\n addMatches(text, ranges, /(?:\\$\\$[^\\r\\n]*?\\$\\$|\\$[^$\\r\\n]+\\$|\\\\\\([^\\r\\n]*?\\\\\\))/gu, 'math');\n\n const urls = /\\b(?:https?|ftp):\\/\\/[^\\s<>{}\"']+/giu;\n let urlMatch: RegExpExecArray | null;\n while ((urlMatch = urls.exec(text)) !== null) {\n let value = urlMatch[0];\n value = trimTechnicalPunctuation(value);\n for (const [open, close] of [['(', ')'], ['[', ']'], ['{', '}']] as const) {\n if (!value.endsWith(close)) continue;\n let balance = 0;\n for (const character of value) {\n if (character === open) balance += 1;\n else if (character === close) balance -= 1;\n }\n if (balance >= 0) continue;\n let end = value.length;\n while (balance < 0 && end > 0 && value[end - 1] === close) {\n balance += 1;\n end -= 1;\n }\n if (end !== value.length) value = value.slice(0, end);\n }\n addRange(ranges, text, urlMatch.index, urlMatch.index + value.length, 'url');\n }\n addMatches(text, ranges, /\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}\\b/giu, 'email');\n addNormalizedMatches(\n text,\n ranges,\n /(?()\\x5B\\x5D{}]+/gu,\n 'path',\n trimTechnicalPunctuation\n );\n addMatches(text, ranges, /\\b(?:[A-Za-z0-9_.-]+[\\\\/])+(?:[A-Za-z0-9_.-]+)\\b/gu, 'path');\n addMatches(text, ranges, /(? a.start - b.start || b.end - a.end);\n const merged: TechnicalTokenRange[] = [];\n for (const range of ranges) {\n const previous = merged.at(-1);\n if (previous && range.start <= previous.end) {\n previous.end = Math.max(previous.end, range.end);\n previous.text = text.slice(previous.start, previous.end);\n } else {\n merged.push({ ...range });\n }\n }\n return merged;\n}\n\nexport function countStrongCharacters(\n text: string,\n options: DetectionOptions = {}\n): StrongCharacterCounts & { firstStrong: Direction; technicalTokens: TechnicalTokenRange[] } {\n const normalized = normalizeOptions(options);\n return countStrongCharactersNormalized(text, normalized);\n}\n\nfunction countStrongCharactersNormalized(\n text: string,\n normalized: Required\n): StrongCharacterCounts & { firstStrong: Direction; technicalTokens: TechnicalTokenRange[] } {\n const technicalTokens = normalized.excludeTechnicalTokens\n ? findTechnicalTokenRanges(text, normalized.technicalIdentifiers)\n : [];\n let ltr = 0;\n let rtl = 0;\n let firstStrong: Direction = 'neutral';\n let index = 0;\n let technicalIndex = 0;\n const classify = normalized.strategy === 'first-strong' || normalized.strategy === 'strict-uax9'\n ? classifyBidiStrongCharacter\n : classifyCharacter;\n\n for (const character of text) {\n // Technical ranges are sorted and merged, so advance one cursor instead\n // of rescanning every range for every code point. This keeps detection\n // linear even for long transcripts containing many URLs/identifiers.\n while (technicalIndex < technicalTokens.length && index >= technicalTokens[technicalIndex]!.end) {\n technicalIndex += 1;\n }\n const technicalRange = technicalTokens[technicalIndex];\n const isTechnical = technicalRange !== undefined\n && index >= technicalRange.start\n && index < technicalRange.end;\n if (!isTechnical) {\n const direction = classify(character);\n if (direction === 'ltr') ltr += 1;\n if (direction === 'rtl') rtl += 1;\n if (firstStrong === 'neutral' && direction !== 'neutral') firstStrong = direction;\n }\n index += character.length;\n }\n\n return { ltr, rtl, total: ltr + rtl, firstStrong, technicalTokens };\n}\n\nfunction fallbackDirection(options: Required): Direction {\n return options.fallback;\n}\n\nfunction directionFromCounts(\n counts: StrongCharacterCounts & { firstStrong: Direction },\n normalized: Required\n): Direction {\n if (normalized.strategy === 'ltr' || normalized.strategy === 'rtl') return normalized.strategy;\n if (normalized.strategy === 'inherit') return normalized.inheritedDirection;\n if (counts.total < normalized.minimumStrongCharacters) return fallbackDirection(normalized);\n\n if (normalized.strategy === 'first-strong' || normalized.strategy === 'strict-uax9') {\n return counts.firstStrong === 'neutral' ? fallbackDirection(normalized) : counts.firstStrong;\n }\n\n if (counts.rtl > counts.ltr && counts.rtl / counts.total >= normalized.majorityThreshold) return 'rtl';\n if (counts.ltr > counts.rtl && counts.ltr / counts.total >= normalized.majorityThreshold) return 'ltr';\n return counts.firstStrong === 'neutral' ? fallbackDirection(normalized) : counts.firstStrong;\n}\n\nexport function detectDirection(text: string, options: DetectionOptions = {}): Direction {\n const normalized = normalizeOptions(options);\n if (normalized.strategy === 'ltr' || normalized.strategy === 'rtl') return normalized.strategy;\n if (normalized.strategy === 'inherit') return normalized.inheritedDirection;\n return directionFromCounts(countStrongCharactersNormalized(text, normalized), normalized);\n}\n\nfunction confidenceFor(counts: StrongCharacterCounts, direction: Direction): number {\n if (counts.total === 0 || direction === 'neutral') return 0;\n const matching = direction === 'rtl' ? counts.rtl : counts.ltr;\n return Number((matching / counts.total).toFixed(4));\n}\n\nfunction firstBidiStrongCharacter(text: string): Direction {\n for (const character of text) {\n const direction = classifyBidiStrongCharacter(character);\n if (direction !== 'neutral') return direction;\n }\n return 'neutral';\n}\n\nfunction splitParagraphs(text: string): Array<{ text: string; start: number; end: number }> {\n const paragraphs: Array<{ text: string; start: number; end: number }> = [];\n const separator = /\\r\\n|\\n|\\r|\\u2029/gu;\n let start = 0;\n let match: RegExpExecArray | null;\n\n while ((match = separator.exec(text)) !== null) {\n paragraphs.push({ text: text.slice(start, match.index), start, end: match.index });\n start = match.index + match[0].length;\n }\n paragraphs.push({ text: text.slice(start), start, end: text.length });\n return paragraphs;\n}\n\nexport function analyzeParagraph(text: string, start = 0, options: DetectionOptions = {}): ParagraphAnalysis {\n const normalized = normalizeOptions(options);\n const countsWithFirst = countStrongCharactersNormalized(text, normalized);\n const counts: StrongCharacterCounts = {\n ltr: countsWithFirst.ltr,\n rtl: countsWithFirst.rtl,\n total: countsWithFirst.total\n };\n const direction = directionFromCounts(countsWithFirst, normalized);\n return {\n text,\n start,\n end: start + text.length,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n confidence: confidenceFor(counts, direction),\n counts\n };\n}\n\nexport function analyzeText(text: string, options: DetectionOptions = {}): TextAnalysis {\n const normalized = normalizeOptions(options);\n const countsWithFirst = countStrongCharactersNormalized(text, normalized);\n const counts: StrongCharacterCounts = {\n ltr: countsWithFirst.ltr,\n rtl: countsWithFirst.rtl,\n total: countsWithFirst.total\n };\n const direction = directionFromCounts(countsWithFirst, normalized);\n const rawCountsWithFirst = countStrongCharactersNormalized(text, normalizeOptions({\n ...normalized,\n strategy: 'content-majority',\n excludeTechnicalTokens: false\n }));\n const rawCounts: StrongCharacterCounts = {\n ltr: rawCountsWithFirst.ltr,\n rtl: rawCountsWithFirst.rtl,\n total: rawCountsWithFirst.total\n };\n const split = splitParagraphs(text);\n const paragraphs = split.length === 1\n ? [{\n text,\n start: 0,\n end: text.length,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n confidence: confidenceFor(counts, direction),\n counts\n }]\n : split.map((paragraph) => analyzeParagraph(paragraph.text, paragraph.start, normalized));\n return {\n text,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n rawFirstStrong: firstBidiStrongCharacter(text),\n confidence: confidenceFor(counts, direction),\n counts,\n rawCounts,\n paragraphs,\n mixed: rawCounts.ltr > 0 && rawCounts.rtl > 0\n };\n}\n", "import type {\n BidiControlFinding,\n BidiControlRisk,\n BidiControlSanitizationGroup,\n BidiSecurityFinding,\n BidiSecurityMode,\n BidiSecurityReport,\n BidiSecuritySeverity\n} from './types.js';\n\nconst CONTROL_METADATA = new Map>([\n [0x061c, { name: 'ARABIC LETTER MARK', risk: 'low', category: 'mark' }],\n [0x200e, { name: 'LEFT-TO-RIGHT MARK', risk: 'low', category: 'mark' }],\n [0x200f, { name: 'RIGHT-TO-LEFT MARK', risk: 'low', category: 'mark' }],\n [0x202a, { name: 'LEFT-TO-RIGHT EMBEDDING', risk: 'high', category: 'embedding' }],\n [0x202b, { name: 'RIGHT-TO-LEFT EMBEDDING', risk: 'high', category: 'embedding' }],\n [0x202c, { name: 'POP DIRECTIONAL FORMATTING', risk: 'medium', category: 'pop' }],\n [0x202d, { name: 'LEFT-TO-RIGHT OVERRIDE', risk: 'high', category: 'override' }],\n [0x202e, { name: 'RIGHT-TO-LEFT OVERRIDE', risk: 'high', category: 'override' }],\n [0x2066, { name: 'LEFT-TO-RIGHT ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2067, { name: 'RIGHT-TO-LEFT ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2068, { name: 'FIRST STRONG ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2069, { name: 'POP DIRECTIONAL ISOLATE', risk: 'medium', category: 'pop' }],\n [0x206a, { name: 'INHIBIT SYMMETRIC SWAPPING', risk: 'medium', category: 'deprecated' }],\n [0x206b, { name: 'ACTIVATE SYMMETRIC SWAPPING', risk: 'medium', category: 'deprecated' }],\n [0x206c, { name: 'INHIBIT ARABIC FORM SHAPING', risk: 'medium', category: 'deprecated' }],\n [0x206d, { name: 'ACTIVATE ARABIC FORM SHAPING', risk: 'medium', category: 'deprecated' }],\n [0x206e, { name: 'NATIONAL DIGIT SHAPES', risk: 'medium', category: 'deprecated' }],\n [0x206f, { name: 'NOMINAL DIGIT SHAPES', risk: 'medium', category: 'deprecated' }]\n]);\n\nconst REMEDIATION = 'Remove the control unless a documented plain-text protocol requires it; prefer semantic markup and isolation.';\n\nfunction severityForRisk(risk: BidiControlRisk): BidiSecuritySeverity {\n if (risk === 'high') return 'high';\n if (risk === 'medium') return 'warning';\n return 'info';\n}\n\nfunction rangeFor(control: BidiControlFinding): BidiSecurityFinding['sourceRange'] {\n return {\n utf16: { start: control.index, end: control.end },\n codePoint: { start: control.codePointIndex, end: control.codePointIndex + 1 }\n };\n}\n\nfunction codeForControl(control: BidiControlFinding): string {\n if (control.category === 'override') return 'BIDI_OVERRIDE_CONTROL';\n if (control.category === 'embedding') return 'BIDI_EMBEDDING_CONTROL';\n if (control.category === 'isolate') return 'BIDI_ISOLATE_CONTROL';\n if (control.category === 'mark') return 'BIDI_DIRECTIONAL_MARK';\n if (control.category === 'deprecated') return 'BIDI_DEPRECATED_CONTROL';\n return 'BIDI_POP_CONTROL';\n}\n\nfunction controlFinding(control: BidiControlFinding): BidiSecurityFinding {\n return {\n code: codeForControl(control),\n severity: severityForRisk(control.risk),\n message: `${control.name} (${control.codePoint}) is invisible and changes bidirectional interpretation.`,\n sourceRange: rangeFor(control),\n remediation: REMEDIATION,\n control\n };\n}\n\nexport function findBidiControls(text: string): BidiControlFinding[] {\n const findings: BidiControlFinding[] = [];\n let utf16Index = 0;\n let codePointIndex = 0;\n\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const metadata = CONTROL_METADATA.get(codePoint);\n if (metadata) {\n findings.push({\n character,\n codePoint: `U+${codePoint.toString(16).toUpperCase().padStart(4, '0')}`,\n index: utf16Index,\n end: utf16Index + character.length,\n codePointIndex,\n ...metadata\n });\n }\n utf16Index += character.length;\n codePointIndex += 1;\n }\n return findings;\n}\n\nexport function visibleBidiControls(text: string): string {\n const namesByCodePoint = new Map([...CONTROL_METADATA].map(([codePoint, metadata]) => [codePoint, metadata.name]));\n let result = '';\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const name = namesByCodePoint.get(codePoint);\n result += name ? `\u27E6${name}\u27E7` : character;\n }\n return result;\n}\n\nexport function highestControlRisk(findings: readonly BidiControlFinding[]): BidiControlRisk | null {\n if (findings.some((finding) => finding.risk === 'high')) return 'high';\n if (findings.some((finding) => finding.risk === 'medium')) return 'medium';\n if (findings.some((finding) => finding.risk === 'low')) return 'low';\n return null;\n}\n\ninterface FormattingFrame {\n kind: 'embedding' | 'isolate';\n control: BidiControlFinding;\n}\n\nfunction lastFrameIndex(stack: readonly FormattingFrame[], kind: FormattingFrame['kind']): number {\n for (let index = stack.length - 1; index >= 0; index -= 1) {\n if (stack[index]?.kind === kind) return index;\n }\n return -1;\n}\n\nfunction balanceFindings(controls: readonly BidiControlFinding[]): BidiSecurityFinding[] {\n const findings: BidiSecurityFinding[] = [];\n const stack: FormattingFrame[] = [];\n\n for (const control of controls) {\n const codePoint = control.codePoint;\n if (codePoint === 'U+202A' || codePoint === 'U+202B' || codePoint === 'U+202D' || codePoint === 'U+202E') {\n stack.push({ kind: 'embedding', control });\n continue;\n }\n if (codePoint === 'U+2066' || codePoint === 'U+2067' || codePoint === 'U+2068') {\n stack.push({ kind: 'isolate', control });\n continue;\n }\n if (codePoint === 'U+202C') {\n const isolateIndex = lastFrameIndex(stack, 'isolate');\n const embeddingIndex = lastFrameIndex(stack, 'embedding');\n if (embeddingIndex <= isolateIndex) {\n findings.push({\n code: 'BIDI_UNMATCHED_PDF',\n severity: 'high',\n message: 'POP DIRECTIONAL FORMATTING has no matching active embedding or override.',\n sourceRange: rangeFor(control),\n remediation: 'Remove the unmatched PDF or add the intended opener within the same isolate.',\n control\n });\n } else {\n stack.splice(embeddingIndex, 1);\n }\n continue;\n }\n if (codePoint === 'U+2069') {\n const isolateIndex = lastFrameIndex(stack, 'isolate');\n if (isolateIndex < 0) {\n findings.push({\n code: 'BIDI_UNMATCHED_PDI',\n severity: 'high',\n message: 'POP DIRECTIONAL ISOLATE has no matching isolate opener.',\n sourceRange: rangeFor(control),\n remediation: 'Remove the unmatched PDI or add the intended LRI, RLI, or FSI opener.',\n control\n });\n } else {\n const crossing = stack.slice(isolateIndex + 1).filter((frame) => frame.kind === 'embedding');\n for (const frame of crossing) {\n findings.push({\n code: 'BIDI_FORMAT_CROSSES_ISOLATE_BOUNDARY',\n severity: 'high',\n message: `${frame.control.name} is not closed before the containing isolate ends.`,\n sourceRange: rangeFor(frame.control),\n remediation: 'Close the embedding or override with PDF before PDI.',\n control: frame.control\n });\n }\n stack.splice(isolateIndex);\n }\n }\n }\n\n for (const frame of stack) {\n findings.push({\n code: frame.kind === 'isolate' ? 'BIDI_UNCLOSED_ISOLATE' : 'BIDI_UNCLOSED_EMBEDDING',\n severity: 'high',\n message: `${frame.control.name} is not terminated before the end of the text.`,\n sourceRange: rangeFor(frame.control),\n remediation: frame.kind === 'isolate'\n ? 'Add the matching PDI or remove the isolate opener.'\n : 'Add the matching PDF or remove the embedding/override opener.',\n control: frame.control\n });\n }\n return findings;\n}\n\nfunction isAsciiIdentifierCharacter(value: string | undefined): boolean {\n return value !== undefined && /^[A-Za-z0-9_$]$/u.test(value);\n}\n\nfunction invisibleCharacterFindings(text: string): BidiSecurityFinding[] {\n const findings: BidiSecurityFinding[] = [];\n const characters = [...text];\n let utf16Index = 0;\n for (let codePointIndex = 0; codePointIndex < characters.length; codePointIndex += 1) {\n const character = characters[codePointIndex]!;\n const sourceRange = {\n utf16: { start: utf16Index, end: utf16Index + character.length },\n codePoint: { start: codePointIndex, end: codePointIndex + 1 }\n };\n if (character === '\\u200B') {\n findings.push({\n code: 'HIDDEN_ZERO_WIDTH_SPACE',\n severity: 'warning',\n message: 'ZERO WIDTH SPACE (U+200B) is hidden and can disguise identifiers, links, or filenames.',\n sourceRange,\n remediation: 'Remove it from identifiers and source-like content unless its use is explicitly required.'\n });\n }\n if ((character === '\\u200C' || character === '\\u200D')\n && isAsciiIdentifierCharacter(characters[codePointIndex - 1])\n && isAsciiIdentifierCharacter(characters[codePointIndex + 1])) {\n const name = character === '\\u200C' ? 'ZERO WIDTH NON-JOINER' : 'ZERO WIDTH JOINER';\n findings.push({\n code: 'HIDDEN_IDENTIFIER_JOINER',\n severity: 'warning',\n message: `${name} is hidden inside an ASCII identifier-like token.`,\n sourceRange,\n remediation: 'Remove the joiner from machine identifiers, or document and validate the identifier protocol that requires it.'\n });\n }\n if (character === '\\u2060') {\n findings.push({\n code: 'HIDDEN_WORD_JOINER',\n severity: 'info',\n message: 'WORD JOINER (U+2060) is invisible and can disguise token boundaries.',\n sourceRange,\n remediation: 'Confirm that non-breaking behavior is required; remove it from identifiers and source-like content.'\n });\n }\n // A leading U+FEFF can represent a decoded byte-order signature. The same\n // character midstream is invisible content and deserves an explicit finding.\n if (character === '\\uFEFF' && codePointIndex > 0) {\n findings.push({\n code: 'HIDDEN_MIDSTREAM_BOM',\n severity: 'warning',\n message: 'ZERO WIDTH NO-BREAK SPACE/BOM (U+FEFF) appears inside the text.',\n sourceRange,\n remediation: 'Remove the midstream BOM unless a documented protocol explicitly requires it.'\n });\n }\n utf16Index += character.length;\n }\n return findings;\n}\n\n/** Audits hidden bidi formatting without mutating the source string. */\nexport function scanBidiSecurity(\n text: string,\n options: { mode?: BidiSecurityMode } = {}\n): BidiSecurityReport {\n const mode = options.mode ?? 'audit';\n if (mode === 'off') return { mode, safe: true, shouldBlock: false, controls: [], findings: [] };\n const controls = findBidiControls(text);\n const findings = [\n ...controls.map(controlFinding),\n ...balanceFindings(controls),\n ...invisibleCharacterFindings(text)\n ].sort((a, b) => a.sourceRange.utf16.start - b.sourceRange.utf16.start || a.code.localeCompare(b.code));\n const hasHigh = findings.some((finding) => finding.severity === 'high');\n return {\n mode,\n safe: !hasHigh,\n shouldBlock: mode === 'strict' ? findings.length > 0 : mode === 'warn' && hasHigh,\n controls,\n findings\n };\n}\n\nexport interface SanitizeBidiControlsOptions {\n /** Remove controls with these risk levels. Defaults to every level. */\n remove?: BidiControlRisk[];\n /**\n * Remove only these semantic control groups. PDF follows embedding/override;\n * PDI follows isolate, so preserved isolate pairs stay structurally intact.\n */\n removeGroups?: BidiControlSanitizationGroup[];\n}\n\nconst ALL_SANITIZATION_GROUPS: readonly BidiControlSanitizationGroup[] = [\n 'mark', 'embedding-override', 'isolate', 'deprecated'\n];\n\nconst SANITIZATION_GROUP_RISK: Readonly> = {\n mark: 'low',\n 'embedding-override': 'high',\n isolate: 'medium',\n deprecated: 'medium'\n};\n\nfunction sanitizationGroup(codePoint: number, category: BidiControlFinding['category']): BidiControlSanitizationGroup {\n if (codePoint === 0x202c || category === 'embedding' || category === 'override') {\n return 'embedding-override';\n }\n if (codePoint === 0x2069 || category === 'isolate') return 'isolate';\n if (category === 'mark' || category === 'deprecated') return category;\n // Every recognized pop is handled above; keep an explicit defensive\n // fallback so future metadata cannot silently escape the default sanitizer.\n return 'deprecated';\n}\n\nexport function sanitizeBidiControls(\n text: string,\n options: SanitizeBidiControlsOptions = {}\n): { text: string; removed: BidiControlFinding[] } {\n const remove = new Set(options.remove ?? ['high', 'medium', 'low']);\n const removeGroups = new Set(options.removeGroups ?? ALL_SANITIZATION_GROUPS);\n const grouped = options.removeGroups !== undefined;\n const removed: BidiControlFinding[] = [];\n let output = '';\n let utf16Index = 0;\n let codePointIndex = 0;\n\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const metadata = CONTROL_METADATA.get(codePoint);\n const group = metadata && sanitizationGroup(codePoint, metadata.category);\n const selected = metadata && group && removeGroups.has(group)\n && remove.has(grouped ? SANITIZATION_GROUP_RISK[group] : metadata.risk);\n if (metadata && selected) {\n removed.push({\n character,\n codePoint: `U+${codePoint.toString(16).toUpperCase().padStart(4, '0')}`,\n index: utf16Index,\n end: utf16Index + character.length,\n codePointIndex,\n ...metadata\n });\n } else {\n output += character;\n }\n utf16Index += character.length;\n codePointIndex += 1;\n }\n\n return { text: output, removed };\n}\n", "import { classifyBidiStrongCharacter } from './classify.js';\nimport { findBidiControls } from './security.js';\nimport type { ResolvedDirection } from './types.js';\n\n/**\n * `auto` is the non-interference default: ordinary LTR content in an LTR\n * context receives no BidiLens markup or DOM mutation. `always` retains the\n * explicit-annotation behavior for integrations that require stable markers.\n */\nexport type BidiInterventionMode = 'auto' | 'always';\n\nexport interface BidiInterventionOptions {\n intervention?: BidiInterventionMode | undefined;\n inheritedDirection?: ResolvedDirection | undefined;\n}\n\n/**\n * Reports whether rendering metadata is needed for a string in its host\n * context. Hidden bidi controls deliberately disable the LTR fast path so an\n * apparently English string cannot bypass bidi-aware handling.\n */\nexport function needsBidiIntervention(\n text: string,\n options: BidiInterventionOptions = {}\n): boolean {\n if (options.intervention === 'always') return true;\n if (findBidiControls(text).length > 0) return true;\n\n let hasLtr = false;\n for (const character of text) {\n const direction = classifyBidiStrongCharacter(character);\n if (direction === 'rtl') return true;\n if (direction === 'ltr') hasLtr = true;\n }\n\n return options.inheritedDirection === 'rtl' && (hasLtr || text.length > 0);\n}\n", "import { classifyCharacter } from './classify.js';\nimport { isolateText } from './controls.js';\nimport { findTechnicalTokenRanges } from './detect.js';\nimport { needsBidiIntervention } from './intervention.js';\nimport type { BidiInterventionMode } from './intervention.js';\nimport type { Direction, DirectionalRun, InlineIsolation } from './types.js';\n\ntype PlannedIsolation = Omit;\n\nfunction attachSourceRanges(text: string, isolations: Omit[]): InlineIsolation[] {\n const codePointAtUtf16 = new Uint32Array(text.length + 1);\n let utf16Offset = 0;\n let codePointOffset = 0;\n for (const character of text) {\n codePointAtUtf16[utf16Offset] = codePointOffset;\n if (character.length === 2) codePointAtUtf16[utf16Offset + 1] = codePointOffset;\n utf16Offset += character.length;\n codePointOffset += 1;\n codePointAtUtf16[utf16Offset] = codePointOffset;\n }\n return isolations.map((isolation) => ({\n ...isolation,\n sourceRange: {\n utf16: { start: isolation.start, end: isolation.end },\n codePoint: {\n start: codePointAtUtf16[isolation.start]!,\n end: codePointAtUtf16[isolation.end]!\n }\n }\n }));\n}\n\nfunction resolveNeutralRuns(runs: DirectionalRun[]): DirectionalRun[] {\n const previousStrong: Direction[] = new Array(runs.length).fill('neutral');\n const nextStrong: Direction[] = new Array(runs.length).fill('neutral');\n let previous: Direction = 'neutral';\n let next: Direction = 'neutral';\n\n for (let index = 0; index < runs.length; index += 1) {\n previousStrong[index] = previous;\n const direction = runs[index]!.direction;\n if (direction !== 'neutral') previous = direction;\n }\n\n for (let index = runs.length - 1; index >= 0; index -= 1) {\n nextStrong[index] = next;\n const direction = runs[index]!.direction;\n if (direction !== 'neutral') next = direction;\n }\n\n return runs.map((run, index) => {\n if (run.direction !== 'neutral') return run;\n const before = previousStrong[index] ?? 'neutral';\n const after = nextStrong[index] ?? 'neutral';\n const direction: Direction = before === after && before !== 'neutral'\n ? before\n : before !== 'neutral'\n ? before\n : after;\n return { ...run, direction };\n });\n}\n\nfunction mergeAdjacent(runs: DirectionalRun[]): DirectionalRun[] {\n const merged: DirectionalRun[] = [];\n for (const run of runs) {\n const previous = merged.at(-1);\n if (previous && previous.direction === run.direction) {\n previous.text += run.text;\n previous.end = run.end;\n } else {\n merged.push({ ...run });\n }\n }\n return merged;\n}\n\nfunction trimNeutralBoundaries(text: string, start: number, end: number): { start: number; end: number } {\n while (start < end) {\n const character = text.slice(start).match(/^./su)?.[0];\n if (!character || classifyCharacter(character) !== 'neutral') break;\n start += character.length;\n }\n while (end > start) {\n const character = text.slice(0, end).match(/.$/su)?.[0];\n if (!character || classifyCharacter(character) !== 'neutral') break;\n end -= character.length;\n }\n return { start, end };\n}\n\nconst HARD_FRAGMENT_SEPARATOR = /[,\u060C;\u061B:!?\u061F|]/u;\n\n/**\n * Punctuation separates semantic LTR fragments in an RTL paragraph, while\n * whitespace joins adjacent fragments into one ordered phrase. Without this\n * normalization, two neighboring isolates such as `page` and `97` are\n * reordered as independent RTL atoms.\n */\nfunction normalizeIsolationPlan(text: string, isolations: PlannedIsolation[]): PlannedIsolation[] {\n const split: PlannedIsolation[] = [];\n for (const isolation of isolations) {\n if (isolation.kind !== 'opposite-direction-run') {\n split.push(isolation);\n continue;\n }\n let pieceStart = isolation.start;\n let cursor = isolation.start;\n for (const character of text.slice(isolation.start, isolation.end)) {\n const index = cursor;\n cursor += character.length;\n if (HARD_FRAGMENT_SEPARATOR.test(character)) {\n const trimmed = trimNeutralBoundaries(text, pieceStart, index);\n if (trimmed.start < trimmed.end) {\n split.push({\n ...isolation,\n text: text.slice(trimmed.start, trimmed.end),\n start: trimmed.start,\n end: trimmed.end\n });\n }\n pieceStart = cursor;\n }\n }\n const trimmed = trimNeutralBoundaries(text, pieceStart, isolation.end);\n if (trimmed.start < trimmed.end) {\n split.push({\n ...isolation,\n text: text.slice(trimmed.start, trimmed.end),\n start: trimmed.start,\n end: trimmed.end\n });\n }\n }\n\n const ordered = split.sort((a, b) => a.start - b.start || a.end - b.end);\n const merged: PlannedIsolation[] = [];\n for (const isolation of ordered) {\n const previous = merged.at(-1);\n if (\n previous &&\n previous.direction === isolation.direction &&\n previous.end <= isolation.start &&\n /^\\s*$/u.test(text.slice(previous.end, isolation.start))\n ) {\n previous.end = isolation.end;\n previous.text = text.slice(previous.start, previous.end);\n if (previous.kind !== isolation.kind) previous.kind = 'opposite-direction-run';\n } else {\n merged.push({ ...isolation });\n }\n }\n return merged;\n}\n\nexport function segmentDirectionalRuns(text: string): DirectionalRun[] {\n if (!text) return [];\n const runs: DirectionalRun[] = [];\n let currentDirection: Direction | null = null;\n let currentText = '';\n let start = 0;\n let index = 0;\n\n for (const character of text) {\n const direction = classifyCharacter(character);\n if (currentDirection === null) {\n currentDirection = direction;\n currentText = character;\n start = index;\n } else if (direction === currentDirection) {\n currentText += character;\n } else {\n runs.push({ text: currentText, direction: currentDirection, start, end: index });\n currentDirection = direction;\n currentText = character;\n start = index;\n }\n index += character.length;\n }\n\n if (currentDirection !== null) {\n runs.push({ text: currentText, direction: currentDirection, start, end: index });\n }\n\n return mergeAdjacent(resolveNeutralRuns(runs));\n}\n\nexport function isolateDirectionalRuns(text: string): string {\n return segmentDirectionalRuns(text)\n .map((run) => isolateText(run.text, run.direction))\n .join('');\n}\n\n/**\n * Plans semantic inline boundaries without changing the stored source text.\n * Technical ranges are isolated first; opposite natural-language runs are\n * then isolated only when they differ from the block's base direction.\n */\nexport function planInlineIsolation(\n text: string,\n blockDirection: Exclude,\n options: {\n excludeTechnicalTokens?: boolean;\n isolateOppositeRuns?: boolean;\n intervention?: BidiInterventionMode | undefined;\n technicalIdentifiers?: readonly string[] | undefined;\n } = {}\n): InlineIsolation[] {\n if (!needsBidiIntervention(text, {\n intervention: options.intervention,\n inheritedDirection: blockDirection\n })) return [];\n const technical = options.excludeTechnicalTokens === false\n ? []\n : findTechnicalTokenRanges(text, options.technicalIdentifiers);\n const isolations: Omit[] = technical.map((range) => ({\n text: range.text,\n direction: 'ltr',\n start: range.start,\n end: range.end,\n kind: range.kind\n }));\n\n if (options.isolateOppositeRuns === false) {\n return attachSourceRanges(text, normalizeIsolationPlan(text, isolations));\n }\n\n let technicalIndex = 0;\n for (const run of segmentDirectionalRuns(text)) {\n if (run.direction === 'neutral' || run.direction === blockDirection) continue;\n while (technicalIndex < technical.length && technical[technicalIndex]!.end <= run.start) {\n technicalIndex += 1;\n }\n let cursor = run.start;\n for (let index = technicalIndex; index < technical.length; index += 1) {\n const range = technical[index]!;\n if (range.end <= cursor) continue;\n if (range.start >= run.end) break;\n const partEnd = Math.min(range.start, run.end);\n if (cursor < partEnd) {\n const trimmed = trimNeutralBoundaries(text, cursor, partEnd);\n if (trimmed.start < trimmed.end) isolations.push({\n text: text.slice(trimmed.start, trimmed.end),\n direction: run.direction,\n start: trimmed.start,\n end: trimmed.end,\n kind: 'opposite-direction-run'\n });\n }\n cursor = Math.max(cursor, range.end);\n if (cursor >= run.end) break;\n }\n if (cursor < run.end) {\n const trimmed = trimNeutralBoundaries(text, cursor, run.end);\n if (trimmed.start < trimmed.end) isolations.push({\n text: text.slice(trimmed.start, trimmed.end),\n direction: run.direction,\n start: trimmed.start,\n end: trimmed.end,\n kind: 'opposite-direction-run'\n });\n }\n }\n\n return attachSourceRanges(text, normalizeIsolationPlan(text, isolations));\n}\n", "import {\n analyzeText,\n needsBidiIntervention,\n planInlineIsolation,\n type BidiInterventionMode,\n type DetectionOptions,\n type ResolvedDirection,\n type TextAnalysis\n} from '@bidilens/core';\n\nexport interface RenderHtmlOptions extends DetectionOptions {\n blockTag?: string;\n containerTag?: string | false;\n blockClassName?: string;\n containerClassName?: string;\n includeDataAttributes?: boolean;\n /** Skip BidiLens markup for LTR-only text in an LTR context. */\n intervention?: BidiInterventionMode;\n}\n\nexport interface RenderedHtmlBlock {\n text: string;\n html: string;\n direction: ResolvedDirection;\n start: number;\n end: number;\n}\n\nexport interface RenderedBidiHtml {\n source: string;\n html: string;\n analysis: TextAnalysis;\n blocks: RenderedHtmlBlock[];\n}\n\nconst SAFE_TAG = /^[a-z][a-z0-9-]*$/u;\nconst SAFE_BLOCK_TAGS = new Set([\n 'address', 'article', 'aside', 'blockquote', 'dd', 'div', 'dt', 'figcaption',\n 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'li', 'main', 'nav',\n 'p', 'pre', 'section', 'span', 'td', 'th'\n]);\nconst SAFE_CONTAINER_TAGS = new Set([\n 'article', 'aside', 'blockquote', 'div', 'footer', 'header', 'main', 'nav', 'section', 'span'\n]);\n\nexport function escapeHtml(value: string): string {\n return value.replace(/[&<>\"']/gu, (character) => ({\n '&': '&', '<': '<', '>': '>', '\"': '"', \"'\": '''\n }[character] ?? character));\n}\n\nfunction checkedTag(value: string, option: string, allowed: ReadonlySet): string {\n const normalized = value.toLowerCase();\n if (!SAFE_TAG.test(normalized) || !allowed.has(normalized)) {\n throw new Error(`${option} must be an allowed non-executable HTML container tag.`);\n }\n return normalized;\n}\n\nfunction classAttribute(value: string | undefined): string {\n return value ? ` class=\"${escapeHtml(value)}\"` : '';\n}\n\nexport function renderInlineBidiHtml(\n source: string,\n direction: ResolvedDirection,\n options: {\n includeDataAttributes?: boolean;\n intervention?: BidiInterventionMode | undefined;\n technicalIdentifiers?: readonly string[] | undefined;\n } = {}\n): string {\n const includeData = options.includeDataAttributes ?? true;\n const isolations = planInlineIsolation(source, direction, {\n intervention: options.intervention,\n technicalIdentifiers: options.technicalIdentifiers\n });\n let html = '';\n let cursor = 0;\n for (const isolation of isolations) {\n html += escapeHtml(source.slice(cursor, isolation.start));\n const tag = isolation.kind === 'code' ? 'code' : 'bdi';\n const data = includeData\n ? ` data-bidilens-isolate=\"\" data-bidilens-kind=\"${isolation.kind}\"${isolation.kind === 'code' ? ' data-bidilens-code=\"\"' : ''}`\n : '';\n html += `<${tag} dir=\"${isolation.direction}\"${data}>${escapeHtml(isolation.text)}`;\n cursor = isolation.end;\n }\n return html + escapeHtml(source.slice(cursor));\n}\n\n/** Serializes untrusted plain text; it never accepts or emits unescaped source HTML. */\nexport function renderBidiHtml(source: string, options: RenderHtmlOptions = {}): RenderedBidiHtml {\n const detection: DetectionOptions = {\n ...options,\n fallback: options.fallback ?? options.inheritedDirection ?? 'ltr'\n };\n const analysis = analyzeText(source, detection);\n const blockTag = checkedTag(options.blockTag ?? 'p', 'blockTag', SAFE_BLOCK_TAGS);\n const includeData = options.includeDataAttributes ?? true;\n const intervene = analysis.paragraphs.some((paragraph) => paragraph.direction === 'rtl')\n || needsBidiIntervention(source, {\n intervention: options.intervention,\n inheritedDirection: options.inheritedDirection\n });\n const blocks = analysis.paragraphs.map((paragraph) => {\n const direction = paragraph.direction === 'neutral'\n ? (options.inheritedDirection ?? 'ltr')\n : paragraph.direction;\n const data = intervene && includeData ? ' data-bidilens-block=\"\"' : '';\n const directionAttribute = intervene ? ` dir=\"${direction}\"` : '';\n const blockClass = classAttribute(options.blockClassName);\n const inline = intervene\n ? renderInlineBidiHtml(paragraph.text, direction, {\n includeDataAttributes: includeData,\n intervention: options.intervention,\n technicalIdentifiers: options.technicalIdentifiers\n })\n : escapeHtml(paragraph.text);\n const html = `<${blockTag}${directionAttribute}${data}${blockClass}>${inline}`;\n return { text: paragraph.text, html, direction, start: paragraph.start, end: paragraph.end };\n });\n\n const serializedBlocks = blocks.map((block, index) => {\n const next = blocks[index + 1];\n const separator = next ? source.slice(block.end, next.start) : '';\n return `${block.html}${escapeHtml(separator)}`;\n }).join('');\n const automaticContainer = blocks.length > 1 ? 'div' : false;\n const container = options.containerTag === undefined ? automaticContainer : options.containerTag;\n const html = container === false\n ? serializedBlocks\n : (() => {\n const tag = checkedTag(container, 'containerTag', SAFE_CONTAINER_TAGS);\n const data = intervene && includeData ? ' data-bidilens-document=\"\"' : '';\n const containerClass = classAttribute(options.containerClassName);\n return `<${tag}${data}${containerClass}>${serializedBlocks}`;\n })();\n return { source, html, analysis, blocks };\n}\n", "{\n \"name\": \"@bidilens/cli\",\n \"version\": \"0.3.0\",\n \"description\": \"CLI for inspecting direction and auditing hidden Unicode bidi controls.\",\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Shayan SalehiRad\",\n \"url\": \"https://github.com/CodeinScrubs\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/CodeinScrubs/BidiLens.git\",\n \"directory\": \"packages/cli\"\n },\n \"homepage\": \"https://github.com/CodeinScrubs/BidiLens#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/CodeinScrubs/BidiLens/issues\"\n },\n \"type\": \"module\",\n \"sideEffects\": false,\n \"keywords\": [\n \"bidi\",\n \"rtl\",\n \"ltr\",\n \"unicode\",\n \"cli\",\n \"security\"\n ],\n \"files\": [\n \"dist\",\n \"README.md\",\n \"LICENSE\",\n \"CHANGELOG.md\",\n \"THIRD_PARTY_NOTICES.md\",\n \"corpus\",\n \"examples\"\n ],\n \"bin\": {\n \"bidilens\": \"./dist/bin.js\"\n },\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/bin.ts --format esm --dts --clean --sourcemap\",\n \"prepack\": \"pnpm run build\",\n \"example\": \"node examples/basic.mjs\"\n },\n \"dependencies\": {\n \"@bidilens/core\": \"workspace:*\",\n \"@bidilens/html\": \"workspace:*\",\n \"commander\": \"^15.0.0\"\n },\n \"devDependencies\": {\n \"tsup\": \"^8.5.1\"\n },\n \"engines\": {\n \"node\": \">=22.12.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,uBAAoB;;;ACApB,IAAAC,mBAA6C;AAC7C,yBAA2B;AAC3B,IAAAC,oBAAuD;AACvD,IAAAC,uBAAoB;;;AC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MAAI,OAAO,WAAW,SAAS;AAC7B,UAAM,SAAS,cAAc,KAAK,OAAO,SAAS;AAClD,cAAM,4BAAM,2BAAQ,OAAO,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;AACzD,cAAM,4BAAU,OAAO,UAAU,YAAY,MAAM;AACnD,aAAS,OAAO;AAChB,QAAI,oCAAoC,MAAM,GAAG;AAAA,EACnD,WAAW,YAAY;AACrB,QAAI,WAAW,QAAQ,CAAC;AAAA,EAC1B;AACA,MAAI,WAAY,OAAM,WAAW,QAAQ,CAAC;AAE1C,QAAM,UAAU,IAAI,eAAe,aAAa,OAAO,QAAQ,CAAC;AAChE,QAAM,UAAU,IAAI,eAAe,UAAU,MAAM;AACnD,MAAI,aAAa,EAAG,OAAM,YAAY,OAAO,OAAO,0BAA0B,QAAQ,GAAG;AACzF,SAAO,EAAE,UAAU,QAAQ,QAAQ,YAAY,QAAQ,WAAW;AACpE;AAEO,SAAS,cAAc,SAAyB;AACrD,QAAM,UAAU,QACb,WAAW,KAAK,KAAK,EACrB,WAAW,MAAM,KAAK,EACtB,WAAW,MAAM,KAAK;AACzB,SAAO,2BAA2B,OAAO;AAC3C;;;ADxIA,eAAe,OAAsB;AACnC,MAAI;AACF,UAAM,SAAS,MAAM,UAAU;AAC/B,yBAAAE,QAAQ,WAAW,OAAO;AAAA,EAC5B,SAAS,OAAO;AACd,UAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,yBAAAA,QAAQ,OAAO,MAAM,GAAG,cAAc,OAAO,CAAC;AAAA,CAAI;AAClD,yBAAAA,QAAQ,WAAW;AAAA,EACrB;AACF;AAEA,KAAK,KAAK;", "names": ["import_node_process", "import_promises", "import_node_path", "import_node_process", "import_node_path", "import_node_process", "import_node_util", "cmd", "choice", "line", "str", "process", "fs", "path", "childProcess", "option", "line", "lineStart", "trimmed", "html", "process", "input", "program", "process", "path", "process"] } diff --git a/android/README.md b/android/README.md index 3fa2cd7..a6233ad 100644 --- a/android/README.md +++ b/android/README.md @@ -2,7 +2,7 @@ BidiLens Android fixes mixed Persian/Arabic/Hebrew and English text at the native rendering boundary. It uses the same Unicode 17 data, content-majority -policy, technical-token rules, security scanner, and 930-case canonical corpus +policy, technical-token rules, security scanner, and 932-case canonical corpus as the JavaScript packages. The Android implementation has three small libraries: @@ -175,7 +175,7 @@ pnpm run android:check Current executable evidence includes: -- all 930 canonical direction fixtures and declared isolation plans in Kotlin; +- all 932 canonical direction fixtures and declared isolation plans in Kotlin; - 23 core, 9 Views/Robolectric, and 8 Compose JVM tests; - 3 Views and 3 Compose UI tests on an Android 16/API 36.1 emulator; - release AAR assembly, sample APK assembly, and Android lint; diff --git a/android/core/src/main/kotlin/io/github/codeinscrubs/bidilens/core/TechnicalTokens.kt b/android/core/src/main/kotlin/io/github/codeinscrubs/bidilens/core/TechnicalTokens.kt index 98ef608..9bc9634 100644 --- a/android/core/src/main/kotlin/io/github/codeinscrubs/bidilens/core/TechnicalTokens.kt +++ b/android/core/src/main/kotlin/io/github/codeinscrubs/bidilens/core/TechnicalTokens.kt @@ -174,13 +174,55 @@ private fun addCodeRanges(source: String, ranges: MutableList): Boolean { - val normalized = token.lowercase() - return normalized in DEFAULT_TECHNICAL_IDENTIFIERS || - normalized in custom || - token.any { it.isDigit() || it == '_' || it == '.' || it == '-' } || - token.matches(Regex("^[A-Z]{2,}$")) || - Regex("[a-z][A-Z]").containsMatchIn(token) +/** + * Acronyms are short. A longer all-capital word is emphasized prose, not an + * identifier, and must keep deciding the natural-language base direction. + */ +private const val ACRONYM_MAXIMUM_LENGTH = 5 + +private fun isKnownTechnicalWord(value: String, custom: Set): Boolean { + val normalized = value.lowercase() + return normalized in DEFAULT_TECHNICAL_IDENTIFIERS || normalized in custom +} + +/** + * Reports whether capitals are the block's prose style rather than an + * identifier signal. `PLEASE READ THIS WARNING` is emphasized natural language; + * the same `API` token inside mixed-case prose is an acronym. + */ +private fun usesUppercaseProse(text: String): Boolean { + var total = 0 + var capitalized = 0 + for (match in Regex("\\b[A-Za-z]{2,}\\b").findAll(text)) { + total += 1 + if (match.value.all { it in 'A'..'Z' }) capitalized += 1 + } + return total >= 2 && capitalized * 2 > total +} + +private fun isTechnicalIdentifier( + token: String, + custom: Set, + uppercaseProse: Boolean, +): Boolean { + if (isKnownTechnicalWord(token, custom)) return true + // A hyphenated token is technical when a segment is itself a known technical + // word (`react-markdown`), not merely because it is hyphenated. `well-known` + // and `state-of-the-art` are ordinary English and stay direction evidence. + if (token.contains('-') && + token.split('-').any { it.isNotEmpty() && isKnownTechnicalWord(it, custom) } + ) { + return true + } + // The hyphen is deliberately absent here: only digits, underscores, and dots + // are structural identifier syntax. + return token.any { it.isDigit() || it == '_' || it == '.' } || + Regex("[a-z][A-Z]").containsMatchIn(token) || + ( + !uppercaseProse && + token.length <= ACRONYM_MAXIMUM_LENGTH && + token.matches(Regex("^[A-Z]{2,}$")) + ) } /** Finds technical spans that should not decide natural-language direction. */ @@ -294,8 +336,9 @@ fun findTechnicalTokenRanges( .filter { it.matches(Regex("^[A-Za-z][A-Za-z0-9_.-]*$")) } .map(String::lowercase) .toSet() + val uppercaseProse = usesUppercaseProse(text) for (match in Regex("\\b[A-Za-z][A-Za-z0-9_.-]*\\b").findAll(text)) { - if (isTechnicalIdentifier(match.value, custom)) { + if (isTechnicalIdentifier(match.value, custom, uppercaseProse)) { ranges.addRange(text, match.range.first, match.range.last + 1, TechnicalTokenKind.IDENTIFIER) } } diff --git a/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/BidiCoreTest.kt b/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/BidiCoreTest.kt index 61b3bd7..e69b654 100644 --- a/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/BidiCoreTest.kt +++ b/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/BidiCoreTest.kt @@ -29,6 +29,26 @@ class BidiCoreTest { ) } + @Test + fun hyphenatedEnglishCompoundsStayNaturalLanguageEvidence() { + // A hyphen is ordinary English compounding. Excluding these tokens + // removes only LTR evidence, biasing mixed blocks toward RTL. + val source = "The well-known state-of-the-art open-source کتابخانه" + assertEquals(BidiDirection.LTR, detectDirection(source)) + assertTrue(findTechnicalTokenRanges(source).isEmpty()) + // A segment that is itself a known technical word still excludes it. + assertEquals(1, findTechnicalTokenRanges("react-markdown").size) + } + + @Test + fun emphasizedUppercaseProseIsEvidenceButAcronymsAreTechnical() { + val shouted = "PLEASE READ THIS IMPORTANT WARNING کتاب" + assertEquals(BidiDirection.LTR, detectDirection(shouted)) + assertTrue(findTechnicalTokenRanges(shouted).isEmpty()) + // Inside mixed-case prose the same shape is an acronym again. + assertEquals(2, findTechnicalTokenRanges("Use the HTTP API for this").size) + } + @Test fun photographedPersianTitleResolvesRtl() { val analysis = analyzeBidi("آپاندیسیت") diff --git a/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/GeneratedCorpusFixtures.kt b/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/GeneratedCorpusFixtures.kt index a2957a1..50a6f15 100644 --- a/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/GeneratedCorpusFixtures.kt +++ b/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/GeneratedCorpusFixtures.kt @@ -23,6 +23,22 @@ internal val generatedCorpusFixtures = listOf( ExpectedIsolation("React", BidiDirection.LTR, BidiIsolationKind.IDENTIFIER) ), ), + CorpusFixture( + id = "en-hyphenated-compounds-001", + text = "The well-known state-of-the-art open-source کتابخانه", + expected = BidiDirection.LTR, + isolations = listOf( + ExpectedIsolation("کتابخانه", BidiDirection.RTL, BidiIsolationKind.OPPOSITE_DIRECTION_RUN) + ), + ), + CorpusFixture( + id = "en-uppercase-emphasis-001", + text = "PLEASE READ THIS IMPORTANT WARNING کتاب", + expected = BidiDirection.LTR, + isolations = listOf( + ExpectedIsolation("کتاب", BidiDirection.RTL, BidiIsolationKind.OPPOSITE_DIRECTION_RUN) + ), + ), CorpusFixture( id = "fa-adjacent-url-001", text = "یکhttps://example.com", diff --git a/apple/Sources/BidiLens/BidiAnalyzer.swift b/apple/Sources/BidiLens/BidiAnalyzer.swift index 2f310aa..8aefc12 100644 --- a/apple/Sources/BidiLens/BidiAnalyzer.swift +++ b/apple/Sources/BidiLens/BidiAnalyzer.swift @@ -105,6 +105,34 @@ public enum BidiAnalyzer { ) } + /// Acronyms are short. A longer all-capital word is emphasized prose, not an + /// identifier, and must keep deciding the natural-language base direction. + private static let acronymMaximumLength = 5 + + private static func isKnownTechnicalWord(_ value: String, _ custom: Set) -> Bool { + let lower = value.lowercased() + return defaultTechnicalIdentifiers.contains(lower) + || custom.contains { $0.lowercased() == lower } + } + + /// Reports whether capitals are the block's prose style rather than an + /// identifier signal. `PLEASE READ THIS WARNING` is emphasized natural + /// language; the same `API` token inside mixed-case prose is an acronym. + private static func usesUppercaseProse(_ text: String) -> Bool { + guard let regex = try? NSRegularExpression( + pattern: #"(?= 2 && capitalized * 2 > matches.count + } + public static func findTechnicalTokenRanges( _ text: String, customIdentifiers: Set = [] @@ -153,20 +181,27 @@ public enum BidiAnalyzer { } } + let uppercaseProse = usesUppercaseProse(text) if let regex = try? NSRegularExpression( pattern: #"(?= 2 + && token.count <= acronymMaximumLength + && token.allSatisfy { $0.isUppercase && $0.isASCII }) if technical { ranges.append(TechnicalTokenRange( text: token, diff --git a/apple/Tests/BidiLensTests/BidiLensTests.swift b/apple/Tests/BidiLensTests/BidiLensTests.swift index f6d4140..9debb5b 100644 --- a/apple/Tests/BidiLensTests/BidiLensTests.swift +++ b/apple/Tests/BidiLensTests/BidiLensTests.swift @@ -11,6 +11,23 @@ final class BidiLensTests: XCTestCase { XCTAssertTrue(BidiAnalyzer.analyze(flagship).isolations.contains { $0.text == "React" }) } + func testNaturalLanguageEvidenceIsNotMistakenForIdentifiers() { + let compounds = "The well-known state-of-the-art open-source کتابخانه" + XCTAssertEqual(BidiAnalyzer.detectDirection(compounds), .leftToRight) + XCTAssertTrue(BidiAnalyzer.findTechnicalTokenRanges(compounds).isEmpty) + + let emphasized = "PLEASE READ THIS IMPORTANT WARNING کتاب" + XCTAssertEqual(BidiAnalyzer.detectDirection(emphasized), .leftToRight) + XCTAssertTrue(BidiAnalyzer.findTechnicalTokenRanges(emphasized).isEmpty) + + let acronyms = BidiAnalyzer.findTechnicalTokenRanges("Use the HTTP API for this") + XCTAssertEqual(acronyms.map(\.text), ["HTTP", "API"]) + XCTAssertEqual( + BidiAnalyzer.findTechnicalTokenRanges("react-markdown").map(\.text), + ["react-markdown"] + ) + } + func testPhysicalLeftDoesNotChangeRTLDirection() { let presentation = BidiAnalyzer.presentation( "این متن فارسی در سمت چپ باقی می‌ماند.", @@ -51,7 +68,7 @@ final class BidiLensTests: XCTestCase { } let url = try XCTUnwrap(Bundle.module.url(forResource: "cases", withExtension: "json")) let cases = try JSONDecoder().decode([CorpusCase].self, from: Data(contentsOf: url)) - XCTAssertEqual(cases.count, 930) + XCTAssertEqual(cases.count, 932) for item in cases { let expected: BidiDirection = switch item.expected { case "rtl": .rightToLeft diff --git a/apple/Tests/BidiLensTests/Resources/cases.json b/apple/Tests/BidiLensTests/Resources/cases.json index dd7bcdd..4f70d5a 100644 --- a/apple/Tests/BidiLensTests/Resources/cases.json +++ b/apple/Tests/BidiLensTests/Resources/cases.json @@ -40,6 +40,80 @@ } ] }, + { + "id": "en-hyphenated-compounds-001", + "description": "Ordinary hyphenated English compounds remain LTR evidence in a mixed paragraph.", + "text": "The well-known state-of-the-art open-source کتابخانه", + "words": [ + "The", + "well-known", + "state-of-the-art", + "open-source", + "کتابخانه" + ], + "expected": "ltr", + "expectedVisualOrderLeftToRight": [ + 1, + 2, + 3, + 4, + 5 + ], + "tags": [ + "en", + "fa", + "mixed", + "hyphenated-prose", + "natural-language-evidence" + ], + "curation": "authored-template-matrix", + "nativeSpeakerReviewed": false, + "expectedIsolations": [ + { + "text": "کتابخانه", + "direction": "rtl", + "kind": "opposite-direction-run" + } + ] + }, + { + "id": "en-uppercase-emphasis-001", + "description": "An all-capital English prose style remains LTR evidence instead of being discarded as acronyms.", + "text": "PLEASE READ THIS IMPORTANT WARNING کتاب", + "words": [ + "PLEASE", + "READ", + "THIS", + "IMPORTANT", + "WARNING", + "کتاب" + ], + "expected": "ltr", + "expectedVisualOrderLeftToRight": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "tags": [ + "en", + "fa", + "mixed", + "uppercase-prose", + "natural-language-evidence" + ], + "curation": "authored-template-matrix", + "nativeSpeakerReviewed": false, + "expectedIsolations": [ + { + "text": "کتاب", + "direction": "rtl", + "kind": "opposite-direction-run" + } + ] + }, { "id": "fa-adjacent-url-001", "description": "A URL immediately following an RTL letter keeps its full technical range.", diff --git a/corpus/cases.json b/corpus/cases.json index dd7bcdd..4f70d5a 100644 --- a/corpus/cases.json +++ b/corpus/cases.json @@ -40,6 +40,80 @@ } ] }, + { + "id": "en-hyphenated-compounds-001", + "description": "Ordinary hyphenated English compounds remain LTR evidence in a mixed paragraph.", + "text": "The well-known state-of-the-art open-source کتابخانه", + "words": [ + "The", + "well-known", + "state-of-the-art", + "open-source", + "کتابخانه" + ], + "expected": "ltr", + "expectedVisualOrderLeftToRight": [ + 1, + 2, + 3, + 4, + 5 + ], + "tags": [ + "en", + "fa", + "mixed", + "hyphenated-prose", + "natural-language-evidence" + ], + "curation": "authored-template-matrix", + "nativeSpeakerReviewed": false, + "expectedIsolations": [ + { + "text": "کتابخانه", + "direction": "rtl", + "kind": "opposite-direction-run" + } + ] + }, + { + "id": "en-uppercase-emphasis-001", + "description": "An all-capital English prose style remains LTR evidence instead of being discarded as acronyms.", + "text": "PLEASE READ THIS IMPORTANT WARNING کتاب", + "words": [ + "PLEASE", + "READ", + "THIS", + "IMPORTANT", + "WARNING", + "کتاب" + ], + "expected": "ltr", + "expectedVisualOrderLeftToRight": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "tags": [ + "en", + "fa", + "mixed", + "uppercase-prose", + "natural-language-evidence" + ], + "curation": "authored-template-matrix", + "nativeSpeakerReviewed": false, + "expectedIsolations": [ + { + "text": "کتاب", + "direction": "rtl", + "kind": "opposite-direction-run" + } + ] + }, { "id": "fa-adjacent-url-001", "description": "A URL immediately following an RTL letter keeps its full technical range.", diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 9f7ed68..335d146 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -167,7 +167,7 @@ String ``` `:core` is independent of Compose and Android widgets. Its Unicode 17 range -tables and 930-case fixtures are generated from the same canonical inputs as +tables and 932-case fixtures are generated from the same canonical inputs as the TypeScript core. Kotlin APIs report both UTF-16 and code-point offsets so editable/selection integrations do not reinterpret Java string indices. @@ -241,7 +241,7 @@ JavaScript runtime or UI-framework dependency: Generated copies of the canonical Unicode 17 tables drive binary-search classification. Public ranges report Rust byte offsets, UTF-16 code units, and Unicode scalar-value offsets so hosts can map results without guessing index -semantics. The crate validates the same 930 direction fixtures and all declared +semantics. The crate validates the same 932 direction fixtures and all declared isolation/security fixtures as the other native cores. Direction and alignment remain separate. The Rust core returns semantic text diff --git a/docs/LIMITATIONS.md b/docs/LIMITATIONS.md index acb3e23..a769583 100644 --- a/docs/LIMITATIONS.md +++ b/docs/LIMITATIONS.md @@ -22,6 +22,14 @@ detector. Domain-specific prose dominated by identifiers may need an explicit direction or the `technicalIdentifiers` option. Very short or neutral blocks use the configured fallback or inherited direction. +Separating an acronym from an emphasized word is decided by shape and block +context, not by a dictionary: a short all-capital token is treated as an +identifier unless capitals are the block's prose style. A block written only in +short capitalized words can still classify them either way, and a hyphenated +product name whose segments are all outside the technical vocabulary counts as +natural language. Both cases are addressable with `technicalIdentifiers` or an +explicit direction. + The scanner identifies suspicious structure, not malicious intent. It does not implement whole-script confusable analysis or language-specific source parsing. diff --git a/docs/OUTREACH.md b/docs/OUTREACH.md index a22a0ee..58770b2 100644 --- a/docs/OUTREACH.md +++ b/docs/OUTREACH.md @@ -30,7 +30,7 @@ wrappers, styles, or source changes. The repository includes Unicode 17-derived classification, per-block direction, semantic isolation, streaming reconciliation, bidi-control auditing, adapters for major web renderers, native Kotlin/Views/Compose modules, compiler-tested -SwiftUI/UIKit and .NET/WPF adapters, 930 direction fixtures, three-browser +SwiftUI/UIKit and .NET/WPF adapters, 932 direction fixtures, three-browser tests, and Android/iOS simulator tests. Twelve public npm packages include provenance; three signed Maven Central modules, source-only Apple/Windows distribution, and missing external validation are documented explicitly. diff --git a/docs/PROJECT_COMPARISON.md b/docs/PROJECT_COMPARISON.md index 54a94e6..ec92522 100644 --- a/docs/PROJECT_COMPARISON.md +++ b/docs/PROJECT_COMPARISON.md @@ -16,7 +16,7 @@ folders and do not treat README claims as proof. | `v1.3-Her` | 11 | 11 | 197 | 3 / 64 | 200 | | `v1.4-Her` working tree | 16 | 21 | 745 | 1 / 18 | 310 | | `v1.5-Her` working tree | 16 | 23 | 997 | 4 / 82 | 616 | -| canonical BidiLens checkout | 12 | 15 | 1,248 | 3 / 63 | 930 | +| canonical BidiLens checkout | 12 | 15 | 1,248 | 3 / 63 | 932 | Static assertion counts are only a depth signal; the canonical total is 1,311 across package and visual tests. The canonical checkout also runs those tests, @@ -277,7 +277,7 @@ of rendering correctness, and BidiLens retains the user-selected MIT license. | Trojan-Source-style scanner | Implemented with balance/cross-isolate checks, modes, dual offsets, and SARIF | | Conservative terminal behavior | Implemented with complete ECMA-48 CSI/string-control masking; control insertion remains opt-in | | CLI inspection/audit/render/test/sanitize | Implemented with deterministic directory filtering, unconditional explicit-file scans, and symlink skipping | -| Corpus schemas and numbered words | Implemented with JSON Schema and 930 direction-exact cases; 209 also carry exact isolation expectations, five carry security-code expectations, and numbered-order arrays are schema/permutation fixtures rather than rendered-geometry oracles | +| Corpus schemas and numbered words | Implemented with JSON Schema and 932 direction-exact cases; 211 also carry exact isolation expectations, five carry security-code expectations, and numbered-order arrays are schema/permutation fixtures rather than rendered-geometry oracles | | Package/release evidence | Implemented with examples executed from all tarballs, licenses, ESM type analysis, pack/install consumer, audit, and SBOM command | | Reusable Playwright assertions | Implemented as a public package and exercised for direction, source text, isolation metadata, logical selection/clipboard, and physical edge geometry in the three-browser suite | | React Native adapter | Not copied from `v1.4-Her` or `v1.5-Her`: their tests never import the adapter and there is no iOS/Android rendering gate. Canonical instead implements native Android directly with Kotlin core, Views, Compose, a sample, generated corpus parity, and device tests. React Native remains deferred until it has equivalent adapter-level iOS/Android evidence | @@ -294,7 +294,7 @@ of rendering correctness, and BidiLens retains the user-selected MIT license. | Reset with replacement text | Adopted atomically in the shared core stream and every framework adapter; one state transition replaces the source | | Wider multilingual examples | 196 substantive strings imported under their Apache-2.0 notice; four empty/whitespace-only cases were excluded because they add no linguistic oracle; canonical outputs were recomputed and 17 documented policy differences were retained rather than copying sibling labels blindly | | No-build custom element | Adopted as a genuinely self-contained `standalone.js`; normal imports remain externalized for deduplication, and all three browsers load the packed design without an import map | -| Demo presets and inspectors | Adopted and extended into a complete offline bilingual playground: policy/security and stream controls, four-way live input, AST/evidence/isolation/security, searchable 930-case asset, copy verification, semantic HTML/JSON export, hash state, theme, and an opt-in Pages workflow | +| Demo presets and inspectors | Adopted and extended into a complete offline bilingual playground: policy/security and stream controls, four-way live input, AST/evidence/isolation/security, searchable 932-case asset, copy verification, semantic HTML/JSON export, hash state, theme, and an opt-in Pages workflow | | Cross-platform CI | Complete `check` and example jobs pass on Windows and macOS in addition to Ubuntu Node 22/24; Android adds unit/lint/AAR/APK and API 35 emulator jobs; public hosted results are linked from the release report | | Machine-readable benchmark history | Adopted as manual/weekly JSON artifacts; kept advisory because shared CI hardware is noisy | | CLI color and `.gitignore` plan | Color work is unnecessary because canonical CLI output contains no ANSI styling. Recursive audits already restrict traversal to known text extensions, skip symlinks/common generated directories, and still scan explicitly named files. `.gitignore` is deliberately not an implicit security boundary; a future opt-in requires full nested-pattern semantics rather than a partial matcher | @@ -304,7 +304,7 @@ of rendering correctness, and BidiLens retains the user-selected MIT license. | Simplistic mixed-script/confusable warning | Rejected pending a sourced UTS #39 policy to avoid false security claims and ordinary multilingual false positives | | `innerHTML` custom element and ambiguous package side effects | Rejected; canonical constructs text/element nodes, keeps its main import side-effect-free, and limits global registration to explicit `/auto` and standalone entries | -The general corpus row above is now 930 cases, not 722: 734 authored/generated +The general corpus row above is now 932 cases, not 722: 736 authored/generated canonical fixtures plus the 196 attributed comparison seeds. ## Evidence-calibrated ratings diff --git a/docs/REQUIREMENT_MATRIX.md b/docs/REQUIREMENT_MATRIX.md index 0dbdc2f..90f6950 100644 --- a/docs/REQUIREMENT_MATRIX.md +++ b/docs/REQUIREMENT_MATRIX.md @@ -29,7 +29,7 @@ Status vocabulary: | Every public package has implementation, ≥25 package-local assertions, README/install, and example | Complete and executable | `pnpm run packages:depth` enforces this for all 12 packages; packed examples are also exercised by `pnpm run release:check` | | Full source lives in Git; annotated milestone tag after every gate | Partial | Reviewed source is committed to the canonical public Git repository, but only historical tags `m0` and `m1` exist. Missing history is not retroactively fabricated | | No fabricated badges, counts, adoption, or publication | Complete for the current tree | Publication is tied to registry/release evidence; the [outreach log](OUTREACH_LOG.md) labels submissions as contact only and makes no merge, audit, pilot, adoption, endorsement, or unverified badge claim | -| ≥300 corpus fixtures | Complete as a technical corpus; external review incomplete | 930 schema-valid entries; 733 authored template-matrix cases, 196 attributed sibling-project seeds, one user fixture; zero are marked native-speaker-reviewed | +| ≥300 corpus fixtures | Complete as a technical corpus; external review incomplete | 932 schema-valid entries; 735 authored template-matrix cases, 196 attributed sibling-project seeds, one user fixture; zero are marked native-speaker-reviewed | | Automated wrong-versus-correct visual proof | Complete and tested | `tests/visual/flagship.spec.ts` and committed Windows/Arial baselines; Chromium, Firefox, and WebKit gate | ## Mission and platform scope @@ -51,7 +51,7 @@ Status vocabulary: | CLI commands and CI exit behavior | Complete and tested | `@bidilens/cli`: inspect, lint, render, test, audit/security-scan, sanitize; human/JSON/SARIF; packed binary consumer test | | Reusable Playwright helpers | Complete and tested | `@bidilens/playwright`: metadata, logical text, isolation, selection, clipboard and edge geometry; package-local tests plus real Chromium/Firefox/WebKit use | | Reusable conformance GitHub Action | Complete and tested | `action/action.yml`; self-contained Node 24 bundle around the real CLI; audit/test, human/JSON/SARIF, stable outputs and exit codes; 43 source assertions plus built safe/strict-failure probes | -| Playground | Complete and tested | Static/offline Vite app; Markdown; adjustable chunk/speed simulation; policy/security selectors; live arbitrary-input four-way comparison; AST/evidence/isolation/security inspectors; searchable 930-case local corpus asset; logical-copy verifier; JSON/semantic-HTML export; URL state; explicit dark theme; responsive layout; complete EN/FA UI switch. The full flow passes all three browsers | +| Playground | Complete and tested | Static/offline Vite app; Markdown; adjustable chunk/speed simulation; policy/security selectors; live arbitrary-input four-way comparison; AST/evidence/isolation/security inspectors; searchable 932-case local corpus asset; logical-copy verifier; JSON/semantic-HTML export; URL state; explicit dark theme; responsive layout; complete EN/FA UI switch. The full flow passes all three browsers | Keeping the dependency-free direction stream and security primitives inside `@bidilens/core` is intentional. Parser-specific rich state belongs in @@ -71,12 +71,12 @@ batch plugin path; it is not misrepresented as a stateful streaming backend. | Surface | Status | Evidence or exact gap | |---|---|---| -| Android/Jetpack Compose | Implemented, signed, and published; external validation pending | Maven Central `0.1.1` pure Kotlin core, Views, and Compose libraries; sample app; current source verifies the generated 930-case corpus (the published `0.1.1` release predates the twelve boundary-regression fixtures); JVM/Robolectric suites; lint/AAR/APK tasks; 3 Views plus 3 Compose UI tests on local API 36.1; and an API 35 emulator CI gate. Physical-device/OEM/IME/TalkBack evidence and a downstream pilot remain open | +| Android/Jetpack Compose | Implemented, signed, and published; external validation pending | Maven Central `0.1.1` pure Kotlin core, Views, and Compose libraries; sample app; current source verifies the generated 932-case corpus (the published `0.1.1` release predates the fourteen boundary-regression fixtures); JVM/Robolectric suites; lint/AAR/APK tasks; 3 Views plus 3 Compose UI tests on local API 36.1; and an API 35 emulator CI gate. Physical-device/OEM/IME/TalkBack evidence and a downstream pilot remain open | | Flutter/Dart | Missing | No package/demo, generated corpus representation, widget/golden tests, or SDK build report | | React Native | Missing | No component, generated corpus representation, native tests, or platform build report | -| Swift Package/SwiftUI/UIKit | Source and hosted simulator/compiler validation complete; physical-device/release validation pending | Swift Package, generated Unicode 17 ranges, copied 930-case corpus, core tests/example, UIKit `UILabel`/`UITextView`/`UITextField` adapters, UIKit-backed SwiftUI `BidiText`, independent physical alignment, and protected macOS/iOS Simulator gates in [CI](https://github.com/CodeinScrubs/BidiLens/actions/workflows/ci.yml). Physical iOS/VoiceOver evidence, sample app, editable SwiftUI integration, and registry publication remain open | -| Windows .NET/WPF | Source and hosted compiler validation complete; physical-device/release validation pending | Dependency-free .NET 8 core, generated Unicode ranges, 930-case executable test, WPF `TextBlock`/`TextBox` adapter, selection/source preservation, physical-left RTL test, runnable sample, package builds, and a protected Windows compiler/corpus gate in [CI](https://github.com/CodeinScrubs/BidiLens/actions/workflows/ci.yml). WinUI/WinForms/MAUI, accessibility/IME lab evidence, NuGet publication, and downstream validation remain open | -| Rust core | Source and hosted compiler validation complete; integration/release validation pending | Native `bidilens-core`, generated Unicode 17 ranges, byte/UTF-16/code-point offsets, all 930 direction fixtures, all declared isolation/security fixtures, a runnable example, and Linux/macOS/Windows CI. crates.io publication, an editor adapter, independent audit, and a downstream pilot remain open | +| Swift Package/SwiftUI/UIKit | Source and hosted simulator/compiler validation complete; physical-device/release validation pending | Swift Package, generated Unicode 17 ranges, copied 932-case corpus, core tests/example, UIKit `UILabel`/`UITextView`/`UITextField` adapters, UIKit-backed SwiftUI `BidiText`, independent physical alignment, and protected macOS/iOS Simulator gates in [CI](https://github.com/CodeinScrubs/BidiLens/actions/workflows/ci.yml). Physical iOS/VoiceOver evidence, sample app, editable SwiftUI integration, and registry publication remain open | +| Windows .NET/WPF | Source and hosted compiler validation complete; physical-device/release validation pending | Dependency-free .NET 8 core, generated Unicode ranges, 932-case executable test, WPF `TextBlock`/`TextBox` adapter, selection/source preservation, physical-left RTL test, runnable sample, package builds, and a protected Windows compiler/corpus gate in [CI](https://github.com/CodeinScrubs/BidiLens/actions/workflows/ci.yml). WinUI/WinForms/MAUI, accessibility/IME lab evidence, NuGet publication, and downstream validation remain open | +| Rust core | Source and hosted compiler validation complete; integration/release validation pending | Native `bidilens-core`, generated Unicode 17 ranges, byte/UTF-16/code-point offsets, all 932 direction fixtures, all declared isolation/security fixtures, a runnable example, and Linux/macOS/Windows CI. crates.io publication, an editor adapter, independent audit, and a downstream pilot remain open | | Terminal/TUI | Complete and tested within documented limits | `@bidilens/terminal`; ANSI-aware, source-preserving compatibility mode and emulator limitations. A real multi-emulator manual matrix remains external/manual | Absent platform directories are intentional: the anti-hollow rule forbids @@ -152,7 +152,7 @@ tag. Therefore working code alone cannot make an historical milestone green. | M3 streaming | Implemented; historical gate incomplete | Direction and rich Markdown-It stream gates pass now; no historical `m3` tag exists and is not fabricated retroactively | | M4 frameworks/Electron | Partial | Web Component/React/Vue/Svelte pass anti-hollow and SSR gates; Electron is missing; no `m4` tag | | M5 CLI/Playwright Action/VS Code | Partial | CLI, reusable Playwright helpers, and bundled conformance Action pass; VS Code extension is missing; no `m5` tag | -| M6 ≥300/visual/copy | Implemented; historical gate incomplete | 930 corpus cases and 24 three-engine visual tests pass; no `m6` tag | +| M6 ≥300/visual/copy | Implemented; historical gate incomplete | 932 corpus cases and 24 three-engine visual tests pass; no `m6` tag | | M7 native + terminal | Partial | Terminal, Android, SwiftUI/UIKit, and .NET/WPF exist; Flutter, React Native, and other documented native adapters remain open; no `m7` tag | | M8 playground/full EN/FA docs | Implemented; historical gate incomplete | Offline bilingual playground and EN/FA repository docs pass build/browser/link checks; no annotated `m8` tag | | M9 release/integrations | Partial | Package release side is complete: clean committed checkout, public npm artifacts, provenance, trusted publishing, SBOM, retained manifest, immutable `v0.3.0` web release, and signed `android-v0.1.1` Maven release. One of the required three host-tested integrations is submitted but unmerged, so the integration minimum remains incomplete | diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index ade269d..eba4d6b 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -16,7 +16,7 @@ implementation or adoption claim. packages; - real typed framework/renderer integrations, SSR tests, examples, and package-local assertion depth; -- 930 schema-validated fixtures and native-review metadata, including 196 +- 932 schema-validated fixtures and native-review metadata, including 196 attributed comparison-project seeds awaiting native review; - Chromium, Firefox, and WebKit visual/geometry/selection tests, structured Markdown snapshots, Chromium clipboard verification, and real standalone @@ -30,7 +30,7 @@ implementation or adoption claim. - public npm packages with SLSA provenance, registry-integrity verification, an annotated source tag, and a protected human-approved release workflow. - native Android Kotlin core, Views and Compose adapters, photographed-case - sample, generated 930-case corpus, JVM/Robolectric tests, lint/AAR/APK gates, + sample, generated 932-case corpus, JVM/Robolectric tests, lint/AAR/APK gates, API 35 plus local API 36.1 UI tests, signed Maven Central `0.1.1` publication, and independently verified public-consumer resolution. @@ -38,13 +38,13 @@ implementation or adoption claim. - Swift Package core, UIKit adapters, and a UIKit-backed SwiftUI `BidiText` renderer with generated Unicode 17 data, independent direction/alignment - policy, shared 930-case corpus tests, a runnable core example, macOS + policy, shared 932-case corpus tests, a runnable core example, macOS verification, and iOS Simulator adapter tests; - .NET 8 core and WPF adapters with generated Unicode 17 data, independent - direction/alignment policy, shared 930-case executable verification, a + direction/alignment policy, shared 932-case executable verification, a runnable WPF sample, package builds, and a Windows compiler gate; - native Rust core with generated Unicode 17 data, byte/UTF-16/code-point - ranges, shared 930-case direction conformance, declared isolation/security + ranges, shared 932-case direction conformance, declared isolation/security conformance, a runnable example, and Linux/macOS/Windows compiler gates. These are not yet registry releases or downstream production/accessibility diff --git a/packages/cli/corpus/cases.json b/packages/cli/corpus/cases.json index dd7bcdd..4f70d5a 100644 --- a/packages/cli/corpus/cases.json +++ b/packages/cli/corpus/cases.json @@ -40,6 +40,80 @@ } ] }, + { + "id": "en-hyphenated-compounds-001", + "description": "Ordinary hyphenated English compounds remain LTR evidence in a mixed paragraph.", + "text": "The well-known state-of-the-art open-source کتابخانه", + "words": [ + "The", + "well-known", + "state-of-the-art", + "open-source", + "کتابخانه" + ], + "expected": "ltr", + "expectedVisualOrderLeftToRight": [ + 1, + 2, + 3, + 4, + 5 + ], + "tags": [ + "en", + "fa", + "mixed", + "hyphenated-prose", + "natural-language-evidence" + ], + "curation": "authored-template-matrix", + "nativeSpeakerReviewed": false, + "expectedIsolations": [ + { + "text": "کتابخانه", + "direction": "rtl", + "kind": "opposite-direction-run" + } + ] + }, + { + "id": "en-uppercase-emphasis-001", + "description": "An all-capital English prose style remains LTR evidence instead of being discarded as acronyms.", + "text": "PLEASE READ THIS IMPORTANT WARNING کتاب", + "words": [ + "PLEASE", + "READ", + "THIS", + "IMPORTANT", + "WARNING", + "کتاب" + ], + "expected": "ltr", + "expectedVisualOrderLeftToRight": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "tags": [ + "en", + "fa", + "mixed", + "uppercase-prose", + "natural-language-evidence" + ], + "curation": "authored-template-matrix", + "nativeSpeakerReviewed": false, + "expectedIsolations": [ + { + "text": "کتاب", + "direction": "rtl", + "kind": "opposite-direction-run" + } + ] + }, { "id": "fa-adjacent-url-001", "description": "A URL immediately following an RTL letter keeps its full technical range.", diff --git a/packages/core/src/core.test.ts b/packages/core/src/core.test.ts index 7e285f4..69afcda 100644 --- a/packages/core/src/core.test.ts +++ b/packages/core/src/core.test.ts @@ -57,6 +57,46 @@ describe('direction detection', () => { expect(detectDirection('React یک کتابخانه است.')).toBe('rtl'); }); + it('keeps hyphenated English compounds as natural-language evidence', () => { + // A hyphen is ordinary English compounding. Excluding these tokens removes + // only LTR evidence, which silently biases mixed blocks toward RTL. + const source = 'The well-known state-of-the-art open-source کتابخانه'; + expect(findTechnicalTokenRanges(source)).toEqual([]); + expect(detectDirection(source)).toBe('ltr'); + for (const compound of ['well-known', 'state-of-the-art', 'co-op', 'e-mail', 'twenty-one']) { + expect(findTechnicalTokenRanges(compound)).toEqual([]); + expect(needsBidiIntervention(compound)).toBe(false); + } + }); + + it('still excludes hyphenated tokens built from a known technical segment', () => { + expect(findTechnicalTokenRanges('react-markdown').map((range) => range.text)) + .toEqual(['react-markdown']); + expect(findTechnicalTokenRanges('GPT-5').map((range) => range.text)).toEqual(['GPT-5']); + expect(findTechnicalTokenRanges('x86-64').map((range) => range.text)).toEqual(['x86-64']); + expect(detectDirection('react-markdown یک کتابخانه است.')).toBe('rtl'); + }); + + it('treats emphasized uppercase prose as evidence but short acronyms as technical', () => { + const shouted = 'PLEASE READ THIS IMPORTANT WARNING کتاب'; + expect(findTechnicalTokenRanges(shouted)).toEqual([]); + expect(detectDirection(shouted)).toBe('ltr'); + expect(needsBidiIntervention('PLEASE READ THIS IMPORTANT WARNING')).toBe(false); + // Inside mixed-case prose the same shape is an acronym again. + expect(findTechnicalTokenRanges('Use the HTTP API for this').map((range) => range.text)) + .toEqual(['HTTP', 'API']); + // A long all-capital word is emphasis, not an identifier, in either context. + expect(findTechnicalTokenRanges('An IMPORTANT note')).toEqual([]); + }); + + it('keeps live stream direction reconciled with batch for uppercase prose', () => { + const shouted = 'PLEASE READ THIS IMPORTANT WARNING کتاب'; + const stream = createBidiStream(); + stream.push(shouted); + expect(stream.snapshot().direction).toBe(detectDirection(shouted, { fallback: 'ltr' })); + expect(stream.finish().direction).toBe('ltr'); + }); + it('covers unambiguous tool names and accepts caller-specific identifiers', () => { expect(detectDirection('Kubernetes \u062e\u0648\u0628 \u0627\u0633\u062a.')).toBe('rtl'); expect(detectDirection('Playwright \u062e\u0648\u0628 \u0627\u0633\u062a.')).toBe('rtl'); diff --git a/packages/core/src/detect.ts b/packages/core/src/detect.ts index c652473..97cff65 100644 --- a/packages/core/src/detect.ts +++ b/packages/core/src/detect.ts @@ -270,13 +270,56 @@ function customTechnicalIdentifiers(values: readonly string[]): ReadonlySet): boolean { - const normalized = token.toLowerCase(); - return KNOWN_TECHNICAL_TOKENS.has(normalized) - || custom.has(normalized) - || /[0-9_.-]/u.test(token) - || /^[A-Z]{2,}$/u.test(token) - || /[a-z][A-Z]/u.test(token); +/** + * Acronyms are short. A longer all-capital word is emphasized prose, not an + * identifier, and must keep deciding the natural-language base direction. + */ +const ACRONYM_MAXIMUM_LENGTH = 5; + +function isKnownTechnicalWord(value: string, custom: ReadonlySet): boolean { + const normalized = value.toLowerCase(); + return KNOWN_TECHNICAL_TOKENS.has(normalized) || custom.has(normalized); +} + +/** + * Reports whether capitals are the block's prose style rather than an + * identifier signal. `PLEASE READ THIS WARNING` is emphasized natural language; + * the same `API` token inside mixed-case prose is an acronym. Deciding this per + * block keeps the rule deterministic and needs no dictionary or language model. + */ +function usesUppercaseProse(text: string): boolean { + const words = text.match(/\b[A-Za-z]{2,}\b/gu); + if (words === null || words.length < 2) return false; + let capitalized = 0; + // Every candidate is alphabetic, so "contains no lowercase" means all-capital. + for (const word of words) if (!/[a-z]/u.test(word)) capitalized += 1; + return capitalized * 2 > words.length; +} + +/** + * Only tokens starting with an ASCII letter reach this test, so every false + * exclusion removes LTR evidence and never RTL evidence. An over-broad rule + * therefore biases mixed blocks toward RTL — the mirror of the failure this + * project exists to fix — which is why the hyphen is not a signal on its own. + */ +function isTechnicalIdentifier( + token: string, + custom: ReadonlySet, + uppercaseProse: boolean +): boolean { + if (isKnownTechnicalWord(token, custom)) return true; + // A hyphenated token is technical when a segment is itself a known technical + // word (`react-markdown`, `web-app`), not merely because it is hyphenated. + if (token.includes('-') + && token.split('-').some((segment) => segment !== '' && isKnownTechnicalWord(segment, custom))) { + return true; + } + // Digits, underscores, and dots are structural identifier syntax. + return /[0-9_.]/u.test(token) + || /[a-z][A-Z]/u.test(token) + || (!uppercaseProse + && token.length <= ACRONYM_MAXIMUM_LENGTH + && /^[A-Z]{2,}$/u.test(token)); } /** Finds ranges that should not decide the natural-language base direction. */ @@ -340,10 +383,11 @@ export function findTechnicalTokenRanges( const words = /\b[A-Za-z][A-Za-z0-9_.-]*\b/gu; const customIdentifiers = customTechnicalIdentifiers(technicalIdentifiers); + const uppercaseProse = usesUppercaseProse(text); let match: RegExpExecArray | null; while ((match = words.exec(text)) !== null) { const token = match[0]; - if (isTechnicalIdentifier(token, customIdentifiers)) { + if (isTechnicalIdentifier(token, customIdentifiers, uppercaseProse)) { addRange(ranges, text, match.index, match.index + token.length, 'identifier'); } } diff --git a/packages/core/src/stream.ts b/packages/core/src/stream.ts index 914eaf1..3a3d0df 100644 --- a/packages/core/src/stream.ts +++ b/packages/core/src/stream.ts @@ -11,6 +11,8 @@ import type { const DEFAULT_SEPARATOR_SOURCE = '\\r\\n|\\n|\\r|\\u2029'; const DEFAULT_SEPARATOR = new RegExp(DEFAULT_SEPARATOR_SOURCE, 'g'); const COMMAND_STARTERS = new Set(['npm', 'pnpm', 'yarn', 'npx', 'git', 'pip', 'python', 'node', 'cargo', 'go', 'docker', 'kubectl']); +/** Mirrors the batch acronym bound in `detect.ts`. */ +const ACRONYM_MAXIMUM_LENGTH = 5; interface IdentifierTrieNode { terminal: boolean; @@ -121,6 +123,8 @@ export class BidiStream { #policyTokenIdentifierTechnical = false; #policyTokenIdentifierHasShapeMarker = false; #policyTokenTrailingSeparator = false; + #policyTokenPendingDotSeparator = false; + #policyTokenSegmentTechnical = false; #policyTokenLastWordTechnical = false; #policyTokenStableTechnical: 'url' | 'email' | 'path' | 'identifier' | null = null; #policyTokenStableLtr = 0; @@ -781,6 +785,16 @@ export class BidiStream { if (!identifierCharacter) { this.#policyTokenDefaultTrieNode = null; this.#policyTokenCustomTrieNode = null; + } else if (character === '-') { + // A hyphen opens a new identifier segment. Recording a completed known + // segment here keeps `react-markdown` technical while `well-known` + // stays ordinary hyphenated English, matching the batch policy. + if (this.#policyTokenDefaultTrieNode?.terminal === true + || this.#policyTokenCustomTrieNode?.terminal === true) { + this.#policyTokenSegmentTechnical = true; + } + this.#policyTokenDefaultTrieNode = DEFAULT_TECHNICAL_TRIE; + this.#policyTokenCustomTrieNode = this.#customTechnicalTrie; } else { const normalized = character.toLowerCase(); this.#policyTokenDefaultTrieNode = this.#policyTokenDefaultTrieNode?.children.get(normalized) ?? null; @@ -795,13 +809,24 @@ export class BidiStream { if (/^[0-9_]$/u.test(character)) this.#policyTokenIdentifierHasShapeMarker = true; if (/^[.-]$/u.test(character)) { this.#policyTokenTrailingSeparator = true; + // Only the dot is structural identifier syntax. A hyphen alone is + // ordinary English compounding and must not mark the token technical. + if (character === '.') this.#policyTokenPendingDotSeparator = true; } else if (/^[A-Za-z0-9_]$/u.test(character)) { - if (this.#policyTokenTrailingSeparator) this.#policyTokenIdentifierHasShapeMarker = true; + if (this.#policyTokenPendingDotSeparator) this.#policyTokenIdentifierHasShapeMarker = true; + this.#policyTokenPendingDotSeparator = false; this.#policyTokenTrailingSeparator = false; - const acronym = this.#policyTokenAllUpper && this.#policyTokenUppercaseCount >= 2; + const allCapitalWord = this.#policyTokenAllUpper && this.#policyTokenUppercaseCount >= 2; + // Whether capitals mean "acronym" or "emphasized prose" depends on the + // whole block, which a per-character pass cannot know. Hand this block + // to the exact batch policy instead of guessing from the prefix. + if (allCapitalWord) this.#exactLiveAnalysisDue = true; + const acronym = allCapitalWord + && this.#policyTokenUppercaseCount <= ACRONYM_MAXIMUM_LENGTH; this.#policyTokenIdentifierTechnical = this.#policyTokenIdentifierHasShapeMarker || this.#policyTokenCamelCase || acronym + || this.#policyTokenSegmentTechnical || this.#policyTokenDefaultTrieNode?.terminal === true || this.#policyTokenCustomTrieNode?.terminal === true; this.#policyTokenLastWordTechnical = this.#policyTokenIdentifierTechnical; @@ -1455,6 +1480,8 @@ export class BidiStream { this.#policyTokenIdentifierTechnical = false; this.#policyTokenIdentifierHasShapeMarker = false; this.#policyTokenTrailingSeparator = false; + this.#policyTokenPendingDotSeparator = false; + this.#policyTokenSegmentTechnical = false; this.#policyTokenLastWordTechnical = false; this.#policyTokenStableTechnical = null; this.#policyTokenStableLtr = 0; diff --git a/rust/BUILD_REPORT.md b/rust/BUILD_REPORT.md index d41fe71..00a85f9 100644 --- a/rust/BUILD_REPORT.md +++ b/rust/BUILD_REPORT.md @@ -13,7 +13,7 @@ formatting, and hidden-control auditing; - byte, UTF-16, and Unicode scalar-value ranges; - exact pure-LTR/LTR-context no-op behavior; -- shared `corpus/cases.json` gate: 930 direction fixtures, all explicitly +- shared `corpus/cases.json` gate: 932 direction fixtures, all explicitly declared isolation plans, and all security-code fixtures; - focused option, offset, mixed-direction, source-immutability, formatting, and independent direction/alignment assertions; @@ -32,7 +32,7 @@ cargo run --manifest-path rust/Cargo.toml --example basic The complete command set passed locally on Windows 10 x64 with the declared minimum Rust `1.85.0` GNU toolchain on 2026-08-01. The conformance executable -reported 18/18 test groups passing; the corpus groups cover all 930 direction +reported 18/18 test groups passing; the corpus groups cover all 932 direction cases and every declared isolation/security expectation. The protected [initial pull-request run](https://github.com/CodeinScrubs/BidiLens/actions/runs/30702127236) passed the Rust core gate with 928 fixtures at that commit on diff --git a/rust/README.md b/rust/README.md index df23a24..9c4e13d 100644 --- a/rust/README.md +++ b/rust/README.md @@ -74,7 +74,7 @@ cargo clippy --manifest-path rust/Cargo.toml --all-targets --all-features -- -D cargo test --manifest-path rust/Cargo.toml --all-targets ``` -The conformance suite checks all 930 shared direction fixtures, every declared +The conformance suite checks all 932 shared direction fixtures, every declared isolation plan, security expectations, index conversions, invalid options, and the LTR identity contract. CI repeats the gate on Linux, macOS, and Windows. See the [Rust build report](BUILD_REPORT.md) and project-wide diff --git a/rust/src/technical.rs b/rust/src/technical.rs index fef2bc8..b990084 100644 --- a/rust/src/technical.rs +++ b/rust/src/technical.rs @@ -343,18 +343,61 @@ fn add_code_ranges(source: &str, ranges: &mut Vec) { } } -fn is_technical_identifier(token: &str, custom: &HashSet) -> bool { - let normalized = token.to_ascii_lowercase(); - DEFAULT_TECHNICAL_IDENTIFIERS.contains(&normalized.as_str()) - || custom.contains(&normalized) - || token +/// Acronyms are short. A longer all-capital word is emphasized prose, not an +/// identifier, and must keep deciding the natural-language base direction. +const ACRONYM_MAXIMUM_LENGTH: usize = 5; + +fn is_known_technical_word(value: &str, custom: &HashSet) -> bool { + let normalized = value.to_ascii_lowercase(); + DEFAULT_TECHNICAL_IDENTIFIERS.contains(&normalized.as_str()) || custom.contains(&normalized) +} + +/// Reports whether capitals are the block's prose style rather than an +/// identifier signal. `PLEASE READ THIS WARNING` is emphasized natural +/// language; the same `API` token inside mixed-case prose is an acronym. +fn uses_uppercase_prose(text: &str) -> bool { + let words = built_in_regex(r"(?-u:\b)[A-Za-z]{2,}(?-u:\b)"); + let mut total = 0usize; + let mut capitalized = 0usize; + for found in words.find_iter(text) { + total += 1; + if found + .as_str() .chars() - .any(|character| character.is_ascii_digit() || matches!(character, '_' | '.' | '-')) - || (token.len() >= 2 + .all(|character| character.is_ascii_uppercase()) + { + capitalized += 1; + } + } + total >= 2 && capitalized * 2 > total +} + +fn is_technical_identifier(token: &str, custom: &HashSet, uppercase_prose: bool) -> bool { + if is_known_technical_word(token, custom) { + return true; + } + // A hyphenated token is technical when a segment is itself a known technical + // word (`react-markdown`), not merely because it is hyphenated. `well-known` + // and `state-of-the-art` are ordinary English and stay direction evidence. + if token.contains('-') + && token + .split('-') + .any(|segment| !segment.is_empty() && is_known_technical_word(segment, custom)) + { + return true; + } + // The hyphen is deliberately absent here: only digits, underscores, and dots + // are structural identifier syntax. + token + .chars() + .any(|character| character.is_ascii_digit() || matches!(character, '_' | '.')) + || built_in_regex(r"[a-z][A-Z]").is_match(token) + || (!uppercase_prose + && token.len() >= 2 + && token.len() <= ACRONYM_MAXIMUM_LENGTH && token .chars() .all(|character| character.is_ascii_uppercase())) - || built_in_regex(r"[a-z][A-Z]").is_match(token) } /// Finds technical spans that should not decide natural-language direction. @@ -536,8 +579,9 @@ pub fn find_technical_token_ranges( .map(|value| value.to_ascii_lowercase()) .collect(); let identifiers = built_in_regex(r"(?-u:\b)[A-Za-z][A-Za-z0-9_.-]*(?-u:\b)"); + let uppercase_prose = uses_uppercase_prose(text); for found in identifiers.find_iter(text) { - if is_technical_identifier(found.as_str(), &custom) { + if is_technical_identifier(found.as_str(), &custom, uppercase_prose) { add_range(&mut ranges, found.range(), TechnicalTokenKind::Identifier); } } diff --git a/rust/tests/conformance.rs b/rust/tests/conformance.rs index e854330..8c75c74 100644 --- a/rust/tests/conformance.rs +++ b/rust/tests/conformance.rs @@ -62,7 +62,7 @@ fn shared_corpus_direction_contract() { let fixtures = corpus(); assert_eq!( fixtures.len(), - 930, + 932, "corpus size changed; review the Rust gate" ); let options = AnalysisOptions::default(); @@ -187,6 +187,33 @@ fn english_majority_keeps_persian_run_isolated() { })); } +#[test] +fn hyphenated_english_compounds_stay_natural_language_evidence() { + // A hyphen is ordinary English compounding. Excluding these tokens removes + // only LTR evidence, which would silently bias mixed blocks toward RTL. + let source = "The well-known state-of-the-art open-source کتابخانه"; + let analysis = analyze(source, &AnalysisOptions::default()).expect("valid defaults"); + assert_eq!(analysis.direction, Direction::Ltr); + assert!(find_technical_token_ranges(source, &[]).is_empty()); + // A segment that is itself a known technical word still excludes the token. + assert_eq!( + find_technical_token_ranges("react-markdown", &[]).len(), + 1, + "a known technical segment must still be recognized" + ); +} + +#[test] +fn emphasized_uppercase_prose_is_evidence_but_acronyms_are_technical() { + let shouted = "PLEASE READ THIS IMPORTANT WARNING کتاب"; + let analysis = analyze(shouted, &AnalysisOptions::default()).expect("valid defaults"); + assert_eq!(analysis.direction, Direction::Ltr); + assert!(find_technical_token_ranges(shouted, &[]).is_empty()); + // Inside mixed-case prose the same shape is an acronym again. + let acronyms = find_technical_token_ranges("Use the HTTP API for this", &[]); + assert_eq!(acronyms.len(), 2); +} + #[test] fn forced_physical_alignment_does_not_change_semantic_direction() { let source = "این متن فارسی است."; diff --git a/scripts/generate-corpus.ts b/scripts/generate-corpus.ts index 7139b4d..a758051 100644 --- a/scripts/generate-corpus.ts +++ b/scripts/generate-corpus.ts @@ -164,6 +164,37 @@ const fixtures: Fixture[] = [ ) ]; +fixtures.push( + makeFixture( + 'en-hyphenated-compounds-001', + 'Ordinary hyphenated English compounds remain LTR evidence in a mixed paragraph.', + 'The well-known state-of-the-art open-source کتابخانه', + 'ltr', + ['en', 'fa', 'mixed', 'hyphenated-prose', 'natural-language-evidence'], + { + expectedIsolations: [{ + text: 'کتابخانه', + direction: 'rtl', + kind: 'opposite-direction-run' + }] + } + ), + makeFixture( + 'en-uppercase-emphasis-001', + 'An all-capital English prose style remains LTR evidence instead of being discarded as acronyms.', + 'PLEASE READ THIS IMPORTANT WARNING کتاب', + 'ltr', + ['en', 'fa', 'mixed', 'uppercase-prose', 'natural-language-evidence'], + { + expectedIsolations: [{ + text: 'کتاب', + direction: 'rtl', + kind: 'opposite-direction-run' + }] + } + ) +); + const rtlAdjacentTechnicalCases = [ { id: 'fa-adjacent-url-001', diff --git a/scripts/release-check.ts b/scripts/release-check.ts index cbcef33..131d9a6 100644 --- a/scripts/release-check.ts +++ b/scripts/release-check.ts @@ -31,9 +31,10 @@ const CANONICAL_ISSUES = 'https://github.com/CodeinScrubs/BidiLens/issues'; const DIST_BUDGETS = new Map([ // Unicode 17 tables plus auditable evidence, invisible-character security, // atomic control sanitization, fenced-code detection, configurable token - // policy, and the chunk-invariant streaming classifier remain below a - // 120 KiB unminified ceiling (the current artifact is about 25 KiB gzip). - ['@bidilens/core', 120 * 1024], + // policy, block-scoped natural-language evidence (hyphenated compounds and + // uppercase prose), and the chunk-invariant streaming classifier remain + // below a 124 KiB unminified ceiling (the current artifact is ~25 KiB gzip). + ['@bidilens/core', 124 * 1024], // Ownership-aware live direction/style restoration adds deliberate DOM // integration code; keep a tight but realistic unminified ceiling. ['@bidilens/dom', 20 * 1024], diff --git a/windows/src/BidiLens.Core/BidiAnalyzer.cs b/windows/src/BidiLens.Core/BidiAnalyzer.cs index 2a24857..ae68385 100644 --- a/windows/src/BidiLens.Core/BidiAnalyzer.cs +++ b/windows/src/BidiLens.Core/BidiAnalyzer.cs @@ -133,14 +133,23 @@ public static IReadOnlyList FindTechnicalTokenRanges( AddStandaloneFenceDelimiters(text, match.Index, length, ranges); } } + var uppercaseProse = UsesUppercaseProse(text); foreach (Match match in IdentifierPattern().Matches(text)) { var token = match.Value; - var technical = DefaultTechnicalIdentifiers.Contains(token) - || customIdentifiers?.Contains(token) == true - || token.Any(character => char.IsDigit(character) || character is '_' or '.' or '-') - || token.Length >= 2 && token.All(character => character is >= 'A' and <= 'Z') - || Regex.IsMatch(token, "[a-z][A-Z]", RegexOptions.CultureInvariant); + var technical = IsKnownTechnicalWord(token, customIdentifiers) + // A hyphenated token is technical when a segment is itself a known + // technical word ("react-markdown"), not merely because it is + // hyphenated: "well-known" is ordinary English direction evidence. + || (token.Contains('-') && token.Split('-').Any(segment => + segment.Length > 0 && IsKnownTechnicalWord(segment, customIdentifiers))) + // Only digits, underscores, and dots are structural identifier syntax. + || token.Any(character => char.IsDigit(character) || character is '_' or '.') + || Regex.IsMatch(token, "[a-z][A-Z]", RegexOptions.CultureInvariant) + || (!uppercaseProse + && token.Length >= 2 + && token.Length <= AcronymMaximumLength + && token.All(character => character is >= 'A' and <= 'Z')); if (technical) ranges.Add(new(token, match.Index, match.Index + match.Length, TechnicalTokenKind.Identifier)); } ranges.Sort((left, right) => @@ -531,6 +540,35 @@ private static BidiSecurityReport ScanSecurity(string text) return new(!controls.Any(control => control.Risk == "high"), controls); } + /// + /// Acronyms are short. A longer all-capital word is emphasized prose, not an + /// identifier, and must keep deciding the natural-language base direction. + /// + private const int AcronymMaximumLength = 5; + + private static bool IsKnownTechnicalWord(string value, IReadOnlySet? custom) => + DefaultTechnicalIdentifiers.Contains(value) || custom?.Contains(value) == true; + + /// + /// Reports whether capitals are the block's prose style rather than an + /// identifier signal. PLEASE READ THIS WARNING is emphasized natural + /// language; the same API token inside mixed-case prose is an acronym. + /// + private static bool UsesUppercaseProse(string text) + { + var total = 0; + var capitalized = 0; + foreach (Match match in ProseWordPattern().Matches(text)) + { + total += 1; + if (match.Value.All(character => character is >= 'A' and <= 'Z')) capitalized += 1; + } + return total >= 2 && capitalized * 2 > total; + } + [GeneratedRegex(@"(? value.Text == "React"), "React isolation missing"); + const string compounds = "The well-known state-of-the-art open-source کتابخانه"; + Equal(BidiDirection.LeftToRight, BidiAnalyzer.DetectDirection(compounds), "hyphenated prose direction"); + Equal(0, BidiAnalyzer.FindTechnicalTokenRanges(compounds).Count, "hyphenated prose technical ranges"); + const string emphasized = "PLEASE READ THIS IMPORTANT WARNING کتاب"; + Equal(BidiDirection.LeftToRight, BidiAnalyzer.DetectDirection(emphasized), "uppercase prose direction"); + Equal(0, BidiAnalyzer.FindTechnicalTokenRanges(emphasized).Count, "uppercase prose technical ranges"); + Equal( + 2, + BidiAnalyzer.FindTechnicalTokenRanges("Use the HTTP API for this").Count, + "mixed-case acronym ranges"); + Equal( + 1, + BidiAnalyzer.FindTechnicalTokenRanges("react-markdown").Count, + "hyphenated technical range"); + var textBlock = new TextBlock { Text = flagship, TextAlignment = TextAlignment.Left }; var blockAnalysis = BidiWpf.Apply(textBlock, alignment: BidiAlignment.PhysicalLeft); Equal(BidiDirection.RightToLeft, blockAnalysis.ResolvedDirection, "WPF analysis direction"); From 416022db24ae4b4f66fbdd5513d5d962254ac952 Mon Sep 17 00:00:00 2001 From: Shayan SalehiRad <167648493+CodeinScrubs@users.noreply.github.com> Date: Thu, 13 Aug 2026 15:07:26 +0330 Subject: [PATCH 2/2] fix(core): distinguish acronym-only uppercase text --- CHANGELOG.md | 2 ++ action/dist/index.cjs | 9 ++++++-- action/dist/index.cjs.map | 4 ++-- .../bidilens/core/TechnicalTokens.kt | 9 ++++++-- .../bidilens/core/BidiCoreTest.kt | 2 ++ apple/Sources/BidiLens/BidiAnalyzer.swift | 21 ++++++++++++------- apple/Tests/BidiLensTests/BidiLensTests.swift | 4 ++++ docs/LIMITATIONS.md | 7 ++++--- packages/core/src/core.test.ts | 4 ++++ packages/core/src/detect.ts | 12 +++++++++-- rust/src/technical.rs | 7 ++++++- rust/tests/conformance.rs | 2 ++ windows/src/BidiLens.Core/BidiAnalyzer.cs | 15 +++++++++---- windows/tests/BidiLens.Tests/Program.cs | 10 +++++++++ 14 files changed, 85 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d80eb5..4c56422 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ is published under the public `@bidilens` npm scope. identifiers such as `react-markdown`, `GPT-5`, and mixed-case acronyms. - Added shared cross-platform regressions for both evidence classes, bringing the canonical direction corpus to 932 cases. +- Kept caller-supplied .NET technical identifiers case-insensitive regardless + of the comparer used by the caller's set. ### Release and verification diff --git a/action/dist/index.cjs b/action/dist/index.cjs index 25399e7..9240edb 100644 --- a/action/dist/index.cjs +++ b/action/dist/index.cjs @@ -6314,8 +6314,13 @@ function usesUppercaseProse(text) { const words = text.match(/\b[A-Za-z]{2,}\b/gu); if (words === null || words.length < 2) return false; let capitalized = 0; - for (const word of words) if (!/[a-z]/u.test(word)) capitalized += 1; - return capitalized * 2 > words.length; + let hasLongCapitalizedWord = false; + for (const word of words) { + if (/[a-z]/u.test(word)) continue; + capitalized += 1; + if (word.length > ACRONYM_MAXIMUM_LENGTH) hasLongCapitalizedWord = true; + } + return hasLongCapitalizedWord && capitalized * 2 > words.length; } function isTechnicalIdentifier(token, custom, uppercaseProse) { if (isKnownTechnicalWord(token, custom)) return true; diff --git a/action/dist/index.cjs.map b/action/dist/index.cjs.map index 7a23e19..d8668a4 100644 --- a/action/dist/index.cjs.map +++ b/action/dist/index.cjs.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../src/main.ts", "../src/index.ts", "../../packages/cli/src/index.ts", "../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js", "../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/argument.js", "../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/command.js", "../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/help.js", "../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/option.js", "../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/suggestSimilar.js", "../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/index.js", "../../packages/core/src/generated/bidi-ranges.ts", "../../packages/core/src/classify.ts", "../../packages/core/src/detect.ts", "../../packages/core/src/security.ts", "../../packages/core/src/intervention.ts", "../../packages/core/src/segments.ts", "../../packages/html/src/index.ts", "../../packages/cli/package.json"], - "sourcesContent": ["import process from 'node:process';\nimport { runAction, workflowError } from './index.js';\n\nasync function main(): Promise {\n try {\n const result = await runAction();\n process.exitCode = result.exitCode;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n process.stderr.write(`${workflowError(message)}\\n`);\n process.exitCode = 1;\n }\n}\n\nvoid main();\n", "import { appendFile, mkdir, writeFile } from 'node:fs/promises';\nimport { randomUUID } from 'node:crypto';\nimport { dirname, isAbsolute, relative, resolve } from 'node:path';\nimport process from 'node:process';\nimport { runCli } from '../../packages/cli/src/index.js';\n\nexport type ActionCommand = 'audit' | 'test';\nexport type ActionFormat = 'human' | 'json' | 'sarif';\nexport type ActionMode = 'off' | 'audit' | 'warn' | 'strict';\nexport type ActionRisk = 'low' | 'medium' | 'high';\n\nexport interface ActionInputs {\n command: ActionCommand;\n paths: string[];\n corpus: string;\n mode: ActionMode;\n failOn: ActionRisk;\n format: ActionFormat;\n sarifFile: string;\n}\n\nexport interface ActionContext {\n env?: NodeJS.ProcessEnv;\n cwd?: string;\n log?: (value: string) => void;\n error?: (value: string) => void;\n}\n\nexport interface ActionResult {\n exitCode: number;\n report: string;\n stdout: string;\n stderr: string;\n}\n\nfunction input(env: NodeJS.ProcessEnv, name: string): string {\n return env[`INPUT_${name.toUpperCase()}`]?.trim() ?? '';\n}\n\nfunction choice(\n name: string,\n value: string,\n fallback: Value,\n allowed: readonly Value[]\n): Value {\n const candidate = value || fallback;\n if (!allowed.includes(candidate as Value)) {\n throw new Error(`${name} must be one of ${allowed.join(', ')}; received ${JSON.stringify(candidate)}.`);\n }\n return candidate as Value;\n}\n\nexport function readActionInputs(env: NodeJS.ProcessEnv = process.env): ActionInputs {\n return {\n command: choice('command', input(env, 'COMMAND'), 'audit', ['audit', 'test']),\n paths: (input(env, 'PATHS') || '.').split(/\\r?\\n/u).map((path) => path.trim()).filter(Boolean),\n corpus: input(env, 'CORPUS'),\n mode: choice('mode', input(env, 'MODE'), 'audit', ['off', 'audit', 'warn', 'strict']),\n failOn: choice('fail-on', input(env, 'FAIL-ON'), 'high', ['low', 'medium', 'high']),\n format: choice('format', input(env, 'FORMAT'), 'human', ['human', 'json', 'sarif']),\n sarifFile: input(env, 'SARIF-FILE') || 'bidilens.sarif'\n };\n}\n\nexport function buildCliArguments(inputs: ActionInputs, env: NodeJS.ProcessEnv = process.env): string[] {\n if (inputs.command === 'test') {\n if (inputs.format === 'sarif') throw new Error('SARIF output is available only for the audit command.');\n const actionPath = env.GITHUB_ACTION_PATH\n ? resolve(env.GITHUB_ACTION_PATH)\n : resolve(env.GITHUB_WORKSPACE ?? process.cwd(), 'action');\n const corpus = inputs.corpus || resolve(actionPath, '..', 'corpus', 'cases.json');\n return ['node', 'bidilens', 'test', '--corpus', corpus, ...(inputs.format === 'json' ? ['--json'] : [])];\n }\n\n const format = inputs.format === 'json' ? ['--json'] : inputs.format === 'sarif' ? ['--sarif'] : [];\n return [\n 'node', 'bidilens', 'audit', ...inputs.paths,\n '--mode', inputs.mode,\n '--fail-on', inputs.failOn,\n ...format\n ];\n}\n\nfunction workspaceFile(cwd: string, requested: string): { absolute: string; relative: string } {\n const absolute = resolve(cwd, requested);\n const local = relative(cwd, absolute);\n if (!local || local.startsWith('..') || isAbsolute(local)) {\n throw new Error('sarif-file must resolve to a file inside GITHUB_WORKSPACE.');\n }\n return { absolute, relative: local.replaceAll('\\\\', '/') };\n}\n\nasync function setOutput(path: string | undefined, name: string, value: string): Promise {\n if (!path) return;\n const delimiter = `bidilens_${randomUUID()}`;\n await appendFile(path, `${name}<<${delimiter}\\n${value}\\n${delimiter}\\n`, 'utf8');\n}\n\n/** Executes the bundled CLI without a shell and propagates its real exit code. */\nexport async function runAction(context: ActionContext = {}): Promise {\n const env = context.env ?? process.env;\n const cwd = resolve(context.cwd ?? env.GITHUB_WORKSPACE ?? process.cwd());\n const log = context.log ?? console.log;\n const error = context.error ?? console.error;\n const inputs = readActionInputs(env);\n const stdout: string[] = [];\n const stderr: string[] = [];\n const exitCode = await runCli(buildCliArguments(inputs, env), {\n cwd,\n stdout: (value) => stdout.push(value),\n stderr: (value) => stderr.push(value)\n });\n const stdoutText = stdout.join('');\n const stderrText = stderr.join('');\n let report = '';\n\n if (inputs.format === 'sarif') {\n const target = workspaceFile(cwd, inputs.sarifFile);\n await mkdir(dirname(target.absolute), { recursive: true });\n await writeFile(target.absolute, stdoutText, 'utf8');\n report = target.relative;\n log(`BidiLens SARIF report written to ${report}.`);\n } else if (stdoutText) {\n log(stdoutText.trimEnd());\n }\n if (stderrText) error(stderrText.trimEnd());\n\n await setOutput(env.GITHUB_OUTPUT, 'exit-code', String(exitCode));\n await setOutput(env.GITHUB_OUTPUT, 'report', report);\n if (exitCode !== 0) error(`BidiLens ${inputs.command} failed with exit code ${exitCode}.`);\n return { exitCode, report, stdout: stdoutText, stderr: stderrText };\n}\n\nexport function workflowError(message: string): string {\n const escaped = message\n .replaceAll('%', '%25')\n .replaceAll('\\r', '%0D')\n .replaceAll('\\n', '%0A');\n return `::error title=BidiLens::${escaped}`;\n}\n", "#!/usr/bin/env node\nimport { lstat, readFile, readdir, writeFile } from 'node:fs/promises';\nimport { basename, extname, isAbsolute, relative, resolve } from 'node:path';\nimport process from 'node:process';\nimport { pathToFileURL } from 'node:url';\nimport { Command, CommanderError } from 'commander';\nimport { renderBidiHtml } from '@bidilens/html';\nimport packageManifest from '../package.json' with { type: 'json' };\nimport {\n analyzeText,\n findBidiControls,\n sanitizeBidiControls,\n scanBidiSecurity,\n visibleBidiControls,\n type BidiControlRisk,\n type BidiInterventionMode,\n type BidiSecurityFinding,\n type BidiSecurityMode\n} from '@bidilens/core';\n\nconst SUPPORTED_EXTENSIONS = new Set([\n '.md', '.mdx', '.txt', '.html', '.htm', '.json', '.yaml', '.yml',\n '.js', '.jsx', '.ts', '.tsx', '.css', '.scss', '.py', '.go', '.rs',\n '.java', '.kt', '.swift', '.c', '.cc', '.cpp', '.h', '.hpp', '.toml',\n '.vue', '.svelte', '.astro', '.dart', '.xml', '.svg', '.sh', '.bash',\n '.zsh', '.fish', '.cs', '.fs', '.fsx', '.vb', '.rb', '.php', '.sql',\n '.ini', '.conf', '.properties', '.gradle', '.groovy', '.lua', '.pl', '.r',\n '.ex', '.exs', '.erl', '.hrl'\n]);\n\nconst SUPPORTED_BASENAMES = new Set([\n 'dockerfile', 'makefile', 'gemfile', 'podfile', 'rakefile', 'cmakelists.txt',\n 'build', 'workspace', '.env'\n]);\n\nconst IGNORED_DIRECTORIES = new Set([\n 'node_modules', '.git', 'dist', 'build', 'coverage', 'test-results',\n 'playwright-report', '.vite', '.next', '.nuxt', '.svelte-kit', '.output'\n]);\n\nconst RISK_ORDER: Record = { low: 1, medium: 2, high: 3 };\nconst CLI_VERSION = packageManifest.version;\n\ninterface CorpusCase {\n id: string;\n text: string;\n expected: 'ltr' | 'rtl' | 'neutral';\n}\n\nexport interface CliRuntime {\n cwd?: string;\n stdout?: (value: string) => void;\n stderr?: (value: string) => void;\n}\n\ninterface RuntimeState {\n cwd: string;\n stdout: (value: string) => void;\n stderr: (value: string) => void;\n exitCode: number;\n}\n\nfunction createRuntime(runtime: CliRuntime): RuntimeState {\n return {\n cwd: resolve(runtime.cwd ?? process.cwd()),\n stdout: runtime.stdout ?? ((value) => process.stdout.write(value)),\n stderr: runtime.stderr ?? ((value) => process.stderr.write(value)),\n exitCode: 0\n };\n}\n\nfunction line(writer: (value: string) => void, value = ''): void {\n writer(`${value}\\n`);\n}\n\nasync function collectFiles(inputs: string[], cwd: string): Promise {\n const files: string[] = [];\n async function visitPath(input: string, explicitlyNamed: boolean): Promise {\n const absolute = resolve(cwd, input);\n const info = await lstat(absolute);\n if (info.isSymbolicLink()) return;\n if (info.isDirectory()) {\n const entries = await readdir(absolute, { withFileTypes: true });\n entries.sort((a, b) => a.name.localeCompare(b.name));\n for (const entry of entries) {\n if (IGNORED_DIRECTORIES.has(entry.name.toLowerCase())) continue;\n if (entry.isSymbolicLink()) continue;\n await visitPath(resolve(absolute, entry.name), false);\n }\n return;\n }\n const name = basename(absolute).toLowerCase();\n const supportedName = SUPPORTED_BASENAMES.has(name) || name.startsWith('.env.');\n if (info.isFile() && (explicitlyNamed || supportedName || SUPPORTED_EXTENSIONS.has(extname(absolute).toLowerCase()))) {\n files.push(absolute);\n }\n }\n for (const input of inputs) await visitPath(input, true);\n return files.sort((a, b) => a.localeCompare(b));\n}\n\nfunction parseCorpus(source: string, location: string): CorpusCase[] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(source);\n } catch (error) {\n throw new Error(`${location} is not valid JSON. ${String(error)}`, { cause: error });\n }\n if (!Array.isArray(parsed)) throw new Error(`${location} must contain a JSON array.`);\n const ids = new Set();\n return parsed.map((item: unknown, index) => {\n if (typeof item !== 'object' || item === null) {\n throw new Error(`${location}: case ${index + 1} must be an object.`);\n }\n const candidate = item as Record;\n if (typeof candidate.id !== 'string' || candidate.id.length === 0) {\n throw new Error(`${location}: case ${index + 1} must have a non-empty string id.`);\n }\n if (ids.has(candidate.id)) throw new Error(`${location}: duplicate case id \"${candidate.id}\".`);\n ids.add(candidate.id);\n if (typeof candidate.text !== 'string') {\n throw new Error(`${location}: case \"${candidate.id}\" must have string text.`);\n }\n if (candidate.expected !== 'ltr' && candidate.expected !== 'rtl' && candidate.expected !== 'neutral') {\n throw new Error(`${location}: case \"${candidate.id}\" has invalid expected direction.`);\n }\n return { id: candidate.id, text: candidate.text, expected: candidate.expected };\n });\n}\n\nasync function readCorpus(cwd: string, explicitPath?: string): Promise {\n if (explicitPath !== undefined) {\n const location = resolve(cwd, explicitPath);\n return parseCorpus(await readFile(location, 'utf8'), location);\n }\n const candidates: Array = [\n resolve(cwd, 'corpus/cases.json'),\n new URL('../corpus/cases.json', import.meta.url),\n new URL('../../../corpus/cases.json', import.meta.url)\n ];\n let lastError: unknown;\n for (const candidate of candidates) {\n let source: string;\n try {\n source = await readFile(candidate, 'utf8');\n } catch (error) {\n lastError = error;\n continue;\n }\n // An existing, malformed higher-priority corpus is a configuration error,\n // not a reason to silently fall back to a different data set.\n return parseCorpus(source, String(candidate));\n }\n throw new Error(`Unable to locate corpus/cases.json. Pass --corpus . ${String(lastError)}`);\n}\n\nfunction parseRisk(value: string): BidiControlRisk {\n if (value === 'low' || value === 'medium' || value === 'high') return value;\n throw new Error(`Invalid risk level: ${value}`);\n}\n\nfunction parseSecurityMode(value: string): BidiSecurityMode {\n if (value === 'off' || value === 'audit' || value === 'warn' || value === 'strict') return value;\n throw new Error(`Invalid security mode: ${value}`);\n}\n\nfunction parseIntervention(value: string): BidiInterventionMode {\n if (value === 'auto' || value === 'always') return value;\n throw new Error(`Invalid intervention mode: ${value}`);\n}\n\nfunction riskForFinding(finding: BidiSecurityFinding): BidiControlRisk {\n if (finding.severity === 'high') return 'high';\n if (finding.severity === 'warning') return 'medium';\n return 'low';\n}\n\nfunction highestFindingRisk(findings: readonly BidiSecurityFinding[]): BidiControlRisk | null {\n if (findings.some((finding) => finding.severity === 'high')) return 'high';\n if (findings.some((finding) => finding.severity === 'warning')) return 'medium';\n if (findings.length) return 'low';\n return null;\n}\n\nfunction sourcePosition(text: string, utf16Offset: number): { line: number; column: number } {\n let lineNumber = 1;\n let lineStart = 0;\n const newline = /\\r\\n|\\n|\\r/gu;\n let match: RegExpExecArray | null;\n while ((match = newline.exec(text)) !== null && match.index < utf16Offset) {\n lineNumber += 1;\n lineStart = match.index + match[0].length;\n }\n return { line: lineNumber, column: utf16Offset - lineStart + 1 };\n}\n\nfunction artifactUri(file: string, cwd: string): string {\n const local = relative(cwd, file);\n if (local && !local.startsWith('..') && !isAbsolute(local)) return local.replaceAll('\\\\', '/');\n return pathToFileURL(file).href;\n}\n\ninterface SecurityFileReport {\n file: string;\n text: string;\n findings: BidiSecurityFinding[];\n highestRisk: BidiControlRisk | null;\n}\n\nasync function readTextInput(\n options: { text?: string; file?: string },\n cwd: string\n): Promise {\n if (options.text === undefined && options.file === undefined) {\n throw new Error('Provide --text or --file.');\n }\n if (options.text !== undefined && options.file !== undefined) {\n throw new Error('Choose either --text or --file, not both.');\n }\n return options.file !== undefined\n ? readFile(resolve(cwd, options.file), 'utf8')\n : options.text!;\n}\n\nfunction sarifForReports(reports: readonly SecurityFileReport[], cwd: string): object {\n return {\n version: '2.1.0',\n $schema: 'https://json.schemastore.org/sarif-2.1.0.json',\n runs: [{\n columnKind: 'utf16CodeUnits',\n tool: { driver: { name: 'BidiLens', semanticVersion: CLI_VERSION } },\n results: reports.flatMap((report) => report.findings.map((finding) => {\n const start = sourcePosition(report.text, finding.sourceRange.utf16.start);\n const end = sourcePosition(report.text, finding.sourceRange.utf16.end);\n return {\n ruleId: finding.code,\n level: finding.severity === 'high' ? 'error' : finding.severity === 'warning' ? 'warning' : 'note',\n message: { text: `${finding.message} ${finding.remediation}` },\n locations: [{\n physicalLocation: {\n artifactLocation: { uri: artifactUri(report.file, cwd) },\n region: {\n startLine: start.line,\n startColumn: start.column,\n endLine: end.line,\n endColumn: end.column\n }\n }\n }]\n };\n }))\n }]\n };\n}\n\nfunction createCliProgram(state: RuntimeState): Command {\n const program = new Command();\n program\n .name('bidilens')\n .description('Inspect and secure mixed bidirectional text')\n .version(CLI_VERSION)\n .exitOverride()\n .configureOutput({ writeOut: state.stdout, writeErr: state.stderr });\n\n program.command('inspect')\n .description('Analyze a string or file')\n .option('-t, --text ', 'text to inspect')\n .option('-f, --file ', 'file to inspect')\n .option('--json', 'emit JSON')\n .action(async (options: { text?: string; file?: string; json?: boolean }) => {\n const text = await readTextInput(options, state.cwd);\n const analysis = analyzeText(text, { strategy: 'content-majority', fallback: 'neutral' });\n const controls = findBidiControls(text);\n const report = { analysis, controls, visible: controls.length ? visibleBidiControls(text) : text };\n if (options.json) line(state.stdout, JSON.stringify(report, null, 2));\n else {\n line(state.stdout, `Direction: ${analysis.direction}`);\n line(state.stdout, `Confidence: ${analysis.confidence}`);\n line(state.stdout, `Strong characters: RTL ${analysis.counts.rtl}, LTR ${analysis.counts.ltr}`);\n line(state.stdout, `Paragraphs: ${analysis.paragraphs.length}`);\n line(state.stdout, `Bidi controls: ${controls.length}`);\n if (controls.length) line(state.stdout, report.visible);\n }\n });\n\n program.command('render')\n .description('Render plain text as escaped, semantic direction-aware HTML')\n .option('-t, --text ', 'text to render')\n .option('-f, --file ', 'file to render')\n .option('--intervention ', 'auto or always', parseIntervention, 'auto')\n .option('--json', 'emit analysis and HTML as JSON')\n .action(async (options: {\n text?: string;\n file?: string;\n intervention: BidiInterventionMode;\n json?: boolean;\n }) => {\n const text = await readTextInput(options, state.cwd);\n const result = renderBidiHtml(text, { intervention: options.intervention });\n line(state.stdout, options.json\n ? JSON.stringify({ analysis: result.analysis, html: result.html }, null, 2)\n : result.html);\n });\n\n program.command('audit')\n .aliases(['security-scan', 'lint'])\n .description('Audit files for hidden and unbalanced bidi controls')\n .argument('', 'files or directories')\n .option('--json', 'emit JSON')\n .option('--sarif', 'emit SARIF 2.1.0')\n .option('--mode ', 'off, audit, warn, or strict', parseSecurityMode, 'audit')\n .option('--fail-on ', 'minimum risk that exits non-zero', parseRisk, 'high')\n .action(async (paths: string[], options: {\n json?: boolean;\n sarif?: boolean;\n mode: BidiSecurityMode;\n failOn: BidiControlRisk;\n }) => {\n if (options.json && options.sarif) throw new Error('Choose either --json or --sarif, not both.');\n const files = await collectFiles(paths, state.cwd);\n const reports: SecurityFileReport[] = [];\n let shouldFail = false;\n\n for (const file of files) {\n const text = await readFile(file, 'utf8');\n const security = scanBidiSecurity(text, { mode: options.mode });\n if (!security.findings.length) continue;\n const highestRisk = highestFindingRisk(security.findings);\n reports.push({ file, text, findings: security.findings, highestRisk });\n if (security.shouldBlock || (highestRisk && RISK_ORDER[highestRisk] >= RISK_ORDER[options.failOn])) shouldFail = true;\n }\n\n if (options.sarif) line(state.stdout, JSON.stringify(sarifForReports(reports, state.cwd), null, 2));\n else if (options.json) {\n line(state.stdout, JSON.stringify({\n scanned: files.length,\n reports: reports.map((report) => ({\n file: report.file,\n findings: report.findings,\n highestRisk: report.highestRisk\n }))\n }, null, 2));\n } else if (!reports.length) line(state.stdout, `No bidi security findings in ${files.length} files.`);\n else {\n for (const report of reports) {\n line(state.stdout, `\\n${report.file} (${report.highestRisk ?? 'unknown'})`);\n for (const finding of report.findings) {\n const position = sourcePosition(report.text, finding.sourceRange.utf16.start);\n line(state.stdout, ` ${finding.code} at ${position.line}:${position.column} [${riskForFinding(finding)}] ${finding.message}`);\n }\n }\n }\n if (shouldFail) state.exitCode = Math.max(state.exitCode, 2);\n });\n\n program.command('test')\n .description('Run the direction conformance corpus')\n .option('--json', 'emit failures as JSON')\n .option('--corpus ', 'corpus JSON path; defaults to the bundled corpus or repository corpus')\n .action(async (options: { json?: boolean; corpus?: string }) => {\n const corpus = await readCorpus(state.cwd, options.corpus);\n const failures = corpus.flatMap((item) => {\n const actual = analyzeText(item.text, { strategy: 'content-majority', fallback: 'neutral' }).direction;\n return actual === item.expected ? [] : [{ id: item.id, expected: item.expected, actual }];\n });\n if (options.json) line(state.stdout, JSON.stringify({ total: corpus.length, failures }, null, 2));\n else line(state.stdout, `Corpus: ${corpus.length - failures.length}/${corpus.length} passed`);\n if (failures.length) state.exitCode = Math.max(state.exitCode, 1);\n });\n\n program.command('sanitize')\n .description('Remove bidi controls from one file')\n .argument('', 'input file')\n .option('-o, --output ', 'output path; defaults to stdout')\n .option('--keep-low', 'preserve low-risk ALM/LRM/RLM marks')\n .action(async (file: string, options: { output?: string; keepLow?: boolean }) => {\n const text = await readFile(resolve(state.cwd, file), 'utf8');\n const remove: BidiControlRisk[] = options.keepLow ? ['high', 'medium'] : ['high', 'medium', 'low'];\n const result = sanitizeBidiControls(text, { remove });\n if (options.output) {\n const output = resolve(state.cwd, options.output);\n await writeFile(output, result.text, 'utf8');\n line(state.stderr, `Removed ${result.removed.length} controls and wrote ${output}.`);\n } else {\n state.stdout(result.text);\n }\n });\n\n return program;\n}\n\nexport async function runCli(argv: readonly string[] = process.argv, runtime: CliRuntime = {}): Promise {\n const state = createRuntime(runtime);\n const program = createCliProgram(state);\n try {\n await program.parseAsync([...argv], { from: 'node' });\n } catch (error) {\n if (error instanceof CommanderError) return Math.max(state.exitCode, error.exitCode);\n const message = error instanceof Error ? error.message : String(error);\n line(state.stderr, `bidilens: ${message}`);\n return Math.max(state.exitCode, 1);\n }\n return state.exitCode;\n}\n", "/**\n * CommanderError class\n */\nexport class 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 */\nexport class 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", "import { InvalidArgumentError } from './error.js';\n\nexport class 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. \n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.endsWith('...')) {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nexport function humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n", "import { EventEmitter } from 'node:events';\nimport childProcess from 'node:child_process';\nimport path from 'node:path';\nimport fs from 'node:fs';\nimport process from 'node:process';\nimport { stripVTControlCharacters } from 'node:util';\n\nimport { Argument, humanReadableArgName } from './argument.js';\nimport { CommanderError } from './error.js';\nimport { Help } from './help.js';\nimport { Option, DualOptions } from './option.js';\nimport { suggestSimilar } from './suggestSimilar.js';\n\nexport class 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) => stripVTControlCharacters(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n /** @type {string | undefined} */\n this._helpGroupHeading = undefined; // soft initialised when added to parent\n /** @type {string | undefined} */\n this._defaultCommandGroup = undefined;\n /** @type {string | undefined} */\n this._defaultOptionGroup = undefined;\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone [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 ', '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 `` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n this._outputConfiguration = {\n ...this._outputConfiguration,\n ...configuration,\n };\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom argument processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, parseArg, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof parseArg === 'function') {\n argument.default(defaultValue).argParser(parseArg);\n } else {\n argument.default(parseArg);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments(' [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument?.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n if (enableOrNameAndArgs && this._defaultCommandGroup) {\n // make the command to store the group\n this._initCommandGroup(this._getHelpCommand());\n }\n return this;\n }\n\n const nameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = nameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n // init group unless lazy create\n if (enableOrNameAndArgs || description) this._initCommandGroup(helpCommand);\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n this._initCommandGroup(helpCommand);\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this._initOptionGroup(option);\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this._initCommandGroup(command);\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._collectValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type ', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip ', '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 // Save the state the first time, then restore the state before each subsequent parse.\n if (this._savedState === null) {\n // Do the special default of lone negated option to true, now that we have all the options.\n // Filter for negated options that have not been processed already.\n this.options\n .filter(\n (option) =>\n option.negate &&\n option.defaultValue === undefined &&\n this.getOptionValue(option.attributeName()) === undefined,\n )\n .forEach((option) => {\n // check for lone negated option: --no-foo without a --foo option\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n option.attributeName(),\n true,\n 'default',\n );\n }\n });\n\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 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 const launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise?.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent?.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} args\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(args) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n const negativeNumberArg = (arg) => {\n // return false if not a negative number\n if (!/^-(\\d+|\\d*\\.\\d+)(e[+-]?\\d+)?$/.test(arg)) return false;\n // negative number is ok unless digit used as an option in command hierarchy\n return !this._getCommandAndAncestors().some((cmd) =>\n cmd.options\n .map((opt) => opt.short)\n .some((short) => /^-\\d$/.test(short)),\n );\n };\n\n // parse options\n let activeVariadicOption = null;\n let activeGroup = null; // working through group of short options, like -abc\n let i = 0;\n while (i < args.length || activeGroup) {\n const arg = activeGroup ?? args[i++];\n activeGroup = null;\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args.slice(i));\n break;\n }\n\n if (\n activeVariadicOption &&\n (!maybeOption(arg) || negativeNumberArg(arg))\n ) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args[i++];\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (\n i < args.length &&\n (!maybeOption(args[i]) || negativeNumberArg(args[i]))\n ) {\n value = args[i++];\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option\n this.emit(`option:${option.name()}`);\n // remove the processed option and keep processing group\n activeGroup = `-${arg.slice(2)}`;\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n // A negative number in a leaf command is not an unknown option.\n if (\n dest === operands &&\n maybeOption(arg) &&\n !(this.commands.length === 0 && negativeNumberArg(arg))\n ) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n unknown.push(...args.slice(i));\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg, ...args.slice(i));\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg, ...args.slice(i));\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg, ...args.slice(i));\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const received = receivedArgs.length;\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const details = receivedArgs.join(', ');\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${received}: ${details}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set/get the help group heading for this subcommand in parent command's help.\n *\n * @param {string} [heading]\n * @return {Command | string}\n */\n\n helpGroup(heading) {\n if (heading === undefined) return this._helpGroupHeading ?? '';\n this._helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n commandsGroup(heading) {\n if (heading === undefined) return this._defaultCommandGroup ?? '';\n this._defaultCommandGroup = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n optionsGroup(heading) {\n if (heading === undefined) return this._defaultOptionGroup ?? '';\n this._defaultOptionGroup = heading;\n return this;\n }\n\n /**\n * @param {Option} option\n * @private\n */\n _initOptionGroup(option) {\n if (this._defaultOptionGroup && !option.helpGroupHeading)\n option.helpGroup(this._defaultOptionGroup);\n }\n\n /**\n * @param {Command} cmd\n * @private\n */\n _initCommandGroup(cmd) {\n if (this._defaultCommandGroup && !cmd.helpGroup())\n cmd.helpGroup(this._defaultCommandGroup);\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or import.meta.filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(import.meta.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(import.meta.dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support enabling/disabling built-in help option.\n if (typeof flags === 'boolean') {\n if (flags) {\n if (this._helpOption === null) this._helpOption = undefined; // reenable\n if (this._defaultOptionGroup) {\n // make the option to store the group\n this._initOptionGroup(this._getHelpOption());\n }\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n this._helpOption = this.createOption(\n flags ?? '-h, --help',\n description ?? 'display help for command',\n );\n // init group unless lazy create\n if (flags || description) this._initOptionGroup(this._helpOption);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n this._initOptionGroup(option);\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * Exported for using from tests, not otherwise used outside this file.\n *\n * @returns {boolean | undefined}\n * @package\n */\nexport function 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", "import { humanReadableArgName } from './argument.js';\nimport { stripVTControlCharacters } from 'node:util';\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.\nexport class Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (option.description) {\n return `${option.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n *\n * @param {string} heading\n * @param {string[]} items\n * @param {Help} helper\n * @returns string[]\n */\n formatItemList(heading, items, helper) {\n if (items.length === 0) return [];\n\n return [helper.styleTitle(heading), ...items, ''];\n }\n\n /**\n * Group items by their help group heading.\n *\n * @param {Command[] | Option[]} unsortedItems\n * @param {Command[] | Option[]} visibleItems\n * @param {Function} getGroup\n * @returns {Map}\n */\n groupItems(unsortedItems, visibleItems, getGroup) {\n const result = new Map();\n // Add groups in order of appearance in unsortedItems.\n unsortedItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) result.set(group, []);\n });\n // Add items in order of appearance in visibleItems.\n visibleItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) {\n result.set(group, []);\n }\n result.get(group).push(item);\n });\n return result;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n output = output.concat(\n this.formatItemList('Arguments:', argumentList, helper),\n );\n\n // Options\n const optionGroups = this.groupItems(\n cmd.options,\n helper.visibleOptions(cmd),\n (option) => option.helpGroupHeading ?? 'Options:',\n );\n optionGroups.forEach((options, group) => {\n const optionList = options.map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(this.formatItemList(group, optionList, helper));\n });\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(\n this.formatItemList('Global Options:', globalOptionList, helper),\n );\n }\n\n // Commands\n const commandGroups = this.groupItems(\n cmd.commands,\n helper.visibleCommands(cmd),\n (sub) => sub.helpGroup() || 'Commands:',\n );\n commandGroups.forEach((commands, group) => {\n const commandList = commands.map((sub) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(sub)),\n helper.styleSubcommandDescription(helper.subcommandDescription(sub)),\n );\n });\n output = output.concat(this.formatItemList(group, commandList, helper));\n });\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripVTControlCharacters(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] [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] [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", "import { InvalidArgumentError } from './error.js';\n\nexport class 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 et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n this.helpGroupHeading = undefined; // soft initialised when option added to command\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Set the help group heading.\n *\n * @param {string} heading\n * @return {Option}\n */\n helpGroup(heading) {\n this.helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nexport class 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 '\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", "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau\u2013Levenshtein_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;\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\nexport function 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", "import { Argument } from './lib/argument.js';\nimport { Command } from './lib/command.js';\nimport { CommanderError, InvalidArgumentError } from './lib/error.js';\nimport { Help } from './lib/help.js';\nimport { Option } from './lib/option.js';\n\nexport const program = new Command();\n\nexport const createCommand = (name) => new Command(name);\nexport const createOption = (flags, description) =>\n new Option(flags, description);\nexport const createArgument = (name, description) =>\n new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexport { Command, Option, Argument, Help };\nexport { CommanderError, InvalidArgumentError };\nexport { InvalidArgumentError as InvalidOptionArgumentError }; // Deprecated\n", "// Generated by scripts/generate-bidi-data.ts. Do not edit by hand.\n// Source: https://www.unicode.org/Public/17.0.0/ucd/extracted/DerivedBidiClass.txt\n// SHA-256: 4867b4b7f0731ed1bfcd34cc6251211ff1542541fce0734b6fbda139ee80b3a4\n// Source: https://www.unicode.org/Public/17.0.0/ucd/extracted/DerivedGeneralCategory.txt\n// SHA-256: d62e5bab70ca74f099343f71224fa051cb1fdd61a1ab45c0488c44cfc0b6102e\n\nexport const UNICODE_BIDI_VERSION = '17.0.0';\nexport const UNICODE_BIDI_SHA256 = '4867b4b7f0731ed1bfcd34cc6251211ff1542541fce0734b6fbda139ee80b3a4';\nexport const UNICODE_GENERAL_CATEGORY_SHA256 = 'd62e5bab70ca74f099343f71224fa051cb1fdd61a1ab45c0488c44cfc0b6102e';\n\nexport const RTL_BIDI_RANGES: ReadonlyArray = [\n 0x590, 0x590,\n 0x5be, 0x5be,\n 0x5c0, 0x5c0,\n 0x5c3, 0x5c3,\n 0x5c6, 0x5c6,\n 0x5c8, 0x5ff,\n 0x608, 0x608,\n 0x60b, 0x60b,\n 0x60d, 0x60d,\n 0x61b, 0x64a,\n 0x66d, 0x66f,\n 0x671, 0x6d5,\n 0x6e5, 0x6e6,\n 0x6ee, 0x6ef,\n 0x6fa, 0x710,\n 0x712, 0x72f,\n 0x74b, 0x7a5,\n 0x7b1, 0x7ea,\n 0x7f4, 0x7f5,\n 0x7fa, 0x7fc,\n 0x7fe, 0x815,\n 0x81a, 0x81a,\n 0x824, 0x824,\n 0x828, 0x828,\n 0x82e, 0x858,\n 0x85c, 0x88f,\n 0x892, 0x896,\n 0x8a0, 0x8c9,\n 0x200f, 0x200f,\n 0xfb1d, 0xfb1d,\n 0xfb1f, 0xfb28,\n 0xfb2a, 0xfbc2,\n 0xfbd3, 0xfd3d,\n 0xfd50, 0xfd8f,\n 0xfd92, 0xfdc7,\n 0xfdf0, 0xfdfc,\n 0xfe70, 0xfefe,\n 0x10800, 0x1091e,\n 0x10920, 0x10a00,\n 0x10a04, 0x10a04,\n 0x10a07, 0x10a0b,\n 0x10a10, 0x10a37,\n 0x10a3b, 0x10a3e,\n 0x10a40, 0x10ae4,\n 0x10ae7, 0x10b38,\n 0x10b40, 0x10d23,\n 0x10d28, 0x10d2f,\n 0x10d3a, 0x10d3f,\n 0x10d4a, 0x10d68,\n 0x10d6f, 0x10e5f,\n 0x10e7f, 0x10eaa,\n 0x10ead, 0x10ecf,\n 0x10ed9, 0x10ef9,\n 0x10f00, 0x10f45,\n 0x10f51, 0x10f81,\n 0x10f86, 0x10fff,\n 0x1e800, 0x1e8cf,\n 0x1e8d7, 0x1e943,\n 0x1e94b, 0x1eeef,\n 0x1eef2, 0x1efff\n];\n\nexport const NON_STRONG_BIDI_RANGES: ReadonlyArray = [\n 0x0, 0x40,\n 0x5b, 0x60,\n 0x7b, 0xa9,\n 0xab, 0xb4,\n 0xb6, 0xb9,\n 0xbb, 0xbf,\n 0xd7, 0xd7,\n 0xf7, 0xf7,\n 0x2b9, 0x2ba,\n 0x2c2, 0x2cf,\n 0x2d2, 0x2df,\n 0x2e5, 0x2ed,\n 0x2ef, 0x36f,\n 0x374, 0x375,\n 0x37e, 0x37e,\n 0x384, 0x385,\n 0x387, 0x387,\n 0x3f6, 0x3f6,\n 0x483, 0x489,\n 0x58a, 0x58a,\n 0x58d, 0x58f,\n 0x591, 0x5bd,\n 0x5bf, 0x5bf,\n 0x5c1, 0x5c2,\n 0x5c4, 0x5c5,\n 0x5c7, 0x5c7,\n 0x600, 0x607,\n 0x609, 0x60a,\n 0x60c, 0x60c,\n 0x60e, 0x61a,\n 0x64b, 0x66c,\n 0x670, 0x670,\n 0x6d6, 0x6e4,\n 0x6e7, 0x6ed,\n 0x6f0, 0x6f9,\n 0x711, 0x711,\n 0x730, 0x74a,\n 0x7a6, 0x7b0,\n 0x7eb, 0x7f3,\n 0x7f6, 0x7f9,\n 0x7fd, 0x7fd,\n 0x816, 0x819,\n 0x81b, 0x823,\n 0x825, 0x827,\n 0x829, 0x82d,\n 0x859, 0x85b,\n 0x890, 0x891,\n 0x897, 0x89f,\n 0x8ca, 0x902,\n 0x93a, 0x93a,\n 0x93c, 0x93c,\n 0x941, 0x948,\n 0x94d, 0x94d,\n 0x951, 0x957,\n 0x962, 0x963,\n 0x981, 0x981,\n 0x9bc, 0x9bc,\n 0x9c1, 0x9c4,\n 0x9cd, 0x9cd,\n 0x9e2, 0x9e3,\n 0x9f2, 0x9f3,\n 0x9fb, 0x9fb,\n 0x9fe, 0x9fe,\n 0xa01, 0xa02,\n 0xa3c, 0xa3c,\n 0xa41, 0xa42,\n 0xa47, 0xa48,\n 0xa4b, 0xa4d,\n 0xa51, 0xa51,\n 0xa70, 0xa71,\n 0xa75, 0xa75,\n 0xa81, 0xa82,\n 0xabc, 0xabc,\n 0xac1, 0xac5,\n 0xac7, 0xac8,\n 0xacd, 0xacd,\n 0xae2, 0xae3,\n 0xaf1, 0xaf1,\n 0xafa, 0xaff,\n 0xb01, 0xb01,\n 0xb3c, 0xb3c,\n 0xb3f, 0xb3f,\n 0xb41, 0xb44,\n 0xb4d, 0xb4d,\n 0xb55, 0xb56,\n 0xb62, 0xb63,\n 0xb82, 0xb82,\n 0xbc0, 0xbc0,\n 0xbcd, 0xbcd,\n 0xbf3, 0xbfa,\n 0xc00, 0xc00,\n 0xc04, 0xc04,\n 0xc3c, 0xc3c,\n 0xc3e, 0xc40,\n 0xc46, 0xc48,\n 0xc4a, 0xc4d,\n 0xc55, 0xc56,\n 0xc62, 0xc63,\n 0xc78, 0xc7e,\n 0xc81, 0xc81,\n 0xcbc, 0xcbc,\n 0xccc, 0xccd,\n 0xce2, 0xce3,\n 0xd00, 0xd01,\n 0xd3b, 0xd3c,\n 0xd41, 0xd44,\n 0xd4d, 0xd4d,\n 0xd62, 0xd63,\n 0xd81, 0xd81,\n 0xdca, 0xdca,\n 0xdd2, 0xdd4,\n 0xdd6, 0xdd6,\n 0xe31, 0xe31,\n 0xe34, 0xe3a,\n 0xe3f, 0xe3f,\n 0xe47, 0xe4e,\n 0xeb1, 0xeb1,\n 0xeb4, 0xebc,\n 0xec8, 0xece,\n 0xf18, 0xf19,\n 0xf35, 0xf35,\n 0xf37, 0xf37,\n 0xf39, 0xf3d,\n 0xf71, 0xf7e,\n 0xf80, 0xf84,\n 0xf86, 0xf87,\n 0xf8d, 0xf97,\n 0xf99, 0xfbc,\n 0xfc6, 0xfc6,\n 0x102d, 0x1030,\n 0x1032, 0x1037,\n 0x1039, 0x103a,\n 0x103d, 0x103e,\n 0x1058, 0x1059,\n 0x105e, 0x1060,\n 0x1071, 0x1074,\n 0x1082, 0x1082,\n 0x1085, 0x1086,\n 0x108d, 0x108d,\n 0x109d, 0x109d,\n 0x135d, 0x135f,\n 0x1390, 0x1399,\n 0x1400, 0x1400,\n 0x1680, 0x1680,\n 0x169b, 0x169c,\n 0x1712, 0x1714,\n 0x1732, 0x1733,\n 0x1752, 0x1753,\n 0x1772, 0x1773,\n 0x17b4, 0x17b5,\n 0x17b7, 0x17bd,\n 0x17c6, 0x17c6,\n 0x17c9, 0x17d3,\n 0x17db, 0x17db,\n 0x17dd, 0x17dd,\n 0x17f0, 0x17f9,\n 0x1800, 0x180f,\n 0x1885, 0x1886,\n 0x18a9, 0x18a9,\n 0x1920, 0x1922,\n 0x1927, 0x1928,\n 0x1932, 0x1932,\n 0x1939, 0x193b,\n 0x1940, 0x1940,\n 0x1944, 0x1945,\n 0x19de, 0x19ff,\n 0x1a17, 0x1a18,\n 0x1a1b, 0x1a1b,\n 0x1a56, 0x1a56,\n 0x1a58, 0x1a5e,\n 0x1a60, 0x1a60,\n 0x1a62, 0x1a62,\n 0x1a65, 0x1a6c,\n 0x1a73, 0x1a7c,\n 0x1a7f, 0x1a7f,\n 0x1ab0, 0x1add,\n 0x1ae0, 0x1aeb,\n 0x1b00, 0x1b03,\n 0x1b34, 0x1b34,\n 0x1b36, 0x1b3a,\n 0x1b3c, 0x1b3c,\n 0x1b42, 0x1b42,\n 0x1b6b, 0x1b73,\n 0x1b80, 0x1b81,\n 0x1ba2, 0x1ba5,\n 0x1ba8, 0x1ba9,\n 0x1bab, 0x1bad,\n 0x1be6, 0x1be6,\n 0x1be8, 0x1be9,\n 0x1bed, 0x1bed,\n 0x1bef, 0x1bf1,\n 0x1c2c, 0x1c33,\n 0x1c36, 0x1c37,\n 0x1cd0, 0x1cd2,\n 0x1cd4, 0x1ce0,\n 0x1ce2, 0x1ce8,\n 0x1ced, 0x1ced,\n 0x1cf4, 0x1cf4,\n 0x1cf8, 0x1cf9,\n 0x1dc0, 0x1dff,\n 0x1fbd, 0x1fbd,\n 0x1fbf, 0x1fc1,\n 0x1fcd, 0x1fcf,\n 0x1fdd, 0x1fdf,\n 0x1fed, 0x1fef,\n 0x1ffd, 0x1ffe,\n 0x2000, 0x200d,\n 0x2010, 0x2070,\n 0x2074, 0x207e,\n 0x2080, 0x208e,\n 0x20a0, 0x20f0,\n 0x2100, 0x2101,\n 0x2103, 0x2106,\n 0x2108, 0x2109,\n 0x2114, 0x2114,\n 0x2116, 0x2118,\n 0x211e, 0x2123,\n 0x2125, 0x2125,\n 0x2127, 0x2127,\n 0x2129, 0x2129,\n 0x212e, 0x212e,\n 0x213a, 0x213b,\n 0x2140, 0x2144,\n 0x214a, 0x214d,\n 0x2150, 0x215f,\n 0x2189, 0x218b,\n 0x2190, 0x2335,\n 0x237b, 0x2394,\n 0x2396, 0x2429,\n 0x2440, 0x244a,\n 0x2460, 0x249b,\n 0x24ea, 0x26ab,\n 0x26ad, 0x27ff,\n 0x2900, 0x2b73,\n 0x2b76, 0x2bff,\n 0x2ce5, 0x2cea,\n 0x2cef, 0x2cf1,\n 0x2cf9, 0x2cff,\n 0x2d7f, 0x2d7f,\n 0x2de0, 0x2e5d,\n 0x2e80, 0x2e99,\n 0x2e9b, 0x2ef3,\n 0x2f00, 0x2fd5,\n 0x2ff0, 0x3004,\n 0x3008, 0x3020,\n 0x302a, 0x302d,\n 0x3030, 0x3030,\n 0x3036, 0x3037,\n 0x303d, 0x303f,\n 0x3099, 0x309c,\n 0x30a0, 0x30a0,\n 0x30fb, 0x30fb,\n 0x31c0, 0x31e5,\n 0x31ef, 0x31ef,\n 0x321d, 0x321e,\n 0x3250, 0x325f,\n 0x327c, 0x327e,\n 0x32b1, 0x32bf,\n 0x32cc, 0x32cf,\n 0x3377, 0x337a,\n 0x33de, 0x33df,\n 0x33ff, 0x33ff,\n 0x4dc0, 0x4dff,\n 0xa490, 0xa4c6,\n 0xa60d, 0xa60f,\n 0xa66f, 0xa67f,\n 0xa69e, 0xa69f,\n 0xa6f0, 0xa6f1,\n 0xa700, 0xa721,\n 0xa788, 0xa788,\n 0xa802, 0xa802,\n 0xa806, 0xa806,\n 0xa80b, 0xa80b,\n 0xa825, 0xa826,\n 0xa828, 0xa82c,\n 0xa838, 0xa839,\n 0xa874, 0xa877,\n 0xa8c4, 0xa8c5,\n 0xa8e0, 0xa8f1,\n 0xa8ff, 0xa8ff,\n 0xa926, 0xa92d,\n 0xa947, 0xa951,\n 0xa980, 0xa982,\n 0xa9b3, 0xa9b3,\n 0xa9b6, 0xa9b9,\n 0xa9bc, 0xa9bd,\n 0xa9e5, 0xa9e5,\n 0xaa29, 0xaa2e,\n 0xaa31, 0xaa32,\n 0xaa35, 0xaa36,\n 0xaa43, 0xaa43,\n 0xaa4c, 0xaa4c,\n 0xaa7c, 0xaa7c,\n 0xaab0, 0xaab0,\n 0xaab2, 0xaab4,\n 0xaab7, 0xaab8,\n 0xaabe, 0xaabf,\n 0xaac1, 0xaac1,\n 0xaaec, 0xaaed,\n 0xaaf6, 0xaaf6,\n 0xab6a, 0xab6b,\n 0xabe5, 0xabe5,\n 0xabe8, 0xabe8,\n 0xabed, 0xabed,\n 0xfb1e, 0xfb1e,\n 0xfb29, 0xfb29,\n 0xfbc3, 0xfbd2,\n 0xfd3e, 0xfd4f,\n 0xfd90, 0xfd91,\n 0xfdc8, 0xfdef,\n 0xfdfd, 0xfe19,\n 0xfe20, 0xfe52,\n 0xfe54, 0xfe66,\n 0xfe68, 0xfe6b,\n 0xfeff, 0xfeff,\n 0xff01, 0xff20,\n 0xff3b, 0xff40,\n 0xff5b, 0xff65,\n 0xffe0, 0xffe6,\n 0xffe8, 0xffee,\n 0xfff0, 0xffff,\n 0x10101, 0x10101,\n 0x10140, 0x1018c,\n 0x10190, 0x1019c,\n 0x101a0, 0x101a0,\n 0x101fd, 0x101fd,\n 0x102e0, 0x102fb,\n 0x10376, 0x1037a,\n 0x1091f, 0x1091f,\n 0x10a01, 0x10a03,\n 0x10a05, 0x10a06,\n 0x10a0c, 0x10a0f,\n 0x10a38, 0x10a3a,\n 0x10a3f, 0x10a3f,\n 0x10ae5, 0x10ae6,\n 0x10b39, 0x10b3f,\n 0x10d24, 0x10d27,\n 0x10d30, 0x10d39,\n 0x10d40, 0x10d49,\n 0x10d69, 0x10d6e,\n 0x10e60, 0x10e7e,\n 0x10eab, 0x10eac,\n 0x10ed0, 0x10ed8,\n 0x10efa, 0x10eff,\n 0x10f46, 0x10f50,\n 0x10f82, 0x10f85,\n 0x11001, 0x11001,\n 0x11038, 0x11046,\n 0x11052, 0x11065,\n 0x11070, 0x11070,\n 0x11073, 0x11074,\n 0x1107f, 0x11081,\n 0x110b3, 0x110b6,\n 0x110b9, 0x110ba,\n 0x110c2, 0x110c2,\n 0x11100, 0x11102,\n 0x11127, 0x1112b,\n 0x1112d, 0x11134,\n 0x11173, 0x11173,\n 0x11180, 0x11181,\n 0x111b6, 0x111be,\n 0x111c9, 0x111cc,\n 0x111cf, 0x111cf,\n 0x1122f, 0x11231,\n 0x11234, 0x11234,\n 0x11236, 0x11237,\n 0x1123e, 0x1123e,\n 0x11241, 0x11241,\n 0x112df, 0x112df,\n 0x112e3, 0x112ea,\n 0x11300, 0x11301,\n 0x1133b, 0x1133c,\n 0x11340, 0x11340,\n 0x11366, 0x1136c,\n 0x11370, 0x11374,\n 0x113bb, 0x113c0,\n 0x113ce, 0x113ce,\n 0x113d0, 0x113d0,\n 0x113d2, 0x113d2,\n 0x113e1, 0x113e2,\n 0x11438, 0x1143f,\n 0x11442, 0x11444,\n 0x11446, 0x11446,\n 0x1145e, 0x1145e,\n 0x114b3, 0x114b8,\n 0x114ba, 0x114ba,\n 0x114bf, 0x114c0,\n 0x114c2, 0x114c3,\n 0x115b2, 0x115b5,\n 0x115bc, 0x115bd,\n 0x115bf, 0x115c0,\n 0x115dc, 0x115dd,\n 0x11633, 0x1163a,\n 0x1163d, 0x1163d,\n 0x1163f, 0x11640,\n 0x11660, 0x1166c,\n 0x116ab, 0x116ab,\n 0x116ad, 0x116ad,\n 0x116b0, 0x116b5,\n 0x116b7, 0x116b7,\n 0x1171d, 0x1171d,\n 0x1171f, 0x1171f,\n 0x11722, 0x11725,\n 0x11727, 0x1172b,\n 0x1182f, 0x11837,\n 0x11839, 0x1183a,\n 0x1193b, 0x1193c,\n 0x1193e, 0x1193e,\n 0x11943, 0x11943,\n 0x119d4, 0x119d7,\n 0x119da, 0x119db,\n 0x119e0, 0x119e0,\n 0x11a01, 0x11a06,\n 0x11a09, 0x11a0a,\n 0x11a33, 0x11a38,\n 0x11a3b, 0x11a3e,\n 0x11a47, 0x11a47,\n 0x11a51, 0x11a56,\n 0x11a59, 0x11a5b,\n 0x11a8a, 0x11a96,\n 0x11a98, 0x11a99,\n 0x11b60, 0x11b60,\n 0x11b62, 0x11b64,\n 0x11b66, 0x11b66,\n 0x11c30, 0x11c36,\n 0x11c38, 0x11c3d,\n 0x11c92, 0x11ca7,\n 0x11caa, 0x11cb0,\n 0x11cb2, 0x11cb3,\n 0x11cb5, 0x11cb6,\n 0x11d31, 0x11d36,\n 0x11d3a, 0x11d3a,\n 0x11d3c, 0x11d3d,\n 0x11d3f, 0x11d45,\n 0x11d47, 0x11d47,\n 0x11d90, 0x11d91,\n 0x11d95, 0x11d95,\n 0x11d97, 0x11d97,\n 0x11ef3, 0x11ef4,\n 0x11f00, 0x11f01,\n 0x11f36, 0x11f3a,\n 0x11f40, 0x11f40,\n 0x11f42, 0x11f42,\n 0x11f5a, 0x11f5a,\n 0x11fd5, 0x11ff1,\n 0x13440, 0x13440,\n 0x13447, 0x13455,\n 0x1611e, 0x16129,\n 0x1612d, 0x1612f,\n 0x16af0, 0x16af4,\n 0x16b30, 0x16b36,\n 0x16f4f, 0x16f4f,\n 0x16f8f, 0x16f92,\n 0x16fe2, 0x16fe2,\n 0x16fe4, 0x16fe4,\n 0x1bc9d, 0x1bc9e,\n 0x1bca0, 0x1bca3,\n 0x1cc00, 0x1ccd5,\n 0x1ccf0, 0x1ccfc,\n 0x1cd00, 0x1ceb3,\n 0x1ceba, 0x1ced0,\n 0x1cee0, 0x1cef0,\n 0x1cf00, 0x1cf2d,\n 0x1cf30, 0x1cf46,\n 0x1d167, 0x1d169,\n 0x1d173, 0x1d182,\n 0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f7e0, 0x1f7eb,\n 0x1f7f0, 0x1f7f0,\n 0x1f800, 0x1f80b,\n 0x1f810, 0x1f847,\n 0x1f850, 0x1f859,\n 0x1f860, 0x1f887,\n 0x1f890, 0x1f8ad,\n 0x1f8b0, 0x1f8bb,\n 0x1f8c0, 0x1f8c1,\n 0x1f8d0, 0x1f8d8,\n 0x1f900, 0x1fa57,\n 0x1fa60, 0x1fa6d,\n 0x1fa70, 0x1fa7c,\n 0x1fa80, 0x1fa8a,\n 0x1fa8e, 0x1fac6,\n 0x1fac8, 0x1fac8,\n 0x1facd, 0x1fadc,\n 0x1fadf, 0x1faea,\n 0x1faef, 0x1faf8,\n 0x1fb00, 0x1fb92,\n 0x1fb94, 0x1fbfa,\n 0x1fffe, 0x1ffff,\n 0x2fffe, 0x2ffff,\n 0x3fffe, 0x3ffff,\n 0x4fffe, 0x4ffff,\n 0x5fffe, 0x5ffff,\n 0x6fffe, 0x6ffff,\n 0x7fffe, 0x7ffff,\n 0x8fffe, 0x8ffff,\n 0x9fffe, 0x9ffff,\n 0xafffe, 0xaffff,\n 0xbfffe, 0xbffff,\n 0xcfffe, 0xcffff,\n 0xdfffe, 0xe0fff,\n 0xefffe, 0xeffff,\n 0xffffe, 0xfffff,\n 0x10fffe, 0x10ffff\n];\n\nexport const NATURAL_LETTER_RANGES: ReadonlyArray = [\n 0x41, 0x5a,\n 0x61, 0x7a,\n 0xaa, 0xaa,\n 0xb5, 0xb5,\n 0xba, 0xba,\n 0xc0, 0xd6,\n 0xd8, 0xf6,\n 0xf8, 0x2c1,\n 0x2c6, 0x2d1,\n 0x2e0, 0x2e4,\n 0x2ec, 0x2ec,\n 0x2ee, 0x2ee,\n 0x370, 0x374,\n 0x376, 0x377,\n 0x37a, 0x37d,\n 0x37f, 0x37f,\n 0x386, 0x386,\n 0x388, 0x38a,\n 0x38c, 0x38c,\n 0x38e, 0x3a1,\n 0x3a3, 0x3f5,\n 0x3f7, 0x481,\n 0x48a, 0x52f,\n 0x531, 0x556,\n 0x559, 0x559,\n 0x560, 0x588,\n 0x5d0, 0x5ea,\n 0x5ef, 0x5f2,\n 0x620, 0x64a,\n 0x66e, 0x66f,\n 0x671, 0x6d3,\n 0x6d5, 0x6d5,\n 0x6e5, 0x6e6,\n 0x6ee, 0x6ef,\n 0x6fa, 0x6fc,\n 0x6ff, 0x6ff,\n 0x710, 0x710,\n 0x712, 0x72f,\n 0x74d, 0x7a5,\n 0x7b1, 0x7b1,\n 0x7ca, 0x7ea,\n 0x7f4, 0x7f5,\n 0x7fa, 0x7fa,\n 0x800, 0x815,\n 0x81a, 0x81a,\n 0x824, 0x824,\n 0x828, 0x828,\n 0x840, 0x858,\n 0x860, 0x86a,\n 0x870, 0x887,\n 0x889, 0x88f,\n 0x8a0, 0x8c9,\n 0x904, 0x939,\n 0x93d, 0x93d,\n 0x950, 0x950,\n 0x958, 0x961,\n 0x971, 0x980,\n 0x985, 0x98c,\n 0x98f, 0x990,\n 0x993, 0x9a8,\n 0x9aa, 0x9b0,\n 0x9b2, 0x9b2,\n 0x9b6, 0x9b9,\n 0x9bd, 0x9bd,\n 0x9ce, 0x9ce,\n 0x9dc, 0x9dd,\n 0x9df, 0x9e1,\n 0x9f0, 0x9f1,\n 0x9fc, 0x9fc,\n 0xa05, 0xa0a,\n 0xa0f, 0xa10,\n 0xa13, 0xa28,\n 0xa2a, 0xa30,\n 0xa32, 0xa33,\n 0xa35, 0xa36,\n 0xa38, 0xa39,\n 0xa59, 0xa5c,\n 0xa5e, 0xa5e,\n 0xa72, 0xa74,\n 0xa85, 0xa8d,\n 0xa8f, 0xa91,\n 0xa93, 0xaa8,\n 0xaaa, 0xab0,\n 0xab2, 0xab3,\n 0xab5, 0xab9,\n 0xabd, 0xabd,\n 0xad0, 0xad0,\n 0xae0, 0xae1,\n 0xaf9, 0xaf9,\n 0xb05, 0xb0c,\n 0xb0f, 0xb10,\n 0xb13, 0xb28,\n 0xb2a, 0xb30,\n 0xb32, 0xb33,\n 0xb35, 0xb39,\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,\n 0x1065, 0x1066,\n 0x106e, 0x1070,\n 0x1075, 0x1081,\n 0x108e, 0x108e,\n 0x10a0, 0x10c5,\n 0x10c7, 0x10c7,\n 0x10cd, 0x10cd,\n 0x10d0, 0x10fa,\n 0x10fc, 0x1248,\n 0x124a, 0x124d,\n 0x1250, 0x1256,\n 0x1258, 0x1258,\n 0x125a, 0x125d,\n 0x1260, 0x1288,\n 0x128a, 0x128d,\n 0x1290, 0x12b0,\n 0x12b2, 0x12b5,\n 0x12b8, 0x12be,\n 0x12c0, 0x12c0,\n 0x12c2, 0x12c5,\n 0x12c8, 0x12d6,\n 0x12d8, 0x1310,\n 0x1312, 0x1315,\n 0x1318, 0x135a,\n 0x1380, 0x138f,\n 0x13a0, 0x13f5,\n 0x13f8, 0x13fd,\n 0x1401, 0x166c,\n 0x166f, 0x167f,\n 0x1681, 0x169a,\n 0x16a0, 0x16ea,\n 0x16f1, 0x16f8,\n 0x1700, 0x1711,\n 0x171f, 0x1731,\n 0x1740, 0x1751,\n 0x1760, 0x176c,\n 0x176e, 0x1770,\n 0x1780, 0x17b3,\n 0x17d7, 0x17d7,\n 0x17dc, 0x17dc,\n 0x1820, 0x1878,\n 0x1880, 0x1884,\n 0x1887, 0x18a8,\n 0x18aa, 0x18aa,\n 0x18b0, 0x18f5,\n 0x1900, 0x191e,\n 0x1950, 0x196d,\n 0x1970, 0x1974,\n 0x1980, 0x19ab,\n 0x19b0, 0x19c9,\n 0x1a00, 0x1a16,\n 0x1a20, 0x1a54,\n 0x1aa7, 0x1aa7,\n 0x1b05, 0x1b33,\n 0x1b45, 0x1b4c,\n 0x1b83, 0x1ba0,\n 0x1bae, 0x1baf,\n 0x1bba, 0x1be5,\n 0x1c00, 0x1c23,\n 0x1c4d, 0x1c4f,\n 0x1c5a, 0x1c7d,\n 0x1c80, 0x1c8a,\n 0x1c90, 0x1cba,\n 0x1cbd, 0x1cbf,\n 0x1ce9, 0x1cec,\n 0x1cee, 0x1cf3,\n 0x1cf5, 0x1cf6,\n 0x1cfa, 0x1cfa,\n 0x1d00, 0x1dbf,\n 0x1e00, 0x1f15,\n 0x1f18, 0x1f1d,\n 0x1f20, 0x1f45,\n 0x1f48, 0x1f4d,\n 0x1f50, 0x1f57,\n 0x1f59, 0x1f59,\n 0x1f5b, 0x1f5b,\n 0x1f5d, 0x1f5d,\n 0x1f5f, 0x1f7d,\n 0x1f80, 0x1fb4,\n 0x1fb6, 0x1fbc,\n 0x1fbe, 0x1fbe,\n 0x1fc2, 0x1fc4,\n 0x1fc6, 0x1fcc,\n 0x1fd0, 0x1fd3,\n 0x1fd6, 0x1fdb,\n 0x1fe0, 0x1fec,\n 0x1ff2, 0x1ff4,\n 0x1ff6, 0x1ffc,\n 0x2071, 0x2071,\n 0x207f, 0x207f,\n 0x2090, 0x209c,\n 0x2102, 0x2102,\n 0x2107, 0x2107,\n 0x210a, 0x2113,\n 0x2115, 0x2115,\n 0x2119, 0x211d,\n 0x2124, 0x2124,\n 0x2126, 0x2126,\n 0x2128, 0x2128,\n 0x212a, 0x212d,\n 0x212f, 0x2139,\n 0x213c, 0x213f,\n 0x2145, 0x2149,\n 0x214e, 0x214e,\n 0x2183, 0x2184,\n 0x2c00, 0x2ce4,\n 0x2ceb, 0x2cee,\n 0x2cf2, 0x2cf3,\n 0x2d00, 0x2d25,\n 0x2d27, 0x2d27,\n 0x2d2d, 0x2d2d,\n 0x2d30, 0x2d67,\n 0x2d6f, 0x2d6f,\n 0x2d80, 0x2d96,\n 0x2da0, 0x2da6,\n 0x2da8, 0x2dae,\n 0x2db0, 0x2db6,\n 0x2db8, 0x2dbe,\n 0x2dc0, 0x2dc6,\n 0x2dc8, 0x2dce,\n 0x2dd0, 0x2dd6,\n 0x2dd8, 0x2dde,\n 0x2e2f, 0x2e2f,\n 0x3005, 0x3006,\n 0x3031, 0x3035,\n 0x303b, 0x303c,\n 0x3041, 0x3096,\n 0x309d, 0x309f,\n 0x30a1, 0x30fa,\n 0x30fc, 0x30ff,\n 0x3105, 0x312f,\n 0x3131, 0x318e,\n 0x31a0, 0x31bf,\n 0x31f0, 0x31ff,\n 0x3400, 0x4dbf,\n 0x4e00, 0xa48c,\n 0xa4d0, 0xa4fd,\n 0xa500, 0xa60c,\n 0xa610, 0xa61f,\n 0xa62a, 0xa62b,\n 0xa640, 0xa66e,\n 0xa67f, 0xa69d,\n 0xa6a0, 0xa6e5,\n 0xa717, 0xa71f,\n 0xa722, 0xa788,\n 0xa78b, 0xa7dc,\n 0xa7f1, 0xa801,\n 0xa803, 0xa805,\n 0xa807, 0xa80a,\n 0xa80c, 0xa822,\n 0xa840, 0xa873,\n 0xa882, 0xa8b3,\n 0xa8f2, 0xa8f7,\n 0xa8fb, 0xa8fb,\n 0xa8fd, 0xa8fe,\n 0xa90a, 0xa925,\n 0xa930, 0xa946,\n 0xa960, 0xa97c,\n 0xa984, 0xa9b2,\n 0xa9cf, 0xa9cf,\n 0xa9e0, 0xa9e4,\n 0xa9e6, 0xa9ef,\n 0xa9fa, 0xa9fe,\n 0xaa00, 0xaa28,\n 0xaa40, 0xaa42,\n 0xaa44, 0xaa4b,\n 0xaa60, 0xaa76,\n 0xaa7a, 0xaa7a,\n 0xaa7e, 0xaaaf,\n 0xaab1, 0xaab1,\n 0xaab5, 0xaab6,\n 0xaab9, 0xaabd,\n 0xaac0, 0xaac0,\n 0xaac2, 0xaac2,\n 0xaadb, 0xaadd,\n 0xaae0, 0xaaea,\n 0xaaf2, 0xaaf4,\n 0xab01, 0xab06,\n 0xab09, 0xab0e,\n 0xab11, 0xab16,\n 0xab20, 0xab26,\n 0xab28, 0xab2e,\n 0xab30, 0xab5a,\n 0xab5c, 0xab69,\n 0xab70, 0xabe2,\n 0xac00, 0xd7a3,\n 0xd7b0, 0xd7c6,\n 0xd7cb, 0xd7fb,\n 0xf900, 0xfa6d,\n 0xfa70, 0xfad9,\n 0xfb00, 0xfb06,\n 0xfb13, 0xfb17,\n 0xfb1d, 0xfb1d,\n 0xfb1f, 0xfb28,\n 0xfb2a, 0xfb36,\n 0xfb38, 0xfb3c,\n 0xfb3e, 0xfb3e,\n 0xfb40, 0xfb41,\n 0xfb43, 0xfb44,\n 0xfb46, 0xfbb1,\n 0xfbd3, 0xfd3d,\n 0xfd50, 0xfd8f,\n 0xfd92, 0xfdc7,\n 0xfdf0, 0xfdfb,\n 0xfe70, 0xfe74,\n 0xfe76, 0xfefc,\n 0xff21, 0xff3a,\n 0xff41, 0xff5a,\n 0xff66, 0xffbe,\n 0xffc2, 0xffc7,\n 0xffca, 0xffcf,\n 0xffd2, 0xffd7,\n 0xffda, 0xffdc,\n 0x10000, 0x1000b,\n 0x1000d, 0x10026,\n 0x10028, 0x1003a,\n 0x1003c, 0x1003d,\n 0x1003f, 0x1004d,\n 0x10050, 0x1005d,\n 0x10080, 0x100fa,\n 0x10280, 0x1029c,\n 0x102a0, 0x102d0,\n 0x10300, 0x1031f,\n 0x1032d, 0x10340,\n 0x10342, 0x10349,\n 0x10350, 0x10375,\n 0x10380, 0x1039d,\n 0x103a0, 0x103c3,\n 0x103c8, 0x103cf,\n 0x10400, 0x1049d,\n 0x104b0, 0x104d3,\n 0x104d8, 0x104fb,\n 0x10500, 0x10527,\n 0x10530, 0x10563,\n 0x10570, 0x1057a,\n 0x1057c, 0x1058a,\n 0x1058c, 0x10592,\n 0x10594, 0x10595,\n 0x10597, 0x105a1,\n 0x105a3, 0x105b1,\n 0x105b3, 0x105b9,\n 0x105bb, 0x105bc,\n 0x105c0, 0x105f3,\n 0x10600, 0x10736,\n 0x10740, 0x10755,\n 0x10760, 0x10767,\n 0x10780, 0x10785,\n 0x10787, 0x107b0,\n 0x107b2, 0x107ba,\n 0x10800, 0x10805,\n 0x10808, 0x10808,\n 0x1080a, 0x10835,\n 0x10837, 0x10838,\n 0x1083c, 0x1083c,\n 0x1083f, 0x10855,\n 0x10860, 0x10876,\n 0x10880, 0x1089e,\n 0x108e0, 0x108f2,\n 0x108f4, 0x108f5,\n 0x10900, 0x10915,\n 0x10920, 0x10939,\n 0x10940, 0x10959,\n 0x10980, 0x109b7,\n 0x109be, 0x109bf,\n 0x10a00, 0x10a00,\n 0x10a10, 0x10a13,\n 0x10a15, 0x10a17,\n 0x10a19, 0x10a35,\n 0x10a60, 0x10a7c,\n 0x10a80, 0x10a9c,\n 0x10ac0, 0x10ac7,\n 0x10ac9, 0x10ae4,\n 0x10b00, 0x10b35,\n 0x10b40, 0x10b55,\n 0x10b60, 0x10b72,\n 0x10b80, 0x10b91,\n 0x10c00, 0x10c48,\n 0x10c80, 0x10cb2,\n 0x10cc0, 0x10cf2,\n 0x10d00, 0x10d23,\n 0x10d4a, 0x10d65,\n 0x10d6f, 0x10d85,\n 0x10e80, 0x10ea9,\n 0x10eb0, 0x10eb1,\n 0x10ec2, 0x10ec7,\n 0x10f00, 0x10f1c,\n 0x10f27, 0x10f27,\n 0x10f30, 0x10f45,\n 0x10f70, 0x10f81,\n 0x10fb0, 0x10fc4,\n 0x10fe0, 0x10ff6,\n 0x11003, 0x11037,\n 0x11071, 0x11072,\n 0x11075, 0x11075,\n 0x11083, 0x110af,\n 0x110d0, 0x110e8,\n 0x11103, 0x11126,\n 0x11144, 0x11144,\n 0x11147, 0x11147,\n 0x11150, 0x11172,\n 0x11176, 0x11176,\n 0x11183, 0x111b2,\n 0x111c1, 0x111c4,\n 0x111da, 0x111da,\n 0x111dc, 0x111dc,\n 0x11200, 0x11211,\n 0x11213, 0x1122b,\n 0x1123f, 0x11240,\n 0x11280, 0x11286,\n 0x11288, 0x11288,\n 0x1128a, 0x1128d,\n 0x1128f, 0x1129d,\n 0x1129f, 0x112a8,\n 0x112b0, 0x112de,\n 0x11305, 0x1130c,\n 0x1130f, 0x11310,\n 0x11313, 0x11328,\n 0x1132a, 0x11330,\n 0x11332, 0x11333,\n 0x11335, 0x11339,\n 0x1133d, 0x1133d,\n 0x11350, 0x11350,\n 0x1135d, 0x11361,\n 0x11380, 0x11389,\n 0x1138b, 0x1138b,\n 0x1138e, 0x1138e,\n 0x11390, 0x113b5,\n 0x113b7, 0x113b7,\n 0x113d1, 0x113d1,\n 0x113d3, 0x113d3,\n 0x11400, 0x11434,\n 0x11447, 0x1144a,\n 0x1145f, 0x11461,\n 0x11480, 0x114af,\n 0x114c4, 0x114c5,\n 0x114c7, 0x114c7,\n 0x11580, 0x115ae,\n 0x115d8, 0x115db,\n 0x11600, 0x1162f,\n 0x11644, 0x11644,\n 0x11680, 0x116aa,\n 0x116b8, 0x116b8,\n 0x11700, 0x1171a,\n 0x11740, 0x11746,\n 0x11800, 0x1182b,\n 0x118a0, 0x118df,\n 0x118ff, 0x11906,\n 0x11909, 0x11909,\n 0x1190c, 0x11913,\n 0x11915, 0x11916,\n 0x11918, 0x1192f,\n 0x1193f, 0x1193f,\n 0x11941, 0x11941,\n 0x119a0, 0x119a7,\n 0x119aa, 0x119d0,\n 0x119e1, 0x119e1,\n 0x119e3, 0x119e3,\n 0x11a00, 0x11a00,\n 0x11a0b, 0x11a32,\n 0x11a3a, 0x11a3a,\n 0x11a50, 0x11a50,\n 0x11a5c, 0x11a89,\n 0x11a9d, 0x11a9d,\n 0x11ab0, 0x11af8,\n 0x11bc0, 0x11be0,\n 0x11c00, 0x11c08,\n 0x11c0a, 0x11c2e,\n 0x11c40, 0x11c40,\n 0x11c72, 0x11c8f,\n 0x11d00, 0x11d06,\n 0x11d08, 0x11d09,\n 0x11d0b, 0x11d30,\n 0x11d46, 0x11d46,\n 0x11d60, 0x11d65,\n 0x11d67, 0x11d68,\n 0x11d6a, 0x11d89,\n 0x11d98, 0x11d98,\n 0x11db0, 0x11ddb,\n 0x11ee0, 0x11ef2,\n 0x11f02, 0x11f02,\n 0x11f04, 0x11f10,\n 0x11f12, 0x11f33,\n 0x11fb0, 0x11fb0,\n 0x12000, 0x12399,\n 0x12480, 0x12543,\n 0x12f90, 0x12ff0,\n 0x13000, 0x1342f,\n 0x13441, 0x13446,\n 0x13460, 0x143fa,\n 0x14400, 0x14646,\n 0x16100, 0x1611d,\n 0x16800, 0x16a38,\n 0x16a40, 0x16a5e,\n 0x16a70, 0x16abe,\n 0x16ad0, 0x16aed,\n 0x16b00, 0x16b2f,\n 0x16b40, 0x16b43,\n 0x16b63, 0x16b77,\n 0x16b7d, 0x16b8f,\n 0x16d40, 0x16d6c,\n 0x16e40, 0x16e7f,\n 0x16ea0, 0x16eb8,\n 0x16ebb, 0x16ed3,\n 0x16f00, 0x16f4a,\n 0x16f50, 0x16f50,\n 0x16f93, 0x16f9f,\n 0x16fe0, 0x16fe1,\n 0x16fe3, 0x16fe3,\n 0x16ff2, 0x16ff3,\n 0x17000, 0x18cd5,\n 0x18cff, 0x18d1e,\n 0x18d80, 0x18df2,\n 0x1aff0, 0x1aff3,\n 0x1aff5, 0x1affb,\n 0x1affd, 0x1affe,\n 0x1b000, 0x1b122,\n 0x1b132, 0x1b132,\n 0x1b150, 0x1b152,\n 0x1b155, 0x1b155,\n 0x1b164, 0x1b167,\n 0x1b170, 0x1b2fb,\n 0x1bc00, 0x1bc6a,\n 0x1bc70, 0x1bc7c,\n 0x1bc80, 0x1bc88,\n 0x1bc90, 0x1bc99,\n 0x1d400, 0x1d454,\n 0x1d456, 0x1d49c,\n 0x1d49e, 0x1d49f,\n 0x1d4a2, 0x1d4a2,\n 0x1d4a5, 0x1d4a6,\n 0x1d4a9, 0x1d4ac,\n 0x1d4ae, 0x1d4b9,\n 0x1d4bb, 0x1d4bb,\n 0x1d4bd, 0x1d4c3,\n 0x1d4c5, 0x1d505,\n 0x1d507, 0x1d50a,\n 0x1d50d, 0x1d514,\n 0x1d516, 0x1d51c,\n 0x1d51e, 0x1d539,\n 0x1d53b, 0x1d53e,\n 0x1d540, 0x1d544,\n 0x1d546, 0x1d546,\n 0x1d54a, 0x1d550,\n 0x1d552, 0x1d6a5,\n 0x1d6a8, 0x1d6c0,\n 0x1d6c2, 0x1d6da,\n 0x1d6dc, 0x1d6fa,\n 0x1d6fc, 0x1d714,\n 0x1d716, 0x1d734,\n 0x1d736, 0x1d74e,\n 0x1d750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1ee79, 0x1ee7c,\n 0x1ee7e, 0x1ee7e,\n 0x1ee80, 0x1ee89,\n 0x1ee8b, 0x1ee9b,\n 0x1eea1, 0x1eea3,\n 0x1eea5, 0x1eea9,\n 0x1eeab, 0x1eebb,\n 0x20000, 0x2a6df,\n 0x2a700, 0x2b81d,\n 0x2b820, 0x2cead,\n 0x2ceb0, 0x2ebe0,\n 0x2ebf0, 0x2ee5d,\n 0x2f800, 0x2fa1d,\n 0x30000, 0x3134a,\n 0x31350, 0x33479\n];\n", "import type { Direction } from './types.js';\nimport {\n NON_STRONG_BIDI_RANGES,\n NATURAL_LETTER_RANGES,\n RTL_BIDI_RANGES,\n UNICODE_BIDI_SHA256,\n UNICODE_GENERAL_CATEGORY_SHA256,\n UNICODE_BIDI_VERSION\n} from './generated/bidi-ranges.js';\n\nfunction isInRanges(codePoint: number, ranges: ReadonlyArray): boolean {\n let low = 0;\n let high = ranges.length / 2 - 1;\n while (low <= high) {\n const middle = (low + high) >> 1;\n const start = ranges[middle * 2]!;\n const end = ranges[middle * 2 + 1]!;\n if (codePoint < start) high = middle - 1;\n else if (codePoint > end) low = middle + 1;\n else return true;\n }\n return false;\n}\n\nexport function isRtlCodePoint(codePoint: number): boolean {\n return isInRanges(codePoint, RTL_BIDI_RANGES);\n}\n\n/** Returns the Unicode Bidi_Class strong direction, including LRM/RLM/ALM. */\nexport function classifyBidiStrongCharacter(character: string): Direction {\n const codePoint = character.codePointAt(0);\n if (codePoint === undefined || isInRanges(codePoint, NON_STRONG_BIDI_RANGES)) return 'neutral';\n return isRtlCodePoint(codePoint) ? 'rtl' : 'ltr';\n}\n\n/** Classifies natural-language letters while leaving numbers and punctuation neutral. */\nexport function classifyCharacter(character: string): Direction {\n const codePoint = character.codePointAt(0);\n if (codePoint === undefined) return 'neutral';\n return isInRanges(codePoint, NATURAL_LETTER_RANGES) ? classifyBidiStrongCharacter(character) : 'neutral';\n}\n\nexport const UNICODE_DATA_VERSION = UNICODE_BIDI_VERSION;\nexport const UNICODE_DATA_SHA256 = UNICODE_BIDI_SHA256;\nexport const UNICODE_LETTER_DATA_SHA256 = UNICODE_GENERAL_CATEGORY_SHA256;\n", "import { classifyBidiStrongCharacter, classifyCharacter } from './classify.js';\nimport type {\n DetectionOptions,\n Direction,\n ParagraphAnalysis,\n StrongCharacterCounts,\n TextAnalysis\n} from './types.js';\n\nexport interface TechnicalTokenRange {\n text: string;\n start: number;\n end: number;\n kind: 'code' | 'url' | 'email' | 'path' | 'version' | 'hash' | 'identifier' | 'number' | 'command' | 'math' | 'html';\n}\n\nconst DEFAULT_OPTIONS: Required = {\n strategy: 'content-majority',\n fallback: 'neutral',\n inheritedDirection: 'ltr',\n minimumStrongCharacters: 1,\n majorityThreshold: 0.5,\n excludeTechnicalTokens: true,\n technicalIdentifiers: []\n};\n\nexport const DEFAULT_TECHNICAL_IDENTIFIERS = Object.freeze([\n 'ai', 'api', 'anthropic', 'chatgpt', 'claude', 'cli', 'codex', 'copilot', 'cursor',\n 'deepseek', 'electron', 'gemini', 'github', 'gitlab', 'grok', 'huggingface',\n 'javascript', 'json', 'llama', 'markdown', 'mistral', 'node', 'npm', 'openai',\n 'python', 'qwen', 'react', 'rust', 'svelte', 'typescript', 'url', 'version',\n 'vscode', 'vue', 'web', 'webpack', 'yaml',\n 'angular', 'astro', 'chrome', 'docker', 'esbuild', 'eslint', 'firefox',\n 'kubernetes', 'kubectl', 'nuxt', 'playwright', 'pnpm', 'preact', 'remix',\n 'rollup', 'safari', 'stencil', 'storybook', 'tailwind', 'turbopack', 'vite',\n 'vitest'\n] as const);\nconst KNOWN_TECHNICAL_TOKENS = new Set(DEFAULT_TECHNICAL_IDENTIFIERS);\nconst CUSTOM_TECHNICAL_IDENTIFIER_CACHE = new WeakMap>();\n\nfunction normalizeOptions(options: DetectionOptions = {}): Required {\n const strategy = options.strategy ?? DEFAULT_OPTIONS.strategy;\n const majorityStrategy = strategy === 'content-majority'\n || strategy === 'semantic-dominant'\n || strategy === 'majority';\n return {\n strategy,\n fallback: options.fallback ?? options.inheritedDirection ?? DEFAULT_OPTIONS.fallback,\n inheritedDirection: options.inheritedDirection ?? DEFAULT_OPTIONS.inheritedDirection,\n minimumStrongCharacters: Math.max(1, options.minimumStrongCharacters ?? DEFAULT_OPTIONS.minimumStrongCharacters),\n majorityThreshold: Math.min(1, Math.max(0.5, options.majorityThreshold ?? DEFAULT_OPTIONS.majorityThreshold)),\n // Compatibility/strict first-strong modes must see the real first strong\n // character (including a leading technical identifier), like dir=\"auto\".\n excludeTechnicalTokens: options.excludeTechnicalTokens ?? majorityStrategy,\n technicalIdentifiers: options.technicalIdentifiers ?? DEFAULT_OPTIONS.technicalIdentifiers\n };\n}\n\nfunction addRange(\n ranges: TechnicalTokenRange[],\n text: string,\n start: number,\n end: number,\n kind: TechnicalTokenRange['kind']\n): void {\n if (end > start) ranges.push({ text: text.slice(start, end), start, end, kind });\n}\n\nfunction addMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const value = match[group];\n if (value === undefined) continue;\n const start = match.index + match[0].indexOf(value);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction trimTechnicalPunctuation(value: string): string {\n let end = value.length;\n while (end > 0 && /[.,;:!?\u060C\u061B\u061F\u3002\u0964\u06D4]/u.test(value[end - 1]!)) end -= 1;\n return end === value.length ? value : value.slice(0, end);\n}\n\nfunction addValidatedMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n validate: (value: string) => boolean,\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const value = match[group];\n if (value === undefined || !validate(value)) continue;\n const start = match.index + match[0].indexOf(value);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction addNormalizedMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n normalize: (value: string) => string,\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const original = match[group];\n if (original === undefined) continue;\n const value = normalize(original);\n if (!value) continue;\n const start = match.index + match[0].indexOf(original);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction isIpv4(value: string): boolean {\n const parts = value.split('.');\n return parts.length === 4 && parts.every((part) => /^\\d{1,3}$/u.test(part) && Number(part) <= 255);\n}\n\nfunction isIpv6(value: string): boolean {\n if (!/^[0-9A-F:]+$/iu.test(value) || !value.includes(':')) return false;\n const compression = value.indexOf('::');\n if (compression !== value.lastIndexOf('::')) return false;\n const sides = compression >= 0 ? value.split('::') : [value];\n const groups = sides.flatMap((side) => side ? side.split(':') : []);\n if (!groups.every((group) => /^[0-9A-F]{1,4}$/iu.test(group))) return false;\n return compression >= 0 ? groups.length < 8 : groups.length === 8;\n}\n\nfunction addCodeRanges(text: string, ranges: TechnicalTokenRange[]): void {\n let fence: { marker: '`' | '~'; length: number; start: number } | undefined;\n const closedFences: Array<{ start: number; end: number }> = [];\n let lineStart = 0;\n while (lineStart < text.length) {\n let lineEnd = lineStart;\n while (lineEnd < text.length && text[lineEnd] !== '\\r' && text[lineEnd] !== '\\n') lineEnd += 1;\n let nextLine = lineEnd;\n if (text[nextLine] === '\\r') nextLine += 1;\n if (text[nextLine] === '\\n') nextLine += 1;\n const line = text.slice(lineStart, lineEnd);\n if (!fence) {\n const openerMatch = /^ {0,3}(`{3,}|~{3,})(.*)$/u.exec(line);\n const opener = openerMatch?.[1];\n const info = openerMatch?.[2] ?? '';\n if (opener && !(opener[0] === '`' && info.includes('`'))) fence = {\n marker: opener[0] as '`' | '~',\n length: opener.length,\n start: lineStart\n };\n } else {\n const closer = /^ {0,3}(`+|~+)[ \\t]*$/u.exec(line)?.[1];\n if (closer?.[0] === fence.marker && closer.length >= fence.length) {\n closedFences.push({ start: fence.start, end: nextLine });\n fence = undefined;\n }\n }\n lineStart = nextLine;\n }\n // Decide once over the union of all closed spans. Scanning each fence's\n // complementary text separately would be quadratic and would mistake code\n // inside a second standalone fence for prose outside the first.\n let fenceIndex = 0;\n let utf16Index = 0;\n let hasOutsideNaturalText = false;\n for (const character of text) {\n while (fenceIndex < closedFences.length && utf16Index >= closedFences[fenceIndex]!.end) {\n fenceIndex += 1;\n }\n const span = closedFences[fenceIndex];\n const insideFence = span !== undefined && utf16Index >= span.start && utf16Index < span.end;\n if (!insideFence && classifyCharacter(character) !== 'neutral') {\n hasOutsideNaturalText = true;\n break;\n }\n utf16Index += character.length;\n }\n // Standalone fenced code keeps its historical raw-text direction evidence.\n // Parser-aware Markdown adapters force code blocks LTR. Excluding complete\n // fences is useful when surrounding prose\u2014not code literals\u2014must decide the\n // containing raw block's natural direction.\n if (hasOutsideNaturalText) {\n for (const span of closedFences) addRange(ranges, text, span.start, span.end, 'code');\n }\n\n const lineExpression = /[^\\r\\n]*/gu;\n let lineMatch: RegExpExecArray | null;\n while ((lineMatch = lineExpression.exec(text)) !== null) {\n const line = lineMatch[0];\n const lineStart = lineMatch.index;\n const runs: Array<{ start: number; length: number }> = [];\n for (let index = 0; index < line.length;) {\n if (line[index] !== '`') {\n index += 1;\n continue;\n }\n const start = index;\n while (index < line.length && line[index] === '`') index += 1;\n runs.push({ start, length: index - start });\n }\n const suffixMaximum = new Array(runs.length + 1).fill(0);\n for (let index = runs.length - 1; index >= 0; index -= 1) {\n suffixMaximum[index] = Math.max(runs[index]!.length, suffixMaximum[index + 1]!);\n }\n let runIndex = 0;\n let cursor = runs[0]?.start ?? 0;\n while (runIndex < runs.length) {\n const opener = runs[runIndex]!;\n const openerEnd = opener.start + opener.length;\n if (cursor >= openerEnd) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n const available = openerEnd - cursor;\n const delimiterLength = Math.min(\n available,\n Math.max(Math.floor(available / 2), suffixMaximum[runIndex + 1]!)\n );\n if (delimiterLength === 0) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n let closingRunIndex = runIndex;\n let closingStart = cursor + delimiterLength;\n if (available - delimiterLength < delimiterLength) {\n closingRunIndex += 1;\n while (closingRunIndex < runs.length\n && runs[closingRunIndex]!.length < delimiterLength) closingRunIndex += 1;\n if (closingRunIndex >= runs.length) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n closingStart = runs[closingRunIndex]!.start;\n }\n const end = closingStart + delimiterLength;\n addRange(ranges, text, lineStart + cursor, lineStart + end, 'code');\n runIndex = closingRunIndex;\n cursor = end;\n }\n if (lineMatch[0].length === 0) lineExpression.lastIndex += 1;\n }\n}\n\nfunction customTechnicalIdentifiers(values: readonly string[]): ReadonlySet {\n const cacheable = Object.isFrozen(values);\n const cached = cacheable ? CUSTOM_TECHNICAL_IDENTIFIER_CACHE.get(values) : undefined;\n if (cached) return cached;\n const identifiers = new Set();\n for (const value of values) {\n if (/^[A-Za-z][A-Za-z0-9_.-]*$/u.test(value)) identifiers.add(value.toLowerCase());\n }\n if (cacheable) CUSTOM_TECHNICAL_IDENTIFIER_CACHE.set(values, identifiers);\n return identifiers;\n}\n\n/**\n * Acronyms are short. A longer all-capital word is emphasized prose, not an\n * identifier, and must keep deciding the natural-language base direction.\n */\nconst ACRONYM_MAXIMUM_LENGTH = 5;\n\nfunction isKnownTechnicalWord(value: string, custom: ReadonlySet): boolean {\n const normalized = value.toLowerCase();\n return KNOWN_TECHNICAL_TOKENS.has(normalized) || custom.has(normalized);\n}\n\n/**\n * Reports whether capitals are the block's prose style rather than an\n * identifier signal. `PLEASE READ THIS WARNING` is emphasized natural language;\n * the same `API` token inside mixed-case prose is an acronym. Deciding this per\n * block keeps the rule deterministic and needs no dictionary or language model.\n */\nfunction usesUppercaseProse(text: string): boolean {\n const words = text.match(/\\b[A-Za-z]{2,}\\b/gu);\n if (words === null || words.length < 2) return false;\n let capitalized = 0;\n // Every candidate is alphabetic, so \"contains no lowercase\" means all-capital.\n for (const word of words) if (!/[a-z]/u.test(word)) capitalized += 1;\n return capitalized * 2 > words.length;\n}\n\n/**\n * Only tokens starting with an ASCII letter reach this test, so every false\n * exclusion removes LTR evidence and never RTL evidence. An over-broad rule\n * therefore biases mixed blocks toward RTL \u2014 the mirror of the failure this\n * project exists to fix \u2014 which is why the hyphen is not a signal on its own.\n */\nfunction isTechnicalIdentifier(\n token: string,\n custom: ReadonlySet,\n uppercaseProse: boolean\n): boolean {\n if (isKnownTechnicalWord(token, custom)) return true;\n // A hyphenated token is technical when a segment is itself a known technical\n // word (`react-markdown`, `web-app`), not merely because it is hyphenated.\n if (token.includes('-')\n && token.split('-').some((segment) => segment !== '' && isKnownTechnicalWord(segment, custom))) {\n return true;\n }\n // Digits, underscores, and dots are structural identifier syntax.\n return /[0-9_.]/u.test(token)\n || /[a-z][A-Z]/u.test(token)\n || (!uppercaseProse\n && token.length <= ACRONYM_MAXIMUM_LENGTH\n && /^[A-Z]{2,}$/u.test(token));\n}\n\n/** Finds ranges that should not decide the natural-language base direction. */\nexport function findTechnicalTokenRanges(\n text: string,\n technicalIdentifiers: readonly string[] = []\n): TechnicalTokenRange[] {\n const ranges: TechnicalTokenRange[] = [];\n addCodeRanges(text, ranges);\n addMatches(text, ranges, /<\\/?[A-Za-z][^<>\\r\\n]*>/gu, 'html');\n addMatches(text, ranges, /(?:\\$\\$[^\\r\\n]*?\\$\\$|\\$[^$\\r\\n]+\\$|\\\\\\([^\\r\\n]*?\\\\\\))/gu, 'math');\n\n const urls = /\\b(?:https?|ftp):\\/\\/[^\\s<>{}\"']+/giu;\n let urlMatch: RegExpExecArray | null;\n while ((urlMatch = urls.exec(text)) !== null) {\n let value = urlMatch[0];\n value = trimTechnicalPunctuation(value);\n for (const [open, close] of [['(', ')'], ['[', ']'], ['{', '}']] as const) {\n if (!value.endsWith(close)) continue;\n let balance = 0;\n for (const character of value) {\n if (character === open) balance += 1;\n else if (character === close) balance -= 1;\n }\n if (balance >= 0) continue;\n let end = value.length;\n while (balance < 0 && end > 0 && value[end - 1] === close) {\n balance += 1;\n end -= 1;\n }\n if (end !== value.length) value = value.slice(0, end);\n }\n addRange(ranges, text, urlMatch.index, urlMatch.index + value.length, 'url');\n }\n addMatches(text, ranges, /\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}\\b/giu, 'email');\n addNormalizedMatches(\n text,\n ranges,\n /(?()\\x5B\\x5D{}]+/gu,\n 'path',\n trimTechnicalPunctuation\n );\n addMatches(text, ranges, /\\b(?:[A-Za-z0-9_.-]+[\\\\/])+(?:[A-Za-z0-9_.-]+)\\b/gu, 'path');\n addMatches(text, ranges, /(? a.start - b.start || b.end - a.end);\n const merged: TechnicalTokenRange[] = [];\n for (const range of ranges) {\n const previous = merged.at(-1);\n if (previous && range.start <= previous.end) {\n previous.end = Math.max(previous.end, range.end);\n previous.text = text.slice(previous.start, previous.end);\n } else {\n merged.push({ ...range });\n }\n }\n return merged;\n}\n\nexport function countStrongCharacters(\n text: string,\n options: DetectionOptions = {}\n): StrongCharacterCounts & { firstStrong: Direction; technicalTokens: TechnicalTokenRange[] } {\n const normalized = normalizeOptions(options);\n return countStrongCharactersNormalized(text, normalized);\n}\n\nfunction countStrongCharactersNormalized(\n text: string,\n normalized: Required\n): StrongCharacterCounts & { firstStrong: Direction; technicalTokens: TechnicalTokenRange[] } {\n const technicalTokens = normalized.excludeTechnicalTokens\n ? findTechnicalTokenRanges(text, normalized.technicalIdentifiers)\n : [];\n let ltr = 0;\n let rtl = 0;\n let firstStrong: Direction = 'neutral';\n let index = 0;\n let technicalIndex = 0;\n const classify = normalized.strategy === 'first-strong' || normalized.strategy === 'strict-uax9'\n ? classifyBidiStrongCharacter\n : classifyCharacter;\n\n for (const character of text) {\n // Technical ranges are sorted and merged, so advance one cursor instead\n // of rescanning every range for every code point. This keeps detection\n // linear even for long transcripts containing many URLs/identifiers.\n while (technicalIndex < technicalTokens.length && index >= technicalTokens[technicalIndex]!.end) {\n technicalIndex += 1;\n }\n const technicalRange = technicalTokens[technicalIndex];\n const isTechnical = technicalRange !== undefined\n && index >= technicalRange.start\n && index < technicalRange.end;\n if (!isTechnical) {\n const direction = classify(character);\n if (direction === 'ltr') ltr += 1;\n if (direction === 'rtl') rtl += 1;\n if (firstStrong === 'neutral' && direction !== 'neutral') firstStrong = direction;\n }\n index += character.length;\n }\n\n return { ltr, rtl, total: ltr + rtl, firstStrong, technicalTokens };\n}\n\nfunction fallbackDirection(options: Required): Direction {\n return options.fallback;\n}\n\nfunction directionFromCounts(\n counts: StrongCharacterCounts & { firstStrong: Direction },\n normalized: Required\n): Direction {\n if (normalized.strategy === 'ltr' || normalized.strategy === 'rtl') return normalized.strategy;\n if (normalized.strategy === 'inherit') return normalized.inheritedDirection;\n if (counts.total < normalized.minimumStrongCharacters) return fallbackDirection(normalized);\n\n if (normalized.strategy === 'first-strong' || normalized.strategy === 'strict-uax9') {\n return counts.firstStrong === 'neutral' ? fallbackDirection(normalized) : counts.firstStrong;\n }\n\n if (counts.rtl > counts.ltr && counts.rtl / counts.total >= normalized.majorityThreshold) return 'rtl';\n if (counts.ltr > counts.rtl && counts.ltr / counts.total >= normalized.majorityThreshold) return 'ltr';\n return counts.firstStrong === 'neutral' ? fallbackDirection(normalized) : counts.firstStrong;\n}\n\nexport function detectDirection(text: string, options: DetectionOptions = {}): Direction {\n const normalized = normalizeOptions(options);\n if (normalized.strategy === 'ltr' || normalized.strategy === 'rtl') return normalized.strategy;\n if (normalized.strategy === 'inherit') return normalized.inheritedDirection;\n return directionFromCounts(countStrongCharactersNormalized(text, normalized), normalized);\n}\n\nfunction confidenceFor(counts: StrongCharacterCounts, direction: Direction): number {\n if (counts.total === 0 || direction === 'neutral') return 0;\n const matching = direction === 'rtl' ? counts.rtl : counts.ltr;\n return Number((matching / counts.total).toFixed(4));\n}\n\nfunction firstBidiStrongCharacter(text: string): Direction {\n for (const character of text) {\n const direction = classifyBidiStrongCharacter(character);\n if (direction !== 'neutral') return direction;\n }\n return 'neutral';\n}\n\nfunction splitParagraphs(text: string): Array<{ text: string; start: number; end: number }> {\n const paragraphs: Array<{ text: string; start: number; end: number }> = [];\n const separator = /\\r\\n|\\n|\\r|\\u2029/gu;\n let start = 0;\n let match: RegExpExecArray | null;\n\n while ((match = separator.exec(text)) !== null) {\n paragraphs.push({ text: text.slice(start, match.index), start, end: match.index });\n start = match.index + match[0].length;\n }\n paragraphs.push({ text: text.slice(start), start, end: text.length });\n return paragraphs;\n}\n\nexport function analyzeParagraph(text: string, start = 0, options: DetectionOptions = {}): ParagraphAnalysis {\n const normalized = normalizeOptions(options);\n const countsWithFirst = countStrongCharactersNormalized(text, normalized);\n const counts: StrongCharacterCounts = {\n ltr: countsWithFirst.ltr,\n rtl: countsWithFirst.rtl,\n total: countsWithFirst.total\n };\n const direction = directionFromCounts(countsWithFirst, normalized);\n return {\n text,\n start,\n end: start + text.length,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n confidence: confidenceFor(counts, direction),\n counts\n };\n}\n\nexport function analyzeText(text: string, options: DetectionOptions = {}): TextAnalysis {\n const normalized = normalizeOptions(options);\n const countsWithFirst = countStrongCharactersNormalized(text, normalized);\n const counts: StrongCharacterCounts = {\n ltr: countsWithFirst.ltr,\n rtl: countsWithFirst.rtl,\n total: countsWithFirst.total\n };\n const direction = directionFromCounts(countsWithFirst, normalized);\n const rawCountsWithFirst = countStrongCharactersNormalized(text, normalizeOptions({\n ...normalized,\n strategy: 'content-majority',\n excludeTechnicalTokens: false\n }));\n const rawCounts: StrongCharacterCounts = {\n ltr: rawCountsWithFirst.ltr,\n rtl: rawCountsWithFirst.rtl,\n total: rawCountsWithFirst.total\n };\n const split = splitParagraphs(text);\n const paragraphs = split.length === 1\n ? [{\n text,\n start: 0,\n end: text.length,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n confidence: confidenceFor(counts, direction),\n counts\n }]\n : split.map((paragraph) => analyzeParagraph(paragraph.text, paragraph.start, normalized));\n return {\n text,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n rawFirstStrong: firstBidiStrongCharacter(text),\n confidence: confidenceFor(counts, direction),\n counts,\n rawCounts,\n paragraphs,\n mixed: rawCounts.ltr > 0 && rawCounts.rtl > 0\n };\n}\n", "import type {\n BidiControlFinding,\n BidiControlRisk,\n BidiControlSanitizationGroup,\n BidiSecurityFinding,\n BidiSecurityMode,\n BidiSecurityReport,\n BidiSecuritySeverity\n} from './types.js';\n\nconst CONTROL_METADATA = new Map>([\n [0x061c, { name: 'ARABIC LETTER MARK', risk: 'low', category: 'mark' }],\n [0x200e, { name: 'LEFT-TO-RIGHT MARK', risk: 'low', category: 'mark' }],\n [0x200f, { name: 'RIGHT-TO-LEFT MARK', risk: 'low', category: 'mark' }],\n [0x202a, { name: 'LEFT-TO-RIGHT EMBEDDING', risk: 'high', category: 'embedding' }],\n [0x202b, { name: 'RIGHT-TO-LEFT EMBEDDING', risk: 'high', category: 'embedding' }],\n [0x202c, { name: 'POP DIRECTIONAL FORMATTING', risk: 'medium', category: 'pop' }],\n [0x202d, { name: 'LEFT-TO-RIGHT OVERRIDE', risk: 'high', category: 'override' }],\n [0x202e, { name: 'RIGHT-TO-LEFT OVERRIDE', risk: 'high', category: 'override' }],\n [0x2066, { name: 'LEFT-TO-RIGHT ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2067, { name: 'RIGHT-TO-LEFT ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2068, { name: 'FIRST STRONG ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2069, { name: 'POP DIRECTIONAL ISOLATE', risk: 'medium', category: 'pop' }],\n [0x206a, { name: 'INHIBIT SYMMETRIC SWAPPING', risk: 'medium', category: 'deprecated' }],\n [0x206b, { name: 'ACTIVATE SYMMETRIC SWAPPING', risk: 'medium', category: 'deprecated' }],\n [0x206c, { name: 'INHIBIT ARABIC FORM SHAPING', risk: 'medium', category: 'deprecated' }],\n [0x206d, { name: 'ACTIVATE ARABIC FORM SHAPING', risk: 'medium', category: 'deprecated' }],\n [0x206e, { name: 'NATIONAL DIGIT SHAPES', risk: 'medium', category: 'deprecated' }],\n [0x206f, { name: 'NOMINAL DIGIT SHAPES', risk: 'medium', category: 'deprecated' }]\n]);\n\nconst REMEDIATION = 'Remove the control unless a documented plain-text protocol requires it; prefer semantic markup and isolation.';\n\nfunction severityForRisk(risk: BidiControlRisk): BidiSecuritySeverity {\n if (risk === 'high') return 'high';\n if (risk === 'medium') return 'warning';\n return 'info';\n}\n\nfunction rangeFor(control: BidiControlFinding): BidiSecurityFinding['sourceRange'] {\n return {\n utf16: { start: control.index, end: control.end },\n codePoint: { start: control.codePointIndex, end: control.codePointIndex + 1 }\n };\n}\n\nfunction codeForControl(control: BidiControlFinding): string {\n if (control.category === 'override') return 'BIDI_OVERRIDE_CONTROL';\n if (control.category === 'embedding') return 'BIDI_EMBEDDING_CONTROL';\n if (control.category === 'isolate') return 'BIDI_ISOLATE_CONTROL';\n if (control.category === 'mark') return 'BIDI_DIRECTIONAL_MARK';\n if (control.category === 'deprecated') return 'BIDI_DEPRECATED_CONTROL';\n return 'BIDI_POP_CONTROL';\n}\n\nfunction controlFinding(control: BidiControlFinding): BidiSecurityFinding {\n return {\n code: codeForControl(control),\n severity: severityForRisk(control.risk),\n message: `${control.name} (${control.codePoint}) is invisible and changes bidirectional interpretation.`,\n sourceRange: rangeFor(control),\n remediation: REMEDIATION,\n control\n };\n}\n\nexport function findBidiControls(text: string): BidiControlFinding[] {\n const findings: BidiControlFinding[] = [];\n let utf16Index = 0;\n let codePointIndex = 0;\n\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const metadata = CONTROL_METADATA.get(codePoint);\n if (metadata) {\n findings.push({\n character,\n codePoint: `U+${codePoint.toString(16).toUpperCase().padStart(4, '0')}`,\n index: utf16Index,\n end: utf16Index + character.length,\n codePointIndex,\n ...metadata\n });\n }\n utf16Index += character.length;\n codePointIndex += 1;\n }\n return findings;\n}\n\nexport function visibleBidiControls(text: string): string {\n const namesByCodePoint = new Map([...CONTROL_METADATA].map(([codePoint, metadata]) => [codePoint, metadata.name]));\n let result = '';\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const name = namesByCodePoint.get(codePoint);\n result += name ? `\u27E6${name}\u27E7` : character;\n }\n return result;\n}\n\nexport function highestControlRisk(findings: readonly BidiControlFinding[]): BidiControlRisk | null {\n if (findings.some((finding) => finding.risk === 'high')) return 'high';\n if (findings.some((finding) => finding.risk === 'medium')) return 'medium';\n if (findings.some((finding) => finding.risk === 'low')) return 'low';\n return null;\n}\n\ninterface FormattingFrame {\n kind: 'embedding' | 'isolate';\n control: BidiControlFinding;\n}\n\nfunction lastFrameIndex(stack: readonly FormattingFrame[], kind: FormattingFrame['kind']): number {\n for (let index = stack.length - 1; index >= 0; index -= 1) {\n if (stack[index]?.kind === kind) return index;\n }\n return -1;\n}\n\nfunction balanceFindings(controls: readonly BidiControlFinding[]): BidiSecurityFinding[] {\n const findings: BidiSecurityFinding[] = [];\n const stack: FormattingFrame[] = [];\n\n for (const control of controls) {\n const codePoint = control.codePoint;\n if (codePoint === 'U+202A' || codePoint === 'U+202B' || codePoint === 'U+202D' || codePoint === 'U+202E') {\n stack.push({ kind: 'embedding', control });\n continue;\n }\n if (codePoint === 'U+2066' || codePoint === 'U+2067' || codePoint === 'U+2068') {\n stack.push({ kind: 'isolate', control });\n continue;\n }\n if (codePoint === 'U+202C') {\n const isolateIndex = lastFrameIndex(stack, 'isolate');\n const embeddingIndex = lastFrameIndex(stack, 'embedding');\n if (embeddingIndex <= isolateIndex) {\n findings.push({\n code: 'BIDI_UNMATCHED_PDF',\n severity: 'high',\n message: 'POP DIRECTIONAL FORMATTING has no matching active embedding or override.',\n sourceRange: rangeFor(control),\n remediation: 'Remove the unmatched PDF or add the intended opener within the same isolate.',\n control\n });\n } else {\n stack.splice(embeddingIndex, 1);\n }\n continue;\n }\n if (codePoint === 'U+2069') {\n const isolateIndex = lastFrameIndex(stack, 'isolate');\n if (isolateIndex < 0) {\n findings.push({\n code: 'BIDI_UNMATCHED_PDI',\n severity: 'high',\n message: 'POP DIRECTIONAL ISOLATE has no matching isolate opener.',\n sourceRange: rangeFor(control),\n remediation: 'Remove the unmatched PDI or add the intended LRI, RLI, or FSI opener.',\n control\n });\n } else {\n const crossing = stack.slice(isolateIndex + 1).filter((frame) => frame.kind === 'embedding');\n for (const frame of crossing) {\n findings.push({\n code: 'BIDI_FORMAT_CROSSES_ISOLATE_BOUNDARY',\n severity: 'high',\n message: `${frame.control.name} is not closed before the containing isolate ends.`,\n sourceRange: rangeFor(frame.control),\n remediation: 'Close the embedding or override with PDF before PDI.',\n control: frame.control\n });\n }\n stack.splice(isolateIndex);\n }\n }\n }\n\n for (const frame of stack) {\n findings.push({\n code: frame.kind === 'isolate' ? 'BIDI_UNCLOSED_ISOLATE' : 'BIDI_UNCLOSED_EMBEDDING',\n severity: 'high',\n message: `${frame.control.name} is not terminated before the end of the text.`,\n sourceRange: rangeFor(frame.control),\n remediation: frame.kind === 'isolate'\n ? 'Add the matching PDI or remove the isolate opener.'\n : 'Add the matching PDF or remove the embedding/override opener.',\n control: frame.control\n });\n }\n return findings;\n}\n\nfunction isAsciiIdentifierCharacter(value: string | undefined): boolean {\n return value !== undefined && /^[A-Za-z0-9_$]$/u.test(value);\n}\n\nfunction invisibleCharacterFindings(text: string): BidiSecurityFinding[] {\n const findings: BidiSecurityFinding[] = [];\n const characters = [...text];\n let utf16Index = 0;\n for (let codePointIndex = 0; codePointIndex < characters.length; codePointIndex += 1) {\n const character = characters[codePointIndex]!;\n const sourceRange = {\n utf16: { start: utf16Index, end: utf16Index + character.length },\n codePoint: { start: codePointIndex, end: codePointIndex + 1 }\n };\n if (character === '\\u200B') {\n findings.push({\n code: 'HIDDEN_ZERO_WIDTH_SPACE',\n severity: 'warning',\n message: 'ZERO WIDTH SPACE (U+200B) is hidden and can disguise identifiers, links, or filenames.',\n sourceRange,\n remediation: 'Remove it from identifiers and source-like content unless its use is explicitly required.'\n });\n }\n if ((character === '\\u200C' || character === '\\u200D')\n && isAsciiIdentifierCharacter(characters[codePointIndex - 1])\n && isAsciiIdentifierCharacter(characters[codePointIndex + 1])) {\n const name = character === '\\u200C' ? 'ZERO WIDTH NON-JOINER' : 'ZERO WIDTH JOINER';\n findings.push({\n code: 'HIDDEN_IDENTIFIER_JOINER',\n severity: 'warning',\n message: `${name} is hidden inside an ASCII identifier-like token.`,\n sourceRange,\n remediation: 'Remove the joiner from machine identifiers, or document and validate the identifier protocol that requires it.'\n });\n }\n if (character === '\\u2060') {\n findings.push({\n code: 'HIDDEN_WORD_JOINER',\n severity: 'info',\n message: 'WORD JOINER (U+2060) is invisible and can disguise token boundaries.',\n sourceRange,\n remediation: 'Confirm that non-breaking behavior is required; remove it from identifiers and source-like content.'\n });\n }\n // A leading U+FEFF can represent a decoded byte-order signature. The same\n // character midstream is invisible content and deserves an explicit finding.\n if (character === '\\uFEFF' && codePointIndex > 0) {\n findings.push({\n code: 'HIDDEN_MIDSTREAM_BOM',\n severity: 'warning',\n message: 'ZERO WIDTH NO-BREAK SPACE/BOM (U+FEFF) appears inside the text.',\n sourceRange,\n remediation: 'Remove the midstream BOM unless a documented protocol explicitly requires it.'\n });\n }\n utf16Index += character.length;\n }\n return findings;\n}\n\n/** Audits hidden bidi formatting without mutating the source string. */\nexport function scanBidiSecurity(\n text: string,\n options: { mode?: BidiSecurityMode } = {}\n): BidiSecurityReport {\n const mode = options.mode ?? 'audit';\n if (mode === 'off') return { mode, safe: true, shouldBlock: false, controls: [], findings: [] };\n const controls = findBidiControls(text);\n const findings = [\n ...controls.map(controlFinding),\n ...balanceFindings(controls),\n ...invisibleCharacterFindings(text)\n ].sort((a, b) => a.sourceRange.utf16.start - b.sourceRange.utf16.start || a.code.localeCompare(b.code));\n const hasHigh = findings.some((finding) => finding.severity === 'high');\n return {\n mode,\n safe: !hasHigh,\n shouldBlock: mode === 'strict' ? findings.length > 0 : mode === 'warn' && hasHigh,\n controls,\n findings\n };\n}\n\nexport interface SanitizeBidiControlsOptions {\n /** Remove controls with these risk levels. Defaults to every level. */\n remove?: BidiControlRisk[];\n /**\n * Remove only these semantic control groups. PDF follows embedding/override;\n * PDI follows isolate, so preserved isolate pairs stay structurally intact.\n */\n removeGroups?: BidiControlSanitizationGroup[];\n}\n\nconst ALL_SANITIZATION_GROUPS: readonly BidiControlSanitizationGroup[] = [\n 'mark', 'embedding-override', 'isolate', 'deprecated'\n];\n\nconst SANITIZATION_GROUP_RISK: Readonly> = {\n mark: 'low',\n 'embedding-override': 'high',\n isolate: 'medium',\n deprecated: 'medium'\n};\n\nfunction sanitizationGroup(codePoint: number, category: BidiControlFinding['category']): BidiControlSanitizationGroup {\n if (codePoint === 0x202c || category === 'embedding' || category === 'override') {\n return 'embedding-override';\n }\n if (codePoint === 0x2069 || category === 'isolate') return 'isolate';\n if (category === 'mark' || category === 'deprecated') return category;\n // Every recognized pop is handled above; keep an explicit defensive\n // fallback so future metadata cannot silently escape the default sanitizer.\n return 'deprecated';\n}\n\nexport function sanitizeBidiControls(\n text: string,\n options: SanitizeBidiControlsOptions = {}\n): { text: string; removed: BidiControlFinding[] } {\n const remove = new Set(options.remove ?? ['high', 'medium', 'low']);\n const removeGroups = new Set(options.removeGroups ?? ALL_SANITIZATION_GROUPS);\n const grouped = options.removeGroups !== undefined;\n const removed: BidiControlFinding[] = [];\n let output = '';\n let utf16Index = 0;\n let codePointIndex = 0;\n\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const metadata = CONTROL_METADATA.get(codePoint);\n const group = metadata && sanitizationGroup(codePoint, metadata.category);\n const selected = metadata && group && removeGroups.has(group)\n && remove.has(grouped ? SANITIZATION_GROUP_RISK[group] : metadata.risk);\n if (metadata && selected) {\n removed.push({\n character,\n codePoint: `U+${codePoint.toString(16).toUpperCase().padStart(4, '0')}`,\n index: utf16Index,\n end: utf16Index + character.length,\n codePointIndex,\n ...metadata\n });\n } else {\n output += character;\n }\n utf16Index += character.length;\n codePointIndex += 1;\n }\n\n return { text: output, removed };\n}\n", "import { classifyBidiStrongCharacter } from './classify.js';\nimport { findBidiControls } from './security.js';\nimport type { ResolvedDirection } from './types.js';\n\n/**\n * `auto` is the non-interference default: ordinary LTR content in an LTR\n * context receives no BidiLens markup or DOM mutation. `always` retains the\n * explicit-annotation behavior for integrations that require stable markers.\n */\nexport type BidiInterventionMode = 'auto' | 'always';\n\nexport interface BidiInterventionOptions {\n intervention?: BidiInterventionMode | undefined;\n inheritedDirection?: ResolvedDirection | undefined;\n}\n\n/**\n * Reports whether rendering metadata is needed for a string in its host\n * context. Hidden bidi controls deliberately disable the LTR fast path so an\n * apparently English string cannot bypass bidi-aware handling.\n */\nexport function needsBidiIntervention(\n text: string,\n options: BidiInterventionOptions = {}\n): boolean {\n if (options.intervention === 'always') return true;\n if (findBidiControls(text).length > 0) return true;\n\n let hasLtr = false;\n for (const character of text) {\n const direction = classifyBidiStrongCharacter(character);\n if (direction === 'rtl') return true;\n if (direction === 'ltr') hasLtr = true;\n }\n\n return options.inheritedDirection === 'rtl' && (hasLtr || text.length > 0);\n}\n", "import { classifyCharacter } from './classify.js';\nimport { isolateText } from './controls.js';\nimport { findTechnicalTokenRanges } from './detect.js';\nimport { needsBidiIntervention } from './intervention.js';\nimport type { BidiInterventionMode } from './intervention.js';\nimport type { Direction, DirectionalRun, InlineIsolation } from './types.js';\n\ntype PlannedIsolation = Omit;\n\nfunction attachSourceRanges(text: string, isolations: Omit[]): InlineIsolation[] {\n const codePointAtUtf16 = new Uint32Array(text.length + 1);\n let utf16Offset = 0;\n let codePointOffset = 0;\n for (const character of text) {\n codePointAtUtf16[utf16Offset] = codePointOffset;\n if (character.length === 2) codePointAtUtf16[utf16Offset + 1] = codePointOffset;\n utf16Offset += character.length;\n codePointOffset += 1;\n codePointAtUtf16[utf16Offset] = codePointOffset;\n }\n return isolations.map((isolation) => ({\n ...isolation,\n sourceRange: {\n utf16: { start: isolation.start, end: isolation.end },\n codePoint: {\n start: codePointAtUtf16[isolation.start]!,\n end: codePointAtUtf16[isolation.end]!\n }\n }\n }));\n}\n\nfunction resolveNeutralRuns(runs: DirectionalRun[]): DirectionalRun[] {\n const previousStrong: Direction[] = new Array(runs.length).fill('neutral');\n const nextStrong: Direction[] = new Array(runs.length).fill('neutral');\n let previous: Direction = 'neutral';\n let next: Direction = 'neutral';\n\n for (let index = 0; index < runs.length; index += 1) {\n previousStrong[index] = previous;\n const direction = runs[index]!.direction;\n if (direction !== 'neutral') previous = direction;\n }\n\n for (let index = runs.length - 1; index >= 0; index -= 1) {\n nextStrong[index] = next;\n const direction = runs[index]!.direction;\n if (direction !== 'neutral') next = direction;\n }\n\n return runs.map((run, index) => {\n if (run.direction !== 'neutral') return run;\n const before = previousStrong[index] ?? 'neutral';\n const after = nextStrong[index] ?? 'neutral';\n const direction: Direction = before === after && before !== 'neutral'\n ? before\n : before !== 'neutral'\n ? before\n : after;\n return { ...run, direction };\n });\n}\n\nfunction mergeAdjacent(runs: DirectionalRun[]): DirectionalRun[] {\n const merged: DirectionalRun[] = [];\n for (const run of runs) {\n const previous = merged.at(-1);\n if (previous && previous.direction === run.direction) {\n previous.text += run.text;\n previous.end = run.end;\n } else {\n merged.push({ ...run });\n }\n }\n return merged;\n}\n\nfunction trimNeutralBoundaries(text: string, start: number, end: number): { start: number; end: number } {\n while (start < end) {\n const character = text.slice(start).match(/^./su)?.[0];\n if (!character || classifyCharacter(character) !== 'neutral') break;\n start += character.length;\n }\n while (end > start) {\n const character = text.slice(0, end).match(/.$/su)?.[0];\n if (!character || classifyCharacter(character) !== 'neutral') break;\n end -= character.length;\n }\n return { start, end };\n}\n\nconst HARD_FRAGMENT_SEPARATOR = /[,\u060C;\u061B:!?\u061F|]/u;\n\n/**\n * Punctuation separates semantic LTR fragments in an RTL paragraph, while\n * whitespace joins adjacent fragments into one ordered phrase. Without this\n * normalization, two neighboring isolates such as `page` and `97` are\n * reordered as independent RTL atoms.\n */\nfunction normalizeIsolationPlan(text: string, isolations: PlannedIsolation[]): PlannedIsolation[] {\n const split: PlannedIsolation[] = [];\n for (const isolation of isolations) {\n if (isolation.kind !== 'opposite-direction-run') {\n split.push(isolation);\n continue;\n }\n let pieceStart = isolation.start;\n let cursor = isolation.start;\n for (const character of text.slice(isolation.start, isolation.end)) {\n const index = cursor;\n cursor += character.length;\n if (HARD_FRAGMENT_SEPARATOR.test(character)) {\n const trimmed = trimNeutralBoundaries(text, pieceStart, index);\n if (trimmed.start < trimmed.end) {\n split.push({\n ...isolation,\n text: text.slice(trimmed.start, trimmed.end),\n start: trimmed.start,\n end: trimmed.end\n });\n }\n pieceStart = cursor;\n }\n }\n const trimmed = trimNeutralBoundaries(text, pieceStart, isolation.end);\n if (trimmed.start < trimmed.end) {\n split.push({\n ...isolation,\n text: text.slice(trimmed.start, trimmed.end),\n start: trimmed.start,\n end: trimmed.end\n });\n }\n }\n\n const ordered = split.sort((a, b) => a.start - b.start || a.end - b.end);\n const merged: PlannedIsolation[] = [];\n for (const isolation of ordered) {\n const previous = merged.at(-1);\n if (\n previous &&\n previous.direction === isolation.direction &&\n previous.end <= isolation.start &&\n /^\\s*$/u.test(text.slice(previous.end, isolation.start))\n ) {\n previous.end = isolation.end;\n previous.text = text.slice(previous.start, previous.end);\n if (previous.kind !== isolation.kind) previous.kind = 'opposite-direction-run';\n } else {\n merged.push({ ...isolation });\n }\n }\n return merged;\n}\n\nexport function segmentDirectionalRuns(text: string): DirectionalRun[] {\n if (!text) return [];\n const runs: DirectionalRun[] = [];\n let currentDirection: Direction | null = null;\n let currentText = '';\n let start = 0;\n let index = 0;\n\n for (const character of text) {\n const direction = classifyCharacter(character);\n if (currentDirection === null) {\n currentDirection = direction;\n currentText = character;\n start = index;\n } else if (direction === currentDirection) {\n currentText += character;\n } else {\n runs.push({ text: currentText, direction: currentDirection, start, end: index });\n currentDirection = direction;\n currentText = character;\n start = index;\n }\n index += character.length;\n }\n\n if (currentDirection !== null) {\n runs.push({ text: currentText, direction: currentDirection, start, end: index });\n }\n\n return mergeAdjacent(resolveNeutralRuns(runs));\n}\n\nexport function isolateDirectionalRuns(text: string): string {\n return segmentDirectionalRuns(text)\n .map((run) => isolateText(run.text, run.direction))\n .join('');\n}\n\n/**\n * Plans semantic inline boundaries without changing the stored source text.\n * Technical ranges are isolated first; opposite natural-language runs are\n * then isolated only when they differ from the block's base direction.\n */\nexport function planInlineIsolation(\n text: string,\n blockDirection: Exclude,\n options: {\n excludeTechnicalTokens?: boolean;\n isolateOppositeRuns?: boolean;\n intervention?: BidiInterventionMode | undefined;\n technicalIdentifiers?: readonly string[] | undefined;\n } = {}\n): InlineIsolation[] {\n if (!needsBidiIntervention(text, {\n intervention: options.intervention,\n inheritedDirection: blockDirection\n })) return [];\n const technical = options.excludeTechnicalTokens === false\n ? []\n : findTechnicalTokenRanges(text, options.technicalIdentifiers);\n const isolations: Omit[] = technical.map((range) => ({\n text: range.text,\n direction: 'ltr',\n start: range.start,\n end: range.end,\n kind: range.kind\n }));\n\n if (options.isolateOppositeRuns === false) {\n return attachSourceRanges(text, normalizeIsolationPlan(text, isolations));\n }\n\n let technicalIndex = 0;\n for (const run of segmentDirectionalRuns(text)) {\n if (run.direction === 'neutral' || run.direction === blockDirection) continue;\n while (technicalIndex < technical.length && technical[technicalIndex]!.end <= run.start) {\n technicalIndex += 1;\n }\n let cursor = run.start;\n for (let index = technicalIndex; index < technical.length; index += 1) {\n const range = technical[index]!;\n if (range.end <= cursor) continue;\n if (range.start >= run.end) break;\n const partEnd = Math.min(range.start, run.end);\n if (cursor < partEnd) {\n const trimmed = trimNeutralBoundaries(text, cursor, partEnd);\n if (trimmed.start < trimmed.end) isolations.push({\n text: text.slice(trimmed.start, trimmed.end),\n direction: run.direction,\n start: trimmed.start,\n end: trimmed.end,\n kind: 'opposite-direction-run'\n });\n }\n cursor = Math.max(cursor, range.end);\n if (cursor >= run.end) break;\n }\n if (cursor < run.end) {\n const trimmed = trimNeutralBoundaries(text, cursor, run.end);\n if (trimmed.start < trimmed.end) isolations.push({\n text: text.slice(trimmed.start, trimmed.end),\n direction: run.direction,\n start: trimmed.start,\n end: trimmed.end,\n kind: 'opposite-direction-run'\n });\n }\n }\n\n return attachSourceRanges(text, normalizeIsolationPlan(text, isolations));\n}\n", "import {\n analyzeText,\n needsBidiIntervention,\n planInlineIsolation,\n type BidiInterventionMode,\n type DetectionOptions,\n type ResolvedDirection,\n type TextAnalysis\n} from '@bidilens/core';\n\nexport interface RenderHtmlOptions extends DetectionOptions {\n blockTag?: string;\n containerTag?: string | false;\n blockClassName?: string;\n containerClassName?: string;\n includeDataAttributes?: boolean;\n /** Skip BidiLens markup for LTR-only text in an LTR context. */\n intervention?: BidiInterventionMode;\n}\n\nexport interface RenderedHtmlBlock {\n text: string;\n html: string;\n direction: ResolvedDirection;\n start: number;\n end: number;\n}\n\nexport interface RenderedBidiHtml {\n source: string;\n html: string;\n analysis: TextAnalysis;\n blocks: RenderedHtmlBlock[];\n}\n\nconst SAFE_TAG = /^[a-z][a-z0-9-]*$/u;\nconst SAFE_BLOCK_TAGS = new Set([\n 'address', 'article', 'aside', 'blockquote', 'dd', 'div', 'dt', 'figcaption',\n 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'li', 'main', 'nav',\n 'p', 'pre', 'section', 'span', 'td', 'th'\n]);\nconst SAFE_CONTAINER_TAGS = new Set([\n 'article', 'aside', 'blockquote', 'div', 'footer', 'header', 'main', 'nav', 'section', 'span'\n]);\n\nexport function escapeHtml(value: string): string {\n return value.replace(/[&<>\"']/gu, (character) => ({\n '&': '&', '<': '<', '>': '>', '\"': '"', \"'\": '''\n }[character] ?? character));\n}\n\nfunction checkedTag(value: string, option: string, allowed: ReadonlySet): string {\n const normalized = value.toLowerCase();\n if (!SAFE_TAG.test(normalized) || !allowed.has(normalized)) {\n throw new Error(`${option} must be an allowed non-executable HTML container tag.`);\n }\n return normalized;\n}\n\nfunction classAttribute(value: string | undefined): string {\n return value ? ` class=\"${escapeHtml(value)}\"` : '';\n}\n\nexport function renderInlineBidiHtml(\n source: string,\n direction: ResolvedDirection,\n options: {\n includeDataAttributes?: boolean;\n intervention?: BidiInterventionMode | undefined;\n technicalIdentifiers?: readonly string[] | undefined;\n } = {}\n): string {\n const includeData = options.includeDataAttributes ?? true;\n const isolations = planInlineIsolation(source, direction, {\n intervention: options.intervention,\n technicalIdentifiers: options.technicalIdentifiers\n });\n let html = '';\n let cursor = 0;\n for (const isolation of isolations) {\n html += escapeHtml(source.slice(cursor, isolation.start));\n const tag = isolation.kind === 'code' ? 'code' : 'bdi';\n const data = includeData\n ? ` data-bidilens-isolate=\"\" data-bidilens-kind=\"${isolation.kind}\"${isolation.kind === 'code' ? ' data-bidilens-code=\"\"' : ''}`\n : '';\n html += `<${tag} dir=\"${isolation.direction}\"${data}>${escapeHtml(isolation.text)}`;\n cursor = isolation.end;\n }\n return html + escapeHtml(source.slice(cursor));\n}\n\n/** Serializes untrusted plain text; it never accepts or emits unescaped source HTML. */\nexport function renderBidiHtml(source: string, options: RenderHtmlOptions = {}): RenderedBidiHtml {\n const detection: DetectionOptions = {\n ...options,\n fallback: options.fallback ?? options.inheritedDirection ?? 'ltr'\n };\n const analysis = analyzeText(source, detection);\n const blockTag = checkedTag(options.blockTag ?? 'p', 'blockTag', SAFE_BLOCK_TAGS);\n const includeData = options.includeDataAttributes ?? true;\n const intervene = analysis.paragraphs.some((paragraph) => paragraph.direction === 'rtl')\n || needsBidiIntervention(source, {\n intervention: options.intervention,\n inheritedDirection: options.inheritedDirection\n });\n const blocks = analysis.paragraphs.map((paragraph) => {\n const direction = paragraph.direction === 'neutral'\n ? (options.inheritedDirection ?? 'ltr')\n : paragraph.direction;\n const data = intervene && includeData ? ' data-bidilens-block=\"\"' : '';\n const directionAttribute = intervene ? ` dir=\"${direction}\"` : '';\n const blockClass = classAttribute(options.blockClassName);\n const inline = intervene\n ? renderInlineBidiHtml(paragraph.text, direction, {\n includeDataAttributes: includeData,\n intervention: options.intervention,\n technicalIdentifiers: options.technicalIdentifiers\n })\n : escapeHtml(paragraph.text);\n const html = `<${blockTag}${directionAttribute}${data}${blockClass}>${inline}`;\n return { text: paragraph.text, html, direction, start: paragraph.start, end: paragraph.end };\n });\n\n const serializedBlocks = blocks.map((block, index) => {\n const next = blocks[index + 1];\n const separator = next ? source.slice(block.end, next.start) : '';\n return `${block.html}${escapeHtml(separator)}`;\n }).join('');\n const automaticContainer = blocks.length > 1 ? 'div' : false;\n const container = options.containerTag === undefined ? automaticContainer : options.containerTag;\n const html = container === false\n ? serializedBlocks\n : (() => {\n const tag = checkedTag(container, 'containerTag', SAFE_CONTAINER_TAGS);\n const data = intervene && includeData ? ' data-bidilens-document=\"\"' : '';\n const containerClass = classAttribute(options.containerClassName);\n return `<${tag}${data}${containerClass}>${serializedBlocks}`;\n })();\n return { source, html, analysis, blocks };\n}\n", "{\n \"name\": \"@bidilens/cli\",\n \"version\": \"0.3.0\",\n \"description\": \"CLI for inspecting direction and auditing hidden Unicode bidi controls.\",\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Shayan SalehiRad\",\n \"url\": \"https://github.com/CodeinScrubs\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/CodeinScrubs/BidiLens.git\",\n \"directory\": \"packages/cli\"\n },\n \"homepage\": \"https://github.com/CodeinScrubs/BidiLens#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/CodeinScrubs/BidiLens/issues\"\n },\n \"type\": \"module\",\n \"sideEffects\": false,\n \"keywords\": [\n \"bidi\",\n \"rtl\",\n \"ltr\",\n \"unicode\",\n \"cli\",\n \"security\"\n ],\n \"files\": [\n \"dist\",\n \"README.md\",\n \"LICENSE\",\n \"CHANGELOG.md\",\n \"THIRD_PARTY_NOTICES.md\",\n \"corpus\",\n \"examples\"\n ],\n \"bin\": {\n \"bidilens\": \"./dist/bin.js\"\n },\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/bin.ts --format esm --dts --clean --sourcemap\",\n \"prepack\": \"pnpm run build\",\n \"example\": \"node examples/basic.mjs\"\n },\n \"dependencies\": {\n \"@bidilens/core\": \"workspace:*\",\n \"@bidilens/html\": \"workspace:*\",\n \"commander\": \"^15.0.0\"\n },\n \"devDependencies\": {\n \"tsup\": \"^8.5.1\"\n },\n \"engines\": {\n \"node\": \">=22.12.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,uBAAoB;;;ACApB,IAAAC,mBAA6C;AAC7C,yBAA2B;AAC3B,IAAAC,oBAAuD;AACvD,IAAAC,uBAAoB;;;ACFpB,sBAAoD;AACpD,IAAAC,oBAAiE;AACjE,IAAAC,uBAAoB;AACpB,sBAA8B;;;ACDvB,IAAM,iBAAN,cAA6B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOxC,YAAY,UAAU,MAAM,SAAS;AACnC,UAAM,OAAO;AAEb,UAAM,kBAAkB,MAAM,KAAK,WAAW;AAC9C,SAAK,OAAO,KAAK,YAAY;AAC7B,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,cAAc;AAAA,EACrB;AACF;AAKO,IAAM,uBAAN,cAAmC,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,EAKvD,YAAY,SAAS;AACnB,UAAM,GAAG,6BAA6B,OAAO;AAE7C,UAAM,kBAAkB,MAAM,KAAK,WAAW;AAC9C,SAAK,OAAO,KAAK,YAAY;AAAA,EAC/B;AACF;;;ACjCO,IAAM,WAAN,MAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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WAAW,KAAK,KAAK,EACrB,WAAW,MAAM,KAAK,EACtB,WAAW,MAAM,KAAK;AACzB,SAAO,2BAA2B,OAAO;AAC3C;;;ADxIA,eAAe,OAAsB;AACnC,MAAI;AACF,UAAM,SAAS,MAAM,UAAU;AAC/B,yBAAAE,QAAQ,WAAW,OAAO;AAAA,EAC5B,SAAS,OAAO;AACd,UAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,yBAAAA,QAAQ,OAAO,MAAM,GAAG,cAAc,OAAO,CAAC;AAAA,CAAI;AAClD,yBAAAA,QAAQ,WAAW;AAAA,EACrB;AACF;AAEA,KAAK,KAAK;", + "sourcesContent": ["import process from 'node:process';\nimport { runAction, workflowError } from './index.js';\n\nasync function main(): Promise {\n try {\n const result = await runAction();\n process.exitCode = result.exitCode;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n process.stderr.write(`${workflowError(message)}\\n`);\n process.exitCode = 1;\n }\n}\n\nvoid main();\n", "import { appendFile, mkdir, writeFile } from 'node:fs/promises';\nimport { randomUUID } from 'node:crypto';\nimport { dirname, isAbsolute, relative, resolve } from 'node:path';\nimport process from 'node:process';\nimport { runCli } from '../../packages/cli/src/index.js';\n\nexport type ActionCommand = 'audit' | 'test';\nexport type ActionFormat = 'human' | 'json' | 'sarif';\nexport type ActionMode = 'off' | 'audit' | 'warn' | 'strict';\nexport type ActionRisk = 'low' | 'medium' | 'high';\n\nexport interface ActionInputs {\n command: ActionCommand;\n paths: string[];\n corpus: string;\n mode: ActionMode;\n failOn: ActionRisk;\n format: ActionFormat;\n sarifFile: string;\n}\n\nexport interface ActionContext {\n env?: NodeJS.ProcessEnv;\n cwd?: string;\n log?: (value: string) => void;\n error?: (value: string) => void;\n}\n\nexport interface ActionResult {\n exitCode: number;\n report: string;\n stdout: string;\n stderr: string;\n}\n\nfunction input(env: NodeJS.ProcessEnv, name: string): string {\n return env[`INPUT_${name.toUpperCase()}`]?.trim() ?? '';\n}\n\nfunction choice(\n name: string,\n value: string,\n fallback: Value,\n allowed: readonly Value[]\n): Value {\n const candidate = value || fallback;\n if (!allowed.includes(candidate as Value)) {\n throw new Error(`${name} must be one of ${allowed.join(', ')}; received ${JSON.stringify(candidate)}.`);\n }\n return candidate as Value;\n}\n\nexport function readActionInputs(env: NodeJS.ProcessEnv = process.env): ActionInputs {\n return {\n command: choice('command', input(env, 'COMMAND'), 'audit', ['audit', 'test']),\n paths: (input(env, 'PATHS') || '.').split(/\\r?\\n/u).map((path) => path.trim()).filter(Boolean),\n corpus: input(env, 'CORPUS'),\n mode: choice('mode', input(env, 'MODE'), 'audit', ['off', 'audit', 'warn', 'strict']),\n failOn: choice('fail-on', input(env, 'FAIL-ON'), 'high', ['low', 'medium', 'high']),\n format: choice('format', input(env, 'FORMAT'), 'human', ['human', 'json', 'sarif']),\n sarifFile: input(env, 'SARIF-FILE') || 'bidilens.sarif'\n };\n}\n\nexport function buildCliArguments(inputs: ActionInputs, env: NodeJS.ProcessEnv = process.env): string[] {\n if (inputs.command === 'test') {\n if (inputs.format === 'sarif') throw new Error('SARIF output is available only for the audit command.');\n const actionPath = env.GITHUB_ACTION_PATH\n ? resolve(env.GITHUB_ACTION_PATH)\n : resolve(env.GITHUB_WORKSPACE ?? process.cwd(), 'action');\n const corpus = inputs.corpus || resolve(actionPath, '..', 'corpus', 'cases.json');\n return ['node', 'bidilens', 'test', '--corpus', corpus, ...(inputs.format === 'json' ? ['--json'] : [])];\n }\n\n const format = inputs.format === 'json' ? ['--json'] : inputs.format === 'sarif' ? ['--sarif'] : [];\n return [\n 'node', 'bidilens', 'audit', ...inputs.paths,\n '--mode', inputs.mode,\n '--fail-on', inputs.failOn,\n ...format\n ];\n}\n\nfunction workspaceFile(cwd: string, requested: string): { absolute: string; relative: string } {\n const absolute = resolve(cwd, requested);\n const local = relative(cwd, absolute);\n if (!local || local.startsWith('..') || isAbsolute(local)) {\n throw new Error('sarif-file must resolve to a file inside GITHUB_WORKSPACE.');\n }\n return { absolute, relative: local.replaceAll('\\\\', '/') };\n}\n\nasync function setOutput(path: string | undefined, name: string, value: string): Promise {\n if (!path) return;\n const delimiter = `bidilens_${randomUUID()}`;\n await appendFile(path, `${name}<<${delimiter}\\n${value}\\n${delimiter}\\n`, 'utf8');\n}\n\n/** Executes the bundled CLI without a shell and propagates its real exit code. */\nexport async function runAction(context: ActionContext = {}): Promise {\n const env = context.env ?? process.env;\n const cwd = resolve(context.cwd ?? env.GITHUB_WORKSPACE ?? process.cwd());\n const log = context.log ?? console.log;\n const error = context.error ?? console.error;\n const inputs = readActionInputs(env);\n const stdout: string[] = [];\n const stderr: string[] = [];\n const exitCode = await runCli(buildCliArguments(inputs, env), {\n cwd,\n stdout: (value) => stdout.push(value),\n stderr: (value) => stderr.push(value)\n });\n const stdoutText = stdout.join('');\n const stderrText = stderr.join('');\n let report = '';\n\n if (inputs.format === 'sarif') {\n const target = workspaceFile(cwd, inputs.sarifFile);\n await mkdir(dirname(target.absolute), { recursive: true });\n await writeFile(target.absolute, stdoutText, 'utf8');\n report = target.relative;\n log(`BidiLens SARIF report written to ${report}.`);\n } else if (stdoutText) {\n log(stdoutText.trimEnd());\n }\n if (stderrText) error(stderrText.trimEnd());\n\n await setOutput(env.GITHUB_OUTPUT, 'exit-code', String(exitCode));\n await setOutput(env.GITHUB_OUTPUT, 'report', report);\n if (exitCode !== 0) error(`BidiLens ${inputs.command} failed with exit code ${exitCode}.`);\n return { exitCode, report, stdout: stdoutText, stderr: stderrText };\n}\n\nexport function workflowError(message: string): string {\n const escaped = message\n .replaceAll('%', '%25')\n .replaceAll('\\r', '%0D')\n .replaceAll('\\n', '%0A');\n return `::error title=BidiLens::${escaped}`;\n}\n", "#!/usr/bin/env node\nimport { lstat, readFile, readdir, writeFile } from 'node:fs/promises';\nimport { basename, extname, isAbsolute, relative, resolve } from 'node:path';\nimport process from 'node:process';\nimport { pathToFileURL } from 'node:url';\nimport { Command, CommanderError } from 'commander';\nimport { renderBidiHtml } from '@bidilens/html';\nimport packageManifest from '../package.json' with { type: 'json' };\nimport {\n analyzeText,\n findBidiControls,\n sanitizeBidiControls,\n scanBidiSecurity,\n visibleBidiControls,\n type BidiControlRisk,\n type BidiInterventionMode,\n type BidiSecurityFinding,\n type BidiSecurityMode\n} from '@bidilens/core';\n\nconst SUPPORTED_EXTENSIONS = new Set([\n '.md', '.mdx', '.txt', '.html', '.htm', '.json', '.yaml', '.yml',\n '.js', '.jsx', '.ts', '.tsx', '.css', '.scss', '.py', '.go', '.rs',\n '.java', '.kt', '.swift', '.c', '.cc', '.cpp', '.h', '.hpp', '.toml',\n '.vue', '.svelte', '.astro', '.dart', '.xml', '.svg', '.sh', '.bash',\n '.zsh', '.fish', '.cs', '.fs', '.fsx', '.vb', '.rb', '.php', '.sql',\n '.ini', '.conf', '.properties', '.gradle', '.groovy', '.lua', '.pl', '.r',\n '.ex', '.exs', '.erl', '.hrl'\n]);\n\nconst SUPPORTED_BASENAMES = new Set([\n 'dockerfile', 'makefile', 'gemfile', 'podfile', 'rakefile', 'cmakelists.txt',\n 'build', 'workspace', '.env'\n]);\n\nconst IGNORED_DIRECTORIES = new Set([\n 'node_modules', '.git', 'dist', 'build', 'coverage', 'test-results',\n 'playwright-report', '.vite', '.next', '.nuxt', '.svelte-kit', '.output'\n]);\n\nconst RISK_ORDER: Record = { low: 1, medium: 2, high: 3 };\nconst CLI_VERSION = packageManifest.version;\n\ninterface CorpusCase {\n id: string;\n text: string;\n expected: 'ltr' | 'rtl' | 'neutral';\n}\n\nexport interface CliRuntime {\n cwd?: string;\n stdout?: (value: string) => void;\n stderr?: (value: string) => void;\n}\n\ninterface RuntimeState {\n cwd: string;\n stdout: (value: string) => void;\n stderr: (value: string) => void;\n exitCode: number;\n}\n\nfunction createRuntime(runtime: CliRuntime): RuntimeState {\n return {\n cwd: resolve(runtime.cwd ?? process.cwd()),\n stdout: runtime.stdout ?? ((value) => process.stdout.write(value)),\n stderr: runtime.stderr ?? ((value) => process.stderr.write(value)),\n exitCode: 0\n };\n}\n\nfunction line(writer: (value: string) => void, value = ''): void {\n writer(`${value}\\n`);\n}\n\nasync function collectFiles(inputs: string[], cwd: string): Promise {\n const files: string[] = [];\n async function visitPath(input: string, explicitlyNamed: boolean): Promise {\n const absolute = resolve(cwd, input);\n const info = await lstat(absolute);\n if (info.isSymbolicLink()) return;\n if (info.isDirectory()) {\n const entries = await readdir(absolute, { withFileTypes: true });\n entries.sort((a, b) => a.name.localeCompare(b.name));\n for (const entry of entries) {\n if (IGNORED_DIRECTORIES.has(entry.name.toLowerCase())) continue;\n if (entry.isSymbolicLink()) continue;\n await visitPath(resolve(absolute, entry.name), false);\n }\n return;\n }\n const name = basename(absolute).toLowerCase();\n const supportedName = SUPPORTED_BASENAMES.has(name) || name.startsWith('.env.');\n if (info.isFile() && (explicitlyNamed || supportedName || SUPPORTED_EXTENSIONS.has(extname(absolute).toLowerCase()))) {\n files.push(absolute);\n }\n }\n for (const input of inputs) await visitPath(input, true);\n return files.sort((a, b) => a.localeCompare(b));\n}\n\nfunction parseCorpus(source: string, location: string): CorpusCase[] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(source);\n } catch (error) {\n throw new Error(`${location} is not valid JSON. ${String(error)}`, { cause: error });\n }\n if (!Array.isArray(parsed)) throw new Error(`${location} must contain a JSON array.`);\n const ids = new Set();\n return parsed.map((item: unknown, index) => {\n if (typeof item !== 'object' || item === null) {\n throw new Error(`${location}: case ${index + 1} must be an object.`);\n }\n const candidate = item as Record;\n if (typeof candidate.id !== 'string' || candidate.id.length === 0) {\n throw new Error(`${location}: case ${index + 1} must have a non-empty string id.`);\n }\n if (ids.has(candidate.id)) throw new Error(`${location}: duplicate case id \"${candidate.id}\".`);\n ids.add(candidate.id);\n if (typeof candidate.text !== 'string') {\n throw new Error(`${location}: case \"${candidate.id}\" must have string text.`);\n }\n if (candidate.expected !== 'ltr' && candidate.expected !== 'rtl' && candidate.expected !== 'neutral') {\n throw new Error(`${location}: case \"${candidate.id}\" has invalid expected direction.`);\n }\n return { id: candidate.id, text: candidate.text, expected: candidate.expected };\n });\n}\n\nasync function readCorpus(cwd: string, explicitPath?: string): Promise {\n if (explicitPath !== undefined) {\n const location = resolve(cwd, explicitPath);\n return parseCorpus(await readFile(location, 'utf8'), location);\n }\n const candidates: Array = [\n resolve(cwd, 'corpus/cases.json'),\n new URL('../corpus/cases.json', import.meta.url),\n new URL('../../../corpus/cases.json', import.meta.url)\n ];\n let lastError: unknown;\n for (const candidate of candidates) {\n let source: string;\n try {\n source = await readFile(candidate, 'utf8');\n } catch (error) {\n lastError = error;\n continue;\n }\n // An existing, malformed higher-priority corpus is a configuration error,\n // not a reason to silently fall back to a different data set.\n return parseCorpus(source, String(candidate));\n }\n throw new Error(`Unable to locate corpus/cases.json. Pass --corpus . ${String(lastError)}`);\n}\n\nfunction parseRisk(value: string): BidiControlRisk {\n if (value === 'low' || value === 'medium' || value === 'high') return value;\n throw new Error(`Invalid risk level: ${value}`);\n}\n\nfunction parseSecurityMode(value: string): BidiSecurityMode {\n if (value === 'off' || value === 'audit' || value === 'warn' || value === 'strict') return value;\n throw new Error(`Invalid security mode: ${value}`);\n}\n\nfunction parseIntervention(value: string): BidiInterventionMode {\n if (value === 'auto' || value === 'always') return value;\n throw new Error(`Invalid intervention mode: ${value}`);\n}\n\nfunction riskForFinding(finding: BidiSecurityFinding): BidiControlRisk {\n if (finding.severity === 'high') return 'high';\n if (finding.severity === 'warning') return 'medium';\n return 'low';\n}\n\nfunction highestFindingRisk(findings: readonly BidiSecurityFinding[]): BidiControlRisk | null {\n if (findings.some((finding) => finding.severity === 'high')) return 'high';\n if (findings.some((finding) => finding.severity === 'warning')) return 'medium';\n if (findings.length) return 'low';\n return null;\n}\n\nfunction sourcePosition(text: string, utf16Offset: number): { line: number; column: number } {\n let lineNumber = 1;\n let lineStart = 0;\n const newline = /\\r\\n|\\n|\\r/gu;\n let match: RegExpExecArray | null;\n while ((match = newline.exec(text)) !== null && match.index < utf16Offset) {\n lineNumber += 1;\n lineStart = match.index + match[0].length;\n }\n return { line: lineNumber, column: utf16Offset - lineStart + 1 };\n}\n\nfunction artifactUri(file: string, cwd: string): string {\n const local = relative(cwd, file);\n if (local && !local.startsWith('..') && !isAbsolute(local)) return local.replaceAll('\\\\', '/');\n return pathToFileURL(file).href;\n}\n\ninterface SecurityFileReport {\n file: string;\n text: string;\n findings: BidiSecurityFinding[];\n highestRisk: BidiControlRisk | null;\n}\n\nasync function readTextInput(\n options: { text?: string; file?: string },\n cwd: string\n): Promise {\n if (options.text === undefined && options.file === undefined) {\n throw new Error('Provide --text or --file.');\n }\n if (options.text !== undefined && options.file !== undefined) {\n throw new Error('Choose either --text or --file, not both.');\n }\n return options.file !== undefined\n ? readFile(resolve(cwd, options.file), 'utf8')\n : options.text!;\n}\n\nfunction sarifForReports(reports: readonly SecurityFileReport[], cwd: string): object {\n return {\n version: '2.1.0',\n $schema: 'https://json.schemastore.org/sarif-2.1.0.json',\n runs: [{\n columnKind: 'utf16CodeUnits',\n tool: { driver: { name: 'BidiLens', semanticVersion: CLI_VERSION } },\n results: reports.flatMap((report) => report.findings.map((finding) => {\n const start = sourcePosition(report.text, finding.sourceRange.utf16.start);\n const end = sourcePosition(report.text, finding.sourceRange.utf16.end);\n return {\n ruleId: finding.code,\n level: finding.severity === 'high' ? 'error' : finding.severity === 'warning' ? 'warning' : 'note',\n message: { text: `${finding.message} ${finding.remediation}` },\n locations: [{\n physicalLocation: {\n artifactLocation: { uri: artifactUri(report.file, cwd) },\n region: {\n startLine: start.line,\n startColumn: start.column,\n endLine: end.line,\n endColumn: end.column\n }\n }\n }]\n };\n }))\n }]\n };\n}\n\nfunction createCliProgram(state: RuntimeState): Command {\n const program = new Command();\n program\n .name('bidilens')\n .description('Inspect and secure mixed bidirectional text')\n .version(CLI_VERSION)\n .exitOverride()\n .configureOutput({ writeOut: state.stdout, writeErr: state.stderr });\n\n program.command('inspect')\n .description('Analyze a string or file')\n .option('-t, --text ', 'text to inspect')\n .option('-f, --file ', 'file to inspect')\n .option('--json', 'emit JSON')\n .action(async (options: { text?: string; file?: string; json?: boolean }) => {\n const text = await readTextInput(options, state.cwd);\n const analysis = analyzeText(text, { strategy: 'content-majority', fallback: 'neutral' });\n const controls = findBidiControls(text);\n const report = { analysis, controls, visible: controls.length ? visibleBidiControls(text) : text };\n if (options.json) line(state.stdout, JSON.stringify(report, null, 2));\n else {\n line(state.stdout, `Direction: ${analysis.direction}`);\n line(state.stdout, `Confidence: ${analysis.confidence}`);\n line(state.stdout, `Strong characters: RTL ${analysis.counts.rtl}, LTR ${analysis.counts.ltr}`);\n line(state.stdout, `Paragraphs: ${analysis.paragraphs.length}`);\n line(state.stdout, `Bidi controls: ${controls.length}`);\n if (controls.length) line(state.stdout, report.visible);\n }\n });\n\n program.command('render')\n .description('Render plain text as escaped, semantic direction-aware HTML')\n .option('-t, --text ', 'text to render')\n .option('-f, --file ', 'file to render')\n .option('--intervention ', 'auto or always', parseIntervention, 'auto')\n .option('--json', 'emit analysis and HTML as JSON')\n .action(async (options: {\n text?: string;\n file?: string;\n intervention: BidiInterventionMode;\n json?: boolean;\n }) => {\n const text = await readTextInput(options, state.cwd);\n const result = renderBidiHtml(text, { intervention: options.intervention });\n line(state.stdout, options.json\n ? JSON.stringify({ analysis: result.analysis, html: result.html }, null, 2)\n : result.html);\n });\n\n program.command('audit')\n .aliases(['security-scan', 'lint'])\n .description('Audit files for hidden and unbalanced bidi controls')\n .argument('', 'files or directories')\n .option('--json', 'emit JSON')\n .option('--sarif', 'emit SARIF 2.1.0')\n .option('--mode ', 'off, audit, warn, or strict', parseSecurityMode, 'audit')\n .option('--fail-on ', 'minimum risk that exits non-zero', parseRisk, 'high')\n .action(async (paths: string[], options: {\n json?: boolean;\n sarif?: boolean;\n mode: BidiSecurityMode;\n failOn: BidiControlRisk;\n }) => {\n if (options.json && options.sarif) throw new Error('Choose either --json or --sarif, not both.');\n const files = await collectFiles(paths, state.cwd);\n const reports: SecurityFileReport[] = [];\n let shouldFail = false;\n\n for (const file of files) {\n const text = await readFile(file, 'utf8');\n const security = scanBidiSecurity(text, { mode: options.mode });\n if (!security.findings.length) continue;\n const highestRisk = highestFindingRisk(security.findings);\n reports.push({ file, text, findings: security.findings, highestRisk });\n if (security.shouldBlock || (highestRisk && RISK_ORDER[highestRisk] >= RISK_ORDER[options.failOn])) shouldFail = true;\n }\n\n if (options.sarif) line(state.stdout, JSON.stringify(sarifForReports(reports, state.cwd), null, 2));\n else if (options.json) {\n line(state.stdout, JSON.stringify({\n scanned: files.length,\n reports: reports.map((report) => ({\n file: report.file,\n findings: report.findings,\n highestRisk: report.highestRisk\n }))\n }, null, 2));\n } else if (!reports.length) line(state.stdout, `No bidi security findings in ${files.length} files.`);\n else {\n for (const report of reports) {\n line(state.stdout, `\\n${report.file} (${report.highestRisk ?? 'unknown'})`);\n for (const finding of report.findings) {\n const position = sourcePosition(report.text, finding.sourceRange.utf16.start);\n line(state.stdout, ` ${finding.code} at ${position.line}:${position.column} [${riskForFinding(finding)}] ${finding.message}`);\n }\n }\n }\n if (shouldFail) state.exitCode = Math.max(state.exitCode, 2);\n });\n\n program.command('test')\n .description('Run the direction conformance corpus')\n .option('--json', 'emit failures as JSON')\n .option('--corpus ', 'corpus JSON path; defaults to the bundled corpus or repository corpus')\n .action(async (options: { json?: boolean; corpus?: string }) => {\n const corpus = await readCorpus(state.cwd, options.corpus);\n const failures = corpus.flatMap((item) => {\n const actual = analyzeText(item.text, { strategy: 'content-majority', fallback: 'neutral' }).direction;\n return actual === item.expected ? [] : [{ id: item.id, expected: item.expected, actual }];\n });\n if (options.json) line(state.stdout, JSON.stringify({ total: corpus.length, failures }, null, 2));\n else line(state.stdout, `Corpus: ${corpus.length - failures.length}/${corpus.length} passed`);\n if (failures.length) state.exitCode = Math.max(state.exitCode, 1);\n });\n\n program.command('sanitize')\n .description('Remove bidi controls from one file')\n .argument('', 'input file')\n .option('-o, --output ', 'output path; defaults to stdout')\n .option('--keep-low', 'preserve low-risk ALM/LRM/RLM marks')\n .action(async (file: string, options: { output?: string; keepLow?: boolean }) => {\n const text = await readFile(resolve(state.cwd, file), 'utf8');\n const remove: BidiControlRisk[] = options.keepLow ? ['high', 'medium'] : ['high', 'medium', 'low'];\n const result = sanitizeBidiControls(text, { remove });\n if (options.output) {\n const output = resolve(state.cwd, options.output);\n await writeFile(output, result.text, 'utf8');\n line(state.stderr, `Removed ${result.removed.length} controls and wrote ${output}.`);\n } else {\n state.stdout(result.text);\n }\n });\n\n return program;\n}\n\nexport async function runCli(argv: readonly string[] = process.argv, runtime: CliRuntime = {}): Promise {\n const state = createRuntime(runtime);\n const program = createCliProgram(state);\n try {\n await program.parseAsync([...argv], { from: 'node' });\n } catch (error) {\n if (error instanceof CommanderError) return Math.max(state.exitCode, error.exitCode);\n const message = error instanceof Error ? error.message : String(error);\n line(state.stderr, `bidilens: ${message}`);\n return Math.max(state.exitCode, 1);\n }\n return state.exitCode;\n}\n", "/**\n * CommanderError class\n */\nexport class 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 */\nexport class 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", "import { InvalidArgumentError } from './error.js';\n\nexport class 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. \n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.endsWith('...')) {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nexport function humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n", "import { EventEmitter } from 'node:events';\nimport childProcess from 'node:child_process';\nimport path from 'node:path';\nimport fs from 'node:fs';\nimport process from 'node:process';\nimport { stripVTControlCharacters } from 'node:util';\n\nimport { Argument, humanReadableArgName } from './argument.js';\nimport { CommanderError } from './error.js';\nimport { Help } from './help.js';\nimport { Option, DualOptions } from './option.js';\nimport { suggestSimilar } from './suggestSimilar.js';\n\nexport class 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) => stripVTControlCharacters(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n /** @type {string | undefined} */\n this._helpGroupHeading = undefined; // soft initialised when added to parent\n /** @type {string | undefined} */\n this._defaultCommandGroup = undefined;\n /** @type {string | undefined} */\n this._defaultOptionGroup = undefined;\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone [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 ', '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 `` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n this._outputConfiguration = {\n ...this._outputConfiguration,\n ...configuration,\n };\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom argument processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, parseArg, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof parseArg === 'function') {\n argument.default(defaultValue).argParser(parseArg);\n } else {\n argument.default(parseArg);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments(' [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument?.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n if (enableOrNameAndArgs && this._defaultCommandGroup) {\n // make the command to store the group\n this._initCommandGroup(this._getHelpCommand());\n }\n return this;\n }\n\n const nameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = nameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n // init group unless lazy create\n if (enableOrNameAndArgs || description) this._initCommandGroup(helpCommand);\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n this._initCommandGroup(helpCommand);\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this._initOptionGroup(option);\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this._initCommandGroup(command);\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._collectValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type ', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip ', '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 // Save the state the first time, then restore the state before each subsequent parse.\n if (this._savedState === null) {\n // Do the special default of lone negated option to true, now that we have all the options.\n // Filter for negated options that have not been processed already.\n this.options\n .filter(\n (option) =>\n option.negate &&\n option.defaultValue === undefined &&\n this.getOptionValue(option.attributeName()) === undefined,\n )\n .forEach((option) => {\n // check for lone negated option: --no-foo without a --foo option\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n option.attributeName(),\n true,\n 'default',\n );\n }\n });\n\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 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 const launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise?.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent?.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} args\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(args) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n const negativeNumberArg = (arg) => {\n // return false if not a negative number\n if (!/^-(\\d+|\\d*\\.\\d+)(e[+-]?\\d+)?$/.test(arg)) return false;\n // negative number is ok unless digit used as an option in command hierarchy\n return !this._getCommandAndAncestors().some((cmd) =>\n cmd.options\n .map((opt) => opt.short)\n .some((short) => /^-\\d$/.test(short)),\n );\n };\n\n // parse options\n let activeVariadicOption = null;\n let activeGroup = null; // working through group of short options, like -abc\n let i = 0;\n while (i < args.length || activeGroup) {\n const arg = activeGroup ?? args[i++];\n activeGroup = null;\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args.slice(i));\n break;\n }\n\n if (\n activeVariadicOption &&\n (!maybeOption(arg) || negativeNumberArg(arg))\n ) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args[i++];\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (\n i < args.length &&\n (!maybeOption(args[i]) || negativeNumberArg(args[i]))\n ) {\n value = args[i++];\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option\n this.emit(`option:${option.name()}`);\n // remove the processed option and keep processing group\n activeGroup = `-${arg.slice(2)}`;\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n // A negative number in a leaf command is not an unknown option.\n if (\n dest === operands &&\n maybeOption(arg) &&\n !(this.commands.length === 0 && negativeNumberArg(arg))\n ) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n unknown.push(...args.slice(i));\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg, ...args.slice(i));\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg, ...args.slice(i));\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg, ...args.slice(i));\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const received = receivedArgs.length;\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const details = receivedArgs.join(', ');\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${received}: ${details}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set/get the help group heading for this subcommand in parent command's help.\n *\n * @param {string} [heading]\n * @return {Command | string}\n */\n\n helpGroup(heading) {\n if (heading === undefined) return this._helpGroupHeading ?? '';\n this._helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n commandsGroup(heading) {\n if (heading === undefined) return this._defaultCommandGroup ?? '';\n this._defaultCommandGroup = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n optionsGroup(heading) {\n if (heading === undefined) return this._defaultOptionGroup ?? '';\n this._defaultOptionGroup = heading;\n return this;\n }\n\n /**\n * @param {Option} option\n * @private\n */\n _initOptionGroup(option) {\n if (this._defaultOptionGroup && !option.helpGroupHeading)\n option.helpGroup(this._defaultOptionGroup);\n }\n\n /**\n * @param {Command} cmd\n * @private\n */\n _initCommandGroup(cmd) {\n if (this._defaultCommandGroup && !cmd.helpGroup())\n cmd.helpGroup(this._defaultCommandGroup);\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or import.meta.filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(import.meta.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(import.meta.dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support enabling/disabling built-in help option.\n if (typeof flags === 'boolean') {\n if (flags) {\n if (this._helpOption === null) this._helpOption = undefined; // reenable\n if (this._defaultOptionGroup) {\n // make the option to store the group\n this._initOptionGroup(this._getHelpOption());\n }\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n this._helpOption = this.createOption(\n flags ?? '-h, --help',\n description ?? 'display help for command',\n );\n // init group unless lazy create\n if (flags || description) this._initOptionGroup(this._helpOption);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n this._initOptionGroup(option);\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * Exported for using from tests, not otherwise used outside this file.\n *\n * @returns {boolean | undefined}\n * @package\n */\nexport function 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", "import { humanReadableArgName } from './argument.js';\nimport { stripVTControlCharacters } from 'node:util';\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.\nexport class Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (option.description) {\n return `${option.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n *\n * @param {string} heading\n * @param {string[]} items\n * @param {Help} helper\n * @returns string[]\n */\n formatItemList(heading, items, helper) {\n if (items.length === 0) return [];\n\n return [helper.styleTitle(heading), ...items, ''];\n }\n\n /**\n * Group items by their help group heading.\n *\n * @param {Command[] | Option[]} unsortedItems\n * @param {Command[] | Option[]} visibleItems\n * @param {Function} getGroup\n * @returns {Map}\n */\n groupItems(unsortedItems, visibleItems, getGroup) {\n const result = new Map();\n // Add groups in order of appearance in unsortedItems.\n unsortedItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) result.set(group, []);\n });\n // Add items in order of appearance in visibleItems.\n visibleItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) {\n result.set(group, []);\n }\n result.get(group).push(item);\n });\n return result;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n output = output.concat(\n this.formatItemList('Arguments:', argumentList, helper),\n );\n\n // Options\n const optionGroups = this.groupItems(\n cmd.options,\n helper.visibleOptions(cmd),\n (option) => option.helpGroupHeading ?? 'Options:',\n );\n optionGroups.forEach((options, group) => {\n const optionList = options.map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(this.formatItemList(group, optionList, helper));\n });\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(\n this.formatItemList('Global Options:', globalOptionList, helper),\n );\n }\n\n // Commands\n const commandGroups = this.groupItems(\n cmd.commands,\n helper.visibleCommands(cmd),\n (sub) => sub.helpGroup() || 'Commands:',\n );\n commandGroups.forEach((commands, group) => {\n const commandList = commands.map((sub) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(sub)),\n helper.styleSubcommandDescription(helper.subcommandDescription(sub)),\n );\n });\n output = output.concat(this.formatItemList(group, commandList, helper));\n });\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripVTControlCharacters(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] [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] [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", "import { InvalidArgumentError } from './error.js';\n\nexport class 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 et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n this.helpGroupHeading = undefined; // soft initialised when option added to command\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _collectValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n previous.push(value);\n return previous;\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._collectValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Set the help group heading.\n *\n * @param {string} heading\n * @return {Option}\n */\n helpGroup(heading) {\n this.helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nexport class 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 '\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", "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau\u2013Levenshtein_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;\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\nexport function 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", "import { Argument } from './lib/argument.js';\nimport { Command } from './lib/command.js';\nimport { CommanderError, InvalidArgumentError } from './lib/error.js';\nimport { Help } from './lib/help.js';\nimport { Option } from './lib/option.js';\n\nexport const program = new Command();\n\nexport const createCommand = (name) => new Command(name);\nexport const createOption = (flags, description) =>\n new Option(flags, description);\nexport const createArgument = (name, description) =>\n new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexport { Command, Option, Argument, Help };\nexport { CommanderError, InvalidArgumentError };\nexport { InvalidArgumentError as InvalidOptionArgumentError }; // Deprecated\n", "// Generated by scripts/generate-bidi-data.ts. Do not edit by hand.\n// Source: https://www.unicode.org/Public/17.0.0/ucd/extracted/DerivedBidiClass.txt\n// SHA-256: 4867b4b7f0731ed1bfcd34cc6251211ff1542541fce0734b6fbda139ee80b3a4\n// Source: https://www.unicode.org/Public/17.0.0/ucd/extracted/DerivedGeneralCategory.txt\n// SHA-256: d62e5bab70ca74f099343f71224fa051cb1fdd61a1ab45c0488c44cfc0b6102e\n\nexport const UNICODE_BIDI_VERSION = '17.0.0';\nexport const UNICODE_BIDI_SHA256 = '4867b4b7f0731ed1bfcd34cc6251211ff1542541fce0734b6fbda139ee80b3a4';\nexport const UNICODE_GENERAL_CATEGORY_SHA256 = 'd62e5bab70ca74f099343f71224fa051cb1fdd61a1ab45c0488c44cfc0b6102e';\n\nexport const RTL_BIDI_RANGES: ReadonlyArray = [\n 0x590, 0x590,\n 0x5be, 0x5be,\n 0x5c0, 0x5c0,\n 0x5c3, 0x5c3,\n 0x5c6, 0x5c6,\n 0x5c8, 0x5ff,\n 0x608, 0x608,\n 0x60b, 0x60b,\n 0x60d, 0x60d,\n 0x61b, 0x64a,\n 0x66d, 0x66f,\n 0x671, 0x6d5,\n 0x6e5, 0x6e6,\n 0x6ee, 0x6ef,\n 0x6fa, 0x710,\n 0x712, 0x72f,\n 0x74b, 0x7a5,\n 0x7b1, 0x7ea,\n 0x7f4, 0x7f5,\n 0x7fa, 0x7fc,\n 0x7fe, 0x815,\n 0x81a, 0x81a,\n 0x824, 0x824,\n 0x828, 0x828,\n 0x82e, 0x858,\n 0x85c, 0x88f,\n 0x892, 0x896,\n 0x8a0, 0x8c9,\n 0x200f, 0x200f,\n 0xfb1d, 0xfb1d,\n 0xfb1f, 0xfb28,\n 0xfb2a, 0xfbc2,\n 0xfbd3, 0xfd3d,\n 0xfd50, 0xfd8f,\n 0xfd92, 0xfdc7,\n 0xfdf0, 0xfdfc,\n 0xfe70, 0xfefe,\n 0x10800, 0x1091e,\n 0x10920, 0x10a00,\n 0x10a04, 0x10a04,\n 0x10a07, 0x10a0b,\n 0x10a10, 0x10a37,\n 0x10a3b, 0x10a3e,\n 0x10a40, 0x10ae4,\n 0x10ae7, 0x10b38,\n 0x10b40, 0x10d23,\n 0x10d28, 0x10d2f,\n 0x10d3a, 0x10d3f,\n 0x10d4a, 0x10d68,\n 0x10d6f, 0x10e5f,\n 0x10e7f, 0x10eaa,\n 0x10ead, 0x10ecf,\n 0x10ed9, 0x10ef9,\n 0x10f00, 0x10f45,\n 0x10f51, 0x10f81,\n 0x10f86, 0x10fff,\n 0x1e800, 0x1e8cf,\n 0x1e8d7, 0x1e943,\n 0x1e94b, 0x1eeef,\n 0x1eef2, 0x1efff\n];\n\nexport const NON_STRONG_BIDI_RANGES: ReadonlyArray = [\n 0x0, 0x40,\n 0x5b, 0x60,\n 0x7b, 0xa9,\n 0xab, 0xb4,\n 0xb6, 0xb9,\n 0xbb, 0xbf,\n 0xd7, 0xd7,\n 0xf7, 0xf7,\n 0x2b9, 0x2ba,\n 0x2c2, 0x2cf,\n 0x2d2, 0x2df,\n 0x2e5, 0x2ed,\n 0x2ef, 0x36f,\n 0x374, 0x375,\n 0x37e, 0x37e,\n 0x384, 0x385,\n 0x387, 0x387,\n 0x3f6, 0x3f6,\n 0x483, 0x489,\n 0x58a, 0x58a,\n 0x58d, 0x58f,\n 0x591, 0x5bd,\n 0x5bf, 0x5bf,\n 0x5c1, 0x5c2,\n 0x5c4, 0x5c5,\n 0x5c7, 0x5c7,\n 0x600, 0x607,\n 0x609, 0x60a,\n 0x60c, 0x60c,\n 0x60e, 0x61a,\n 0x64b, 0x66c,\n 0x670, 0x670,\n 0x6d6, 0x6e4,\n 0x6e7, 0x6ed,\n 0x6f0, 0x6f9,\n 0x711, 0x711,\n 0x730, 0x74a,\n 0x7a6, 0x7b0,\n 0x7eb, 0x7f3,\n 0x7f6, 0x7f9,\n 0x7fd, 0x7fd,\n 0x816, 0x819,\n 0x81b, 0x823,\n 0x825, 0x827,\n 0x829, 0x82d,\n 0x859, 0x85b,\n 0x890, 0x891,\n 0x897, 0x89f,\n 0x8ca, 0x902,\n 0x93a, 0x93a,\n 0x93c, 0x93c,\n 0x941, 0x948,\n 0x94d, 0x94d,\n 0x951, 0x957,\n 0x962, 0x963,\n 0x981, 0x981,\n 0x9bc, 0x9bc,\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f8d, 0xf97,\n 0xf99, 0xfbc,\n 0xfc6, 0xfc6,\n 0x102d, 0x1030,\n 0x1032, 0x1037,\n 0x1039, 0x103a,\n 0x103d, 0x103e,\n 0x1058, 0x1059,\n 0x105e, 0x1060,\n 0x1071, 0x1074,\n 0x1082, 0x1082,\n 0x1085, 0x1086,\n 0x108d, 0x108d,\n 0x109d, 0x109d,\n 0x135d, 0x135f,\n 0x1390, 0x1399,\n 0x1400, 0x1400,\n 0x1680, 0x1680,\n 0x169b, 0x169c,\n 0x1712, 0x1714,\n 0x1732, 0x1733,\n 0x1752, 0x1753,\n 0x1772, 0x1773,\n 0x17b4, 0x17b5,\n 0x17b7, 0x17bd,\n 0x17c6, 0x17c6,\n 0x17c9, 0x17d3,\n 0x17db, 0x17db,\n 0x17dd, 0x17dd,\n 0x17f0, 0x17f9,\n 0x1800, 0x180f,\n 0x1885, 0x1886,\n 0x18a9, 0x18a9,\n 0x1920, 0x1922,\n 0x1927, 0x1928,\n 0x1932, 0x1932,\n 0x1939, 0x193b,\n 0x1940, 0x1940,\n 0x1944, 0x1945,\n 0x19de, 0x19ff,\n 0x1a17, 0x1a18,\n 0x1a1b, 0x1a1b,\n 0x1a56, 0x1a56,\n 0x1a58, 0x1a5e,\n 0x1a60, 0x1a60,\n 0x1a62, 0x1a62,\n 0x1a65, 0x1a6c,\n 0x1a73, 0x1a7c,\n 0x1a7f, 0x1a7f,\n 0x1ab0, 0x1add,\n 0x1ae0, 0x1aeb,\n 0x1b00, 0x1b03,\n 0x1b34, 0x1b34,\n 0x1b36, 0x1b3a,\n 0x1b3c, 0x1b3c,\n 0x1b42, 0x1b42,\n 0x1b6b, 0x1b73,\n 0x1b80, 0x1b81,\n 0x1ba2, 0x1ba5,\n 0x1ba8, 0x1ba9,\n 0x1bab, 0x1bad,\n 0x1be6, 0x1be6,\n 0x1be8, 0x1be9,\n 0x1bed, 0x1bed,\n 0x1bef, 0x1bf1,\n 0x1c2c, 0x1c33,\n 0x1c36, 0x1c37,\n 0x1cd0, 0x1cd2,\n 0x1cd4, 0x1ce0,\n 0x1ce2, 0x1ce8,\n 0x1ced, 0x1ced,\n 0x1cf4, 0x1cf4,\n 0x1cf8, 0x1cf9,\n 0x1dc0, 0x1dff,\n 0x1fbd, 0x1fbd,\n 0x1fbf, 0x1fc1,\n 0x1fcd, 0x1fcf,\n 0x1fdd, 0x1fdf,\n 0x1fed, 0x1fef,\n 0x1ffd, 0x1ffe,\n 0x2000, 0x200d,\n 0x2010, 0x2070,\n 0x2074, 0x207e,\n 0x2080, 0x208e,\n 0x20a0, 0x20f0,\n 0x2100, 0x2101,\n 0x2103, 0x2106,\n 0x2108, 0x2109,\n 0x2114, 0x2114,\n 0x2116, 0x2118,\n 0x211e, 0x2123,\n 0x2125, 0x2125,\n 0x2127, 0x2127,\n 0x2129, 0x2129,\n 0x212e, 0x212e,\n 0x213a, 0x213b,\n 0x2140, 0x2144,\n 0x214a, 0x214d,\n 0x2150, 0x215f,\n 0x2189, 0x218b,\n 0x2190, 0x2335,\n 0x237b, 0x2394,\n 0x2396, 0x2429,\n 0x2440, 0x244a,\n 0x2460, 0x249b,\n 0x24ea, 0x26ab,\n 0x26ad, 0x27ff,\n 0x2900, 0x2b73,\n 0x2b76, 0x2bff,\n 0x2ce5, 0x2cea,\n 0x2cef, 0x2cf1,\n 0x2cf9, 0x2cff,\n 0x2d7f, 0x2d7f,\n 0x2de0, 0x2e5d,\n 0x2e80, 0x2e99,\n 0x2e9b, 0x2ef3,\n 0x2f00, 0x2fd5,\n 0x2ff0, 0x3004,\n 0x3008, 0x3020,\n 0x302a, 0x302d,\n 0x3030, 0x3030,\n 0x3036, 0x3037,\n 0x303d, 0x303f,\n 0x3099, 0x309c,\n 0x30a0, 0x30a0,\n 0x30fb, 0x30fb,\n 0x31c0, 0x31e5,\n 0x31ef, 0x31ef,\n 0x321d, 0x321e,\n 0x3250, 0x325f,\n 0x327c, 0x327e,\n 0x32b1, 0x32bf,\n 0x32cc, 0x32cf,\n 0x3377, 0x337a,\n 0x33de, 0x33df,\n 0x33ff, 0x33ff,\n 0x4dc0, 0x4dff,\n 0xa490, 0xa4c6,\n 0xa60d, 0xa60f,\n 0xa66f, 0xa67f,\n 0xa69e, 0xa69f,\n 0xa6f0, 0xa6f1,\n 0xa700, 0xa721,\n 0xa788, 0xa788,\n 0xa802, 0xa802,\n 0xa806, 0xa806,\n 0xa80b, 0xa80b,\n 0xa825, 0xa826,\n 0xa828, 0xa82c,\n 0xa838, 0xa839,\n 0xa874, 0xa877,\n 0xa8c4, 0xa8c5,\n 0xa8e0, 0xa8f1,\n 0xa8ff, 0xa8ff,\n 0xa926, 0xa92d,\n 0xa947, 0xa951,\n 0xa980, 0xa982,\n 0xa9b3, 0xa9b3,\n 0xa9b6, 0xa9b9,\n 0xa9bc, 0xa9bd,\n 0xa9e5, 0xa9e5,\n 0xaa29, 0xaa2e,\n 0xaa31, 0xaa32,\n 0xaa35, 0xaa36,\n 0xaa43, 0xaa43,\n 0xaa4c, 0xaa4c,\n 0xaa7c, 0xaa7c,\n 0xaab0, 0xaab0,\n 0xaab2, 0xaab4,\n 0xaab7, 0xaab8,\n 0xaabe, 0xaabf,\n 0xaac1, 0xaac1,\n 0xaaec, 0xaaed,\n 0xaaf6, 0xaaf6,\n 0xab6a, 0xab6b,\n 0xabe5, 0xabe5,\n 0xabe8, 0xabe8,\n 0xabed, 0xabed,\n 0xfb1e, 0xfb1e,\n 0xfb29, 0xfb29,\n 0xfbc3, 0xfbd2,\n 0xfd3e, 0xfd4f,\n 0xfd90, 0xfd91,\n 0xfdc8, 0xfdef,\n 0xfdfd, 0xfe19,\n 0xfe20, 0xfe52,\n 0xfe54, 0xfe66,\n 0xfe68, 0xfe6b,\n 0xfeff, 0xfeff,\n 0xff01, 0xff20,\n 0xff3b, 0xff40,\n 0xff5b, 0xff65,\n 0xffe0, 0xffe6,\n 0xffe8, 0xffee,\n 0xfff0, 0xffff,\n 0x10101, 0x10101,\n 0x10140, 0x1018c,\n 0x10190, 0x1019c,\n 0x101a0, 0x101a0,\n 0x101fd, 0x101fd,\n 0x102e0, 0x102fb,\n 0x10376, 0x1037a,\n 0x1091f, 0x1091f,\n 0x10a01, 0x10a03,\n 0x10a05, 0x10a06,\n 0x10a0c, 0x10a0f,\n 0x10a38, 0x10a3a,\n 0x10a3f, 0x10a3f,\n 0x10ae5, 0x10ae6,\n 0x10b39, 0x10b3f,\n 0x10d24, 0x10d27,\n 0x10d30, 0x10d39,\n 0x10d40, 0x10d49,\n 0x10d69, 0x10d6e,\n 0x10e60, 0x10e7e,\n 0x10eab, 0x10eac,\n 0x10ed0, 0x10ed8,\n 0x10efa, 0x10eff,\n 0x10f46, 0x10f50,\n 0x10f82, 0x10f85,\n 0x11001, 0x11001,\n 0x11038, 0x11046,\n 0x11052, 0x11065,\n 0x11070, 0x11070,\n 0x11073, 0x11074,\n 0x1107f, 0x11081,\n 0x110b3, 0x110b6,\n 0x110b9, 0x110ba,\n 0x110c2, 0x110c2,\n 0x11100, 0x11102,\n 0x11127, 0x1112b,\n 0x1112d, 0x11134,\n 0x11173, 0x11173,\n 0x11180, 0x11181,\n 0x111b6, 0x111be,\n 0x111c9, 0x111cc,\n 0x111cf, 0x111cf,\n 0x1122f, 0x11231,\n 0x11234, 0x11234,\n 0x11236, 0x11237,\n 0x1123e, 0x1123e,\n 0x11241, 0x11241,\n 0x112df, 0x112df,\n 0x112e3, 0x112ea,\n 0x11300, 0x11301,\n 0x1133b, 0x1133c,\n 0x11340, 0x11340,\n 0x11366, 0x1136c,\n 0x11370, 0x11374,\n 0x113bb, 0x113c0,\n 0x113ce, 0x113ce,\n 0x113d0, 0x113d0,\n 0x113d2, 0x113d2,\n 0x113e1, 0x113e2,\n 0x11438, 0x1143f,\n 0x11442, 0x11444,\n 0x11446, 0x11446,\n 0x1145e, 0x1145e,\n 0x114b3, 0x114b8,\n 0x114ba, 0x114ba,\n 0x114bf, 0x114c0,\n 0x114c2, 0x114c3,\n 0x115b2, 0x115b5,\n 0x115bc, 0x115bd,\n 0x115bf, 0x115c0,\n 0x115dc, 0x115dd,\n 0x11633, 0x1163a,\n 0x1163d, 0x1163d,\n 0x1163f, 0x11640,\n 0x11660, 0x1166c,\n 0x116ab, 0x116ab,\n 0x116ad, 0x116ad,\n 0x116b0, 0x116b5,\n 0x116b7, 0x116b7,\n 0x1171d, 0x1171d,\n 0x1171f, 0x1171f,\n 0x11722, 0x11725,\n 0x11727, 0x1172b,\n 0x1182f, 0x11837,\n 0x11839, 0x1183a,\n 0x1193b, 0x1193c,\n 0x1193e, 0x1193e,\n 0x11943, 0x11943,\n 0x119d4, 0x119d7,\n 0x119da, 0x119db,\n 0x119e0, 0x119e0,\n 0x11a01, 0x11a06,\n 0x11a09, 0x11a0a,\n 0x11a33, 0x11a38,\n 0x11a3b, 0x11a3e,\n 0x11a47, 0x11a47,\n 0x11a51, 0x11a56,\n 0x11a59, 0x11a5b,\n 0x11a8a, 0x11a96,\n 0x11a98, 0x11a99,\n 0x11b60, 0x11b60,\n 0x11b62, 0x11b64,\n 0x11b66, 0x11b66,\n 0x11c30, 0x11c36,\n 0x11c38, 0x11c3d,\n 0x11c92, 0x11ca7,\n 0x11caa, 0x11cb0,\n 0x11cb2, 0x11cb3,\n 0x11cb5, 0x11cb6,\n 0x11d31, 0x11d36,\n 0x11d3a, 0x11d3a,\n 0x11d3c, 0x11d3d,\n 0x11d3f, 0x11d45,\n 0x11d47, 0x11d47,\n 0x11d90, 0x11d91,\n 0x11d95, 0x11d95,\n 0x11d97, 0x11d97,\n 0x11ef3, 0x11ef4,\n 0x11f00, 0x11f01,\n 0x11f36, 0x11f3a,\n 0x11f40, 0x11f40,\n 0x11f42, 0x11f42,\n 0x11f5a, 0x11f5a,\n 0x11fd5, 0x11ff1,\n 0x13440, 0x13440,\n 0x13447, 0x13455,\n 0x1611e, 0x16129,\n 0x1612d, 0x1612f,\n 0x16af0, 0x16af4,\n 0x16b30, 0x16b36,\n 0x16f4f, 0x16f4f,\n 0x16f8f, 0x16f92,\n 0x16fe2, 0x16fe2,\n 0x16fe4, 0x16fe4,\n 0x1bc9d, 0x1bc9e,\n 0x1bca0, 0x1bca3,\n 0x1cc00, 0x1ccd5,\n 0x1ccf0, 0x1ccfc,\n 0x1cd00, 0x1ceb3,\n 0x1ceba, 0x1ced0,\n 0x1cee0, 0x1cef0,\n 0x1cf00, 0x1cf2d,\n 0x1cf30, 0x1cf46,\n 0x1d167, 0x1d169,\n 0x1d173, 0x1d182,\n 0x1d185, 0x1d18b,\n 0x1d1aa, 0x1d1ad,\n 0x1d1e9, 0x1d1ea,\n 0x1d200, 0x1d245,\n 0x1d300, 0x1d356,\n 0x1d6c1, 0x1d6c1,\n 0x1d6db, 0x1d6db,\n 0x1d6fb, 0x1d6fb,\n 0x1d715, 0x1d715,\n 0x1d735, 0x1d735,\n 0x1d74f, 0x1d74f,\n 0x1d76f, 0x1d76f,\n 0x1d789, 0x1d789,\n 0x1d7a9, 0x1d7a9,\n 0x1d7c3, 0x1d7c3,\n 0x1d7ce, 0x1d7ff,\n 0x1da00, 0x1da36,\n 0x1da3b, 0x1da6c,\n 0x1da75, 0x1da75,\n 0x1da84, 0x1da84,\n 0x1da9b, 0x1da9f,\n 0x1daa1, 0x1daaf,\n 0x1e000, 0x1e006,\n 0x1e008, 0x1e018,\n 0x1e01b, 0x1e021,\n 0x1e023, 0x1e024,\n 0x1e026, 0x1e02a,\n 0x1e08f, 0x1e08f,\n 0x1e130, 0x1e136,\n 0x1e2ae, 0x1e2ae,\n 0x1e2ec, 0x1e2ef,\n 0x1e2ff, 0x1e2ff,\n 0x1e4ec, 0x1e4ef,\n 0x1e5ee, 0x1e5ef,\n 0x1e6e3, 0x1e6e3,\n 0x1e6e6, 0x1e6e6,\n 0x1e6ee, 0x1e6ef,\n 0x1e6f5, 0x1e6f5,\n 0x1e8d0, 0x1e8d6,\n 0x1e944, 0x1e94a,\n 0x1eef0, 0x1eef1,\n 0x1f000, 0x1f02b,\n 0x1f030, 0x1f093,\n 0x1f0a0, 0x1f0ae,\n 0x1f0b1, 0x1f0bf,\n 0x1f0c1, 0x1f0cf,\n 0x1f0d1, 0x1f0f5,\n 0x1f100, 0x1f10f,\n 0x1f12f, 0x1f12f,\n 0x1f16a, 0x1f16f,\n 0x1f1ad, 0x1f1ad,\n 0x1f260, 0x1f265,\n 0x1f300, 0x1f6d8,\n 0x1f6dc, 0x1f6ec,\n 0x1f6f0, 0x1f6fc,\n 0x1f700, 0x1f7d9,\n 0x1f7e0, 0x1f7eb,\n 0x1f7f0, 0x1f7f0,\n 0x1f800, 0x1f80b,\n 0x1f810, 0x1f847,\n 0x1f850, 0x1f859,\n 0x1f860, 0x1f887,\n 0x1f890, 0x1f8ad,\n 0x1f8b0, 0x1f8bb,\n 0x1f8c0, 0x1f8c1,\n 0x1f8d0, 0x1f8d8,\n 0x1f900, 0x1fa57,\n 0x1fa60, 0x1fa6d,\n 0x1fa70, 0x1fa7c,\n 0x1fa80, 0x1fa8a,\n 0x1fa8e, 0x1fac6,\n 0x1fac8, 0x1fac8,\n 0x1facd, 0x1fadc,\n 0x1fadf, 0x1faea,\n 0x1faef, 0x1faf8,\n 0x1fb00, 0x1fb92,\n 0x1fb94, 0x1fbfa,\n 0x1fffe, 0x1ffff,\n 0x2fffe, 0x2ffff,\n 0x3fffe, 0x3ffff,\n 0x4fffe, 0x4ffff,\n 0x5fffe, 0x5ffff,\n 0x6fffe, 0x6ffff,\n 0x7fffe, 0x7ffff,\n 0x8fffe, 0x8ffff,\n 0x9fffe, 0x9ffff,\n 0xafffe, 0xaffff,\n 0xbfffe, 0xbffff,\n 0xcfffe, 0xcffff,\n 0xdfffe, 0xe0fff,\n 0xefffe, 0xeffff,\n 0xffffe, 0xfffff,\n 0x10fffe, 0x10ffff\n];\n\nexport const NATURAL_LETTER_RANGES: ReadonlyArray = [\n 0x41, 0x5a,\n 0x61, 0x7a,\n 0xaa, 0xaa,\n 0xb5, 0xb5,\n 0xba, 0xba,\n 0xc0, 0xd6,\n 0xd8, 0xf6,\n 0xf8, 0x2c1,\n 0x2c6, 0x2d1,\n 0x2e0, 0x2e4,\n 0x2ec, 0x2ec,\n 0x2ee, 0x2ee,\n 0x370, 0x374,\n 0x376, 0x377,\n 0x37a, 0x37d,\n 0x37f, 0x37f,\n 0x386, 0x386,\n 0x388, 0x38a,\n 0x38c, 0x38c,\n 0x38e, 0x3a1,\n 0x3a3, 0x3f5,\n 0x3f7, 0x481,\n 0x48a, 0x52f,\n 0x531, 0x556,\n 0x559, 0x559,\n 0x560, 0x588,\n 0x5d0, 0x5ea,\n 0x5ef, 0x5f2,\n 0x620, 0x64a,\n 0x66e, 0x66f,\n 0x671, 0x6d3,\n 0x6d5, 0x6d5,\n 0x6e5, 0x6e6,\n 0x6ee, 0x6ef,\n 0x6fa, 0x6fc,\n 0x6ff, 0x6ff,\n 0x710, 0x710,\n 0x712, 0x72f,\n 0x74d, 0x7a5,\n 0x7b1, 0x7b1,\n 0x7ca, 0x7ea,\n 0x7f4, 0x7f5,\n 0x7fa, 0x7fa,\n 0x800, 0x815,\n 0x81a, 0x81a,\n 0x824, 0x824,\n 0x828, 0x828,\n 0x840, 0x858,\n 0x860, 0x86a,\n 0x870, 0x887,\n 0x889, 0x88f,\n 0x8a0, 0x8c9,\n 0x904, 0x939,\n 0x93d, 0x93d,\n 0x950, 0x950,\n 0x958, 0x961,\n 0x971, 0x980,\n 0x985, 0x98c,\n 0x98f, 0x990,\n 0x993, 0x9a8,\n 0x9aa, 0x9b0,\n 0x9b2, 0x9b2,\n 0x9b6, 0x9b9,\n 0x9bd, 0x9bd,\n 0x9ce, 0x9ce,\n 0x9dc, 0x9dd,\n 0x9df, 0x9e1,\n 0x9f0, 0x9f1,\n 0x9fc, 0x9fc,\n 0xa05, 0xa0a,\n 0xa0f, 0xa10,\n 0xa13, 0xa28,\n 0xa2a, 0xa30,\n 0xa32, 0xa33,\n 0xa35, 0xa36,\n 0xa38, 0xa39,\n 0xa59, 0xa5c,\n 0xa5e, 0xa5e,\n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8a,\n 0xe8c, 0xea3,\n 0xea5, 0xea5,\n 0xea7, 0xeb0,\n 0xeb2, 0xeb3,\n 0xebd, 0xebd,\n 0xec0, 0xec4,\n 0xec6, 0xec6,\n 0xedc, 0xedf,\n 0xf00, 0xf00,\n 0xf40, 0xf47,\n 0xf49, 0xf6c,\n 0xf88, 0xf8c,\n 0x1000, 0x102a,\n 0x103f, 0x103f,\n 0x1050, 0x1055,\n 0x105a, 0x105d,\n 0x1061, 0x1061,\n 0x1065, 0x1066,\n 0x106e, 0x1070,\n 0x1075, 0x1081,\n 0x108e, 0x108e,\n 0x10a0, 0x10c5,\n 0x10c7, 0x10c7,\n 0x10cd, 0x10cd,\n 0x10d0, 0x10fa,\n 0x10fc, 0x1248,\n 0x124a, 0x124d,\n 0x1250, 0x1256,\n 0x1258, 0x1258,\n 0x125a, 0x125d,\n 0x1260, 0x1288,\n 0x128a, 0x128d,\n 0x1290, 0x12b0,\n 0x12b2, 0x12b5,\n 0x12b8, 0x12be,\n 0x12c0, 0x12c0,\n 0x12c2, 0x12c5,\n 0x12c8, 0x12d6,\n 0x12d8, 0x1310,\n 0x1312, 0x1315,\n 0x1318, 0x135a,\n 0x1380, 0x138f,\n 0x13a0, 0x13f5,\n 0x13f8, 0x13fd,\n 0x1401, 0x166c,\n 0x166f, 0x167f,\n 0x1681, 0x169a,\n 0x16a0, 0x16ea,\n 0x16f1, 0x16f8,\n 0x1700, 0x1711,\n 0x171f, 0x1731,\n 0x1740, 0x1751,\n 0x1760, 0x176c,\n 0x176e, 0x1770,\n 0x1780, 0x17b3,\n 0x17d7, 0x17d7,\n 0x17dc, 0x17dc,\n 0x1820, 0x1878,\n 0x1880, 0x1884,\n 0x1887, 0x18a8,\n 0x18aa, 0x18aa,\n 0x18b0, 0x18f5,\n 0x1900, 0x191e,\n 0x1950, 0x196d,\n 0x1970, 0x1974,\n 0x1980, 0x19ab,\n 0x19b0, 0x19c9,\n 0x1a00, 0x1a16,\n 0x1a20, 0x1a54,\n 0x1aa7, 0x1aa7,\n 0x1b05, 0x1b33,\n 0x1b45, 0x1b4c,\n 0x1b83, 0x1ba0,\n 0x1bae, 0x1baf,\n 0x1bba, 0x1be5,\n 0x1c00, 0x1c23,\n 0x1c4d, 0x1c4f,\n 0x1c5a, 0x1c7d,\n 0x1c80, 0x1c8a,\n 0x1c90, 0x1cba,\n 0x1cbd, 0x1cbf,\n 0x1ce9, 0x1cec,\n 0x1cee, 0x1cf3,\n 0x1cf5, 0x1cf6,\n 0x1cfa, 0x1cfa,\n 0x1d00, 0x1dbf,\n 0x1e00, 0x1f15,\n 0x1f18, 0x1f1d,\n 0x1f20, 0x1f45,\n 0x1f48, 0x1f4d,\n 0x1f50, 0x1f57,\n 0x1f59, 0x1f59,\n 0x1f5b, 0x1f5b,\n 0x1f5d, 0x1f5d,\n 0x1f5f, 0x1f7d,\n 0x1f80, 0x1fb4,\n 0x1fb6, 0x1fbc,\n 0x1fbe, 0x1fbe,\n 0x1fc2, 0x1fc4,\n 0x1fc6, 0x1fcc,\n 0x1fd0, 0x1fd3,\n 0x1fd6, 0x1fdb,\n 0x1fe0, 0x1fec,\n 0x1ff2, 0x1ff4,\n 0x1ff6, 0x1ffc,\n 0x2071, 0x2071,\n 0x207f, 0x207f,\n 0x2090, 0x209c,\n 0x2102, 0x2102,\n 0x2107, 0x2107,\n 0x210a, 0x2113,\n 0x2115, 0x2115,\n 0x2119, 0x211d,\n 0x2124, 0x2124,\n 0x2126, 0x2126,\n 0x2128, 0x2128,\n 0x212a, 0x212d,\n 0x212f, 0x2139,\n 0x213c, 0x213f,\n 0x2145, 0x2149,\n 0x214e, 0x214e,\n 0x2183, 0x2184,\n 0x2c00, 0x2ce4,\n 0x2ceb, 0x2cee,\n 0x2cf2, 0x2cf3,\n 0x2d00, 0x2d25,\n 0x2d27, 0x2d27,\n 0x2d2d, 0x2d2d,\n 0x2d30, 0x2d67,\n 0x2d6f, 0x2d6f,\n 0x2d80, 0x2d96,\n 0x2da0, 0x2da6,\n 0x2da8, 0x2dae,\n 0x2db0, 0x2db6,\n 0x2db8, 0x2dbe,\n 0x2dc0, 0x2dc6,\n 0x2dc8, 0x2dce,\n 0x2dd0, 0x2dd6,\n 0x2dd8, 0x2dde,\n 0x2e2f, 0x2e2f,\n 0x3005, 0x3006,\n 0x3031, 0x3035,\n 0x303b, 0x303c,\n 0x3041, 0x3096,\n 0x309d, 0x309f,\n 0x30a1, 0x30fa,\n 0x30fc, 0x30ff,\n 0x3105, 0x312f,\n 0x3131, 0x318e,\n 0x31a0, 0x31bf,\n 0x31f0, 0x31ff,\n 0x3400, 0x4dbf,\n 0x4e00, 0xa48c,\n 0xa4d0, 0xa4fd,\n 0xa500, 0xa60c,\n 0xa610, 0xa61f,\n 0xa62a, 0xa62b,\n 0xa640, 0xa66e,\n 0xa67f, 0xa69d,\n 0xa6a0, 0xa6e5,\n 0xa717, 0xa71f,\n 0xa722, 0xa788,\n 0xa78b, 0xa7dc,\n 0xa7f1, 0xa801,\n 0xa803, 0xa805,\n 0xa807, 0xa80a,\n 0xa80c, 0xa822,\n 0xa840, 0xa873,\n 0xa882, 0xa8b3,\n 0xa8f2, 0xa8f7,\n 0xa8fb, 0xa8fb,\n 0xa8fd, 0xa8fe,\n 0xa90a, 0xa925,\n 0xa930, 0xa946,\n 0xa960, 0xa97c,\n 0xa984, 0xa9b2,\n 0xa9cf, 0xa9cf,\n 0xa9e0, 0xa9e4,\n 0xa9e6, 0xa9ef,\n 0xa9fa, 0xa9fe,\n 0xaa00, 0xaa28,\n 0xaa40, 0xaa42,\n 0xaa44, 0xaa4b,\n 0xaa60, 0xaa76,\n 0xaa7a, 0xaa7a,\n 0xaa7e, 0xaaaf,\n 0xaab1, 0xaab1,\n 0xaab5, 0xaab6,\n 0xaab9, 0xaabd,\n 0xaac0, 0xaac0,\n 0xaac2, 0xaac2,\n 0xaadb, 0xaadd,\n 0xaae0, 0xaaea,\n 0xaaf2, 0xaaf4,\n 0xab01, 0xab06,\n 0xab09, 0xab0e,\n 0xab11, 0xab16,\n 0xab20, 0xab26,\n 0xab28, 0xab2e,\n 0xab30, 0xab5a,\n 0xab5c, 0xab69,\n 0xab70, 0xabe2,\n 0xac00, 0xd7a3,\n 0xd7b0, 0xd7c6,\n 0xd7cb, 0xd7fb,\n 0xf900, 0xfa6d,\n 0xfa70, 0xfad9,\n 0xfb00, 0xfb06,\n 0xfb13, 0xfb17,\n 0xfb1d, 0xfb1d,\n 0xfb1f, 0xfb28,\n 0xfb2a, 0xfb36,\n 0xfb38, 0xfb3c,\n 0xfb3e, 0xfb3e,\n 0xfb40, 0xfb41,\n 0xfb43, 0xfb44,\n 0xfb46, 0xfbb1,\n 0xfbd3, 0xfd3d,\n 0xfd50, 0xfd8f,\n 0xfd92, 0xfdc7,\n 0xfdf0, 0xfdfb,\n 0xfe70, 0xfe74,\n 0xfe76, 0xfefc,\n 0xff21, 0xff3a,\n 0xff41, 0xff5a,\n 0xff66, 0xffbe,\n 0xffc2, 0xffc7,\n 0xffca, 0xffcf,\n 0xffd2, 0xffd7,\n 0xffda, 0xffdc,\n 0x10000, 0x1000b,\n 0x1000d, 0x10026,\n 0x10028, 0x1003a,\n 0x1003c, 0x1003d,\n 0x1003f, 0x1004d,\n 0x10050, 0x1005d,\n 0x10080, 0x100fa,\n 0x10280, 0x1029c,\n 0x102a0, 0x102d0,\n 0x10300, 0x1031f,\n 0x1032d, 0x10340,\n 0x10342, 0x10349,\n 0x10350, 0x10375,\n 0x10380, 0x1039d,\n 0x103a0, 0x103c3,\n 0x103c8, 0x103cf,\n 0x10400, 0x1049d,\n 0x104b0, 0x104d3,\n 0x104d8, 0x104fb,\n 0x10500, 0x10527,\n 0x10530, 0x10563,\n 0x10570, 0x1057a,\n 0x1057c, 0x1058a,\n 0x1058c, 0x10592,\n 0x10594, 0x10595,\n 0x10597, 0x105a1,\n 0x105a3, 0x105b1,\n 0x105b3, 0x105b9,\n 0x105bb, 0x105bc,\n 0x105c0, 0x105f3,\n 0x10600, 0x10736,\n 0x10740, 0x10755,\n 0x10760, 0x10767,\n 0x10780, 0x10785,\n 0x10787, 0x107b0,\n 0x107b2, 0x107ba,\n 0x10800, 0x10805,\n 0x10808, 0x10808,\n 0x1080a, 0x10835,\n 0x10837, 0x10838,\n 0x1083c, 0x1083c,\n 0x1083f, 0x10855,\n 0x10860, 0x10876,\n 0x10880, 0x1089e,\n 0x108e0, 0x108f2,\n 0x108f4, 0x108f5,\n 0x10900, 0x10915,\n 0x10920, 0x10939,\n 0x10940, 0x10959,\n 0x10980, 0x109b7,\n 0x109be, 0x109bf,\n 0x10a00, 0x10a00,\n 0x10a10, 0x10a13,\n 0x10a15, 0x10a17,\n 0x10a19, 0x10a35,\n 0x10a60, 0x10a7c,\n 0x10a80, 0x10a9c,\n 0x10ac0, 0x10ac7,\n 0x10ac9, 0x10ae4,\n 0x10b00, 0x10b35,\n 0x10b40, 0x10b55,\n 0x10b60, 0x10b72,\n 0x10b80, 0x10b91,\n 0x10c00, 0x10c48,\n 0x10c80, 0x10cb2,\n 0x10cc0, 0x10cf2,\n 0x10d00, 0x10d23,\n 0x10d4a, 0x10d65,\n 0x10d6f, 0x10d85,\n 0x10e80, 0x10ea9,\n 0x10eb0, 0x10eb1,\n 0x10ec2, 0x10ec7,\n 0x10f00, 0x10f1c,\n 0x10f27, 0x10f27,\n 0x10f30, 0x10f45,\n 0x10f70, 0x10f81,\n 0x10fb0, 0x10fc4,\n 0x10fe0, 0x10ff6,\n 0x11003, 0x11037,\n 0x11071, 0x11072,\n 0x11075, 0x11075,\n 0x11083, 0x110af,\n 0x110d0, 0x110e8,\n 0x11103, 0x11126,\n 0x11144, 0x11144,\n 0x11147, 0x11147,\n 0x11150, 0x11172,\n 0x11176, 0x11176,\n 0x11183, 0x111b2,\n 0x111c1, 0x111c4,\n 0x111da, 0x111da,\n 0x111dc, 0x111dc,\n 0x11200, 0x11211,\n 0x11213, 0x1122b,\n 0x1123f, 0x11240,\n 0x11280, 0x11286,\n 0x11288, 0x11288,\n 0x1128a, 0x1128d,\n 0x1128f, 0x1129d,\n 0x1129f, 0x112a8,\n 0x112b0, 0x112de,\n 0x11305, 0x1130c,\n 0x1130f, 0x11310,\n 0x11313, 0x11328,\n 0x1132a, 0x11330,\n 0x11332, 0x11333,\n 0x11335, 0x11339,\n 0x1133d, 0x1133d,\n 0x11350, 0x11350,\n 0x1135d, 0x11361,\n 0x11380, 0x11389,\n 0x1138b, 0x1138b,\n 0x1138e, 0x1138e,\n 0x11390, 0x113b5,\n 0x113b7, 0x113b7,\n 0x113d1, 0x113d1,\n 0x113d3, 0x113d3,\n 0x11400, 0x11434,\n 0x11447, 0x1144a,\n 0x1145f, 0x11461,\n 0x11480, 0x114af,\n 0x114c4, 0x114c5,\n 0x114c7, 0x114c7,\n 0x11580, 0x115ae,\n 0x115d8, 0x115db,\n 0x11600, 0x1162f,\n 0x11644, 0x11644,\n 0x11680, 0x116aa,\n 0x116b8, 0x116b8,\n 0x11700, 0x1171a,\n 0x11740, 0x11746,\n 0x11800, 0x1182b,\n 0x118a0, 0x118df,\n 0x118ff, 0x11906,\n 0x11909, 0x11909,\n 0x1190c, 0x11913,\n 0x11915, 0x11916,\n 0x11918, 0x1192f,\n 0x1193f, 0x1193f,\n 0x11941, 0x11941,\n 0x119a0, 0x119a7,\n 0x119aa, 0x119d0,\n 0x119e1, 0x119e1,\n 0x119e3, 0x119e3,\n 0x11a00, 0x11a00,\n 0x11a0b, 0x11a32,\n 0x11a3a, 0x11a3a,\n 0x11a50, 0x11a50,\n 0x11a5c, 0x11a89,\n 0x11a9d, 0x11a9d,\n 0x11ab0, 0x11af8,\n 0x11bc0, 0x11be0,\n 0x11c00, 0x11c08,\n 0x11c0a, 0x11c2e,\n 0x11c40, 0x11c40,\n 0x11c72, 0x11c8f,\n 0x11d00, 0x11d06,\n 0x11d08, 0x11d09,\n 0x11d0b, 0x11d30,\n 0x11d46, 0x11d46,\n 0x11d60, 0x11d65,\n 0x11d67, 0x11d68,\n 0x11d6a, 0x11d89,\n 0x11d98, 0x11d98,\n 0x11db0, 0x11ddb,\n 0x11ee0, 0x11ef2,\n 0x11f02, 0x11f02,\n 0x11f04, 0x11f10,\n 0x11f12, 0x11f33,\n 0x11fb0, 0x11fb0,\n 0x12000, 0x12399,\n 0x12480, 0x12543,\n 0x12f90, 0x12ff0,\n 0x13000, 0x1342f,\n 0x13441, 0x13446,\n 0x13460, 0x143fa,\n 0x14400, 0x14646,\n 0x16100, 0x1611d,\n 0x16800, 0x16a38,\n 0x16a40, 0x16a5e,\n 0x16a70, 0x16abe,\n 0x16ad0, 0x16aed,\n 0x16b00, 0x16b2f,\n 0x16b40, 0x16b43,\n 0x16b63, 0x16b77,\n 0x16b7d, 0x16b8f,\n 0x16d40, 0x16d6c,\n 0x16e40, 0x16e7f,\n 0x16ea0, 0x16eb8,\n 0x16ebb, 0x16ed3,\n 0x16f00, 0x16f4a,\n 0x16f50, 0x16f50,\n 0x16f93, 0x16f9f,\n 0x16fe0, 0x16fe1,\n 0x16fe3, 0x16fe3,\n 0x16ff2, 0x16ff3,\n 0x17000, 0x18cd5,\n 0x18cff, 0x18d1e,\n 0x18d80, 0x18df2,\n 0x1aff0, 0x1aff3,\n 0x1aff5, 0x1affb,\n 0x1affd, 0x1affe,\n 0x1b000, 0x1b122,\n 0x1b132, 0x1b132,\n 0x1b150, 0x1b152,\n 0x1b155, 0x1b155,\n 0x1b164, 0x1b167,\n 0x1b170, 0x1b2fb,\n 0x1bc00, 0x1bc6a,\n 0x1bc70, 0x1bc7c,\n 0x1bc80, 0x1bc88,\n 0x1bc90, 0x1bc99,\n 0x1d400, 0x1d454,\n 0x1d456, 0x1d49c,\n 0x1d49e, 0x1d49f,\n 0x1d4a2, 0x1d4a2,\n 0x1d4a5, 0x1d4a6,\n 0x1d4a9, 0x1d4ac,\n 0x1d4ae, 0x1d4b9,\n 0x1d4bb, 0x1d4bb,\n 0x1d4bd, 0x1d4c3,\n 0x1d4c5, 0x1d505,\n 0x1d507, 0x1d50a,\n 0x1d50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0x1ee4d, 0x1ee4f,\n 0x1ee51, 0x1ee52,\n 0x1ee54, 0x1ee54,\n 0x1ee57, 0x1ee57,\n 0x1ee59, 0x1ee59,\n 0x1ee5b, 0x1ee5b,\n 0x1ee5d, 0x1ee5d,\n 0x1ee5f, 0x1ee5f,\n 0x1ee61, 0x1ee62,\n 0x1ee64, 0x1ee64,\n 0x1ee67, 0x1ee6a,\n 0x1ee6c, 0x1ee72,\n 0x1ee74, 0x1ee77,\n 0x1ee79, 0x1ee7c,\n 0x1ee7e, 0x1ee7e,\n 0x1ee80, 0x1ee89,\n 0x1ee8b, 0x1ee9b,\n 0x1eea1, 0x1eea3,\n 0x1eea5, 0x1eea9,\n 0x1eeab, 0x1eebb,\n 0x20000, 0x2a6df,\n 0x2a700, 0x2b81d,\n 0x2b820, 0x2cead,\n 0x2ceb0, 0x2ebe0,\n 0x2ebf0, 0x2ee5d,\n 0x2f800, 0x2fa1d,\n 0x30000, 0x3134a,\n 0x31350, 0x33479\n];\n", "import type { Direction } from './types.js';\nimport {\n NON_STRONG_BIDI_RANGES,\n NATURAL_LETTER_RANGES,\n RTL_BIDI_RANGES,\n UNICODE_BIDI_SHA256,\n UNICODE_GENERAL_CATEGORY_SHA256,\n UNICODE_BIDI_VERSION\n} from './generated/bidi-ranges.js';\n\nfunction isInRanges(codePoint: number, ranges: ReadonlyArray): boolean {\n let low = 0;\n let high = ranges.length / 2 - 1;\n while (low <= high) {\n const middle = (low + high) >> 1;\n const start = ranges[middle * 2]!;\n const end = ranges[middle * 2 + 1]!;\n if (codePoint < start) high = middle - 1;\n else if (codePoint > end) low = middle + 1;\n else return true;\n }\n return false;\n}\n\nexport function isRtlCodePoint(codePoint: number): boolean {\n return isInRanges(codePoint, RTL_BIDI_RANGES);\n}\n\n/** Returns the Unicode Bidi_Class strong direction, including LRM/RLM/ALM. */\nexport function classifyBidiStrongCharacter(character: string): Direction {\n const codePoint = character.codePointAt(0);\n if (codePoint === undefined || isInRanges(codePoint, NON_STRONG_BIDI_RANGES)) return 'neutral';\n return isRtlCodePoint(codePoint) ? 'rtl' : 'ltr';\n}\n\n/** Classifies natural-language letters while leaving numbers and punctuation neutral. */\nexport function classifyCharacter(character: string): Direction {\n const codePoint = character.codePointAt(0);\n if (codePoint === undefined) return 'neutral';\n return isInRanges(codePoint, NATURAL_LETTER_RANGES) ? classifyBidiStrongCharacter(character) : 'neutral';\n}\n\nexport const UNICODE_DATA_VERSION = UNICODE_BIDI_VERSION;\nexport const UNICODE_DATA_SHA256 = UNICODE_BIDI_SHA256;\nexport const UNICODE_LETTER_DATA_SHA256 = UNICODE_GENERAL_CATEGORY_SHA256;\n", "import { classifyBidiStrongCharacter, classifyCharacter } from './classify.js';\nimport type {\n DetectionOptions,\n Direction,\n ParagraphAnalysis,\n StrongCharacterCounts,\n TextAnalysis\n} from './types.js';\n\nexport interface TechnicalTokenRange {\n text: string;\n start: number;\n end: number;\n kind: 'code' | 'url' | 'email' | 'path' | 'version' | 'hash' | 'identifier' | 'number' | 'command' | 'math' | 'html';\n}\n\nconst DEFAULT_OPTIONS: Required = {\n strategy: 'content-majority',\n fallback: 'neutral',\n inheritedDirection: 'ltr',\n minimumStrongCharacters: 1,\n majorityThreshold: 0.5,\n excludeTechnicalTokens: true,\n technicalIdentifiers: []\n};\n\nexport const DEFAULT_TECHNICAL_IDENTIFIERS = Object.freeze([\n 'ai', 'api', 'anthropic', 'chatgpt', 'claude', 'cli', 'codex', 'copilot', 'cursor',\n 'deepseek', 'electron', 'gemini', 'github', 'gitlab', 'grok', 'huggingface',\n 'javascript', 'json', 'llama', 'markdown', 'mistral', 'node', 'npm', 'openai',\n 'python', 'qwen', 'react', 'rust', 'svelte', 'typescript', 'url', 'version',\n 'vscode', 'vue', 'web', 'webpack', 'yaml',\n 'angular', 'astro', 'chrome', 'docker', 'esbuild', 'eslint', 'firefox',\n 'kubernetes', 'kubectl', 'nuxt', 'playwright', 'pnpm', 'preact', 'remix',\n 'rollup', 'safari', 'stencil', 'storybook', 'tailwind', 'turbopack', 'vite',\n 'vitest'\n] as const);\nconst KNOWN_TECHNICAL_TOKENS = new Set(DEFAULT_TECHNICAL_IDENTIFIERS);\nconst CUSTOM_TECHNICAL_IDENTIFIER_CACHE = new WeakMap>();\n\nfunction normalizeOptions(options: DetectionOptions = {}): Required {\n const strategy = options.strategy ?? DEFAULT_OPTIONS.strategy;\n const majorityStrategy = strategy === 'content-majority'\n || strategy === 'semantic-dominant'\n || strategy === 'majority';\n return {\n strategy,\n fallback: options.fallback ?? options.inheritedDirection ?? DEFAULT_OPTIONS.fallback,\n inheritedDirection: options.inheritedDirection ?? DEFAULT_OPTIONS.inheritedDirection,\n minimumStrongCharacters: Math.max(1, options.minimumStrongCharacters ?? DEFAULT_OPTIONS.minimumStrongCharacters),\n majorityThreshold: Math.min(1, Math.max(0.5, options.majorityThreshold ?? DEFAULT_OPTIONS.majorityThreshold)),\n // Compatibility/strict first-strong modes must see the real first strong\n // character (including a leading technical identifier), like dir=\"auto\".\n excludeTechnicalTokens: options.excludeTechnicalTokens ?? majorityStrategy,\n technicalIdentifiers: options.technicalIdentifiers ?? DEFAULT_OPTIONS.technicalIdentifiers\n };\n}\n\nfunction addRange(\n ranges: TechnicalTokenRange[],\n text: string,\n start: number,\n end: number,\n kind: TechnicalTokenRange['kind']\n): void {\n if (end > start) ranges.push({ text: text.slice(start, end), start, end, kind });\n}\n\nfunction addMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const value = match[group];\n if (value === undefined) continue;\n const start = match.index + match[0].indexOf(value);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction trimTechnicalPunctuation(value: string): string {\n let end = value.length;\n while (end > 0 && /[.,;:!?\u060C\u061B\u061F\u3002\u0964\u06D4]/u.test(value[end - 1]!)) end -= 1;\n return end === value.length ? value : value.slice(0, end);\n}\n\nfunction addValidatedMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n validate: (value: string) => boolean,\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const value = match[group];\n if (value === undefined || !validate(value)) continue;\n const start = match.index + match[0].indexOf(value);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction addNormalizedMatches(\n text: string,\n ranges: TechnicalTokenRange[],\n expression: RegExp,\n kind: TechnicalTokenRange['kind'],\n normalize: (value: string) => string,\n group = 0\n): void {\n expression.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = expression.exec(text)) !== null) {\n const original = match[group];\n if (original === undefined) continue;\n const value = normalize(original);\n if (!value) continue;\n const start = match.index + match[0].indexOf(original);\n addRange(ranges, text, start, start + value.length, kind);\n }\n}\n\nfunction isIpv4(value: string): boolean {\n const parts = value.split('.');\n return parts.length === 4 && parts.every((part) => /^\\d{1,3}$/u.test(part) && Number(part) <= 255);\n}\n\nfunction isIpv6(value: string): boolean {\n if (!/^[0-9A-F:]+$/iu.test(value) || !value.includes(':')) return false;\n const compression = value.indexOf('::');\n if (compression !== value.lastIndexOf('::')) return false;\n const sides = compression >= 0 ? value.split('::') : [value];\n const groups = sides.flatMap((side) => side ? side.split(':') : []);\n if (!groups.every((group) => /^[0-9A-F]{1,4}$/iu.test(group))) return false;\n return compression >= 0 ? groups.length < 8 : groups.length === 8;\n}\n\nfunction addCodeRanges(text: string, ranges: TechnicalTokenRange[]): void {\n let fence: { marker: '`' | '~'; length: number; start: number } | undefined;\n const closedFences: Array<{ start: number; end: number }> = [];\n let lineStart = 0;\n while (lineStart < text.length) {\n let lineEnd = lineStart;\n while (lineEnd < text.length && text[lineEnd] !== '\\r' && text[lineEnd] !== '\\n') lineEnd += 1;\n let nextLine = lineEnd;\n if (text[nextLine] === '\\r') nextLine += 1;\n if (text[nextLine] === '\\n') nextLine += 1;\n const line = text.slice(lineStart, lineEnd);\n if (!fence) {\n const openerMatch = /^ {0,3}(`{3,}|~{3,})(.*)$/u.exec(line);\n const opener = openerMatch?.[1];\n const info = openerMatch?.[2] ?? '';\n if (opener && !(opener[0] === '`' && info.includes('`'))) fence = {\n marker: opener[0] as '`' | '~',\n length: opener.length,\n start: lineStart\n };\n } else {\n const closer = /^ {0,3}(`+|~+)[ \\t]*$/u.exec(line)?.[1];\n if (closer?.[0] === fence.marker && closer.length >= fence.length) {\n closedFences.push({ start: fence.start, end: nextLine });\n fence = undefined;\n }\n }\n lineStart = nextLine;\n }\n // Decide once over the union of all closed spans. Scanning each fence's\n // complementary text separately would be quadratic and would mistake code\n // inside a second standalone fence for prose outside the first.\n let fenceIndex = 0;\n let utf16Index = 0;\n let hasOutsideNaturalText = false;\n for (const character of text) {\n while (fenceIndex < closedFences.length && utf16Index >= closedFences[fenceIndex]!.end) {\n fenceIndex += 1;\n }\n const span = closedFences[fenceIndex];\n const insideFence = span !== undefined && utf16Index >= span.start && utf16Index < span.end;\n if (!insideFence && classifyCharacter(character) !== 'neutral') {\n hasOutsideNaturalText = true;\n break;\n }\n utf16Index += character.length;\n }\n // Standalone fenced code keeps its historical raw-text direction evidence.\n // Parser-aware Markdown adapters force code blocks LTR. Excluding complete\n // fences is useful when surrounding prose\u2014not code literals\u2014must decide the\n // containing raw block's natural direction.\n if (hasOutsideNaturalText) {\n for (const span of closedFences) addRange(ranges, text, span.start, span.end, 'code');\n }\n\n const lineExpression = /[^\\r\\n]*/gu;\n let lineMatch: RegExpExecArray | null;\n while ((lineMatch = lineExpression.exec(text)) !== null) {\n const line = lineMatch[0];\n const lineStart = lineMatch.index;\n const runs: Array<{ start: number; length: number }> = [];\n for (let index = 0; index < line.length;) {\n if (line[index] !== '`') {\n index += 1;\n continue;\n }\n const start = index;\n while (index < line.length && line[index] === '`') index += 1;\n runs.push({ start, length: index - start });\n }\n const suffixMaximum = new Array(runs.length + 1).fill(0);\n for (let index = runs.length - 1; index >= 0; index -= 1) {\n suffixMaximum[index] = Math.max(runs[index]!.length, suffixMaximum[index + 1]!);\n }\n let runIndex = 0;\n let cursor = runs[0]?.start ?? 0;\n while (runIndex < runs.length) {\n const opener = runs[runIndex]!;\n const openerEnd = opener.start + opener.length;\n if (cursor >= openerEnd) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n const available = openerEnd - cursor;\n const delimiterLength = Math.min(\n available,\n Math.max(Math.floor(available / 2), suffixMaximum[runIndex + 1]!)\n );\n if (delimiterLength === 0) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n let closingRunIndex = runIndex;\n let closingStart = cursor + delimiterLength;\n if (available - delimiterLength < delimiterLength) {\n closingRunIndex += 1;\n while (closingRunIndex < runs.length\n && runs[closingRunIndex]!.length < delimiterLength) closingRunIndex += 1;\n if (closingRunIndex >= runs.length) {\n runIndex += 1;\n cursor = runs[runIndex]?.start ?? 0;\n continue;\n }\n closingStart = runs[closingRunIndex]!.start;\n }\n const end = closingStart + delimiterLength;\n addRange(ranges, text, lineStart + cursor, lineStart + end, 'code');\n runIndex = closingRunIndex;\n cursor = end;\n }\n if (lineMatch[0].length === 0) lineExpression.lastIndex += 1;\n }\n}\n\nfunction customTechnicalIdentifiers(values: readonly string[]): ReadonlySet {\n const cacheable = Object.isFrozen(values);\n const cached = cacheable ? CUSTOM_TECHNICAL_IDENTIFIER_CACHE.get(values) : undefined;\n if (cached) return cached;\n const identifiers = new Set();\n for (const value of values) {\n if (/^[A-Za-z][A-Za-z0-9_.-]*$/u.test(value)) identifiers.add(value.toLowerCase());\n }\n if (cacheable) CUSTOM_TECHNICAL_IDENTIFIER_CACHE.set(values, identifiers);\n return identifiers;\n}\n\n/**\n * Acronyms are short. A longer all-capital word is emphasized prose, not an\n * identifier, and must keep deciding the natural-language base direction.\n */\nconst ACRONYM_MAXIMUM_LENGTH = 5;\n\nfunction isKnownTechnicalWord(value: string, custom: ReadonlySet): boolean {\n const normalized = value.toLowerCase();\n return KNOWN_TECHNICAL_TOKENS.has(normalized) || custom.has(normalized);\n}\n\n/**\n * Reports whether capitals are the block's prose style rather than an\n * identifier signal. `PLEASE READ THIS WARNING` is emphasized natural language;\n * the same `API` token inside mixed-case prose is an acronym. Deciding this per\n * block keeps the rule deterministic and needs no dictionary or language model.\n */\nfunction usesUppercaseProse(text: string): boolean {\n const words = text.match(/\\b[A-Za-z]{2,}\\b/gu);\n if (words === null || words.length < 2) return false;\n let capitalized = 0;\n let hasLongCapitalizedWord = false;\n // Every candidate is alphabetic, so \"contains no lowercase\" means all-capital.\n for (const word of words) {\n if (/[a-z]/u.test(word)) continue;\n capitalized += 1;\n if (word.length > ACRONYM_MAXIMUM_LENGTH) hasLongCapitalizedWord = true;\n }\n // `HTTP API` is an acronym sequence, not proof of an uppercase prose style.\n // Requiring one long word keeps that short technical phrase excluded while\n // still recognizing natural-language emphasis such as `PLEASE READ THIS`.\n return hasLongCapitalizedWord && capitalized * 2 > words.length;\n}\n\n/**\n * Only tokens starting with an ASCII letter reach this test, so every false\n * exclusion removes LTR evidence and never RTL evidence. An over-broad rule\n * therefore biases mixed blocks toward RTL \u2014 the mirror of the failure this\n * project exists to fix \u2014 which is why the hyphen is not a signal on its own.\n */\nfunction isTechnicalIdentifier(\n token: string,\n custom: ReadonlySet,\n uppercaseProse: boolean\n): boolean {\n if (isKnownTechnicalWord(token, custom)) return true;\n // A hyphenated token is technical when a segment is itself a known technical\n // word (`react-markdown`, `web-app`), not merely because it is hyphenated.\n if (token.includes('-')\n && token.split('-').some((segment) => segment !== '' && isKnownTechnicalWord(segment, custom))) {\n return true;\n }\n // Digits, underscores, and dots are structural identifier syntax.\n return /[0-9_.]/u.test(token)\n || /[a-z][A-Z]/u.test(token)\n || (!uppercaseProse\n && token.length <= ACRONYM_MAXIMUM_LENGTH\n && /^[A-Z]{2,}$/u.test(token));\n}\n\n/** Finds ranges that should not decide the natural-language base direction. */\nexport function findTechnicalTokenRanges(\n text: string,\n technicalIdentifiers: readonly string[] = []\n): TechnicalTokenRange[] {\n const ranges: TechnicalTokenRange[] = [];\n addCodeRanges(text, ranges);\n addMatches(text, ranges, /<\\/?[A-Za-z][^<>\\r\\n]*>/gu, 'html');\n addMatches(text, ranges, /(?:\\$\\$[^\\r\\n]*?\\$\\$|\\$[^$\\r\\n]+\\$|\\\\\\([^\\r\\n]*?\\\\\\))/gu, 'math');\n\n const urls = /\\b(?:https?|ftp):\\/\\/[^\\s<>{}\"']+/giu;\n let urlMatch: RegExpExecArray | null;\n while ((urlMatch = urls.exec(text)) !== null) {\n let value = urlMatch[0];\n value = trimTechnicalPunctuation(value);\n for (const [open, close] of [['(', ')'], ['[', ']'], ['{', '}']] as const) {\n if (!value.endsWith(close)) continue;\n let balance = 0;\n for (const character of value) {\n if (character === open) balance += 1;\n else if (character === close) balance -= 1;\n }\n if (balance >= 0) continue;\n let end = value.length;\n while (balance < 0 && end > 0 && value[end - 1] === close) {\n balance += 1;\n end -= 1;\n }\n if (end !== value.length) value = value.slice(0, end);\n }\n addRange(ranges, text, urlMatch.index, urlMatch.index + value.length, 'url');\n }\n addMatches(text, ranges, /\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}\\b/giu, 'email');\n addNormalizedMatches(\n text,\n ranges,\n /(?()\\x5B\\x5D{}]+/gu,\n 'path',\n trimTechnicalPunctuation\n );\n addMatches(text, ranges, /\\b(?:[A-Za-z0-9_.-]+[\\\\/])+(?:[A-Za-z0-9_.-]+)\\b/gu, 'path');\n addMatches(text, ranges, /(? a.start - b.start || b.end - a.end);\n const merged: TechnicalTokenRange[] = [];\n for (const range of ranges) {\n const previous = merged.at(-1);\n if (previous && range.start <= previous.end) {\n previous.end = Math.max(previous.end, range.end);\n previous.text = text.slice(previous.start, previous.end);\n } else {\n merged.push({ ...range });\n }\n }\n return merged;\n}\n\nexport function countStrongCharacters(\n text: string,\n options: DetectionOptions = {}\n): StrongCharacterCounts & { firstStrong: Direction; technicalTokens: TechnicalTokenRange[] } {\n const normalized = normalizeOptions(options);\n return countStrongCharactersNormalized(text, normalized);\n}\n\nfunction countStrongCharactersNormalized(\n text: string,\n normalized: Required\n): StrongCharacterCounts & { firstStrong: Direction; technicalTokens: TechnicalTokenRange[] } {\n const technicalTokens = normalized.excludeTechnicalTokens\n ? findTechnicalTokenRanges(text, normalized.technicalIdentifiers)\n : [];\n let ltr = 0;\n let rtl = 0;\n let firstStrong: Direction = 'neutral';\n let index = 0;\n let technicalIndex = 0;\n const classify = normalized.strategy === 'first-strong' || normalized.strategy === 'strict-uax9'\n ? classifyBidiStrongCharacter\n : classifyCharacter;\n\n for (const character of text) {\n // Technical ranges are sorted and merged, so advance one cursor instead\n // of rescanning every range for every code point. This keeps detection\n // linear even for long transcripts containing many URLs/identifiers.\n while (technicalIndex < technicalTokens.length && index >= technicalTokens[technicalIndex]!.end) {\n technicalIndex += 1;\n }\n const technicalRange = technicalTokens[technicalIndex];\n const isTechnical = technicalRange !== undefined\n && index >= technicalRange.start\n && index < technicalRange.end;\n if (!isTechnical) {\n const direction = classify(character);\n if (direction === 'ltr') ltr += 1;\n if (direction === 'rtl') rtl += 1;\n if (firstStrong === 'neutral' && direction !== 'neutral') firstStrong = direction;\n }\n index += character.length;\n }\n\n return { ltr, rtl, total: ltr + rtl, firstStrong, technicalTokens };\n}\n\nfunction fallbackDirection(options: Required): Direction {\n return options.fallback;\n}\n\nfunction directionFromCounts(\n counts: StrongCharacterCounts & { firstStrong: Direction },\n normalized: Required\n): Direction {\n if (normalized.strategy === 'ltr' || normalized.strategy === 'rtl') return normalized.strategy;\n if (normalized.strategy === 'inherit') return normalized.inheritedDirection;\n if (counts.total < normalized.minimumStrongCharacters) return fallbackDirection(normalized);\n\n if (normalized.strategy === 'first-strong' || normalized.strategy === 'strict-uax9') {\n return counts.firstStrong === 'neutral' ? fallbackDirection(normalized) : counts.firstStrong;\n }\n\n if (counts.rtl > counts.ltr && counts.rtl / counts.total >= normalized.majorityThreshold) return 'rtl';\n if (counts.ltr > counts.rtl && counts.ltr / counts.total >= normalized.majorityThreshold) return 'ltr';\n return counts.firstStrong === 'neutral' ? fallbackDirection(normalized) : counts.firstStrong;\n}\n\nexport function detectDirection(text: string, options: DetectionOptions = {}): Direction {\n const normalized = normalizeOptions(options);\n if (normalized.strategy === 'ltr' || normalized.strategy === 'rtl') return normalized.strategy;\n if (normalized.strategy === 'inherit') return normalized.inheritedDirection;\n return directionFromCounts(countStrongCharactersNormalized(text, normalized), normalized);\n}\n\nfunction confidenceFor(counts: StrongCharacterCounts, direction: Direction): number {\n if (counts.total === 0 || direction === 'neutral') return 0;\n const matching = direction === 'rtl' ? counts.rtl : counts.ltr;\n return Number((matching / counts.total).toFixed(4));\n}\n\nfunction firstBidiStrongCharacter(text: string): Direction {\n for (const character of text) {\n const direction = classifyBidiStrongCharacter(character);\n if (direction !== 'neutral') return direction;\n }\n return 'neutral';\n}\n\nfunction splitParagraphs(text: string): Array<{ text: string; start: number; end: number }> {\n const paragraphs: Array<{ text: string; start: number; end: number }> = [];\n const separator = /\\r\\n|\\n|\\r|\\u2029/gu;\n let start = 0;\n let match: RegExpExecArray | null;\n\n while ((match = separator.exec(text)) !== null) {\n paragraphs.push({ text: text.slice(start, match.index), start, end: match.index });\n start = match.index + match[0].length;\n }\n paragraphs.push({ text: text.slice(start), start, end: text.length });\n return paragraphs;\n}\n\nexport function analyzeParagraph(text: string, start = 0, options: DetectionOptions = {}): ParagraphAnalysis {\n const normalized = normalizeOptions(options);\n const countsWithFirst = countStrongCharactersNormalized(text, normalized);\n const counts: StrongCharacterCounts = {\n ltr: countsWithFirst.ltr,\n rtl: countsWithFirst.rtl,\n total: countsWithFirst.total\n };\n const direction = directionFromCounts(countsWithFirst, normalized);\n return {\n text,\n start,\n end: start + text.length,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n confidence: confidenceFor(counts, direction),\n counts\n };\n}\n\nexport function analyzeText(text: string, options: DetectionOptions = {}): TextAnalysis {\n const normalized = normalizeOptions(options);\n const countsWithFirst = countStrongCharactersNormalized(text, normalized);\n const counts: StrongCharacterCounts = {\n ltr: countsWithFirst.ltr,\n rtl: countsWithFirst.rtl,\n total: countsWithFirst.total\n };\n const direction = directionFromCounts(countsWithFirst, normalized);\n const rawCountsWithFirst = countStrongCharactersNormalized(text, normalizeOptions({\n ...normalized,\n strategy: 'content-majority',\n excludeTechnicalTokens: false\n }));\n const rawCounts: StrongCharacterCounts = {\n ltr: rawCountsWithFirst.ltr,\n rtl: rawCountsWithFirst.rtl,\n total: rawCountsWithFirst.total\n };\n const split = splitParagraphs(text);\n const paragraphs = split.length === 1\n ? [{\n text,\n start: 0,\n end: text.length,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n confidence: confidenceFor(counts, direction),\n counts\n }]\n : split.map((paragraph) => analyzeParagraph(paragraph.text, paragraph.start, normalized));\n return {\n text,\n direction,\n firstStrong: countsWithFirst.firstStrong,\n rawFirstStrong: firstBidiStrongCharacter(text),\n confidence: confidenceFor(counts, direction),\n counts,\n rawCounts,\n paragraphs,\n mixed: rawCounts.ltr > 0 && rawCounts.rtl > 0\n };\n}\n", "import type {\n BidiControlFinding,\n BidiControlRisk,\n BidiControlSanitizationGroup,\n BidiSecurityFinding,\n BidiSecurityMode,\n BidiSecurityReport,\n BidiSecuritySeverity\n} from './types.js';\n\nconst CONTROL_METADATA = new Map>([\n [0x061c, { name: 'ARABIC LETTER MARK', risk: 'low', category: 'mark' }],\n [0x200e, { name: 'LEFT-TO-RIGHT MARK', risk: 'low', category: 'mark' }],\n [0x200f, { name: 'RIGHT-TO-LEFT MARK', risk: 'low', category: 'mark' }],\n [0x202a, { name: 'LEFT-TO-RIGHT EMBEDDING', risk: 'high', category: 'embedding' }],\n [0x202b, { name: 'RIGHT-TO-LEFT EMBEDDING', risk: 'high', category: 'embedding' }],\n [0x202c, { name: 'POP DIRECTIONAL FORMATTING', risk: 'medium', category: 'pop' }],\n [0x202d, { name: 'LEFT-TO-RIGHT OVERRIDE', risk: 'high', category: 'override' }],\n [0x202e, { name: 'RIGHT-TO-LEFT OVERRIDE', risk: 'high', category: 'override' }],\n [0x2066, { name: 'LEFT-TO-RIGHT ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2067, { name: 'RIGHT-TO-LEFT ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2068, { name: 'FIRST STRONG ISOLATE', risk: 'medium', category: 'isolate' }],\n [0x2069, { name: 'POP DIRECTIONAL ISOLATE', risk: 'medium', category: 'pop' }],\n [0x206a, { name: 'INHIBIT SYMMETRIC SWAPPING', risk: 'medium', category: 'deprecated' }],\n [0x206b, { name: 'ACTIVATE SYMMETRIC SWAPPING', risk: 'medium', category: 'deprecated' }],\n [0x206c, { name: 'INHIBIT ARABIC FORM SHAPING', risk: 'medium', category: 'deprecated' }],\n [0x206d, { name: 'ACTIVATE ARABIC FORM SHAPING', risk: 'medium', category: 'deprecated' }],\n [0x206e, { name: 'NATIONAL DIGIT SHAPES', risk: 'medium', category: 'deprecated' }],\n [0x206f, { name: 'NOMINAL DIGIT SHAPES', risk: 'medium', category: 'deprecated' }]\n]);\n\nconst REMEDIATION = 'Remove the control unless a documented plain-text protocol requires it; prefer semantic markup and isolation.';\n\nfunction severityForRisk(risk: BidiControlRisk): BidiSecuritySeverity {\n if (risk === 'high') return 'high';\n if (risk === 'medium') return 'warning';\n return 'info';\n}\n\nfunction rangeFor(control: BidiControlFinding): BidiSecurityFinding['sourceRange'] {\n return {\n utf16: { start: control.index, end: control.end },\n codePoint: { start: control.codePointIndex, end: control.codePointIndex + 1 }\n };\n}\n\nfunction codeForControl(control: BidiControlFinding): string {\n if (control.category === 'override') return 'BIDI_OVERRIDE_CONTROL';\n if (control.category === 'embedding') return 'BIDI_EMBEDDING_CONTROL';\n if (control.category === 'isolate') return 'BIDI_ISOLATE_CONTROL';\n if (control.category === 'mark') return 'BIDI_DIRECTIONAL_MARK';\n if (control.category === 'deprecated') return 'BIDI_DEPRECATED_CONTROL';\n return 'BIDI_POP_CONTROL';\n}\n\nfunction controlFinding(control: BidiControlFinding): BidiSecurityFinding {\n return {\n code: codeForControl(control),\n severity: severityForRisk(control.risk),\n message: `${control.name} (${control.codePoint}) is invisible and changes bidirectional interpretation.`,\n sourceRange: rangeFor(control),\n remediation: REMEDIATION,\n control\n };\n}\n\nexport function findBidiControls(text: string): BidiControlFinding[] {\n const findings: BidiControlFinding[] = [];\n let utf16Index = 0;\n let codePointIndex = 0;\n\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const metadata = CONTROL_METADATA.get(codePoint);\n if (metadata) {\n findings.push({\n character,\n codePoint: `U+${codePoint.toString(16).toUpperCase().padStart(4, '0')}`,\n index: utf16Index,\n end: utf16Index + character.length,\n codePointIndex,\n ...metadata\n });\n }\n utf16Index += character.length;\n codePointIndex += 1;\n }\n return findings;\n}\n\nexport function visibleBidiControls(text: string): string {\n const namesByCodePoint = new Map([...CONTROL_METADATA].map(([codePoint, metadata]) => [codePoint, metadata.name]));\n let result = '';\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const name = namesByCodePoint.get(codePoint);\n result += name ? `\u27E6${name}\u27E7` : character;\n }\n return result;\n}\n\nexport function highestControlRisk(findings: readonly BidiControlFinding[]): BidiControlRisk | null {\n if (findings.some((finding) => finding.risk === 'high')) return 'high';\n if (findings.some((finding) => finding.risk === 'medium')) return 'medium';\n if (findings.some((finding) => finding.risk === 'low')) return 'low';\n return null;\n}\n\ninterface FormattingFrame {\n kind: 'embedding' | 'isolate';\n control: BidiControlFinding;\n}\n\nfunction lastFrameIndex(stack: readonly FormattingFrame[], kind: FormattingFrame['kind']): number {\n for (let index = stack.length - 1; index >= 0; index -= 1) {\n if (stack[index]?.kind === kind) return index;\n }\n return -1;\n}\n\nfunction balanceFindings(controls: readonly BidiControlFinding[]): BidiSecurityFinding[] {\n const findings: BidiSecurityFinding[] = [];\n const stack: FormattingFrame[] = [];\n\n for (const control of controls) {\n const codePoint = control.codePoint;\n if (codePoint === 'U+202A' || codePoint === 'U+202B' || codePoint === 'U+202D' || codePoint === 'U+202E') {\n stack.push({ kind: 'embedding', control });\n continue;\n }\n if (codePoint === 'U+2066' || codePoint === 'U+2067' || codePoint === 'U+2068') {\n stack.push({ kind: 'isolate', control });\n continue;\n }\n if (codePoint === 'U+202C') {\n const isolateIndex = lastFrameIndex(stack, 'isolate');\n const embeddingIndex = lastFrameIndex(stack, 'embedding');\n if (embeddingIndex <= isolateIndex) {\n findings.push({\n code: 'BIDI_UNMATCHED_PDF',\n severity: 'high',\n message: 'POP DIRECTIONAL FORMATTING has no matching active embedding or override.',\n sourceRange: rangeFor(control),\n remediation: 'Remove the unmatched PDF or add the intended opener within the same isolate.',\n control\n });\n } else {\n stack.splice(embeddingIndex, 1);\n }\n continue;\n }\n if (codePoint === 'U+2069') {\n const isolateIndex = lastFrameIndex(stack, 'isolate');\n if (isolateIndex < 0) {\n findings.push({\n code: 'BIDI_UNMATCHED_PDI',\n severity: 'high',\n message: 'POP DIRECTIONAL ISOLATE has no matching isolate opener.',\n sourceRange: rangeFor(control),\n remediation: 'Remove the unmatched PDI or add the intended LRI, RLI, or FSI opener.',\n control\n });\n } else {\n const crossing = stack.slice(isolateIndex + 1).filter((frame) => frame.kind === 'embedding');\n for (const frame of crossing) {\n findings.push({\n code: 'BIDI_FORMAT_CROSSES_ISOLATE_BOUNDARY',\n severity: 'high',\n message: `${frame.control.name} is not closed before the containing isolate ends.`,\n sourceRange: rangeFor(frame.control),\n remediation: 'Close the embedding or override with PDF before PDI.',\n control: frame.control\n });\n }\n stack.splice(isolateIndex);\n }\n }\n }\n\n for (const frame of stack) {\n findings.push({\n code: frame.kind === 'isolate' ? 'BIDI_UNCLOSED_ISOLATE' : 'BIDI_UNCLOSED_EMBEDDING',\n severity: 'high',\n message: `${frame.control.name} is not terminated before the end of the text.`,\n sourceRange: rangeFor(frame.control),\n remediation: frame.kind === 'isolate'\n ? 'Add the matching PDI or remove the isolate opener.'\n : 'Add the matching PDF or remove the embedding/override opener.',\n control: frame.control\n });\n }\n return findings;\n}\n\nfunction isAsciiIdentifierCharacter(value: string | undefined): boolean {\n return value !== undefined && /^[A-Za-z0-9_$]$/u.test(value);\n}\n\nfunction invisibleCharacterFindings(text: string): BidiSecurityFinding[] {\n const findings: BidiSecurityFinding[] = [];\n const characters = [...text];\n let utf16Index = 0;\n for (let codePointIndex = 0; codePointIndex < characters.length; codePointIndex += 1) {\n const character = characters[codePointIndex]!;\n const sourceRange = {\n utf16: { start: utf16Index, end: utf16Index + character.length },\n codePoint: { start: codePointIndex, end: codePointIndex + 1 }\n };\n if (character === '\\u200B') {\n findings.push({\n code: 'HIDDEN_ZERO_WIDTH_SPACE',\n severity: 'warning',\n message: 'ZERO WIDTH SPACE (U+200B) is hidden and can disguise identifiers, links, or filenames.',\n sourceRange,\n remediation: 'Remove it from identifiers and source-like content unless its use is explicitly required.'\n });\n }\n if ((character === '\\u200C' || character === '\\u200D')\n && isAsciiIdentifierCharacter(characters[codePointIndex - 1])\n && isAsciiIdentifierCharacter(characters[codePointIndex + 1])) {\n const name = character === '\\u200C' ? 'ZERO WIDTH NON-JOINER' : 'ZERO WIDTH JOINER';\n findings.push({\n code: 'HIDDEN_IDENTIFIER_JOINER',\n severity: 'warning',\n message: `${name} is hidden inside an ASCII identifier-like token.`,\n sourceRange,\n remediation: 'Remove the joiner from machine identifiers, or document and validate the identifier protocol that requires it.'\n });\n }\n if (character === '\\u2060') {\n findings.push({\n code: 'HIDDEN_WORD_JOINER',\n severity: 'info',\n message: 'WORD JOINER (U+2060) is invisible and can disguise token boundaries.',\n sourceRange,\n remediation: 'Confirm that non-breaking behavior is required; remove it from identifiers and source-like content.'\n });\n }\n // A leading U+FEFF can represent a decoded byte-order signature. The same\n // character midstream is invisible content and deserves an explicit finding.\n if (character === '\\uFEFF' && codePointIndex > 0) {\n findings.push({\n code: 'HIDDEN_MIDSTREAM_BOM',\n severity: 'warning',\n message: 'ZERO WIDTH NO-BREAK SPACE/BOM (U+FEFF) appears inside the text.',\n sourceRange,\n remediation: 'Remove the midstream BOM unless a documented protocol explicitly requires it.'\n });\n }\n utf16Index += character.length;\n }\n return findings;\n}\n\n/** Audits hidden bidi formatting without mutating the source string. */\nexport function scanBidiSecurity(\n text: string,\n options: { mode?: BidiSecurityMode } = {}\n): BidiSecurityReport {\n const mode = options.mode ?? 'audit';\n if (mode === 'off') return { mode, safe: true, shouldBlock: false, controls: [], findings: [] };\n const controls = findBidiControls(text);\n const findings = [\n ...controls.map(controlFinding),\n ...balanceFindings(controls),\n ...invisibleCharacterFindings(text)\n ].sort((a, b) => a.sourceRange.utf16.start - b.sourceRange.utf16.start || a.code.localeCompare(b.code));\n const hasHigh = findings.some((finding) => finding.severity === 'high');\n return {\n mode,\n safe: !hasHigh,\n shouldBlock: mode === 'strict' ? findings.length > 0 : mode === 'warn' && hasHigh,\n controls,\n findings\n };\n}\n\nexport interface SanitizeBidiControlsOptions {\n /** Remove controls with these risk levels. Defaults to every level. */\n remove?: BidiControlRisk[];\n /**\n * Remove only these semantic control groups. PDF follows embedding/override;\n * PDI follows isolate, so preserved isolate pairs stay structurally intact.\n */\n removeGroups?: BidiControlSanitizationGroup[];\n}\n\nconst ALL_SANITIZATION_GROUPS: readonly BidiControlSanitizationGroup[] = [\n 'mark', 'embedding-override', 'isolate', 'deprecated'\n];\n\nconst SANITIZATION_GROUP_RISK: Readonly> = {\n mark: 'low',\n 'embedding-override': 'high',\n isolate: 'medium',\n deprecated: 'medium'\n};\n\nfunction sanitizationGroup(codePoint: number, category: BidiControlFinding['category']): BidiControlSanitizationGroup {\n if (codePoint === 0x202c || category === 'embedding' || category === 'override') {\n return 'embedding-override';\n }\n if (codePoint === 0x2069 || category === 'isolate') return 'isolate';\n if (category === 'mark' || category === 'deprecated') return category;\n // Every recognized pop is handled above; keep an explicit defensive\n // fallback so future metadata cannot silently escape the default sanitizer.\n return 'deprecated';\n}\n\nexport function sanitizeBidiControls(\n text: string,\n options: SanitizeBidiControlsOptions = {}\n): { text: string; removed: BidiControlFinding[] } {\n const remove = new Set(options.remove ?? ['high', 'medium', 'low']);\n const removeGroups = new Set(options.removeGroups ?? ALL_SANITIZATION_GROUPS);\n const grouped = options.removeGroups !== undefined;\n const removed: BidiControlFinding[] = [];\n let output = '';\n let utf16Index = 0;\n let codePointIndex = 0;\n\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n const metadata = CONTROL_METADATA.get(codePoint);\n const group = metadata && sanitizationGroup(codePoint, metadata.category);\n const selected = metadata && group && removeGroups.has(group)\n && remove.has(grouped ? SANITIZATION_GROUP_RISK[group] : metadata.risk);\n if (metadata && selected) {\n removed.push({\n character,\n codePoint: `U+${codePoint.toString(16).toUpperCase().padStart(4, '0')}`,\n index: utf16Index,\n end: utf16Index + character.length,\n codePointIndex,\n ...metadata\n });\n } else {\n output += character;\n }\n utf16Index += character.length;\n codePointIndex += 1;\n }\n\n return { text: output, removed };\n}\n", "import { classifyBidiStrongCharacter } from './classify.js';\nimport { findBidiControls } from './security.js';\nimport type { ResolvedDirection } from './types.js';\n\n/**\n * `auto` is the non-interference default: ordinary LTR content in an LTR\n * context receives no BidiLens markup or DOM mutation. `always` retains the\n * explicit-annotation behavior for integrations that require stable markers.\n */\nexport type BidiInterventionMode = 'auto' | 'always';\n\nexport interface BidiInterventionOptions {\n intervention?: BidiInterventionMode | undefined;\n inheritedDirection?: ResolvedDirection | undefined;\n}\n\n/**\n * Reports whether rendering metadata is needed for a string in its host\n * context. Hidden bidi controls deliberately disable the LTR fast path so an\n * apparently English string cannot bypass bidi-aware handling.\n */\nexport function needsBidiIntervention(\n text: string,\n options: BidiInterventionOptions = {}\n): boolean {\n if (options.intervention === 'always') return true;\n if (findBidiControls(text).length > 0) return true;\n\n let hasLtr = false;\n for (const character of text) {\n const direction = classifyBidiStrongCharacter(character);\n if (direction === 'rtl') return true;\n if (direction === 'ltr') hasLtr = true;\n }\n\n return options.inheritedDirection === 'rtl' && (hasLtr || text.length > 0);\n}\n", "import { classifyCharacter } from './classify.js';\nimport { isolateText } from './controls.js';\nimport { findTechnicalTokenRanges } from './detect.js';\nimport { needsBidiIntervention } from './intervention.js';\nimport type { BidiInterventionMode } from './intervention.js';\nimport type { Direction, DirectionalRun, InlineIsolation } from './types.js';\n\ntype PlannedIsolation = Omit;\n\nfunction attachSourceRanges(text: string, isolations: Omit[]): InlineIsolation[] {\n const codePointAtUtf16 = new Uint32Array(text.length + 1);\n let utf16Offset = 0;\n let codePointOffset = 0;\n for (const character of text) {\n codePointAtUtf16[utf16Offset] = codePointOffset;\n if (character.length === 2) codePointAtUtf16[utf16Offset + 1] = codePointOffset;\n utf16Offset += character.length;\n codePointOffset += 1;\n codePointAtUtf16[utf16Offset] = codePointOffset;\n }\n return isolations.map((isolation) => ({\n ...isolation,\n sourceRange: {\n utf16: { start: isolation.start, end: isolation.end },\n codePoint: {\n start: codePointAtUtf16[isolation.start]!,\n end: codePointAtUtf16[isolation.end]!\n }\n }\n }));\n}\n\nfunction resolveNeutralRuns(runs: DirectionalRun[]): DirectionalRun[] {\n const previousStrong: Direction[] = new Array(runs.length).fill('neutral');\n const nextStrong: Direction[] = new Array(runs.length).fill('neutral');\n let previous: Direction = 'neutral';\n let next: Direction = 'neutral';\n\n for (let index = 0; index < runs.length; index += 1) {\n previousStrong[index] = previous;\n const direction = runs[index]!.direction;\n if (direction !== 'neutral') previous = direction;\n }\n\n for (let index = runs.length - 1; index >= 0; index -= 1) {\n nextStrong[index] = next;\n const direction = runs[index]!.direction;\n if (direction !== 'neutral') next = direction;\n }\n\n return runs.map((run, index) => {\n if (run.direction !== 'neutral') return run;\n const before = previousStrong[index] ?? 'neutral';\n const after = nextStrong[index] ?? 'neutral';\n const direction: Direction = before === after && before !== 'neutral'\n ? before\n : before !== 'neutral'\n ? before\n : after;\n return { ...run, direction };\n });\n}\n\nfunction mergeAdjacent(runs: DirectionalRun[]): DirectionalRun[] {\n const merged: DirectionalRun[] = [];\n for (const run of runs) {\n const previous = merged.at(-1);\n if (previous && previous.direction === run.direction) {\n previous.text += run.text;\n previous.end = run.end;\n } else {\n merged.push({ ...run });\n }\n }\n return merged;\n}\n\nfunction trimNeutralBoundaries(text: string, start: number, end: number): { start: number; end: number } {\n while (start < end) {\n const character = text.slice(start).match(/^./su)?.[0];\n if (!character || classifyCharacter(character) !== 'neutral') break;\n start += character.length;\n }\n while (end > start) {\n const character = text.slice(0, end).match(/.$/su)?.[0];\n if (!character || classifyCharacter(character) !== 'neutral') break;\n end -= character.length;\n }\n return { start, end };\n}\n\nconst HARD_FRAGMENT_SEPARATOR = /[,\u060C;\u061B:!?\u061F|]/u;\n\n/**\n * Punctuation separates semantic LTR fragments in an RTL paragraph, while\n * whitespace joins adjacent fragments into one ordered phrase. Without this\n * normalization, two neighboring isolates such as `page` and `97` are\n * reordered as independent RTL atoms.\n */\nfunction normalizeIsolationPlan(text: string, isolations: PlannedIsolation[]): PlannedIsolation[] {\n const split: PlannedIsolation[] = [];\n for (const isolation of isolations) {\n if (isolation.kind !== 'opposite-direction-run') {\n split.push(isolation);\n continue;\n }\n let pieceStart = isolation.start;\n let cursor = isolation.start;\n for (const character of text.slice(isolation.start, isolation.end)) {\n const index = cursor;\n cursor += character.length;\n if (HARD_FRAGMENT_SEPARATOR.test(character)) {\n const trimmed = trimNeutralBoundaries(text, pieceStart, index);\n if (trimmed.start < trimmed.end) {\n split.push({\n ...isolation,\n text: text.slice(trimmed.start, trimmed.end),\n start: trimmed.start,\n end: trimmed.end\n });\n }\n pieceStart = cursor;\n }\n }\n const trimmed = trimNeutralBoundaries(text, pieceStart, isolation.end);\n if (trimmed.start < trimmed.end) {\n split.push({\n ...isolation,\n text: text.slice(trimmed.start, trimmed.end),\n start: trimmed.start,\n end: trimmed.end\n });\n }\n }\n\n const ordered = split.sort((a, b) => a.start - b.start || a.end - b.end);\n const merged: PlannedIsolation[] = [];\n for (const isolation of ordered) {\n const previous = merged.at(-1);\n if (\n previous &&\n previous.direction === isolation.direction &&\n previous.end <= isolation.start &&\n /^\\s*$/u.test(text.slice(previous.end, isolation.start))\n ) {\n previous.end = isolation.end;\n previous.text = text.slice(previous.start, previous.end);\n if (previous.kind !== isolation.kind) previous.kind = 'opposite-direction-run';\n } else {\n merged.push({ ...isolation });\n }\n }\n return merged;\n}\n\nexport function segmentDirectionalRuns(text: string): DirectionalRun[] {\n if (!text) return [];\n const runs: DirectionalRun[] = [];\n let currentDirection: Direction | null = null;\n let currentText = '';\n let start = 0;\n let index = 0;\n\n for (const character of text) {\n const direction = classifyCharacter(character);\n if (currentDirection === null) {\n currentDirection = direction;\n currentText = character;\n start = index;\n } else if (direction === currentDirection) {\n currentText += character;\n } else {\n runs.push({ text: currentText, direction: currentDirection, start, end: index });\n currentDirection = direction;\n currentText = character;\n start = index;\n }\n index += character.length;\n }\n\n if (currentDirection !== null) {\n runs.push({ text: currentText, direction: currentDirection, start, end: index });\n }\n\n return mergeAdjacent(resolveNeutralRuns(runs));\n}\n\nexport function isolateDirectionalRuns(text: string): string {\n return segmentDirectionalRuns(text)\n .map((run) => isolateText(run.text, run.direction))\n .join('');\n}\n\n/**\n * Plans semantic inline boundaries without changing the stored source text.\n * Technical ranges are isolated first; opposite natural-language runs are\n * then isolated only when they differ from the block's base direction.\n */\nexport function planInlineIsolation(\n text: string,\n blockDirection: Exclude,\n options: {\n excludeTechnicalTokens?: boolean;\n isolateOppositeRuns?: boolean;\n intervention?: BidiInterventionMode | undefined;\n technicalIdentifiers?: readonly string[] | undefined;\n } = {}\n): InlineIsolation[] {\n if (!needsBidiIntervention(text, {\n intervention: options.intervention,\n inheritedDirection: blockDirection\n })) return [];\n const technical = options.excludeTechnicalTokens === false\n ? []\n : findTechnicalTokenRanges(text, options.technicalIdentifiers);\n const isolations: Omit[] = technical.map((range) => ({\n text: range.text,\n direction: 'ltr',\n start: range.start,\n end: range.end,\n kind: range.kind\n }));\n\n if (options.isolateOppositeRuns === false) {\n return attachSourceRanges(text, normalizeIsolationPlan(text, isolations));\n }\n\n let technicalIndex = 0;\n for (const run of segmentDirectionalRuns(text)) {\n if (run.direction === 'neutral' || run.direction === blockDirection) continue;\n while (technicalIndex < technical.length && technical[technicalIndex]!.end <= run.start) {\n technicalIndex += 1;\n }\n let cursor = run.start;\n for (let index = technicalIndex; index < technical.length; index += 1) {\n const range = technical[index]!;\n if (range.end <= cursor) continue;\n if (range.start >= run.end) break;\n const partEnd = Math.min(range.start, run.end);\n if (cursor < partEnd) {\n const trimmed = trimNeutralBoundaries(text, cursor, partEnd);\n if (trimmed.start < trimmed.end) isolations.push({\n text: text.slice(trimmed.start, trimmed.end),\n direction: run.direction,\n start: trimmed.start,\n end: trimmed.end,\n kind: 'opposite-direction-run'\n });\n }\n cursor = Math.max(cursor, range.end);\n if (cursor >= run.end) break;\n }\n if (cursor < run.end) {\n const trimmed = trimNeutralBoundaries(text, cursor, run.end);\n if (trimmed.start < trimmed.end) isolations.push({\n text: text.slice(trimmed.start, trimmed.end),\n direction: run.direction,\n start: trimmed.start,\n end: trimmed.end,\n kind: 'opposite-direction-run'\n });\n }\n }\n\n return attachSourceRanges(text, normalizeIsolationPlan(text, isolations));\n}\n", "import {\n analyzeText,\n needsBidiIntervention,\n planInlineIsolation,\n type BidiInterventionMode,\n type DetectionOptions,\n type ResolvedDirection,\n type TextAnalysis\n} from '@bidilens/core';\n\nexport interface RenderHtmlOptions extends DetectionOptions {\n blockTag?: string;\n containerTag?: string | false;\n blockClassName?: string;\n containerClassName?: string;\n includeDataAttributes?: boolean;\n /** Skip BidiLens markup for LTR-only text in an LTR context. */\n intervention?: BidiInterventionMode;\n}\n\nexport interface RenderedHtmlBlock {\n text: string;\n html: string;\n direction: ResolvedDirection;\n start: number;\n end: number;\n}\n\nexport interface RenderedBidiHtml {\n source: string;\n html: string;\n analysis: TextAnalysis;\n blocks: RenderedHtmlBlock[];\n}\n\nconst SAFE_TAG = /^[a-z][a-z0-9-]*$/u;\nconst SAFE_BLOCK_TAGS = new Set([\n 'address', 'article', 'aside', 'blockquote', 'dd', 'div', 'dt', 'figcaption',\n 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'li', 'main', 'nav',\n 'p', 'pre', 'section', 'span', 'td', 'th'\n]);\nconst SAFE_CONTAINER_TAGS = new Set([\n 'article', 'aside', 'blockquote', 'div', 'footer', 'header', 'main', 'nav', 'section', 'span'\n]);\n\nexport function escapeHtml(value: string): string {\n return value.replace(/[&<>\"']/gu, (character) => ({\n '&': '&', '<': '<', '>': '>', '\"': '"', \"'\": '''\n }[character] ?? character));\n}\n\nfunction checkedTag(value: string, option: string, allowed: ReadonlySet): string {\n const normalized = value.toLowerCase();\n if (!SAFE_TAG.test(normalized) || !allowed.has(normalized)) {\n throw new Error(`${option} must be an allowed non-executable HTML container tag.`);\n }\n return normalized;\n}\n\nfunction classAttribute(value: string | undefined): string {\n return value ? ` class=\"${escapeHtml(value)}\"` : '';\n}\n\nexport function renderInlineBidiHtml(\n source: string,\n direction: ResolvedDirection,\n options: {\n includeDataAttributes?: boolean;\n intervention?: BidiInterventionMode | undefined;\n technicalIdentifiers?: readonly string[] | undefined;\n } = {}\n): string {\n const includeData = options.includeDataAttributes ?? true;\n const isolations = planInlineIsolation(source, direction, {\n intervention: options.intervention,\n technicalIdentifiers: options.technicalIdentifiers\n });\n let html = '';\n let cursor = 0;\n for (const isolation of isolations) {\n html += escapeHtml(source.slice(cursor, isolation.start));\n const tag = isolation.kind === 'code' ? 'code' : 'bdi';\n const data = includeData\n ? ` data-bidilens-isolate=\"\" data-bidilens-kind=\"${isolation.kind}\"${isolation.kind === 'code' ? ' data-bidilens-code=\"\"' : ''}`\n : '';\n html += `<${tag} dir=\"${isolation.direction}\"${data}>${escapeHtml(isolation.text)}`;\n cursor = isolation.end;\n }\n return html + escapeHtml(source.slice(cursor));\n}\n\n/** Serializes untrusted plain text; it never accepts or emits unescaped source HTML. */\nexport function renderBidiHtml(source: string, options: RenderHtmlOptions = {}): RenderedBidiHtml {\n const detection: DetectionOptions = {\n ...options,\n fallback: options.fallback ?? options.inheritedDirection ?? 'ltr'\n };\n const analysis = analyzeText(source, detection);\n const blockTag = checkedTag(options.blockTag ?? 'p', 'blockTag', SAFE_BLOCK_TAGS);\n const includeData = options.includeDataAttributes ?? true;\n const intervene = analysis.paragraphs.some((paragraph) => paragraph.direction === 'rtl')\n || needsBidiIntervention(source, {\n intervention: options.intervention,\n inheritedDirection: options.inheritedDirection\n });\n const blocks = analysis.paragraphs.map((paragraph) => {\n const direction = paragraph.direction === 'neutral'\n ? (options.inheritedDirection ?? 'ltr')\n : paragraph.direction;\n const data = intervene && includeData ? ' data-bidilens-block=\"\"' : '';\n const directionAttribute = intervene ? ` dir=\"${direction}\"` : '';\n const blockClass = classAttribute(options.blockClassName);\n const inline = intervene\n ? renderInlineBidiHtml(paragraph.text, direction, {\n includeDataAttributes: includeData,\n intervention: options.intervention,\n technicalIdentifiers: options.technicalIdentifiers\n })\n : escapeHtml(paragraph.text);\n const html = `<${blockTag}${directionAttribute}${data}${blockClass}>${inline}`;\n return { text: paragraph.text, html, direction, start: paragraph.start, end: paragraph.end };\n });\n\n const serializedBlocks = blocks.map((block, index) => {\n const next = blocks[index + 1];\n const separator = next ? source.slice(block.end, next.start) : '';\n return `${block.html}${escapeHtml(separator)}`;\n }).join('');\n const automaticContainer = blocks.length > 1 ? 'div' : false;\n const container = options.containerTag === undefined ? automaticContainer : options.containerTag;\n const html = container === false\n ? serializedBlocks\n : (() => {\n const tag = checkedTag(container, 'containerTag', SAFE_CONTAINER_TAGS);\n const data = intervene && includeData ? ' data-bidilens-document=\"\"' : '';\n const containerClass = classAttribute(options.containerClassName);\n return `<${tag}${data}${containerClass}>${serializedBlocks}`;\n })();\n return { source, html, analysis, blocks };\n}\n", "{\n \"name\": \"@bidilens/cli\",\n \"version\": \"0.3.0\",\n \"description\": \"CLI for inspecting direction and auditing hidden Unicode bidi controls.\",\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Shayan SalehiRad\",\n \"url\": \"https://github.com/CodeinScrubs\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/CodeinScrubs/BidiLens.git\",\n \"directory\": \"packages/cli\"\n },\n \"homepage\": \"https://github.com/CodeinScrubs/BidiLens#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/CodeinScrubs/BidiLens/issues\"\n },\n \"type\": \"module\",\n \"sideEffects\": false,\n \"keywords\": [\n \"bidi\",\n \"rtl\",\n \"ltr\",\n \"unicode\",\n \"cli\",\n \"security\"\n ],\n \"files\": [\n \"dist\",\n \"README.md\",\n \"LICENSE\",\n \"CHANGELOG.md\",\n \"THIRD_PARTY_NOTICES.md\",\n \"corpus\",\n \"examples\"\n ],\n \"bin\": {\n \"bidilens\": \"./dist/bin.js\"\n },\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/bin.ts --format esm --dts --clean --sourcemap\",\n \"prepack\": \"pnpm run build\",\n \"example\": \"node examples/basic.mjs\"\n },\n \"dependencies\": {\n \"@bidilens/core\": \"workspace:*\",\n \"@bidilens/html\": \"workspace:*\",\n \"commander\": \"^15.0.0\"\n },\n \"devDependencies\": {\n \"tsup\": \"^8.5.1\"\n },\n \"engines\": {\n \"node\": \">=22.12.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,uBAAoB;;;ACApB,IAAAC,mBAA6C;AAC7C,yBAA2B;AAC3B,IAAAC,oBAAuD;AACvD,IAAAC,uBAAoB;;;ACFpB,sBAAoD;AACpD,IAAAC,oBAAiE;AACjE,IAAAC,uBAAoB;AACpB,sBAA8B;;;ACDvB,IAAM,iBAAN,cAA6B,MAAM;AAAA;AAAA;A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UAAM,SAAS,cAAc,KAAK,OAAO,SAAS;AAClD,cAAM,4BAAM,2BAAQ,OAAO,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;AACzD,cAAM,4BAAU,OAAO,UAAU,YAAY,MAAM;AACnD,aAAS,OAAO;AAChB,QAAI,oCAAoC,MAAM,GAAG;AAAA,EACnD,WAAW,YAAY;AACrB,QAAI,WAAW,QAAQ,CAAC;AAAA,EAC1B;AACA,MAAI,WAAY,OAAM,WAAW,QAAQ,CAAC;AAE1C,QAAM,UAAU,IAAI,eAAe,aAAa,OAAO,QAAQ,CAAC;AAChE,QAAM,UAAU,IAAI,eAAe,UAAU,MAAM;AACnD,MAAI,aAAa,EAAG,OAAM,YAAY,OAAO,OAAO,0BAA0B,QAAQ,GAAG;AACzF,SAAO,EAAE,UAAU,QAAQ,QAAQ,YAAY,QAAQ,WAAW;AACpE;AAEO,SAAS,cAAc,SAAyB;AACrD,QAAM,UAAU,QACb,WAAW,KAAK,KAAK,EACrB,WAAW,MAAM,KAAK,EACtB,WAAW,MAAM,KAAK;AACzB,SAAO,2BAA2B,OAAO;AAC3C;;;ADxIA,eAAe,OAAsB;AACnC,MAAI;AACF,UAAM,SAAS,MAAM,UAAU;AAC/B,yBAAAE,QAAQ,WAAW,OAAO;AAAA,EAC5B,SAAS,OAAO;AACd,UAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,yBAAAA,QAAQ,OAAO,MAAM,GAAG,cAAc,OAAO,CAAC;AAAA,CAAI;AAClD,yBAAAA,QAAQ,WAAW;AAAA,EACrB;AACF;AAEA,KAAK,KAAK;", "names": ["import_node_process", "import_promises", "import_node_path", "import_node_process", "import_node_path", "import_node_process", "import_node_util", "cmd", "choice", "line", "str", "process", "fs", "path", "childProcess", "option", "line", "lineStart", "trimmed", "html", "process", "input", "program", "process", "path", "process"] } diff --git a/android/core/src/main/kotlin/io/github/codeinscrubs/bidilens/core/TechnicalTokens.kt b/android/core/src/main/kotlin/io/github/codeinscrubs/bidilens/core/TechnicalTokens.kt index 9bc9634..f35bc00 100644 --- a/android/core/src/main/kotlin/io/github/codeinscrubs/bidilens/core/TechnicalTokens.kt +++ b/android/core/src/main/kotlin/io/github/codeinscrubs/bidilens/core/TechnicalTokens.kt @@ -193,11 +193,16 @@ private fun isKnownTechnicalWord(value: String, custom: Set): Boolean { private fun usesUppercaseProse(text: String): Boolean { var total = 0 var capitalized = 0 + var hasLongCapitalizedWord = false for (match in Regex("\\b[A-Za-z]{2,}\\b").findAll(text)) { total += 1 - if (match.value.all { it in 'A'..'Z' }) capitalized += 1 + if (match.value.all { it in 'A'..'Z' }) { + capitalized += 1 + if (match.value.length > ACRONYM_MAXIMUM_LENGTH) hasLongCapitalizedWord = true + } } - return total >= 2 && capitalized * 2 > total + // `HTTP API` is an acronym sequence, not proof of an uppercase prose style. + return total >= 2 && hasLongCapitalizedWord && capitalized * 2 > total } private fun isTechnicalIdentifier( diff --git a/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/BidiCoreTest.kt b/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/BidiCoreTest.kt index e69b654..6d3d537 100644 --- a/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/BidiCoreTest.kt +++ b/android/core/src/test/kotlin/io/github/codeinscrubs/bidilens/core/BidiCoreTest.kt @@ -47,6 +47,8 @@ class BidiCoreTest { assertTrue(findTechnicalTokenRanges(shouted).isEmpty()) // Inside mixed-case prose the same shape is an acronym again. assertEquals(2, findTechnicalTokenRanges("Use the HTTP API for this").size) + // Short all-capital phrases remain acronym-shaped by default. + assertEquals(2, findTechnicalTokenRanges("HTTP API").size) } @Test diff --git a/apple/Sources/BidiLens/BidiAnalyzer.swift b/apple/Sources/BidiLens/BidiAnalyzer.swift index 8aefc12..004b1f3 100644 --- a/apple/Sources/BidiLens/BidiAnalyzer.swift +++ b/apple/Sources/BidiLens/BidiAnalyzer.swift @@ -109,10 +109,10 @@ public enum BidiAnalyzer { /// identifier, and must keep deciding the natural-language base direction. private static let acronymMaximumLength = 5 - private static func isKnownTechnicalWord(_ value: String, _ custom: Set) -> Bool { + private static func isKnownTechnicalWord(_ value: String, _ normalizedCustom: Set) -> Bool { let lower = value.lowercased() return defaultTechnicalIdentifiers.contains(lower) - || custom.contains { $0.lowercased() == lower } + || normalizedCustom.contains(lower) } /// Reports whether capitals are the block's prose style rather than an @@ -126,11 +126,17 @@ public enum BidiAnalyzer { let string = text as NSString let matches = regex.matches(in: text, range: NSRange(location: 0, length: string.length)) var capitalized = 0 - for match in matches where string.substring(with: match.range) - .allSatisfy({ $0.isUppercase && $0.isASCII }) { + var hasLongCapitalizedWord = false + for match in matches { + let word = string.substring(with: match.range) + guard word.allSatisfy({ $0.isUppercase && $0.isASCII }) else { continue } capitalized += 1 + if word.count > acronymMaximumLength { hasLongCapitalizedWord = true } } - return matches.count >= 2 && capitalized * 2 > matches.count + // `HTTP API` is an acronym sequence, not proof of uppercase prose. + return matches.count >= 2 + && hasLongCapitalizedWord + && capitalized * 2 > matches.count } public static func findTechnicalTokenRanges( @@ -139,6 +145,7 @@ public enum BidiAnalyzer { ) -> [TechnicalTokenRange] { let fullRange = NSRange(location: 0, length: (text as NSString).length) var ranges: [TechnicalTokenRange] = [] + let normalizedCustomIdentifiers = Set(customIdentifiers.map { $0.lowercased() }) for (pattern, kind, options) in technicalPatterns { guard let regex = try? NSRegularExpression(pattern: pattern, options: options) else { continue } for match in regex.matches(in: text, range: fullRange) { @@ -188,12 +195,12 @@ public enum BidiAnalyzer { ) { for match in regex.matches(in: text, range: fullRange) { let token = (text as NSString).substring(with: match.range) - let technical = isKnownTechnicalWord(token, customIdentifiers) + let technical = isKnownTechnicalWord(token, normalizedCustomIdentifiers) // A hyphenated token is technical when a segment is itself a // known technical word ("react-markdown"), not merely because // it is hyphenated: "well-known" is ordinary English evidence. || (token.contains("-") && token.split(separator: "-").contains { - !$0.isEmpty && isKnownTechnicalWord(String($0), customIdentifiers) + !$0.isEmpty && isKnownTechnicalWord(String($0), normalizedCustomIdentifiers) }) // Only digits, underscores, and dots are identifier syntax. || token.contains(where: { $0.isNumber || $0 == "_" || $0 == "." }) diff --git a/apple/Tests/BidiLensTests/BidiLensTests.swift b/apple/Tests/BidiLensTests/BidiLensTests.swift index 9debb5b..b94a2eb 100644 --- a/apple/Tests/BidiLensTests/BidiLensTests.swift +++ b/apple/Tests/BidiLensTests/BidiLensTests.swift @@ -22,6 +22,10 @@ final class BidiLensTests: XCTestCase { let acronyms = BidiAnalyzer.findTechnicalTokenRanges("Use the HTTP API for this") XCTAssertEqual(acronyms.map(\.text), ["HTTP", "API"]) + XCTAssertEqual( + BidiAnalyzer.findTechnicalTokenRanges("HTTP API").map(\.text), + ["HTTP", "API"] + ) XCTAssertEqual( BidiAnalyzer.findTechnicalTokenRanges("react-markdown").map(\.text), ["react-markdown"] diff --git a/docs/LIMITATIONS.md b/docs/LIMITATIONS.md index a769583..48bbd12 100644 --- a/docs/LIMITATIONS.md +++ b/docs/LIMITATIONS.md @@ -25,9 +25,10 @@ use the configured fallback or inherited direction. Separating an acronym from an emphasized word is decided by shape and block context, not by a dictionary: a short all-capital token is treated as an identifier unless capitals are the block's prose style. A block written only in -short capitalized words can still classify them either way, and a hyphenated -product name whose segments are all outside the technical vocabulary counts as -natural language. Both cases are addressable with `technicalIdentifiers` or an +short all-capital words remains acronym-shaped by default; an uppercase prose +style requires at least one longer capitalized word. A hyphenated product name +whose segments are all outside the technical vocabulary counts as natural +language. Both boundaries are addressable with `technicalIdentifiers` or an explicit direction. The scanner identifies suspicious structure, not malicious intent. It does diff --git a/packages/core/src/core.test.ts b/packages/core/src/core.test.ts index 69afcda..4abd84b 100644 --- a/packages/core/src/core.test.ts +++ b/packages/core/src/core.test.ts @@ -85,6 +85,10 @@ describe('direction detection', () => { // Inside mixed-case prose the same shape is an acronym again. expect(findTechnicalTokenRanges('Use the HTTP API for this').map((range) => range.text)) .toEqual(['HTTP', 'API']); + // A short all-capital phrase remains acronym-shaped even when every word + // is uppercase; it is not enough evidence to infer an emphasized style. + expect(findTechnicalTokenRanges('HTTP API').map((range) => range.text)) + .toEqual(['HTTP', 'API']); // A long all-capital word is emphasis, not an identifier, in either context. expect(findTechnicalTokenRanges('An IMPORTANT note')).toEqual([]); }); diff --git a/packages/core/src/detect.ts b/packages/core/src/detect.ts index 97cff65..fbc97ab 100644 --- a/packages/core/src/detect.ts +++ b/packages/core/src/detect.ts @@ -291,9 +291,17 @@ function usesUppercaseProse(text: string): boolean { const words = text.match(/\b[A-Za-z]{2,}\b/gu); if (words === null || words.length < 2) return false; let capitalized = 0; + let hasLongCapitalizedWord = false; // Every candidate is alphabetic, so "contains no lowercase" means all-capital. - for (const word of words) if (!/[a-z]/u.test(word)) capitalized += 1; - return capitalized * 2 > words.length; + for (const word of words) { + if (/[a-z]/u.test(word)) continue; + capitalized += 1; + if (word.length > ACRONYM_MAXIMUM_LENGTH) hasLongCapitalizedWord = true; + } + // `HTTP API` is an acronym sequence, not proof of an uppercase prose style. + // Requiring one long word keeps that short technical phrase excluded while + // still recognizing natural-language emphasis such as `PLEASE READ THIS`. + return hasLongCapitalizedWord && capitalized * 2 > words.length; } /** diff --git a/rust/src/technical.rs b/rust/src/technical.rs index b990084..72398b2 100644 --- a/rust/src/technical.rs +++ b/rust/src/technical.rs @@ -359,6 +359,7 @@ fn uses_uppercase_prose(text: &str) -> bool { let words = built_in_regex(r"(?-u:\b)[A-Za-z]{2,}(?-u:\b)"); let mut total = 0usize; let mut capitalized = 0usize; + let mut has_long_capitalized_word = false; for found in words.find_iter(text) { total += 1; if found @@ -367,9 +368,13 @@ fn uses_uppercase_prose(text: &str) -> bool { .all(|character| character.is_ascii_uppercase()) { capitalized += 1; + if found.as_str().len() > ACRONYM_MAXIMUM_LENGTH { + has_long_capitalized_word = true; + } } } - total >= 2 && capitalized * 2 > total + // `HTTP API` is an acronym sequence, not proof of uppercase prose. + total >= 2 && has_long_capitalized_word && capitalized * 2 > total } fn is_technical_identifier(token: &str, custom: &HashSet, uppercase_prose: bool) -> bool { diff --git a/rust/tests/conformance.rs b/rust/tests/conformance.rs index 8c75c74..3068016 100644 --- a/rust/tests/conformance.rs +++ b/rust/tests/conformance.rs @@ -212,6 +212,8 @@ fn emphasized_uppercase_prose_is_evidence_but_acronyms_are_technical() { // Inside mixed-case prose the same shape is an acronym again. let acronyms = find_technical_token_ranges("Use the HTTP API for this", &[]); assert_eq!(acronyms.len(), 2); + let acronym_phrase = find_technical_token_ranges("HTTP API", &[]); + assert_eq!(acronym_phrase.len(), 2); } #[test] diff --git a/windows/src/BidiLens.Core/BidiAnalyzer.cs b/windows/src/BidiLens.Core/BidiAnalyzer.cs index ae68385..5f280af 100644 --- a/windows/src/BidiLens.Core/BidiAnalyzer.cs +++ b/windows/src/BidiLens.Core/BidiAnalyzer.cs @@ -107,6 +107,9 @@ public static IReadOnlyList FindTechnicalTokenRanges( IReadOnlySet? customIdentifiers = null) { var ranges = new List(); + var normalizedCustomIdentifiers = customIdentifiers is null + ? null + : new HashSet(customIdentifiers, StringComparer.OrdinalIgnoreCase); foreach (var (regex, kind) in TechnicalPatterns) { foreach (Match match in regex.Matches(text)) @@ -137,12 +140,12 @@ public static IReadOnlyList FindTechnicalTokenRanges( foreach (Match match in IdentifierPattern().Matches(text)) { var token = match.Value; - var technical = IsKnownTechnicalWord(token, customIdentifiers) + var technical = IsKnownTechnicalWord(token, normalizedCustomIdentifiers) // A hyphenated token is technical when a segment is itself a known // technical word ("react-markdown"), not merely because it is // hyphenated: "well-known" is ordinary English direction evidence. || (token.Contains('-') && token.Split('-').Any(segment => - segment.Length > 0 && IsKnownTechnicalWord(segment, customIdentifiers))) + segment.Length > 0 && IsKnownTechnicalWord(segment, normalizedCustomIdentifiers))) // Only digits, underscores, and dots are structural identifier syntax. || token.Any(character => char.IsDigit(character) || character is '_' or '.') || Regex.IsMatch(token, "[a-z][A-Z]", RegexOptions.CultureInvariant) @@ -558,12 +561,16 @@ private static bool UsesUppercaseProse(string text) { var total = 0; var capitalized = 0; + var hasLongCapitalizedWord = false; foreach (Match match in ProseWordPattern().Matches(text)) { total += 1; - if (match.Value.All(character => character is >= 'A' and <= 'Z')) capitalized += 1; + if (!match.Value.All(character => character is >= 'A' and <= 'Z')) continue; + capitalized += 1; + if (match.Value.Length > AcronymMaximumLength) hasLongCapitalizedWord = true; } - return total >= 2 && capitalized * 2 > total; + // `HTTP API` is an acronym sequence, not proof of uppercase prose. + return total >= 2 && hasLongCapitalizedWord && capitalized * 2 > total; } [GeneratedRegex(@"(? { "widget" }).Count, + "custom identifiers are case-insensitive"); Equal( 1, BidiAnalyzer.FindTechnicalTokenRanges("react-markdown").Count,