@learnosity/lib-qti-converter 0.12.2 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/packages/cli/dist/{batchProcessors-BfmvnTQ5.js → batchProcessors-C55IxXri.js} +2 -1
- package/packages/cli/dist/{batchProcessors-BfmvnTQ5.js.map → batchProcessors-C55IxXri.js.map} +1 -1
- package/packages/cli/dist/batchWorker.js +1 -1
- package/packages/cli/dist/{create-prompt-COXnAzFl.js → create-prompt-DU9wLVhI.js} +23 -18
- package/packages/cli/dist/create-prompt-DU9wLVhI.js.map +1 -0
- package/packages/cli/dist/{dist-CVD-X-DZ.js → dist-DjpU2mIj.js} +7 -7
- package/packages/cli/dist/dist-DjpU2mIj.js.map +1 -0
- package/packages/cli/dist/{learnosityToQti-sKxcj5Hi.js → learnosityToQti-B0PoimXr.js} +3 -3
- package/packages/cli/dist/{learnosityToQti-sKxcj5Hi.js.map → learnosityToQti-B0PoimXr.js.map} +1 -1
- package/packages/cli/dist/{learnosityToQtiPackage-Ij4cM39M.js → learnosityToQtiPackage-Dwgys922.js} +7 -6
- package/packages/cli/dist/{learnosityToQtiPackage-Ij4cM39M.js.map → learnosityToQtiPackage-Dwgys922.js.map} +1 -1
- package/packages/cli/dist/main.js +5 -5
- package/packages/cli/dist/{pathUtils-Cz2GpPEb.js → pathUtils-CwZnJ55s.js} +5 -5
- package/packages/cli/dist/pathUtils-CwZnJ55s.js.map +1 -0
- package/packages/cli/dist/{qtiPackageToLearnosity-CvXdmwsb.js → qtiPackageToLearnosity-HPtU5x5h.js} +3 -3
- package/packages/cli/dist/{qtiPackageToLearnosity-CvXdmwsb.js.map → qtiPackageToLearnosity-HPtU5x5h.js.map} +1 -1
- package/packages/cli/dist/{qtiToLearnosity-CkD0r1q0.js → qtiToLearnosity-jiFTBiQU.js} +3 -3
- package/packages/cli/dist/{qtiToLearnosity-CkD0r1q0.js.map → qtiToLearnosity-jiFTBiQU.js.map} +1 -1
- package/packages/cli/dist/{resolveOptions-CfXUqGkd.js → resolveOptions-gH_YAxxc.js} +163 -147
- package/packages/cli/dist/resolveOptions-gH_YAxxc.js.map +1 -0
- package/packages/core/dist/index.d.ts +8 -1
- package/packages/core/dist/index.js +173 -147
- package/packages/core/dist/node.d.ts +8 -1
- package/packages/core/dist/node.js +175 -148
- package/packages/cli/dist/create-prompt-COXnAzFl.js.map +0 -1
- package/packages/cli/dist/dist-CVD-X-DZ.js.map +0 -1
- package/packages/cli/dist/pathUtils-Cz2GpPEb.js.map +0 -1
- package/packages/cli/dist/resolveOptions-CfXUqGkd.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@learnosity/lib-qti-converter",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "QTI ↔ Learnosity JSON converter",
|
|
6
6
|
"license": "MIT",
|
|
@@ -72,19 +72,19 @@
|
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
75
|
-
"@types/node": "^26.
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
77
|
-
"@typescript-eslint/parser": "^8.
|
|
75
|
+
"@types/node": "^26.3.0",
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "^8.68.0",
|
|
77
|
+
"@typescript-eslint/parser": "^8.68.0",
|
|
78
78
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
79
|
-
"@vitest/coverage-v8": "^4.1.
|
|
80
|
-
"eslint": "^10.
|
|
79
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
80
|
+
"eslint": "^10.9.1",
|
|
81
81
|
"glob": "^13.0.6",
|
|
82
|
-
"publint": "^0.3.
|
|
82
|
+
"publint": "^0.3.24",
|
|
83
83
|
"tsdown": "^0.22.14",
|
|
84
84
|
"tsx": "^4.23.12",
|
|
85
85
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
86
|
-
"vite": "^8.2.
|
|
87
|
-
"vitest": "^4.1.
|
|
86
|
+
"vite": "^8.2.2",
|
|
87
|
+
"vitest": "^4.1.11"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=22.0.0"
|
|
@@ -164,6 +164,7 @@ async function processLearnosityToQtiPackage(pkg, packageOutputPath, options, qu
|
|
|
164
164
|
}
|
|
165
165
|
const pkgData = {
|
|
166
166
|
zipPath: "",
|
|
167
|
+
version: options.qtiVersion,
|
|
167
168
|
resources: [],
|
|
168
169
|
entries: /* @__PURE__ */ new Map(),
|
|
169
170
|
items: [],
|
|
@@ -212,4 +213,4 @@ function itemRefsToFilenames(bundle, itemRefs) {
|
|
|
212
213
|
//#endregion
|
|
213
214
|
export { processQtiPackageToLearnosity as n, runBatchTask as r, processLearnosityToQtiPackage as t };
|
|
214
215
|
|
|
215
|
-
//# sourceMappingURL=batchProcessors-
|
|
216
|
+
//# sourceMappingURL=batchProcessors-C55IxXri.js.map
|
package/packages/cli/dist/{batchProcessors-BfmvnTQ5.js.map → batchProcessors-C55IxXri.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batchProcessors-BfmvnTQ5.js","names":[],"sources":["../src/utils/batchProcessors.ts"],"sourcesContent":["/**\n * Per-package conversion tasks, shared by the serial batch path\n * (`processBatch`) and the parallel worker path (`processBatchParallel` via\n * `batchWorker`). Extracting them here keeps a single implementation per\n * direction — the same code runs inline or inside a worker thread.\n */\n\nimport {\n loadPackageDirectory,\n convertQtiPackageToLearnosityBundle,\n writeLearnosityBundle,\n loadLearnosityBundle,\n convertActivity,\n buildPackageFromActivity,\n mergeActivityPackage,\n sanitizeFolderName,\n ensureUniqueFolderName,\n saveQtiContentPackage,\n nodeFileAccess,\n type Diagnostic,\n type ItemFilenameSource,\n type ItemReferenceSource,\n type LearnosityBundleModel,\n type QtiContentPackage,\n} from '@learnosity/converter-core/node';\nimport type { DetectedPackage } from './packageScanner.js';\nimport { writeDiagnostics } from '../io/writeDiagnostics.js';\nimport { formatDiagnosticsSummaryTable } from '../ux/table.js';\n\n/** Options accepted by the per-package processors (subset of resolved CLI options). */\nexport interface BatchPackageOptions {\n organisationId?: number;\n mediaVault?: boolean;\n customAssetUrl?: string;\n itemReferenceSource?: ItemReferenceSource;\n itemFilenameSource?: ItemFilenameSource;\n truncateTags?: boolean;\n version?: string;\n pretty?: boolean;\n qtiVersion?: '2.1' | '2.2';\n}\n\n/** Result of processing one package (matches PackageProcessor's return shape). */\nexport interface PackageResult {\n success: boolean;\n errorCount: number;\n warningCount: number;\n convertedItemCount?: number;\n failedItemCount?: number;\n message?: string;\n}\n\n/** A single package conversion task dispatched to a worker. */\nexport interface BatchTask {\n direction: 'qti-to-learnosity' | 'learnosity-to-qti';\n pkg: DetectedPackage;\n packageOutputPath: string;\n options: BatchPackageOptions;\n}\n\n/** Run one batch task in-process (used by the worker and directly in tests). */\nexport async function runBatchTask(task: BatchTask, quiet = true): Promise<PackageResult> {\n if (task.direction === 'qti-to-learnosity') {\n return processQtiPackageToLearnosity(task.pkg, task.packageOutputPath, task.options, quiet);\n }\n\n return processLearnosityToQtiPackage(task.pkg, task.packageOutputPath, task.options, quiet);\n}\n\nfunction displayDiagnosticsSummary(diagnostics: Diagnostic[], quiet: boolean): void {\n if (quiet) {\n return;\n }\n\n const summaryTable = formatDiagnosticsSummaryTable(diagnostics);\n\n if (summaryTable) {\n console.log(' Diagnostics:');\n console.log(\n summaryTable\n .split('\\n')\n .map((line) => ' ' + line)\n .join('\\n')\n );\n console.log('');\n }\n}\n\n/** Convert one QTI Content Package directory to a Learnosity bundle on disk. */\nexport async function processQtiPackageToLearnosity(\n pkg: DetectedPackage,\n packageOutputPath: string,\n options: BatchPackageOptions,\n quiet: boolean\n): Promise<PackageResult> {\n // Convert the package\n const loaded = loadPackageDirectory(pkg.path);\n const convertResult = loaded.entries\n ? convertQtiPackageToLearnosityBundle(\n { entries: loaded.entries },\n {\n organisationId: options.organisationId,\n mediaVault: options.mediaVault,\n customAssetUrl: options.customAssetUrl,\n itemReferenceSource: options.itemReferenceSource,\n itemFilenameSource: options.itemFilenameSource,\n truncateTags: options.truncateTags,\n packageVersion: options.version,\n sourceDir: pkg.path,\n fileAccess: nodeFileAccess,\n }\n )\n : { diagnostics: loaded.diagnostics };\n\n const errors = convertResult.diagnostics.filter((d) => d.level === 'error');\n const warnings = convertResult.diagnostics.filter((d) => d.level === 'warning');\n const hasValidBundle = convertResult.bundle && convertResult.bundle.items.size > 0;\n\n const convertedFiles = convertResult.convertedSourceFiles || [];\n const failedFiles = convertResult.failedSourceFiles || [];\n\n // Count items that have error-level diagnostics (includes both\n // completely failed items and items that converted with errors)\n const filesWithErrors = new Set<string>();\n\n for (const d of convertResult.diagnostics) {\n if (d.level === 'error' && d.file) {\n filesWithErrors.add(d.file);\n }\n }\n\n const convertedWithErrors = convertedFiles.filter((f) => filesWithErrors.has(f)).length;\n const erroredItemCount = failedFiles.length + convertedWithErrors;\n const cleanItemCount = convertedFiles.length - convertedWithErrors;\n\n if (errors.length > 0 && !hasValidBundle) {\n return {\n success: false,\n errorCount: errors.length,\n warningCount: warnings.length,\n convertedItemCount: cleanItemCount,\n failedItemCount: erroredItemCount,\n message: 'Conversion failed',\n };\n }\n\n // Write the bundle\n const writeResult = await writeLearnosityBundle(convertResult.bundle!, {\n outDir: packageOutputPath,\n isZipOutput: false,\n });\n\n const writeErrors = writeResult.diagnostics.filter((d) => d.level === 'error');\n\n if (writeErrors.length > 0) {\n return {\n success: false,\n errorCount: errors.length + writeErrors.length,\n warningCount: warnings.length,\n convertedItemCount: cleanItemCount,\n failedItemCount: erroredItemCount,\n message: 'Write failed',\n };\n }\n\n // In batch mode, always write diagnostics.json to each package directory\n const diagnosticsPath = `${packageOutputPath}/diagnostics.json`;\n const allDiagnostics = [...convertResult.diagnostics, ...writeResult.diagnostics];\n const convertedActivityFiles = convertResult.convertedActivityFiles || [];\n\n await writeDiagnostics(allDiagnostics, 'file', diagnosticsPath, packageOutputPath, false, {\n inputPath: pkg.path,\n outputPath: packageOutputPath,\n totalItemsFound: convertedFiles.length + failedFiles.length,\n totalActivitiesFound: convertedActivityFiles.length,\n convertedFiles,\n failedFiles,\n convertedActivities: convertedActivityFiles,\n });\n\n // Show condensed diagnostics summary\n if (!quiet) {\n const summaryTable = formatDiagnosticsSummaryTable(allDiagnostics);\n\n if (summaryTable) {\n console.log(' Diagnostics:');\n console.log(\n summaryTable\n .split('\\n')\n .map((line) => ' ' + line)\n .join('\\n')\n );\n console.log('');\n }\n }\n\n return {\n success: true,\n errorCount: errors.length,\n warningCount: warnings.length,\n convertedItemCount: cleanItemCount,\n failedItemCount: erroredItemCount,\n };\n}\n\n/** Convert one Learnosity bundle directory to a QTI Content Package on disk. */\nexport async function processLearnosityToQtiPackage(\n pkg: DetectedPackage,\n packageOutputPath: string,\n options: BatchPackageOptions,\n quiet: boolean\n): Promise<PackageResult> {\n // Load the bundle\n const loadResult = loadLearnosityBundle(pkg.path);\n\n if (!loadResult.bundle) {\n const errorCount = loadResult.diagnostics.filter((d) => d.level === 'error').length;\n\n displayDiagnosticsSummary(loadResult.diagnostics, quiet);\n\n return {\n success: false,\n errorCount,\n warningCount: 0,\n message: 'Bundle load error',\n };\n }\n\n const bundle = loadResult.bundle;\n const allDiagnostics: Diagnostic[] = [...loadResult.diagnostics];\n\n // Convert all activities in the bundle\n const allConvertedActivities: {\n activityRef: string;\n folderName: string;\n conversion: ReturnType<typeof convertActivity>;\n }[] = [];\n\n // Folder names for tests/<folderName>/assessmentTest.xml must be unique per package\n const usedFolderNames = new Set<string>();\n\n // Track item outcomes for the diagnostics report. Items shared by several\n // activities are counted once, hence the sets.\n const convertedItemRefs = new Set<string>();\n const failedItemRefs = new Set<string>();\n\n for (const activityRef of bundle.activityRefs) {\n const convertResult = convertActivity(bundle, activityRef, {\n pretty: options.pretty,\n version: options.qtiVersion,\n });\n\n allDiagnostics.push(...convertResult.diagnostics);\n\n const itemRefs = bundle.activityItemRefs.get(activityRef) ?? [];\n const successfulItemRefs = new Set(convertResult.items.map((item) => item.reference));\n\n for (const itemRef of itemRefs) {\n if (successfulItemRefs.has(itemRef)) {\n convertedItemRefs.add(itemRef);\n } else {\n failedItemRefs.add(itemRef);\n }\n }\n\n if (convertResult.items.length > 0) {\n const sanitizedName = sanitizeFolderName(\n activityRef,\n `activity_${allConvertedActivities.length + 1}`\n );\n const folderName = ensureUniqueFolderName(sanitizedName, usedFolderNames);\n\n allConvertedActivities.push({ activityRef, folderName, conversion: convertResult });\n }\n }\n\n // An item that converted in one activity is not a failure elsewhere.\n for (const itemRef of convertedItemRefs) {\n failedItemRefs.delete(itemRef);\n }\n\n const convertedFiles = itemRefsToFilenames(bundle, convertedItemRefs);\n const failedFiles = itemRefsToFilenames(bundle, failedItemRefs);\n const convertedActivityFiles = allConvertedActivities.map(\n ({ activityRef }) => `activities/${activityRef}.json`\n );\n const failedActivityFiles = bundle.activityRefs\n .filter((ref) => !allConvertedActivities.some((a) => a.activityRef === ref))\n .map((ref) => `activities/${ref}.json`);\n const totalItemsConverted = convertedItemRefs.size;\n const totalItemsFailed = failedItemRefs.size;\n\n // In batch mode, always write diagnostics.json to each package directory,\n // including when the package fails, so the report explains what happened.\n // Reads allDiagnostics when called, so later diagnostics are included.\n const writePackageDiagnostics = () =>\n writeDiagnostics(\n allDiagnostics,\n 'file',\n `${packageOutputPath}/diagnostics.json`,\n packageOutputPath,\n false,\n {\n inputPath: pkg.path,\n outputPath: packageOutputPath,\n totalItemsFound: totalItemsConverted + totalItemsFailed,\n totalActivitiesFound: bundle.activityRefs.length,\n convertedFiles,\n failedFiles,\n convertedActivities: convertedActivityFiles,\n failedActivities: failedActivityFiles,\n }\n );\n\n if (allConvertedActivities.length === 0) {\n const errorCount = allDiagnostics.filter((d) => d.level === 'error').length;\n\n await writePackageDiagnostics();\n\n return {\n success: false,\n errorCount,\n warningCount: allDiagnostics.filter((d) => d.level === 'warning').length,\n convertedItemCount: 0,\n failedItemCount: totalItemsFailed,\n message: 'No activities converted',\n };\n }\n\n // Build package with all activities\n const pkgData: QtiContentPackage = {\n zipPath: '',\n resources: [],\n entries: new Map(),\n items: [],\n assets: [],\n };\n\n const addedResourceIds = new Set<string>();\n\n for (const { activityRef, folderName, conversion } of allConvertedActivities) {\n const packageResult = buildPackageFromActivity(conversion, {\n bundleDir: pkg.path,\n activityRef,\n version: options.qtiVersion,\n });\n\n allDiagnostics.push(...packageResult.diagnostics);\n\n // Relocates the assessmentTest to tests/<folderName>/assessmentTest.xml and\n // wires manifest dependencies, matching the single-package output layout.\n mergeActivityPackage(pkgData, folderName, packageResult, addedResourceIds);\n }\n\n // Save the package\n const saveResult = saveQtiContentPackage(pkgData, packageOutputPath);\n\n allDiagnostics.push(...saveResult.diagnostics);\n\n const errors = allDiagnostics.filter((d) => d.level === 'error');\n const warnings = allDiagnostics.filter((d) => d.level === 'warning');\n\n await writePackageDiagnostics();\n\n displayDiagnosticsSummary(allDiagnostics, quiet);\n\n if (errors.length > 0) {\n return {\n success: false,\n errorCount: errors.length,\n warningCount: warnings.length,\n convertedItemCount: totalItemsConverted,\n failedItemCount: totalItemsFailed,\n message: 'Conversion failed',\n };\n }\n\n return {\n success: true,\n errorCount: 0,\n warningCount: warnings.length,\n convertedItemCount: totalItemsConverted,\n failedItemCount: totalItemsFailed,\n };\n}\n\n/**\n * Map item references to the filenames they were loaded from, for the\n * diagnostics report. Falls back to the reference when the bundle has no\n * filename recorded, so counts always match the listed items.\n */\nfunction itemRefsToFilenames(bundle: LearnosityBundleModel, itemRefs: Set<string>): string[] {\n return [...itemRefs].map((itemRef) => bundle.itemRefToFilename.get(itemRef) ?? itemRef);\n}\n"],"mappings":";;;;;;;;;;AA6DA,eAAsB,aAAa,MAAiB,QAAQ,MAA8B;CACtF,IAAI,KAAK,cAAc,qBACnB,OAAO,8BAA8B,KAAK,KAAK,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9B,0BAA0B,gBAAgB,KAAK;CAE/C,IAAI,OAAO,SAAS,GAChB,OAAO;EACH,SAAS;EACT,YAAY,OAAO;EACnB,cAAc,SAAS;EACvB,oBAAoB;EACpB,iBAAiB;EACjB,SAAS;CACb;CAGJ,OAAO;EACH,SAAS;EACT,YAAY;EACZ,cAAc,SAAS;EACvB,oBAAoB;EACpB,iBAAiB;CACrB;AACJ;;;;;;AAOA,SAAS,oBAAoB,QAA+B,UAAiC;CACzF,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,KAAK,YAAY,OAAO,kBAAkB,IAAI,OAAO,KAAK,OAAO;AAC1F"}
|
|
1
|
+
{"version":3,"file":"batchProcessors-C55IxXri.js","names":[],"sources":["../src/utils/batchProcessors.ts"],"sourcesContent":["/**\n * Per-package conversion tasks, shared by the serial batch path\n * (`processBatch`) and the parallel worker path (`processBatchParallel` via\n * `batchWorker`). Extracting them here keeps a single implementation per\n * direction — the same code runs inline or inside a worker thread.\n */\n\nimport {\n loadPackageDirectory,\n convertQtiPackageToLearnosityBundle,\n writeLearnosityBundle,\n loadLearnosityBundle,\n convertActivity,\n buildPackageFromActivity,\n mergeActivityPackage,\n sanitizeFolderName,\n ensureUniqueFolderName,\n saveQtiContentPackage,\n nodeFileAccess,\n type Diagnostic,\n type ItemFilenameSource,\n type ItemReferenceSource,\n type LearnosityBundleModel,\n type QtiContentPackage,\n} from '@learnosity/converter-core/node';\nimport type { DetectedPackage } from './packageScanner.js';\nimport { writeDiagnostics } from '../io/writeDiagnostics.js';\nimport { formatDiagnosticsSummaryTable } from '../ux/table.js';\n\n/** Options accepted by the per-package processors (subset of resolved CLI options). */\nexport interface BatchPackageOptions {\n organisationId?: number;\n mediaVault?: boolean;\n customAssetUrl?: string;\n itemReferenceSource?: ItemReferenceSource;\n itemFilenameSource?: ItemFilenameSource;\n truncateTags?: boolean;\n version?: string;\n pretty?: boolean;\n qtiVersion?: '2.1' | '2.2';\n}\n\n/** Result of processing one package (matches PackageProcessor's return shape). */\nexport interface PackageResult {\n success: boolean;\n errorCount: number;\n warningCount: number;\n convertedItemCount?: number;\n failedItemCount?: number;\n message?: string;\n}\n\n/** A single package conversion task dispatched to a worker. */\nexport interface BatchTask {\n direction: 'qti-to-learnosity' | 'learnosity-to-qti';\n pkg: DetectedPackage;\n packageOutputPath: string;\n options: BatchPackageOptions;\n}\n\n/** Run one batch task in-process (used by the worker and directly in tests). */\nexport async function runBatchTask(task: BatchTask, quiet = true): Promise<PackageResult> {\n if (task.direction === 'qti-to-learnosity') {\n return processQtiPackageToLearnosity(task.pkg, task.packageOutputPath, task.options, quiet);\n }\n\n return processLearnosityToQtiPackage(task.pkg, task.packageOutputPath, task.options, quiet);\n}\n\nfunction displayDiagnosticsSummary(diagnostics: Diagnostic[], quiet: boolean): void {\n if (quiet) {\n return;\n }\n\n const summaryTable = formatDiagnosticsSummaryTable(diagnostics);\n\n if (summaryTable) {\n console.log(' Diagnostics:');\n console.log(\n summaryTable\n .split('\\n')\n .map((line) => ' ' + line)\n .join('\\n')\n );\n console.log('');\n }\n}\n\n/** Convert one QTI Content Package directory to a Learnosity bundle on disk. */\nexport async function processQtiPackageToLearnosity(\n pkg: DetectedPackage,\n packageOutputPath: string,\n options: BatchPackageOptions,\n quiet: boolean\n): Promise<PackageResult> {\n // Convert the package\n const loaded = loadPackageDirectory(pkg.path);\n const convertResult = loaded.entries\n ? convertQtiPackageToLearnosityBundle(\n { entries: loaded.entries },\n {\n organisationId: options.organisationId,\n mediaVault: options.mediaVault,\n customAssetUrl: options.customAssetUrl,\n itemReferenceSource: options.itemReferenceSource,\n itemFilenameSource: options.itemFilenameSource,\n truncateTags: options.truncateTags,\n packageVersion: options.version,\n sourceDir: pkg.path,\n fileAccess: nodeFileAccess,\n }\n )\n : { diagnostics: loaded.diagnostics };\n\n const errors = convertResult.diagnostics.filter((d) => d.level === 'error');\n const warnings = convertResult.diagnostics.filter((d) => d.level === 'warning');\n const hasValidBundle = convertResult.bundle && convertResult.bundle.items.size > 0;\n\n const convertedFiles = convertResult.convertedSourceFiles || [];\n const failedFiles = convertResult.failedSourceFiles || [];\n\n // Count items that have error-level diagnostics (includes both\n // completely failed items and items that converted with errors)\n const filesWithErrors = new Set<string>();\n\n for (const d of convertResult.diagnostics) {\n if (d.level === 'error' && d.file) {\n filesWithErrors.add(d.file);\n }\n }\n\n const convertedWithErrors = convertedFiles.filter((f) => filesWithErrors.has(f)).length;\n const erroredItemCount = failedFiles.length + convertedWithErrors;\n const cleanItemCount = convertedFiles.length - convertedWithErrors;\n\n if (errors.length > 0 && !hasValidBundle) {\n return {\n success: false,\n errorCount: errors.length,\n warningCount: warnings.length,\n convertedItemCount: cleanItemCount,\n failedItemCount: erroredItemCount,\n message: 'Conversion failed',\n };\n }\n\n // Write the bundle\n const writeResult = await writeLearnosityBundle(convertResult.bundle!, {\n outDir: packageOutputPath,\n isZipOutput: false,\n });\n\n const writeErrors = writeResult.diagnostics.filter((d) => d.level === 'error');\n\n if (writeErrors.length > 0) {\n return {\n success: false,\n errorCount: errors.length + writeErrors.length,\n warningCount: warnings.length,\n convertedItemCount: cleanItemCount,\n failedItemCount: erroredItemCount,\n message: 'Write failed',\n };\n }\n\n // In batch mode, always write diagnostics.json to each package directory\n const diagnosticsPath = `${packageOutputPath}/diagnostics.json`;\n const allDiagnostics = [...convertResult.diagnostics, ...writeResult.diagnostics];\n const convertedActivityFiles = convertResult.convertedActivityFiles || [];\n\n await writeDiagnostics(allDiagnostics, 'file', diagnosticsPath, packageOutputPath, false, {\n inputPath: pkg.path,\n outputPath: packageOutputPath,\n totalItemsFound: convertedFiles.length + failedFiles.length,\n totalActivitiesFound: convertedActivityFiles.length,\n convertedFiles,\n failedFiles,\n convertedActivities: convertedActivityFiles,\n });\n\n // Show condensed diagnostics summary\n if (!quiet) {\n const summaryTable = formatDiagnosticsSummaryTable(allDiagnostics);\n\n if (summaryTable) {\n console.log(' Diagnostics:');\n console.log(\n summaryTable\n .split('\\n')\n .map((line) => ' ' + line)\n .join('\\n')\n );\n console.log('');\n }\n }\n\n return {\n success: true,\n errorCount: errors.length,\n warningCount: warnings.length,\n convertedItemCount: cleanItemCount,\n failedItemCount: erroredItemCount,\n };\n}\n\n/** Convert one Learnosity bundle directory to a QTI Content Package on disk. */\nexport async function processLearnosityToQtiPackage(\n pkg: DetectedPackage,\n packageOutputPath: string,\n options: BatchPackageOptions,\n quiet: boolean\n): Promise<PackageResult> {\n // Load the bundle\n const loadResult = loadLearnosityBundle(pkg.path);\n\n if (!loadResult.bundle) {\n const errorCount = loadResult.diagnostics.filter((d) => d.level === 'error').length;\n\n displayDiagnosticsSummary(loadResult.diagnostics, quiet);\n\n return {\n success: false,\n errorCount,\n warningCount: 0,\n message: 'Bundle load error',\n };\n }\n\n const bundle = loadResult.bundle;\n const allDiagnostics: Diagnostic[] = [...loadResult.diagnostics];\n\n // Convert all activities in the bundle\n const allConvertedActivities: {\n activityRef: string;\n folderName: string;\n conversion: ReturnType<typeof convertActivity>;\n }[] = [];\n\n // Folder names for tests/<folderName>/assessmentTest.xml must be unique per package\n const usedFolderNames = new Set<string>();\n\n // Track item outcomes for the diagnostics report. Items shared by several\n // activities are counted once, hence the sets.\n const convertedItemRefs = new Set<string>();\n const failedItemRefs = new Set<string>();\n\n for (const activityRef of bundle.activityRefs) {\n const convertResult = convertActivity(bundle, activityRef, {\n pretty: options.pretty,\n version: options.qtiVersion,\n });\n\n allDiagnostics.push(...convertResult.diagnostics);\n\n const itemRefs = bundle.activityItemRefs.get(activityRef) ?? [];\n const successfulItemRefs = new Set(convertResult.items.map((item) => item.reference));\n\n for (const itemRef of itemRefs) {\n if (successfulItemRefs.has(itemRef)) {\n convertedItemRefs.add(itemRef);\n } else {\n failedItemRefs.add(itemRef);\n }\n }\n\n if (convertResult.items.length > 0) {\n const sanitizedName = sanitizeFolderName(\n activityRef,\n `activity_${allConvertedActivities.length + 1}`\n );\n const folderName = ensureUniqueFolderName(sanitizedName, usedFolderNames);\n\n allConvertedActivities.push({ activityRef, folderName, conversion: convertResult });\n }\n }\n\n // An item that converted in one activity is not a failure elsewhere.\n for (const itemRef of convertedItemRefs) {\n failedItemRefs.delete(itemRef);\n }\n\n const convertedFiles = itemRefsToFilenames(bundle, convertedItemRefs);\n const failedFiles = itemRefsToFilenames(bundle, failedItemRefs);\n const convertedActivityFiles = allConvertedActivities.map(\n ({ activityRef }) => `activities/${activityRef}.json`\n );\n const failedActivityFiles = bundle.activityRefs\n .filter((ref) => !allConvertedActivities.some((a) => a.activityRef === ref))\n .map((ref) => `activities/${ref}.json`);\n const totalItemsConverted = convertedItemRefs.size;\n const totalItemsFailed = failedItemRefs.size;\n\n // In batch mode, always write diagnostics.json to each package directory,\n // including when the package fails, so the report explains what happened.\n // Reads allDiagnostics when called, so later diagnostics are included.\n const writePackageDiagnostics = () =>\n writeDiagnostics(\n allDiagnostics,\n 'file',\n `${packageOutputPath}/diagnostics.json`,\n packageOutputPath,\n false,\n {\n inputPath: pkg.path,\n outputPath: packageOutputPath,\n totalItemsFound: totalItemsConverted + totalItemsFailed,\n totalActivitiesFound: bundle.activityRefs.length,\n convertedFiles,\n failedFiles,\n convertedActivities: convertedActivityFiles,\n failedActivities: failedActivityFiles,\n }\n );\n\n if (allConvertedActivities.length === 0) {\n const errorCount = allDiagnostics.filter((d) => d.level === 'error').length;\n\n await writePackageDiagnostics();\n\n return {\n success: false,\n errorCount,\n warningCount: allDiagnostics.filter((d) => d.level === 'warning').length,\n convertedItemCount: 0,\n failedItemCount: totalItemsFailed,\n message: 'No activities converted',\n };\n }\n\n // Build package with all activities\n const pkgData: QtiContentPackage = {\n zipPath: '',\n version: options.qtiVersion,\n resources: [],\n entries: new Map(),\n items: [],\n assets: [],\n };\n\n const addedResourceIds = new Set<string>();\n\n for (const { activityRef, folderName, conversion } of allConvertedActivities) {\n const packageResult = buildPackageFromActivity(conversion, {\n bundleDir: pkg.path,\n activityRef,\n version: options.qtiVersion,\n });\n\n allDiagnostics.push(...packageResult.diagnostics);\n\n // Relocates the assessmentTest to tests/<folderName>/assessmentTest.xml and\n // wires manifest dependencies, matching the single-package output layout.\n mergeActivityPackage(pkgData, folderName, packageResult, addedResourceIds);\n }\n\n // Save the package\n const saveResult = saveQtiContentPackage(pkgData, packageOutputPath);\n\n allDiagnostics.push(...saveResult.diagnostics);\n\n const errors = allDiagnostics.filter((d) => d.level === 'error');\n const warnings = allDiagnostics.filter((d) => d.level === 'warning');\n\n await writePackageDiagnostics();\n\n displayDiagnosticsSummary(allDiagnostics, quiet);\n\n if (errors.length > 0) {\n return {\n success: false,\n errorCount: errors.length,\n warningCount: warnings.length,\n convertedItemCount: totalItemsConverted,\n failedItemCount: totalItemsFailed,\n message: 'Conversion failed',\n };\n }\n\n return {\n success: true,\n errorCount: 0,\n warningCount: warnings.length,\n convertedItemCount: totalItemsConverted,\n failedItemCount: totalItemsFailed,\n };\n}\n\n/**\n * Map item references to the filenames they were loaded from, for the\n * diagnostics report. Falls back to the reference when the bundle has no\n * filename recorded, so counts always match the listed items.\n */\nfunction itemRefsToFilenames(bundle: LearnosityBundleModel, itemRefs: Set<string>): string[] {\n return [...itemRefs].map((itemRef) => bundle.itemRefToFilename.get(itemRef) ?? itemRef);\n}\n"],"mappings":";;;;;;;;;;AA6DA,eAAsB,aAAa,MAAiB,QAAQ,MAA8B;CACtF,IAAI,KAAK,cAAc,qBACnB,OAAO,8BAA8B,KAAK,KAAK,KAAK,mBAAmB,KAAK,SAAS,KAAK;CAG9F,OAAO,8BAA8B,KAAK,KAAK,KAAK,mBAAmB,KAAK,SAAS,KAAK;AAC9F;AAEA,SAAS,0BAA0B,aAA2B,OAAsB;CAChF,IAAI,OACA;CAGJ,MAAM,eAAe,8BAA8B,WAAW;CAE9D,IAAI,cAAc;EACd,QAAQ,IAAI,gBAAgB;EAC5B,QAAQ,IACJ,aACK,MAAM,IAAI,CAAC,CACX,KAAK,SAAS,OAAO,IAAI,CAAC,CAC1B,KAAK,IAAI,CAClB;EACA,QAAQ,IAAI,EAAE;CAClB;AAC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AAkB,IAAI,OAAO,KAAK,OAAO;AAC1F"}
|
|
@@ -4,7 +4,7 @@ import process$1 from "node:process";
|
|
|
4
4
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
5
5
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
6
6
|
import * as readline from "node:readline";
|
|
7
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
7
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/key.js
|
|
8
8
|
const keybindingLookup = /* @__PURE__ */ new Set(["emacs", "vim"]);
|
|
9
9
|
function isKeybinding(value) {
|
|
10
10
|
return keybindingLookup.has(value);
|
|
@@ -22,7 +22,7 @@ const isTabKey = (key) => key.name === "tab";
|
|
|
22
22
|
const isNumberKey = (key) => "1234567890".includes(key.name);
|
|
23
23
|
const isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
24
24
|
//#endregion
|
|
25
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
25
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/errors.js
|
|
26
26
|
var AbortPromptError = class extends Error {
|
|
27
27
|
name = "AbortPromptError";
|
|
28
28
|
message = "Prompt was aborted";
|
|
@@ -45,7 +45,7 @@ var ValidationError = class extends Error {
|
|
|
45
45
|
name = "ValidationError";
|
|
46
46
|
};
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
48
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
49
49
|
const hookStorage = new AsyncLocalStorage();
|
|
50
50
|
function createStore(rl) {
|
|
51
51
|
return {
|
|
@@ -141,15 +141,20 @@ const effectScheduler = {
|
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
//#endregion
|
|
144
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
144
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
145
145
|
function isFactory(value) {
|
|
146
146
|
return typeof value === "function";
|
|
147
147
|
}
|
|
148
|
+
function isReducer(value) {
|
|
149
|
+
return typeof value === "function";
|
|
150
|
+
}
|
|
148
151
|
function useState(defaultValue) {
|
|
149
152
|
return withPointer((pointer) => {
|
|
150
153
|
const setState = AsyncResource.bind(function setState(newValue) {
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
const currentValue = pointer.get();
|
|
155
|
+
const nextValue = isReducer(newValue) ? newValue(currentValue) : newValue;
|
|
156
|
+
if (!Object.is(currentValue, nextValue)) {
|
|
157
|
+
pointer.set(nextValue);
|
|
153
158
|
handleChange();
|
|
154
159
|
}
|
|
155
160
|
});
|
|
@@ -160,7 +165,7 @@ function useState(defaultValue) {
|
|
|
160
165
|
});
|
|
161
166
|
}
|
|
162
167
|
//#endregion
|
|
163
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
168
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
164
169
|
function useEffect(cb, depArray) {
|
|
165
170
|
withPointer((pointer) => {
|
|
166
171
|
const oldDeps = pointer.get();
|
|
@@ -169,7 +174,7 @@ function useEffect(cb, depArray) {
|
|
|
169
174
|
});
|
|
170
175
|
}
|
|
171
176
|
//#endregion
|
|
172
|
-
//#region ../../node_modules/.pnpm/@inquirer+figures@2.0.
|
|
177
|
+
//#region ../../node_modules/.pnpm/@inquirer+figures@2.0.8/node_modules/@inquirer/figures/dist/index.js
|
|
173
178
|
function isUnicodeSupported() {
|
|
174
179
|
if (!process$1.platform.startsWith("win")) return process$1.env["TERM"] !== "linux";
|
|
175
180
|
return Boolean(process$1.env["CI"]) || Boolean(process$1.env["WT_SESSION"]) || Boolean(process$1.env["TERMINUS_SUBLIME"]) || process$1.env["ConEmuTask"] === "{cmd::Cmder}" || process$1.env["TERM_PROGRAM"] === "Terminus-Sublime" || process$1.env["TERM_PROGRAM"] === "vscode" || process$1.env["TERM"] === "xterm-256color" || process$1.env["TERM"] === "alacritty" || process$1.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
@@ -453,7 +458,7 @@ const fallbackSymbols = {
|
|
|
453
458
|
const figures = isUnicodeSupported() ? mainSymbols : fallbackSymbols;
|
|
454
459
|
Object.entries(specialMainSymbols);
|
|
455
460
|
//#endregion
|
|
456
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
461
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/theme.js
|
|
457
462
|
const defaultTheme = {
|
|
458
463
|
prefix: {
|
|
459
464
|
idle: styleText("blue", "?"),
|
|
@@ -492,7 +497,7 @@ function getDefaultTheme() {
|
|
|
492
497
|
};
|
|
493
498
|
}
|
|
494
499
|
//#endregion
|
|
495
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
500
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
496
501
|
function isPlainObject(value) {
|
|
497
502
|
if (typeof value !== "object" || value === null) return false;
|
|
498
503
|
let proto = value;
|
|
@@ -511,7 +516,7 @@ function makeTheme(...themes) {
|
|
|
511
516
|
return deepMerge(...[getDefaultTheme(), ...themes.filter((theme) => theme != null)]);
|
|
512
517
|
}
|
|
513
518
|
//#endregion
|
|
514
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
519
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
515
520
|
function usePrefix({ status = "idle", theme }) {
|
|
516
521
|
const [showLoader, setShowLoader] = useState(false);
|
|
517
522
|
const [tick, setTick] = useState(0);
|
|
@@ -537,12 +542,12 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
537
542
|
return typeof prefix === "string" ? prefix : prefix[status === "loading" ? "idle" : status] ?? prefix["idle"];
|
|
538
543
|
}
|
|
539
544
|
//#endregion
|
|
540
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
545
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
541
546
|
function useRef(val) {
|
|
542
547
|
return useState({ current: val })[0];
|
|
543
548
|
}
|
|
544
549
|
//#endregion
|
|
545
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
550
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
546
551
|
function useKeypress(userHandler) {
|
|
547
552
|
const signal = useRef(userHandler);
|
|
548
553
|
signal.current = userHandler;
|
|
@@ -868,7 +873,7 @@ function wrapAnsi(string, columns, options) {
|
|
|
868
873
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
869
874
|
}
|
|
870
875
|
//#endregion
|
|
871
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
876
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/utils.js
|
|
872
877
|
/**
|
|
873
878
|
* Force line returns at specific width. This function is ANSI code friendly and it'll
|
|
874
879
|
* ignore invisible codes during width calculation.
|
|
@@ -1207,7 +1212,7 @@ const eraseLine = "\x1B[2K";
|
|
|
1207
1212
|
/** Erase the specified number of lines above the cursor */
|
|
1208
1213
|
const eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + "\x1B[2K\x1B[G" : "";
|
|
1209
1214
|
//#endregion
|
|
1210
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
1215
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
1211
1216
|
const height = (content) => content.split("\n").length;
|
|
1212
1217
|
const lastLine = (content) => content.split("\n").pop() ?? "";
|
|
1213
1218
|
var ScreenManager = class {
|
|
@@ -1264,7 +1269,7 @@ var ScreenManager = class {
|
|
|
1264
1269
|
}
|
|
1265
1270
|
};
|
|
1266
1271
|
//#endregion
|
|
1267
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
1272
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
1268
1273
|
var PromisePolyfill = class extends Promise {
|
|
1269
1274
|
static withResolver() {
|
|
1270
1275
|
let resolve;
|
|
@@ -1280,7 +1285,7 @@ var PromisePolyfill = class extends Promise {
|
|
|
1280
1285
|
}
|
|
1281
1286
|
};
|
|
1282
1287
|
//#endregion
|
|
1283
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
1288
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
1284
1289
|
const nativeSetImmediate = globalThis.setImmediate;
|
|
1285
1290
|
function getCallSites() {
|
|
1286
1291
|
const savedPrepareStackTrace = Error.prepareStackTrace;
|
|
@@ -1384,4 +1389,4 @@ function createPrompt(view) {
|
|
|
1384
1389
|
//#endregion
|
|
1385
1390
|
export { isEnterKey as _, readlineWidth as a, isTabKey as b, usePrefix as c, useEffect as d, useState as f, isDownKey as g, isBackspaceKey as h, breakLines as i, makeTheme as l, ValidationError as m, cursorHide as n, useKeypress as o, withPointer as p, onExit as r, useRef as s, createPrompt as t, figures as u, isNumberKey as v, isUpKey as x, isSpaceKey as y };
|
|
1386
1391
|
|
|
1387
|
-
//# sourceMappingURL=create-prompt-
|
|
1392
|
+
//# sourceMappingURL=create-prompt-DU9wLVhI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-prompt-DU9wLVhI.js","names":["readline","process","NO_TRUNCATION","fastStringTruncatedWidth","ESC","stringWidth","cliWidth","readline","process","MuteStream","onSignalExit"],"sources":["../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/key.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/errors.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/hook-engine.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-state.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-effect.js","../../../node_modules/.pnpm/@inquirer+figures@2.0.8/node_modules/@inquirer/figures/dist/index.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/theme.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/make-theme.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-prefix.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-ref.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-keypress.js","../../../node_modules/.pnpm/cli-width@4.1.0/node_modules/cli-width/index.js","../../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js","../../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js","../../../node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js","../../../node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/utils.js","../../../node_modules/.pnpm/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js","../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js","../../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js","../../../node_modules/.pnpm/@inquirer+ansi@2.0.7/node_modules/@inquirer/ansi/dist/index.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/screen-manager.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/promise-polyfill.js","../../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/create-prompt.js"],"sourcesContent":["const keybindings = ['emacs', 'vim'];\nconst keybindingLookup = new Set(keybindings);\nfunction isKeybinding(value) {\n return keybindingLookup.has(value);\n}\nexport function getDefaultKeybindings() {\n const env = process.env['INQUIRER_KEYBINDINGS'];\n if (!env)\n return [];\n return Array.from(new Set(env\n .toLowerCase()\n .split(/[\\s,]+/)\n .filter(isKeybinding)));\n}\nexport const isUpKey = (key, keybindings = []) => \n// The up key\nkey.name === 'up' ||\n // Vim keybinding: hjkl keys map to left/down/up/right\n (keybindings.includes('vim') && key.name === 'k') ||\n // Emacs keybinding: Ctrl+P means \"previous\" in Emacs navigation conventions\n (keybindings.includes('emacs') && key.ctrl && key.name === 'p');\nexport const isDownKey = (key, keybindings = []) => \n// The down key\nkey.name === 'down' ||\n // Vim keybinding: hjkl keys map to left/down/up/right\n (keybindings.includes('vim') && key.name === 'j') ||\n // Emacs keybinding: Ctrl+N means \"next\" in Emacs navigation conventions\n (keybindings.includes('emacs') && key.ctrl && key.name === 'n');\nexport const isSpaceKey = (key) => key.name === 'space';\nexport const isBackspaceKey = (key) => key.name === 'backspace';\nexport const isTabKey = (key) => key.name === 'tab';\nexport const isNumberKey = (key) => '1234567890'.includes(key.name);\nexport const isEnterKey = (key) => key.name === 'enter' || key.name === 'return';\nexport const isShiftKey = (key) => key.shift;\n","export class AbortPromptError extends Error {\n name = 'AbortPromptError';\n message = 'Prompt was aborted';\n constructor(options) {\n super();\n this.cause = options?.cause;\n }\n}\nexport class CancelPromptError extends Error {\n name = 'CancelPromptError';\n message = 'Prompt was canceled';\n}\nexport class ExitPromptError extends Error {\n name = 'ExitPromptError';\n}\nexport class HookError extends Error {\n name = 'HookError';\n}\nexport class ValidationError extends Error {\n name = 'ValidationError';\n}\n","/* eslint @typescript-eslint/no-explicit-any: [\"off\"] */\nimport { AsyncLocalStorage, AsyncResource } from 'node:async_hooks';\nimport { HookError, ValidationError } from \"./errors.js\";\nconst hookStorage = new AsyncLocalStorage();\nfunction createStore(rl) {\n const store = {\n rl,\n hooks: [],\n hooksCleanup: [],\n hooksEffect: [],\n index: 0,\n handleChange() { },\n };\n return store;\n}\n// Run callback in with the hook engine setup.\nexport function withHooks(rl, cb) {\n const store = createStore(rl);\n return hookStorage.run(store, () => {\n function cycle(render) {\n store.handleChange = () => {\n store.index = 0;\n render();\n };\n store.handleChange();\n }\n return cb(cycle);\n });\n}\n// Safe getStore utility that'll return the store or throw if undefined.\nfunction getStore() {\n const store = hookStorage.getStore();\n if (!store) {\n throw new HookError('[Inquirer] Hook functions can only be called from within a prompt');\n }\n return store;\n}\nexport function readline() {\n return getStore().rl;\n}\n// Merge state updates happening within the callback function to avoid multiple renders.\nexport function withUpdates(fn) {\n const wrapped = (...args) => {\n const store = getStore();\n let shouldUpdate = false;\n const oldHandleChange = store.handleChange;\n store.handleChange = () => {\n shouldUpdate = true;\n };\n const returnValue = fn(...args);\n if (shouldUpdate) {\n oldHandleChange();\n }\n store.handleChange = oldHandleChange;\n return returnValue;\n };\n return AsyncResource.bind(wrapped);\n}\nexport function withPointer(cb) {\n const store = getStore();\n const { index } = store;\n const pointer = {\n get() {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return store.hooks[index];\n },\n set(value) {\n store.hooks[index] = value;\n },\n initialized: index in store.hooks,\n };\n const returnValue = cb(pointer);\n store.index++;\n return returnValue;\n}\nexport function handleChange() {\n getStore().handleChange();\n}\nexport const effectScheduler = {\n queue(cb) {\n const store = getStore();\n const { index } = store;\n store.hooksEffect.push(() => {\n store.hooksCleanup[index]?.();\n const cleanFn = cb(readline());\n if (cleanFn != null && typeof cleanFn !== 'function') {\n throw new ValidationError('useEffect return value must be a cleanup function or nothing.');\n }\n store.hooksCleanup[index] = cleanFn;\n });\n },\n run() {\n const store = getStore();\n withUpdates(() => {\n store.hooksEffect.forEach((effect) => {\n effect();\n });\n // Warning: Clean the hooks before exiting the `withUpdates` block.\n // Failure to do so means an updates would hit the same effects again.\n store.hooksEffect.length = 0;\n })();\n },\n clearAll() {\n const store = getStore();\n store.hooksCleanup.forEach((cleanFn) => {\n cleanFn?.();\n });\n store.hooksEffect.length = 0;\n store.hooksCleanup.length = 0;\n },\n};\n","import { AsyncResource } from 'node:async_hooks';\nimport { withPointer, handleChange } from \"./hook-engine.js\";\nfunction isFactory(value) {\n return typeof value === 'function';\n}\nfunction isReducer(value) {\n return typeof value === 'function';\n}\nexport function useState(defaultValue) {\n return withPointer((pointer) => {\n const setState = AsyncResource.bind(function setState(newValue) {\n const currentValue = pointer.get();\n const nextValue = isReducer(newValue) ? newValue(currentValue) : newValue;\n // Noop if the value is still the same.\n if (!Object.is(currentValue, nextValue)) {\n pointer.set(nextValue);\n // Trigger re-render\n handleChange();\n }\n });\n if (pointer.initialized) {\n return [pointer.get(), setState];\n }\n const value = isFactory(defaultValue) ? defaultValue() : defaultValue;\n pointer.set(value);\n return [value, setState];\n });\n}\n","import { withPointer, effectScheduler } from \"./hook-engine.js\";\nexport function useEffect(cb, depArray) {\n withPointer((pointer) => {\n const oldDeps = pointer.get();\n const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));\n if (hasChanged) {\n effectScheduler.queue(cb);\n }\n pointer.set(depArray);\n });\n}\n","// process.env dot-notation access prints:\n// Property 'TERM' comes from an index signature, so it must be accessed with ['TERM'].ts(4111)\n/* eslint dot-notation: [\"off\"] */\nimport process from 'node:process';\n// Ported from is-unicode-supported\nfunction isUnicodeSupported() {\n if (!process.platform.startsWith('win')) {\n return process.env['TERM'] !== 'linux'; // Linux console (kernel)\n }\n return (Boolean(process.env['CI']) || // CI environments generally support unicode\n Boolean(process.env['WT_SESSION']) || // Windows Terminal\n Boolean(process.env['TERMINUS_SUBLIME']) || // Terminus (<0.2.27)\n process.env['ConEmuTask'] === '{cmd::Cmder}' || // ConEmu and cmder\n process.env['TERM_PROGRAM'] === 'Terminus-Sublime' ||\n process.env['TERM_PROGRAM'] === 'vscode' ||\n process.env['TERM'] === 'xterm-256color' ||\n process.env['TERM'] === 'alacritty' ||\n process.env['TERMINAL_EMULATOR'] === 'JetBrains-JediTerm');\n}\n// Ported from figures\nconst common = {\n circleQuestionMark: '(?)',\n questionMarkPrefix: '(?)',\n square: '█',\n squareDarkShade: '▓',\n squareMediumShade: '▒',\n squareLightShade: '░',\n squareTop: '▀',\n squareBottom: '▄',\n squareLeft: '▌',\n squareRight: '▐',\n squareCenter: '■',\n bullet: '●',\n dot: '․',\n ellipsis: '…',\n pointerSmall: '›',\n triangleUp: '▲',\n triangleUpSmall: '▴',\n triangleDown: '▼',\n triangleDownSmall: '▾',\n triangleLeftSmall: '◂',\n triangleRightSmall: '▸',\n home: '⌂',\n heart: '♥',\n musicNote: '♪',\n musicNoteBeamed: '♫',\n arrowUp: '↑',\n arrowDown: '↓',\n arrowLeft: '←',\n arrowRight: '→',\n arrowLeftRight: '↔',\n arrowUpDown: '↕',\n almostEqual: '≈',\n notEqual: '≠',\n lessOrEqual: '≤',\n greaterOrEqual: '≥',\n identical: '≡',\n infinity: '∞',\n subscriptZero: '₀',\n subscriptOne: '₁',\n subscriptTwo: '₂',\n subscriptThree: '₃',\n subscriptFour: '₄',\n subscriptFive: '₅',\n subscriptSix: '₆',\n subscriptSeven: '₇',\n subscriptEight: '₈',\n subscriptNine: '₉',\n oneHalf: '½',\n oneThird: '⅓',\n oneQuarter: '¼',\n oneFifth: '⅕',\n oneSixth: '⅙',\n oneEighth: '⅛',\n twoThirds: '⅔',\n twoFifths: '⅖',\n threeQuarters: '¾',\n threeFifths: '⅗',\n threeEighths: '⅜',\n fourFifths: '⅘',\n fiveSixths: '⅚',\n fiveEighths: '⅝',\n sevenEighths: '⅞',\n line: '─',\n lineBold: '━',\n lineDouble: '═',\n lineDashed0: '┄',\n lineDashed1: '┅',\n lineDashed2: '┈',\n lineDashed3: '┉',\n lineDashed4: '╌',\n lineDashed5: '╍',\n lineDashed6: '╴',\n lineDashed7: '╶',\n lineDashed8: '╸',\n lineDashed9: '╺',\n lineDashed10: '╼',\n lineDashed11: '╾',\n lineDashed12: '−',\n lineDashed13: '–',\n lineDashed14: '‐',\n lineDashed15: '⁃',\n lineVertical: '│',\n lineVerticalBold: '┃',\n lineVerticalDouble: '║',\n lineVerticalDashed0: '┆',\n lineVerticalDashed1: '┇',\n lineVerticalDashed2: '┊',\n lineVerticalDashed3: '┋',\n lineVerticalDashed4: '╎',\n lineVerticalDashed5: '╏',\n lineVerticalDashed6: '╵',\n lineVerticalDashed7: '╷',\n lineVerticalDashed8: '╹',\n lineVerticalDashed9: '╻',\n lineVerticalDashed10: '╽',\n lineVerticalDashed11: '╿',\n lineDownLeft: '┐',\n lineDownLeftArc: '╮',\n lineDownBoldLeftBold: '┓',\n lineDownBoldLeft: '┒',\n lineDownLeftBold: '┑',\n lineDownDoubleLeftDouble: '╗',\n lineDownDoubleLeft: '╖',\n lineDownLeftDouble: '╕',\n lineDownRight: '┌',\n lineDownRightArc: '╭',\n lineDownBoldRightBold: '┏',\n lineDownBoldRight: '┎',\n lineDownRightBold: '┍',\n lineDownDoubleRightDouble: '╔',\n lineDownDoubleRight: '╓',\n lineDownRightDouble: '╒',\n lineUpLeft: '┘',\n lineUpLeftArc: '╯',\n lineUpBoldLeftBold: '┛',\n lineUpBoldLeft: '┚',\n lineUpLeftBold: '┙',\n lineUpDoubleLeftDouble: '╝',\n lineUpDoubleLeft: '╜',\n lineUpLeftDouble: '╛',\n lineUpRight: '└',\n lineUpRightArc: '╰',\n lineUpBoldRightBold: '┗',\n lineUpBoldRight: '┖',\n lineUpRightBold: '┕',\n lineUpDoubleRightDouble: '╚',\n lineUpDoubleRight: '╙',\n lineUpRightDouble: '╘',\n lineUpDownLeft: '┤',\n lineUpBoldDownBoldLeftBold: '┫',\n lineUpBoldDownBoldLeft: '┨',\n lineUpDownLeftBold: '┥',\n lineUpBoldDownLeftBold: '┩',\n lineUpDownBoldLeftBold: '┪',\n lineUpDownBoldLeft: '┧',\n lineUpBoldDownLeft: '┦',\n lineUpDoubleDownDoubleLeftDouble: '╣',\n lineUpDoubleDownDoubleLeft: '╢',\n lineUpDownLeftDouble: '╡',\n lineUpDownRight: '├',\n lineUpBoldDownBoldRightBold: '┣',\n lineUpBoldDownBoldRight: '┠',\n lineUpDownRightBold: '┝',\n lineUpBoldDownRightBold: '┡',\n lineUpDownBoldRightBold: '┢',\n lineUpDownBoldRight: '┟',\n lineUpBoldDownRight: '┞',\n lineUpDoubleDownDoubleRightDouble: '╠',\n lineUpDoubleDownDoubleRight: '╟',\n lineUpDownRightDouble: '╞',\n lineDownLeftRight: '┬',\n lineDownBoldLeftBoldRightBold: '┳',\n lineDownLeftBoldRightBold: '┯',\n lineDownBoldLeftRight: '┰',\n lineDownBoldLeftBoldRight: '┱',\n lineDownBoldLeftRightBold: '┲',\n lineDownLeftRightBold: '┮',\n lineDownLeftBoldRight: '┭',\n lineDownDoubleLeftDoubleRightDouble: '╦',\n lineDownDoubleLeftRight: '╥',\n lineDownLeftDoubleRightDouble: '╤',\n lineUpLeftRight: '┴',\n lineUpBoldLeftBoldRightBold: '┻',\n lineUpLeftBoldRightBold: '┷',\n lineUpBoldLeftRight: '┸',\n lineUpBoldLeftBoldRight: '┹',\n lineUpBoldLeftRightBold: '┺',\n lineUpLeftRightBold: '┶',\n lineUpLeftBoldRight: '┵',\n lineUpDoubleLeftDoubleRightDouble: '╩',\n lineUpDoubleLeftRight: '╨',\n lineUpLeftDoubleRightDouble: '╧',\n lineUpDownLeftRight: '┼',\n lineUpBoldDownBoldLeftBoldRightBold: '╋',\n lineUpDownBoldLeftBoldRightBold: '╈',\n lineUpBoldDownLeftBoldRightBold: '╇',\n lineUpBoldDownBoldLeftRightBold: '╊',\n lineUpBoldDownBoldLeftBoldRight: '╉',\n lineUpBoldDownLeftRight: '╀',\n lineUpDownBoldLeftRight: '╁',\n lineUpDownLeftBoldRight: '┽',\n lineUpDownLeftRightBold: '┾',\n lineUpBoldDownBoldLeftRight: '╂',\n lineUpDownLeftBoldRightBold: '┿',\n lineUpBoldDownLeftBoldRight: '╃',\n lineUpBoldDownLeftRightBold: '╄',\n lineUpDownBoldLeftBoldRight: '╅',\n lineUpDownBoldLeftRightBold: '╆',\n lineUpDoubleDownDoubleLeftDoubleRightDouble: '╬',\n lineUpDoubleDownDoubleLeftRight: '╫',\n lineUpDownLeftDoubleRightDouble: '╪',\n lineCross: '╳',\n lineBackslash: '╲',\n lineSlash: '╱',\n};\nconst specialMainSymbols = {\n tick: '✔',\n info: 'ℹ',\n warning: '⚠',\n cross: '✘',\n squareSmall: '◻',\n squareSmallFilled: '◼',\n circle: '◯',\n circleFilled: '◉',\n circleDotted: '◌',\n circleDouble: '◎',\n circleCircle: 'ⓞ',\n circleCross: 'ⓧ',\n circlePipe: 'Ⓘ',\n radioOn: '◉',\n radioOff: '◯',\n checkboxOn: '☒',\n checkboxOff: '☐',\n checkboxCircleOn: 'ⓧ',\n checkboxCircleOff: 'Ⓘ',\n pointer: '❯',\n triangleUpOutline: '△',\n triangleLeft: '◀',\n triangleRight: '▶',\n lozenge: '◆',\n lozengeOutline: '◇',\n hamburger: '☰',\n smiley: '㋡',\n mustache: '෴',\n star: '★',\n play: '▶',\n nodejs: '⬢',\n oneSeventh: '⅐',\n oneNinth: '⅑',\n oneTenth: '⅒',\n};\nconst specialFallbackSymbols = {\n tick: '√',\n info: 'i',\n warning: '‼',\n cross: '×',\n squareSmall: '□',\n squareSmallFilled: '■',\n circle: '( )',\n circleFilled: '(*)',\n circleDotted: '( )',\n circleDouble: '( )',\n circleCircle: '(○)',\n circleCross: '(×)',\n circlePipe: '(│)',\n radioOn: '(*)',\n radioOff: '( )',\n checkboxOn: '[×]',\n checkboxOff: '[ ]',\n checkboxCircleOn: '(×)',\n checkboxCircleOff: '( )',\n pointer: '>',\n triangleUpOutline: '∆',\n triangleLeft: '◄',\n triangleRight: '►',\n lozenge: '♦',\n lozengeOutline: '◊',\n hamburger: '≡',\n smiley: '☺',\n mustache: '┌─┐',\n star: '✶',\n play: '►',\n nodejs: '♦',\n oneSeventh: '1/7',\n oneNinth: '1/9',\n oneTenth: '1/10',\n};\nexport const mainSymbols = {\n ...common,\n ...specialMainSymbols,\n};\nexport const fallbackSymbols = {\n ...common,\n ...specialFallbackSymbols,\n};\nconst shouldUseMain = isUnicodeSupported();\nconst figures = shouldUseMain\n ? mainSymbols\n : fallbackSymbols;\nexport default figures;\nconst replacements = Object.entries(specialMainSymbols);\n// On terminals which do not support Unicode symbols, substitute them to other symbols\nexport const replaceSymbols = (string, { useFallback = !shouldUseMain } = {}) => {\n if (useFallback) {\n for (const [key, mainSymbol] of replacements) {\n const fallbackSymbol = fallbackSymbols[key];\n if (!fallbackSymbol) {\n throw new Error(`Unable to find fallback for ${key}`);\n }\n string = string.replaceAll(mainSymbol, fallbackSymbol);\n }\n }\n return string;\n};\n","import { styleText } from 'node:util';\nimport figures from '@inquirer/figures';\nimport { getDefaultKeybindings } from \"./key.js\";\nexport const defaultTheme = {\n prefix: {\n idle: styleText('blue', '?'),\n done: styleText('green', figures.tick),\n },\n spinner: {\n interval: 80,\n frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'].map((frame) => styleText('yellow', frame)),\n },\n keybindings: [],\n style: {\n answer: (text) => styleText('cyan', text),\n message: (text) => styleText('bold', text),\n error: (text) => styleText('red', `> ${text}`),\n defaultAnswer: (text) => styleText('dim', `(${text})`),\n help: (text) => styleText('dim', text),\n highlight: (text) => styleText('cyan', text),\n key: (text) => styleText('cyan', styleText('bold', `<${text}>`)),\n },\n};\nexport function getDefaultTheme() {\n return {\n ...defaultTheme,\n keybindings: getDefaultKeybindings(),\n };\n}\n","import { getDefaultTheme } from \"./theme.js\";\nfunction isPlainObject(value) {\n if (typeof value !== 'object' || value === null)\n return false;\n let proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n}\nfunction deepMerge(...objects) {\n const output = {};\n for (const obj of objects) {\n for (const [key, value] of Object.entries(obj)) {\n const prevValue = output[key];\n output[key] =\n isPlainObject(prevValue) && isPlainObject(value)\n ? deepMerge(prevValue, value)\n : value;\n }\n }\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return output;\n}\nexport function makeTheme(...themes) {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const themesToMerge = [\n getDefaultTheme(),\n ...themes.filter((theme) => theme != null),\n ];\n return deepMerge(...themesToMerge);\n}\n","import { useState } from \"./use-state.js\";\nimport { useEffect } from \"./use-effect.js\";\nimport { makeTheme } from \"./make-theme.js\";\nexport function usePrefix({ status = 'idle', theme, }) {\n const [showLoader, setShowLoader] = useState(false);\n const [tick, setTick] = useState(0);\n const { prefix, spinner } = makeTheme(theme);\n useEffect(() => {\n if (status === 'loading') {\n let tickInterval;\n let inc = -1;\n // Delay displaying spinner by 300ms, to avoid flickering\n const delayTimeout = setTimeout(() => {\n setShowLoader(true);\n tickInterval = setInterval(() => {\n inc = inc + 1;\n setTick(inc % spinner.frames.length);\n }, spinner.interval);\n }, 300);\n return () => {\n clearTimeout(delayTimeout);\n clearInterval(tickInterval);\n };\n }\n else {\n setShowLoader(false);\n }\n }, [status]);\n if (showLoader) {\n return spinner.frames[tick];\n }\n // There's a delay before we show the loader. So we want to ignore `loading` here, and pass idle instead.\n const iconName = status === 'loading' ? 'idle' : status;\n return typeof prefix === 'string' ? prefix : (prefix[iconName] ?? prefix['idle']);\n}\n","import { useState } from \"./use-state.js\";\nexport function useRef(val) {\n return useState({ current: val })[0];\n}\n","import { useRef } from \"./use-ref.js\";\nimport { useEffect } from \"./use-effect.js\";\nimport { withUpdates } from \"./hook-engine.js\";\nexport function useKeypress(userHandler) {\n const signal = useRef(userHandler);\n signal.current = userHandler;\n useEffect((rl) => {\n let ignore = false;\n const handler = withUpdates((_input, event) => {\n if (ignore)\n return;\n void signal.current(event, rl);\n });\n rl.input.on('keypress', handler);\n return () => {\n ignore = true;\n rl.input.removeListener('keypress', handler);\n };\n }, []);\n}\n","'use strict';\n\nmodule.exports = cliWidth;\n\nfunction normalizeOpts(options) {\n const defaultOpts = {\n defaultWidth: 0,\n output: process.stdout,\n tty: require('tty'),\n };\n\n if (!options) {\n return defaultOpts;\n }\n\n Object.keys(defaultOpts).forEach(function (key) {\n if (!options[key]) {\n options[key] = defaultOpts[key];\n }\n });\n\n return options;\n}\n\nfunction cliWidth(options) {\n const opts = normalizeOpts(options);\n\n if (opts.output.getWindowSize) {\n return opts.output.getWindowSize()[0] || opts.defaultWidth;\n }\n\n if (opts.tty.getWindowSize) {\n return opts.tty.getWindowSize()[1] || opts.defaultWidth;\n }\n\n if (opts.output.columns) {\n return opts.output.columns;\n }\n\n if (process.env.CLI_WIDTH) {\n const width = parseInt(process.env.CLI_WIDTH, 10);\n\n if (!isNaN(width) && width !== 0) {\n return width;\n }\n }\n\n return opts.defaultWidth;\n}\n","/* MAIN */\nconst getCodePointsLength = (() => {\n const SURROGATE_PAIR_RE = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n return (input) => {\n let surrogatePairsNr = 0;\n SURROGATE_PAIR_RE.lastIndex = 0;\n while (SURROGATE_PAIR_RE.test(input)) {\n surrogatePairsNr += 1;\n }\n return input.length - surrogatePairsNr;\n };\n})();\nconst isFullWidth = (x) => {\n return x === 0x3000 || x >= 0xFF01 && x <= 0xFF60 || x >= 0xFFE0 && x <= 0xFFE6;\n};\nconst isWideNotCJKTNotEmoji = (x) => {\n return x === 0x231B || x === 0x2329 || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || x >= 0x3099 && x <= 0x30FF || x >= 0x3105 && x <= 0x312F || x >= 0x3131 && x <= 0x318E || x >= 0x3190 && x <= 0x31E3 || x >= 0x31EF && x <= 0x321E || x >= 0x3220 && x <= 0x3247 || x >= 0x3250 && x <= 0x4DBF || x >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;\n};\n/* EXPORT */\nexport { getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji };\n","/* IMPORT */\nimport { getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji } from './utils.js';\n/* HELPERS */\nconst ANSI_RE = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\\u001b\\]8;[^;]*;.*?(?:\\u0007|\\u001b\\u005c)/y;\nconst CONTROL_RE = /[\\x00-\\x08\\x0A-\\x1F\\x7F-\\x9F]{1,1000}/y;\nconst CJKT_WIDE_RE = /(?:(?![\\uFF61-\\uFF9F\\uFF00-\\uFFEF])[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}\\p{Script=Tangut}]){1,1000}/yu;\nconst TAB_RE = /\\t{1,1000}/y;\nconst EMOJI_RE = /[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*/yu;\nconst LATIN_RE = /(?:[\\x20-\\x7E\\xA0-\\xFF](?!\\uFE0F)){1,1000}/y;\nconst MODIFIER_RE = /\\p{M}+/gu;\nconst NO_TRUNCATION = { limit: Infinity, ellipsis: '' };\n/* MAIN */\nconst getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {\n /* CONSTANTS */\n const LIMIT = truncationOptions.limit ?? Infinity;\n const ELLIPSIS = truncationOptions.ellipsis ?? '';\n const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);\n const ANSI_WIDTH = 0;\n const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;\n const TAB_WIDTH = widthOptions.tabWidth ?? 8;\n const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;\n const FULL_WIDTH_WIDTH = 2;\n const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;\n const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;\n const PARSE_BLOCKS = [\n [LATIN_RE, REGULAR_WIDTH],\n [ANSI_RE, ANSI_WIDTH],\n [CONTROL_RE, CONTROL_WIDTH],\n [TAB_RE, TAB_WIDTH],\n [EMOJI_RE, EMOJI_WIDTH],\n [CJKT_WIDE_RE, WIDE_WIDTH],\n ];\n /* STATE */\n let indexPrev = 0;\n let index = 0;\n let length = input.length;\n let lengthExtra = 0;\n let truncationEnabled = false;\n let truncationIndex = length;\n let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);\n let unmatchedStart = 0;\n let unmatchedEnd = 0;\n let width = 0;\n let widthExtra = 0;\n /* PARSE LOOP */\n outer: while (true) {\n /* UNMATCHED */\n if ((unmatchedEnd > unmatchedStart) || (index >= length && index > indexPrev)) {\n const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);\n lengthExtra = 0;\n for (const char of unmatched.replaceAll(MODIFIER_RE, '')) {\n const codePoint = char.codePointAt(0) || 0;\n if (isFullWidth(codePoint)) {\n widthExtra = FULL_WIDTH_WIDTH;\n }\n else if (isWideNotCJKTNotEmoji(codePoint)) {\n widthExtra = WIDE_WIDTH;\n }\n else {\n widthExtra = REGULAR_WIDTH;\n }\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n lengthExtra += char.length;\n width += widthExtra;\n }\n unmatchedStart = unmatchedEnd = 0;\n }\n /* EXITING */\n if (index >= length) {\n break outer;\n }\n /* PARSE BLOCKS */\n for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {\n const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];\n BLOCK_RE.lastIndex = index;\n if (BLOCK_RE.test(input)) {\n lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;\n widthExtra = lengthExtra * BLOCK_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = BLOCK_RE.lastIndex;\n continue outer;\n }\n }\n /* UNMATCHED INDEX */\n index += 1;\n }\n /* RETURN */\n return {\n width: truncationEnabled ? truncationLimit : width,\n index: truncationEnabled ? truncationIndex : length,\n truncated: truncationEnabled,\n ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH\n };\n};\n/* EXPORT */\nexport default getStringTruncatedWidth;\n","/* IMPORT */\nimport fastStringTruncatedWidth from 'fast-string-truncated-width';\n/* HELPERS */\nconst NO_TRUNCATION = {\n limit: Infinity,\n ellipsis: '',\n ellipsisWidth: 0,\n};\n/* MAIN */\nconst fastStringWidth = (input, options = {}) => {\n return fastStringTruncatedWidth(input, NO_TRUNCATION, options).width;\n};\n/* EXPORT */\nexport default fastStringWidth;\n","import stringWidth from 'fast-string-width';\nconst ESC = '\\x1B';\nconst CSI = '\\x9B';\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = '\\u0007';\nconst ANSI_CSI = '[';\nconst ANSI_OSC = ']';\nconst ANSI_SGR_TERMINATOR = 'm';\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\nconst GROUP_REGEX = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, 'y');\nconst getClosingCode = (openingCode) => {\n if (openingCode >= 30 && openingCode <= 37)\n return 39;\n if (openingCode >= 90 && openingCode <= 97)\n return 39;\n if (openingCode >= 40 && openingCode <= 47)\n return 49;\n if (openingCode >= 100 && openingCode <= 107)\n return 49;\n if (openingCode === 1 || openingCode === 2)\n return 22;\n if (openingCode === 3)\n return 23;\n if (openingCode === 4)\n return 24;\n if (openingCode === 7)\n return 27;\n if (openingCode === 8)\n return 28;\n if (openingCode === 9)\n return 29;\n if (openingCode === 0)\n return 0;\n return undefined;\n};\nconst wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;\nconst wrapWord = (rows, word, columns) => {\n const characters = word[Symbol.iterator]();\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let lastRow = rows.at(-1);\n let visible = lastRow === undefined ? 0 : stringWidth(lastRow);\n let currentCharacter = characters.next();\n let nextCharacter = characters.next();\n let rawCharacterIndex = 0;\n while (!currentCharacter.done) {\n const character = currentCharacter.value;\n const characterLength = stringWidth(character);\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n }\n else {\n rows.push(character);\n visible = 0;\n }\n if (character === ESC || character === CSI) {\n isInsideEscape = true;\n isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);\n }\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n }\n else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n }\n else {\n visible += characterLength;\n if (visible === columns && !nextCharacter.done) {\n rows.push('');\n visible = 0;\n }\n }\n currentCharacter = nextCharacter;\n nextCharacter = characters.next();\n rawCharacterIndex += character.length;\n }\n lastRow = rows.at(-1);\n if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {\n rows[rows.length - 2] += rows.pop();\n }\n};\nconst stringVisibleTrimSpacesRight = (string) => {\n const words = string.split(' ');\n let last = words.length;\n while (last) {\n if (stringWidth(words[last - 1])) {\n break;\n }\n last--;\n }\n if (last === words.length) {\n return string;\n }\n return words.slice(0, last).join(' ') + words.slice(last).join('');\n};\nconst exec = (string, columns, options = {}) => {\n if (options.trim !== false && string.trim() === '') {\n return '';\n }\n let returnValue = '';\n let escapeCode;\n let escapeUrl;\n const words = string.split(' ');\n let rows = [''];\n let rowLength = 0;\n for (let index = 0; index < words.length; index++) {\n const word = words[index];\n if (options.trim !== false) {\n const row = rows.at(-1) ?? '';\n const trimmed = row.trimStart();\n if (row.length !== trimmed.length) {\n rows[rows.length - 1] = trimmed;\n rowLength = stringWidth(trimmed);\n }\n }\n if (index !== 0) {\n if (rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)) {\n rows.push('');\n rowLength = 0;\n }\n if (rowLength || options.trim === false) {\n rows[rows.length - 1] += ' ';\n rowLength++;\n }\n }\n const wordLength = stringWidth(word);\n if (options.hard && wordLength > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push('');\n }\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n if (rowLength + wordLength > columns && rowLength && wordLength) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n rows.push('');\n rowLength = 0;\n }\n if (rowLength + wordLength > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n rows[rows.length - 1] += word;\n rowLength += wordLength;\n }\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n const preString = rows.join('\\n');\n let inSurrogate = false;\n for (let i = 0; i < preString.length; i++) {\n const character = preString[i];\n returnValue += character;\n if (!inSurrogate) {\n inSurrogate = character >= '\\ud800' && character <= '\\udbff';\n if (inSurrogate) {\n continue;\n }\n }\n else {\n inSurrogate = false;\n }\n if (character === ESC || character === CSI) {\n GROUP_REGEX.lastIndex = i + 1;\n const groupsResult = GROUP_REGEX.exec(preString);\n const groups = groupsResult?.groups;\n if (groups?.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n }\n else if (groups?.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n if (preString[i + 1] === '\\n') {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink('');\n }\n const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(closingCode);\n }\n }\n else if (character === '\\n') {\n if (escapeCode && getClosingCode(escapeCode)) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n }\n return returnValue;\n};\nconst CRLF_OR_LF = /\\r?\\n/;\nexport function wrapAnsi(string, columns, options) {\n return String(string)\n .normalize()\n .split(CRLF_OR_LF)\n .map((line) => exec(line, columns, options))\n .join('\\n');\n}\n","import cliWidth from 'cli-width';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport { readline } from \"./hook-engine.js\";\n/**\n * Force line returns at specific width. This function is ANSI code friendly and it'll\n * ignore invisible codes during width calculation.\n * @param {string} content\n * @param {number} width\n * @return {string}\n */\nexport function breakLines(content, width) {\n return content\n .split('\\n')\n .flatMap((line) => wrapAnsi(line, width, { trim: false, wordWrap: false })\n .split('\\n')\n .map((str) => str.trimEnd()))\n .join('\\n');\n}\n/**\n * Returns the width of the active readline, or 80 as default value.\n * @returns {number}\n */\nexport function readlineWidth() {\n return cliWidth({ defaultWidth: 80, output: readline().output });\n}\n","const Stream = require('stream')\n\nclass MuteStream extends Stream {\n #isTTY = null\n\n constructor (opts = {}) {\n super(opts)\n this.writable = this.readable = true\n this.muted = false\n this.on('pipe', this._onpipe)\n this.replace = opts.replace\n\n // For readline-type situations\n // This much at the start of a line being redrawn after a ctrl char\n // is seen (such as backspace) won't be redrawn as the replacement\n this._prompt = opts.prompt || null\n this._hadControl = false\n }\n\n #destSrc (key, def) {\n if (this._dest) {\n return this._dest[key]\n }\n if (this._src) {\n return this._src[key]\n }\n return def\n }\n\n #proxy (method, ...args) {\n if (typeof this._dest?.[method] === 'function') {\n this._dest[method](...args)\n }\n if (typeof this._src?.[method] === 'function') {\n this._src[method](...args)\n }\n }\n\n get isTTY () {\n if (this.#isTTY !== null) {\n return this.#isTTY\n }\n return this.#destSrc('isTTY', false)\n }\n\n // basically just get replace the getter/setter with a regular value\n set isTTY (val) {\n this.#isTTY = val\n }\n\n get rows () {\n return this.#destSrc('rows')\n }\n\n get columns () {\n return this.#destSrc('columns')\n }\n\n mute () {\n this.muted = true\n }\n\n unmute () {\n this.muted = false\n }\n\n _onpipe (src) {\n this._src = src\n }\n\n pipe (dest, options) {\n this._dest = dest\n return super.pipe(dest, options)\n }\n\n pause () {\n if (this._src) {\n return this._src.pause()\n }\n }\n\n resume () {\n if (this._src) {\n return this._src.resume()\n }\n }\n\n write (c) {\n if (this.muted) {\n if (!this.replace) {\n return true\n }\n // eslint-disable-next-line no-control-regex\n if (c.match(/^\\u001b/)) {\n if (c.indexOf(this._prompt) === 0) {\n c = c.slice(this._prompt.length)\n c = c.replace(/./g, this.replace)\n c = this._prompt + c\n }\n this._hadControl = true\n return this.emit('data', c)\n } else {\n if (this._prompt && this._hadControl &&\n c.indexOf(this._prompt) === 0) {\n this._hadControl = false\n this.emit('data', this._prompt)\n c = c.slice(this._prompt.length)\n }\n c = c.toString().replace(/./g, this.replace)\n }\n }\n this.emit('data', c)\n }\n\n end (c) {\n if (this.muted) {\n if (c && this.replace) {\n c = c.toString().replace(/./g, this.replace)\n } else {\n c = null\n }\n }\n if (c) {\n this.emit('data', c)\n }\n this.emit('end')\n }\n\n destroy (...args) {\n return this.#proxy('destroy', ...args)\n }\n\n destroySoon (...args) {\n return this.#proxy('destroySoon', ...args)\n }\n\n close (...args) {\n return this.#proxy('close', ...args)\n }\n}\n\nmodule.exports = MuteStream\n","/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals = [];\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM');\nif (process.platform !== 'win32') {\n signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n );\n}\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');\n}\n//# sourceMappingURL=signals.js.map","// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js';\nexport { signals };\nconst processOk = (process) => !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function';\nconst kExitEmitter = Symbol.for('signal-exit emitter');\nconst global = globalThis;\nconst ObjectDefineProperty = Object.defineProperty.bind(Object);\n// teeny special purpose ee\nclass Emitter {\n emitted = {\n afterExit: false,\n exit: false,\n };\n listeners = {\n afterExit: [],\n exit: [],\n };\n count = 0;\n id = Math.random();\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter];\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n });\n }\n on(ev, fn) {\n this.listeners[ev].push(fn);\n }\n removeListener(ev, fn) {\n const list = this.listeners[ev];\n const i = list.indexOf(fn);\n /* c8 ignore start */\n if (i === -1) {\n return;\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0;\n }\n else {\n list.splice(i, 1);\n }\n }\n emit(ev, code, signal) {\n if (this.emitted[ev]) {\n return false;\n }\n this.emitted[ev] = true;\n let ret = false;\n for (const fn of this.listeners[ev]) {\n ret = fn(code, signal) === true || ret;\n }\n if (ev === 'exit') {\n ret = this.emit('afterExit', code, signal) || ret;\n }\n return ret;\n }\n}\nclass SignalExitBase {\n}\nconst signalExitWrap = (handler) => {\n return {\n onExit(cb, opts) {\n return handler.onExit(cb, opts);\n },\n load() {\n return handler.load();\n },\n unload() {\n return handler.unload();\n },\n };\n};\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => { };\n }\n load() { }\n unload() { }\n}\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP';\n /* c8 ignore stop */\n #emitter = new Emitter();\n #process;\n #originalProcessEmit;\n #originalProcessReallyExit;\n #sigListeners = {};\n #loaded = false;\n constructor(process) {\n super();\n this.#process = process;\n // { <signal>: <listener fn>, ... }\n this.#sigListeners = {};\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig);\n let { count } = this.#emitter;\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit, and increment by the count of listeners it has\n // created.\n /* c8 ignore start */\n const p = process;\n if (typeof p.__signal_exit_emitter__ === 'object' &&\n typeof p.__signal_exit_emitter__.count === 'number') {\n count += p.__signal_exit_emitter__.count;\n }\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload();\n const ret = this.#emitter.emit('exit', null, sig);\n /* c8 ignore start */\n const s = sig === 'SIGHUP' ? this.#hupSig : sig;\n if (!ret)\n process.kill(process.pid, s);\n /* c8 ignore stop */\n }\n };\n }\n this.#originalProcessReallyExit = process.reallyExit;\n this.#originalProcessEmit = process.emit;\n }\n onExit(cb, opts) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => { };\n }\n /* c8 ignore stop */\n if (this.#loaded === false) {\n this.load();\n }\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit';\n this.#emitter.on(ev, cb);\n return () => {\n this.#emitter.removeListener(ev, cb);\n if (this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0) {\n this.unload();\n }\n };\n }\n load() {\n if (this.#loaded) {\n return;\n }\n this.#loaded = true;\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1;\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig];\n if (fn)\n this.#process.on(sig, fn);\n }\n catch (_) { }\n }\n this.#process.emit = (ev, ...a) => {\n return this.#processEmit(ev, ...a);\n };\n this.#process.reallyExit = (code) => {\n return this.#processReallyExit(code);\n };\n }\n unload() {\n if (!this.#loaded) {\n return;\n }\n this.#loaded = false;\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig];\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig);\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener);\n /* c8 ignore start */\n }\n catch (_) { }\n /* c8 ignore stop */\n });\n this.#process.emit = this.#originalProcessEmit;\n this.#process.reallyExit = this.#originalProcessReallyExit;\n this.#emitter.count -= 1;\n }\n #processReallyExit(code) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0;\n }\n this.#process.exitCode = code || 0;\n /* c8 ignore stop */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);\n }\n #processEmit(ev, ...args) {\n const og = this.#originalProcessEmit;\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0];\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args);\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n /* c8 ignore stop */\n return ret;\n }\n else {\n return og.call(this.#process, ev, ...args);\n }\n }\n}\nconst process = globalThis.process;\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const { \n/**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\nonExit, \n/**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nload, \n/**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nunload, } = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback());\n//# sourceMappingURL=index.js.map","const ESC = '\\u001B[';\n/** Move cursor to first column */\nexport const cursorLeft = ESC + 'G';\n/** Hide the cursor */\nexport const cursorHide = ESC + '?25l';\n/** Show the cursor */\nexport const cursorShow = ESC + '?25h';\n/** Move cursor up by count rows */\nexport const cursorUp = (rows = 1) => (rows > 0 ? `${ESC}${rows}A` : '');\n/** Move cursor down by count rows */\nexport const cursorDown = (rows = 1) => rows > 0 ? `${ESC}${rows}B` : '';\n/** Move cursor to position (x, y) */\nexport const cursorTo = (x, y) => {\n if (typeof y === 'number' && !Number.isNaN(y)) {\n return `${ESC}${y + 1};${x + 1}H`;\n }\n return `${ESC}${x + 1}G`;\n};\nconst eraseLine = ESC + '2K';\n/** Erase the specified number of lines above the cursor */\nexport const eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : '';\n","import { stripVTControlCharacters } from 'node:util';\nimport { breakLines, readlineWidth } from \"./utils.js\";\nimport { cursorDown, cursorLeft, cursorUp, cursorTo, cursorShow, eraseLines, } from '@inquirer/ansi';\nconst height = (content) => content.split('\\n').length;\nconst lastLine = (content) => content.split('\\n').pop() ?? '';\nexport default class ScreenManager {\n // These variables are keeping information to allow correct prompt re-rendering\n height = 0;\n extraLinesUnderPrompt = 0;\n cursorPos;\n rl;\n constructor(rl) {\n this.rl = rl;\n this.cursorPos = rl.getCursorPos();\n }\n write(content) {\n this.rl.output.unmute();\n this.rl.output.write(content);\n this.rl.output.mute();\n }\n render(content, bottomContent = '') {\n // Write message to screen and setPrompt to control backspace\n const promptLine = lastLine(content);\n const rawPromptLine = stripVTControlCharacters(promptLine);\n // Remove the rl.line from our prompt. We can't rely on the content of\n // rl.line (mainly because of the password prompt), so just rely on it's\n // length.\n let prompt = rawPromptLine;\n if (this.rl.line.length > 0) {\n prompt = prompt.slice(0, -this.rl.line.length);\n }\n this.rl.setPrompt(prompt);\n // SetPrompt will change cursor position, now we can get correct value\n this.cursorPos = this.rl.getCursorPos();\n const width = readlineWidth();\n content = breakLines(content, width);\n bottomContent = breakLines(bottomContent, width);\n // Manually insert an extra line if we're at the end of the line.\n // This prevent the cursor from appearing at the beginning of the\n // current line.\n if (rawPromptLine.length % width === 0) {\n content += '\\n';\n }\n let output = content + (bottomContent ? '\\n' + bottomContent : '');\n /**\n * Re-adjust the cursor at the correct position.\n */\n // We need to consider parts of the prompt under the cursor as part of the bottom\n // content in order to correctly cleanup and re-render.\n const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;\n const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);\n // Return cursor to the input position (on top of the bottomContent)\n if (bottomContentHeight > 0)\n output += cursorUp(bottomContentHeight);\n // Return cursor to the initial left offset.\n output += cursorTo(this.cursorPos.cols);\n /**\n * Render and store state for future re-rendering\n */\n this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);\n this.extraLinesUnderPrompt = bottomContentHeight;\n this.height = height(output);\n }\n checkCursorPos() {\n const cursorPos = this.rl.getCursorPos();\n if (cursorPos.cols !== this.cursorPos.cols) {\n this.write(cursorTo(cursorPos.cols));\n this.cursorPos = cursorPos;\n }\n }\n done({ clearContent }) {\n this.rl.setPrompt('');\n let output = cursorDown(this.extraLinesUnderPrompt);\n output += clearContent ? eraseLines(this.height) : '\\n';\n // Reset cursor to column 0. On Windows terminals, \\n moves the cursor\n // down without resetting the column when the rendered prompt+answer\n // wraps past the terminal width. Without this, all subsequent output\n // starts at the wrong horizontal offset.\n output += cursorLeft;\n output += cursorShow;\n this.write(output);\n this.rl.close();\n }\n}\n","// TODO: Remove this class once Node 22 becomes the minimum supported version.\nexport class PromisePolyfill extends Promise {\n // Available starting from Node 22\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers\n static withResolver() {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve: resolve, reject: reject };\n }\n}\n","import * as readline from 'node:readline';\nimport { AsyncResource } from 'node:async_hooks';\nimport MuteStream from 'mute-stream';\nimport { onExit as onSignalExit } from 'signal-exit';\nimport ScreenManager from \"./screen-manager.js\";\nimport { PromisePolyfill } from \"./promise-polyfill.js\";\nimport { withHooks, effectScheduler } from \"./hook-engine.js\";\nimport { AbortPromptError, CancelPromptError, ExitPromptError } from \"./errors.js\";\nimport path from 'node:path';\n// Capture the real setImmediate at module load time so it works even when test\n// frameworks mock timers with vi.useFakeTimers() or similar.\nconst nativeSetImmediate = globalThis.setImmediate;\nfunction getCallSites() {\n // oxlint-disable-next-line typescript/unbound-method\n const savedPrepareStackTrace = Error.prepareStackTrace;\n let result = [];\n try {\n Error.prepareStackTrace = (_, callSites) => {\n const callSitesWithoutCurrent = callSites.slice(1);\n result = callSitesWithoutCurrent;\n return callSitesWithoutCurrent;\n };\n // oxlint-disable-next-line no-unused-expressions\n new Error().stack;\n }\n catch {\n // An error will occur if the Node flag --frozen-intrinsics is used.\n // https://nodejs.org/api/cli.html#--frozen-intrinsics\n return result;\n }\n Error.prepareStackTrace = savedPrepareStackTrace;\n return result;\n}\nexport function createPrompt(view) {\n const callSites = getCallSites();\n const prompt = (config, context = {}) => {\n // Default `input` to stdin\n const { input = process.stdin, signal } = context;\n const cleanups = new Set();\n // Add mute capabilities to the output\n const output = new MuteStream();\n output.pipe(context.output ?? process.stdout);\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const rl = readline.createInterface({\n terminal: true,\n input,\n output,\n });\n // Mute the output after readline has initialized so readline can perform\n // any terminal setup writes (e.g. Windows Console API initialization)\n // before suppressing output. ScreenManager will unmute/mute around each\n // render call as needed.\n output.mute();\n const screen = new ScreenManager(rl);\n const { promise, resolve, reject } = PromisePolyfill.withResolver();\n const cancel = () => reject(new CancelPromptError());\n if (signal) {\n const abort = () => reject(new AbortPromptError({ cause: signal.reason }));\n if (signal.aborted) {\n abort();\n return Object.assign(promise, { cancel });\n }\n signal.addEventListener('abort', abort);\n cleanups.add(() => signal.removeEventListener('abort', abort));\n }\n cleanups.add(onSignalExit((code, signal) => {\n reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal}`));\n }));\n // SIGINT must be explicitly handled by the prompt so the ExitPromptError can be handled.\n // Otherwise, the prompt will stop and in some scenarios never resolve.\n // Ref issue #1741\n const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));\n rl.on('SIGINT', sigint);\n cleanups.add(() => rl.removeListener('SIGINT', sigint));\n return withHooks(rl, (cycle) => {\n // The close event triggers immediately when the user press ctrl+c. SignalExit on the other hand\n // triggers after the process is done (which happens after timeouts are done triggering.)\n // We triggers the hooks cleanup phase on rl `close` so active timeouts can be cleared.\n const hooksCleanup = AsyncResource.bind(() => effectScheduler.clearAll());\n rl.on('close', hooksCleanup);\n cleanups.add(() => rl.removeListener('close', hooksCleanup));\n const startCycle = () => {\n // Re-renders only happen when the state change; but the readline cursor could\n // change position and that also requires a re-render (and a manual one because\n // we mute the streams). We set the listener after the initial workLoop to avoid\n // a double render if render triggered by a state change sets the cursor to the\n // right position.\n const checkCursorPos = () => screen.checkCursorPos();\n rl.input.on('keypress', checkCursorPos);\n cleanups.add(() => rl.input.removeListener('keypress', checkCursorPos));\n let pendingDone = null;\n cycle(() => {\n let effectsSettled = false;\n try {\n const nextView = view(config, (value) => {\n if (effectsSettled) {\n // After the cycle completes (async validation path), the \"done\"\n // render already flushed via setStatus → handleChange, so resolve\n // immediately.\n resolve(value);\n }\n else {\n pendingDone = { value };\n }\n });\n // Typescript won't allow this, but not all users rely on typescript.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (nextView === undefined) {\n let callerFilename = callSites[1]?.getFileName();\n if (callerFilename && !callerFilename.startsWith('file://')) {\n callerFilename = path.resolve(callerFilename);\n }\n throw new Error(`Prompt functions must return a string.\\n at ${callerFilename}`);\n }\n const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView;\n screen.render(content, bottomContent);\n effectScheduler.run();\n }\n catch (error) {\n reject(error);\n }\n effectsSettled = true;\n if (pendingDone !== null) {\n const { value } = pendingDone;\n pendingDone = null;\n resolve(value);\n }\n });\n };\n // Proper Readable streams (like process.stdin) may have OS-level buffered\n // data that arrives in the poll phase when readline resumes the stream.\n // Deferring the first render by one setImmediate tick (check phase, after\n // poll) lets that stale data flow through readline harmlessly—no keypress\n // handlers are registered yet and the output is muted, so the stale\n // keystrokes are silently discarded.\n // Old-style streams (like MuteStream) have no such buffering, so the\n // render cycle starts immediately.\n //\n // @see https://github.com/SBoudrias/Inquirer.js/issues/1303\n if ('readableFlowing' in input) {\n nativeSetImmediate(startCycle);\n }\n else {\n startCycle();\n }\n return Object.assign(promise\n .then((answer) => {\n effectScheduler.clearAll();\n return answer;\n }, (error) => {\n effectScheduler.clearAll();\n throw error;\n })\n // Wait for the promise to settle, then cleanup.\n .finally(() => {\n cleanups.forEach((cleanup) => cleanup());\n screen.done({ clearContent: Boolean(context.clearPromptOnDone) });\n output.end();\n })\n // Once cleanup is done, let the expose promise resolve/reject to the internal one.\n .then(() => promise), { cancel });\n });\n };\n return prompt;\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],"mappings":";;;;;;;AACA,MAAM,mCAAmB,IAAI,IAAI,CADZ,SAAS,KACa,CAAC;AAC5C,SAAS,aAAa,OAAO;CACzB,OAAO,iBAAiB,IAAI,KAAK;AACrC;AACA,SAAgB,wBAAwB;CACpC,MAAM,MAAM,QAAQ,IAAI;CACxB,IAAI,CAAC,KACD,OAAO,CAAC;CACZ,OAAO,MAAM,KAAK,IAAI,IAAI,IACrB,YAAY,CAAC,CACb,MAAM,QAAQ,CAAC,CACf,OAAO,YAAY,CAAC,CAAC;AAC9B;AACA,MAAa,WAAW,KAAK,cAAc,CAAC,MAE5C,IAAI,SAAS,QAER,YAAY,SAAS,KAAK,KAAK,IAAI,SAAS,OAE5C,YAAY,SAAS,OAAO,KAAK,IAAI,QAAQ,IAAI,SAAS;AAC/D,MAAa,aAAa,KAAK,cAAc,CAAC,MAE9C,IAAI,SAAS,UAER,YAAY,SAAS,KAAK,KAAK,IAAI,SAAS,OAE5C,YAAY,SAAS,OAAO,KAAK,IAAI,QAAQ,IAAI,SAAS;AAC/D,MAAa,cAAc,QAAQ,IAAI,SAAS;AAChD,MAAa,kBAAkB,QAAQ,IAAI,SAAS;AACp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AC7E,OAAO,OAAO,SAAS,aAAa;MACpC,gBAAgB,IAAI;KACxB,SACO,OAAO;MACV,OAAO,KAAK;KAChB;KACA,iBAAiB;KACjB,IAAI,gBAAgB,MAAM;MACtB,MAAM,EAAE,UAAU;MAClB,cAAc;MACd,QAAQ,KAAK;KACjB;IACJ,CAAC;GACL;GAWA,IAAI,qBAAqB,OACrB,mBAAmB,UAAU;QAG7B,WAAW;GAEf,OAAO,OAAO,OAAO,QAChB,MAAM,WAAW;IAClB,gBAAgB,SAAS;IACzB,OAAO;GACX,IAAI,UAAU;IACV,gBAAgB,SAAS;IACzB,MAAM;GACV,CAAC,CAAC,CAEG,cAAc;IACf,SAAS,SAAS,YAAY,QAAQ,CAAC;IACvC,OAAO,KAAK,EAAE,cAAc,QAAQ,QAAQ,iBAAiB,EAAE,CAAC;IAChE,OAAO,IAAI;GACf,CAAC,CAAC,CAEG,WAAW,OAAO,GAAG,EAAE,OAAO,CAAC;EACxC,CAAC;CACL;CACA,OAAO;AACX"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as isEnterKey, a as readlineWidth, c as usePrefix, d as useEffect, f as useState, g as isDownKey, h as isBackspaceKey, i as breakLines, l as makeTheme, m as ValidationError, n as cursorHide, o as useKeypress, p as withPointer, s as useRef, t as createPrompt, u as figures, v as isNumberKey, x as isUpKey } from "./create-prompt-
|
|
1
|
+
import { _ as isEnterKey, a as readlineWidth, c as usePrefix, d as useEffect, f as useState, g as isDownKey, h as isBackspaceKey, i as breakLines, l as makeTheme, m as ValidationError, n as cursorHide, o as useKeypress, p as withPointer, s as useRef, t as createPrompt, u as figures, v as isNumberKey, x as isUpKey } from "./create-prompt-DU9wLVhI.js";
|
|
2
2
|
import { styleText } from "node:util";
|
|
3
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
3
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
4
4
|
function useMemo(fn, dependencies) {
|
|
5
5
|
return withPointer((pointer) => {
|
|
6
6
|
const prev = pointer.get();
|
|
7
|
-
if (!
|
|
7
|
+
if (!pointer.initialized || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
|
|
8
8
|
const value = fn();
|
|
9
9
|
pointer.set({
|
|
10
10
|
value,
|
|
@@ -16,7 +16,7 @@ function useMemo(fn, dependencies) {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
19
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
20
20
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
21
21
|
const state = useRef({
|
|
22
22
|
lastPointer: active,
|
|
@@ -101,7 +101,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
101
101
|
return pageBuffer.filter((line) => typeof line === "string").join("\n");
|
|
102
102
|
}
|
|
103
103
|
//#endregion
|
|
104
|
-
//#region ../../node_modules/.pnpm/@inquirer+core@
|
|
104
|
+
//#region ../../node_modules/.pnpm/@inquirer+core@12.0.0_@types+node@26.3.0/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
105
105
|
/**
|
|
106
106
|
* Separator object
|
|
107
107
|
* Used to space/separate choices group
|
|
@@ -117,7 +117,7 @@ var Separator = class {
|
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
//#endregion
|
|
120
|
-
//#region ../../node_modules/.pnpm/@inquirer+select@5.2.
|
|
120
|
+
//#region ../../node_modules/.pnpm/@inquirer+select@5.2.2_@types+node@26.3.0/node_modules/@inquirer/select/dist/index.js
|
|
121
121
|
const selectTheme = {
|
|
122
122
|
icon: { cursor: figures.pointer },
|
|
123
123
|
style: {
|
|
@@ -275,4 +275,4 @@ var dist_default = createPrompt((config, done) => {
|
|
|
275
275
|
//#endregion
|
|
276
276
|
export { useMemo as i, Separator as n, usePagination as r, dist_default as t };
|
|
277
277
|
|
|
278
|
-
//# sourceMappingURL=dist-
|
|
278
|
+
//# sourceMappingURL=dist-DjpU2mIj.js.map
|