omnius 1.0.878 → 1.0.880
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/dist/api/py-embed.js +4 -1
- package/dist/index.js +2 -2
- package/dist/library.js +126 -132
- package/dist/omni-setup-worker.js +4 -1
- package/dist/tui/native/worker.js +436 -162
- package/dist/update-worker-runtime.js +265 -134
- package/docs/DISCOVERY.json +251 -0
- package/docs/DISCOVERY.md +7 -0
- package/docs/work-orders/evidence/explicit-shell-run-views-20261018.json +212 -0
- package/docs/work-orders/evidence/explicit-shell-runs-verification-20261018.json +288 -0
- package/docs/work-orders/evidence/native-space-allocation-verification-20261017.json +177 -0
- package/docs/work-orders/evidence/persistent-shell-tabs-verification-20261018.json +188 -0
- package/docs/work-orders/evidence/persistent-shell-tabs-vte-20261018.json +2307 -0
- package/docs/work-orders/evidence/update-enotempty-real-npm10-20261018.json +229 -0
- package/docs/work-orders/evidence/update-enotempty-verification-20261018.json +94 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -3178,7 +3178,7 @@ var require_util = __commonJS({
|
|
|
3178
3178
|
}
|
|
3179
3179
|
path3 = url.path;
|
|
3180
3180
|
}
|
|
3181
|
-
var
|
|
3181
|
+
var isAbsolute7 = exports.isAbsolute(path3);
|
|
3182
3182
|
var parts = path3.split(/\/+/);
|
|
3183
3183
|
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
|
3184
3184
|
part = parts[i];
|
|
@@ -3198,7 +3198,7 @@ var require_util = __commonJS({
|
|
|
3198
3198
|
}
|
|
3199
3199
|
path3 = parts.join("/");
|
|
3200
3200
|
if (path3 === "") {
|
|
3201
|
-
path3 =
|
|
3201
|
+
path3 = isAbsolute7 ? "/" : ".";
|
|
3202
3202
|
}
|
|
3203
3203
|
if (url) {
|
|
3204
3204
|
url.path = path3;
|
|
@@ -3207,7 +3207,7 @@ var require_util = __commonJS({
|
|
|
3207
3207
|
return path3;
|
|
3208
3208
|
}
|
|
3209
3209
|
exports.normalize = normalize;
|
|
3210
|
-
function
|
|
3210
|
+
function join19(aRoot, aPath) {
|
|
3211
3211
|
if (aRoot === "") {
|
|
3212
3212
|
aRoot = ".";
|
|
3213
3213
|
}
|
|
@@ -3239,7 +3239,7 @@ var require_util = __commonJS({
|
|
|
3239
3239
|
}
|
|
3240
3240
|
return joined;
|
|
3241
3241
|
}
|
|
3242
|
-
exports.join =
|
|
3242
|
+
exports.join = join19;
|
|
3243
3243
|
exports.isAbsolute = function(aPath) {
|
|
3244
3244
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
3245
3245
|
};
|
|
@@ -3412,7 +3412,7 @@ var require_util = __commonJS({
|
|
|
3412
3412
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
3413
3413
|
}
|
|
3414
3414
|
}
|
|
3415
|
-
sourceURL =
|
|
3415
|
+
sourceURL = join19(urlGenerate(parsed), sourceURL);
|
|
3416
3416
|
}
|
|
3417
3417
|
return normalize(sourceURL);
|
|
3418
3418
|
}
|
|
@@ -13228,7 +13228,7 @@ ${lanes.join("\n")}
|
|
|
13228
13228
|
getCurrentDirectory,
|
|
13229
13229
|
getAccessibleSortedChildDirectories,
|
|
13230
13230
|
fileSystemEntryExists,
|
|
13231
|
-
realpath,
|
|
13231
|
+
realpath: realpath2,
|
|
13232
13232
|
setTimeout: setTimeout2,
|
|
13233
13233
|
clearTimeout: clearTimeout2
|
|
13234
13234
|
}) {
|
|
@@ -13404,7 +13404,7 @@ ${lanes.join("\n")}
|
|
|
13404
13404
|
function updateChildWatches(parentDir, parentDirPath, options) {
|
|
13405
13405
|
const parentWatcher = cache.get(parentDirPath);
|
|
13406
13406
|
if (!parentWatcher) return false;
|
|
13407
|
-
const target = normalizePath(
|
|
13407
|
+
const target = normalizePath(realpath2(parentDir));
|
|
13408
13408
|
let hasChanges;
|
|
13409
13409
|
let newChildWatches;
|
|
13410
13410
|
if (filePathComparer(target, parentDir) === 0) {
|
|
@@ -13415,7 +13415,7 @@ ${lanes.join("\n")}
|
|
|
13415
13415
|
/* Directory */
|
|
13416
13416
|
) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => {
|
|
13417
13417
|
const childFullName = getNormalizedAbsolutePath(child, parentDir);
|
|
13418
|
-
return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath(
|
|
13418
|
+
return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath(realpath2(childFullName))) === 0 ? childFullName : void 0;
|
|
13419
13419
|
}) : emptyArray,
|
|
13420
13420
|
parentWatcher.childWatches,
|
|
13421
13421
|
(child, childWatcher) => filePathComparer(child, childWatcher.dirName),
|
|
@@ -13499,7 +13499,7 @@ ${lanes.join("\n")}
|
|
|
13499
13499
|
getCurrentDirectory,
|
|
13500
13500
|
fsSupportsRecursiveFsWatch,
|
|
13501
13501
|
getAccessibleSortedChildDirectories,
|
|
13502
|
-
realpath,
|
|
13502
|
+
realpath: realpath2,
|
|
13503
13503
|
tscWatchFile,
|
|
13504
13504
|
useNonPollingWatchers,
|
|
13505
13505
|
tscWatchDirectory,
|
|
@@ -13639,7 +13639,7 @@ ${lanes.join("\n")}
|
|
|
13639
13639
|
fileSystemEntryExists,
|
|
13640
13640
|
getAccessibleSortedChildDirectories,
|
|
13641
13641
|
watchDirectory: nonRecursiveWatchDirectory,
|
|
13642
|
-
realpath,
|
|
13642
|
+
realpath: realpath2,
|
|
13643
13643
|
setTimeout: setTimeout2,
|
|
13644
13644
|
clearTimeout: clearTimeout2
|
|
13645
13645
|
});
|
|
@@ -13878,7 +13878,7 @@ ${lanes.join("\n")}
|
|
|
13878
13878
|
// (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
|
|
13879
13879
|
fsSupportsRecursiveFsWatch,
|
|
13880
13880
|
getAccessibleSortedChildDirectories: (path3) => getAccessibleFileSystemEntries(path3).directories,
|
|
13881
|
-
realpath,
|
|
13881
|
+
realpath: realpath2,
|
|
13882
13882
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
13883
13883
|
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
13884
13884
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
@@ -13952,7 +13952,7 @@ ${lanes.join("\n")}
|
|
|
13952
13952
|
enableCPUProfiler,
|
|
13953
13953
|
disableCPUProfiler,
|
|
13954
13954
|
cpuProfilingEnabled: () => !!activeSession || contains(process.execArgv, "--cpu-prof") || contains(process.execArgv, "--prof"),
|
|
13955
|
-
realpath,
|
|
13955
|
+
realpath: realpath2,
|
|
13956
13956
|
debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some(process.execArgv, (arg) => /^--(?:inspect|debug)(?:-brk)?(?:=\d+)?$/i.test(arg)) || !!process.recordreplay,
|
|
13957
13957
|
tryEnableSourceMapsForHost() {
|
|
13958
13958
|
try {
|
|
@@ -14184,7 +14184,7 @@ ${lanes.join("\n")}
|
|
|
14184
14184
|
}
|
|
14185
14185
|
}
|
|
14186
14186
|
function readDirectory(path3, extensions, excludes, includes, depth) {
|
|
14187
|
-
return matchFiles(path3, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries,
|
|
14187
|
+
return matchFiles(path3, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath2);
|
|
14188
14188
|
}
|
|
14189
14189
|
function fileSystemEntryExists(path3, entryKind) {
|
|
14190
14190
|
const stat = statSync4(path3);
|
|
@@ -14220,7 +14220,7 @@ ${lanes.join("\n")}
|
|
|
14220
14220
|
function fsRealPathHandlingLongPath(path3) {
|
|
14221
14221
|
return path3.length < 260 ? _fs.realpathSync.native(path3) : _fs.realpathSync(path3);
|
|
14222
14222
|
}
|
|
14223
|
-
function
|
|
14223
|
+
function realpath2(path3) {
|
|
14224
14224
|
try {
|
|
14225
14225
|
return fsRealpath(path3);
|
|
14226
14226
|
} catch {
|
|
@@ -28370,7 +28370,7 @@ ${lanes.join("\n")}
|
|
|
28370
28370
|
function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) {
|
|
28371
28371
|
return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i");
|
|
28372
28372
|
}
|
|
28373
|
-
function matchFiles(path3, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries,
|
|
28373
|
+
function matchFiles(path3, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath2) {
|
|
28374
28374
|
path3 = normalizePath(path3);
|
|
28375
28375
|
currentDirectory = normalizePath(currentDirectory);
|
|
28376
28376
|
const patterns = getFileMatcherPatterns(path3, excludes, includes, useCaseSensitiveFileNames2, currentDirectory);
|
|
@@ -28385,7 +28385,7 @@ ${lanes.join("\n")}
|
|
|
28385
28385
|
}
|
|
28386
28386
|
return flatten(results);
|
|
28387
28387
|
function visitDirectory(path22, absolutePath, depth2) {
|
|
28388
|
-
const canonicalPath = toCanonical(
|
|
28388
|
+
const canonicalPath = toCanonical(realpath2(absolutePath));
|
|
28389
28389
|
if (visited.has(canonicalPath)) return;
|
|
28390
28390
|
visited.set(canonicalPath, true);
|
|
28391
28391
|
const { files, directories } = getFileSystemEntries(path22);
|
|
@@ -38826,8 +38826,8 @@ ${lanes.join("\n")}
|
|
|
38826
38826
|
return void 0;
|
|
38827
38827
|
}
|
|
38828
38828
|
function tryRenameExternalModule(factory2, moduleName, sourceFile) {
|
|
38829
|
-
const
|
|
38830
|
-
return
|
|
38829
|
+
const rename2 = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text);
|
|
38830
|
+
return rename2 ? factory2.createStringLiteral(rename2) : void 0;
|
|
38831
38831
|
}
|
|
38832
38832
|
function tryGetModuleNameFromFile(factory2, file, host, options) {
|
|
38833
38833
|
if (!file) {
|
|
@@ -129580,7 +129580,7 @@ ${lanes.join("\n")}
|
|
|
129580
129580
|
}
|
|
129581
129581
|
}
|
|
129582
129582
|
function createImportCallExpressionAMD(arg, containsLexicalThis) {
|
|
129583
|
-
const
|
|
129583
|
+
const resolve11 = factory2.createUniqueName("resolve");
|
|
129584
129584
|
const reject = factory2.createUniqueName("reject");
|
|
129585
129585
|
const parameters = [
|
|
129586
129586
|
factory2.createParameterDeclaration(
|
|
@@ -129589,7 +129589,7 @@ ${lanes.join("\n")}
|
|
|
129589
129589
|
/*dotDotDotToken*/
|
|
129590
129590
|
void 0,
|
|
129591
129591
|
/*name*/
|
|
129592
|
-
|
|
129592
|
+
resolve11
|
|
129593
129593
|
),
|
|
129594
129594
|
factory2.createParameterDeclaration(
|
|
129595
129595
|
/*modifiers*/
|
|
@@ -129606,7 +129606,7 @@ ${lanes.join("\n")}
|
|
|
129606
129606
|
factory2.createIdentifier("require"),
|
|
129607
129607
|
/*typeArguments*/
|
|
129608
129608
|
void 0,
|
|
129609
|
-
[factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]),
|
|
129609
|
+
[factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]), resolve11, reject]
|
|
129610
129610
|
)
|
|
129611
129611
|
)
|
|
129612
129612
|
]);
|
|
@@ -140607,7 +140607,7 @@ ${lanes.join("\n")}
|
|
|
140607
140607
|
addOrDeleteFileOrDirectory,
|
|
140608
140608
|
addOrDeleteFile,
|
|
140609
140609
|
clearCache,
|
|
140610
|
-
realpath: host.realpath &&
|
|
140610
|
+
realpath: host.realpath && realpath2
|
|
140611
140611
|
};
|
|
140612
140612
|
function toPath3(fileName) {
|
|
140613
140613
|
return toPath(fileName, currentDirectory, getCanonicalFileName);
|
|
@@ -140718,7 +140718,7 @@ ${lanes.join("\n")}
|
|
|
140718
140718
|
const rootResult = tryReadDirectory2(rootDir2, rootDirPath);
|
|
140719
140719
|
let rootSymLinkResult;
|
|
140720
140720
|
if (rootResult !== void 0) {
|
|
140721
|
-
return matchFiles(rootDir2, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries,
|
|
140721
|
+
return matchFiles(rootDir2, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath2);
|
|
140722
140722
|
}
|
|
140723
140723
|
return host.readDirectory(rootDir2, extensions, excludes, includes, depth);
|
|
140724
140724
|
function getFileSystemEntries(dir) {
|
|
@@ -140747,7 +140747,7 @@ ${lanes.join("\n")}
|
|
|
140747
140747
|
return result;
|
|
140748
140748
|
}
|
|
140749
140749
|
}
|
|
140750
|
-
function
|
|
140750
|
+
function realpath2(s) {
|
|
140751
140751
|
return host.realpath ? host.realpath(s) : s;
|
|
140752
140752
|
}
|
|
140753
140753
|
function clearFirstAncestorEntry(fileOrDirectoryPath) {
|
|
@@ -141202,7 +141202,7 @@ ${lanes.join("\n")}
|
|
|
141202
141202
|
return getDirectoryPath(normalizePath(system.getExecutingFilePath()));
|
|
141203
141203
|
}
|
|
141204
141204
|
const newLine = getNewLineCharacter(options);
|
|
141205
|
-
const
|
|
141205
|
+
const realpath2 = system.realpath && ((path3) => system.realpath(path3));
|
|
141206
141206
|
const compilerHost = {
|
|
141207
141207
|
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), setParentNodes),
|
|
141208
141208
|
getDefaultLibLocation,
|
|
@@ -141222,7 +141222,7 @@ ${lanes.join("\n")}
|
|
|
141222
141222
|
directoryExists: (directoryName) => system.directoryExists(directoryName),
|
|
141223
141223
|
getEnvironmentVariable: (name) => system.getEnvironmentVariable ? system.getEnvironmentVariable(name) : "",
|
|
141224
141224
|
getDirectories: (path3) => system.getDirectories(path3),
|
|
141225
|
-
realpath,
|
|
141225
|
+
realpath: realpath2,
|
|
141226
141226
|
readDirectory: (path3, extensions, include, exclude, depth) => system.readDirectory(path3, extensions, include, exclude, depth),
|
|
141227
141227
|
createDirectory: (d) => system.createDirectory(d),
|
|
141228
141228
|
createHash: maybeBind(system, system.createHash)
|
|
@@ -142417,9 +142417,9 @@ ${lanes.join("\n")}
|
|
|
142417
142417
|
/*ignoreCase*/
|
|
142418
142418
|
false
|
|
142419
142419
|
)) {
|
|
142420
|
-
const
|
|
142421
|
-
if (
|
|
142422
|
-
const name = removeSuffix(removePrefix(
|
|
142420
|
+
const basename10 = getBaseFileName(a.fileName);
|
|
142421
|
+
if (basename10 === "lib.d.ts" || basename10 === "lib.es6.d.ts") return 0;
|
|
142422
|
+
const name = removeSuffix(removePrefix(basename10, "lib."), ".d.ts");
|
|
142423
142423
|
const index = libs.indexOf(name);
|
|
142424
142424
|
if (index !== -1) return index + 1;
|
|
142425
142425
|
}
|
|
@@ -173528,19 +173528,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
173528
173528
|
}
|
|
173529
173529
|
function convertNamedExport(sourceFile, assignment, changes, exports2) {
|
|
173530
173530
|
const { text: text2 } = assignment.left.name;
|
|
173531
|
-
const
|
|
173532
|
-
if (
|
|
173531
|
+
const rename2 = exports2.get(text2);
|
|
173532
|
+
if (rename2 !== void 0) {
|
|
173533
173533
|
const newNodes = [
|
|
173534
173534
|
makeConst(
|
|
173535
173535
|
/*modifiers*/
|
|
173536
173536
|
void 0,
|
|
173537
|
-
|
|
173537
|
+
rename2,
|
|
173538
173538
|
assignment.right
|
|
173539
173539
|
),
|
|
173540
173540
|
makeExportDeclaration([factory.createExportSpecifier(
|
|
173541
173541
|
/*isTypeOnly*/
|
|
173542
173542
|
false,
|
|
173543
|
-
|
|
173543
|
+
rename2,
|
|
173544
173544
|
text2
|
|
173545
173545
|
)])
|
|
173546
173546
|
];
|
|
@@ -205053,9 +205053,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
205053
205053
|
if (this.host.realpath) {
|
|
205054
205054
|
Debug.assert(!!this.containingProjects.length);
|
|
205055
205055
|
const project = this.containingProjects[0];
|
|
205056
|
-
const
|
|
205057
|
-
if (
|
|
205058
|
-
this.realpath = project.toPath(
|
|
205056
|
+
const realpath2 = this.host.realpath(this.path);
|
|
205057
|
+
if (realpath2) {
|
|
205058
|
+
this.realpath = project.toPath(realpath2);
|
|
205059
205059
|
if (this.realpath !== this.path) {
|
|
205060
205060
|
project.projectService.realpathToScriptInfos.add(this.realpath, this);
|
|
205061
205061
|
}
|
|
@@ -206345,8 +206345,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
206345
206345
|
}
|
|
206346
206346
|
};
|
|
206347
206347
|
for (const file of files) {
|
|
206348
|
-
const
|
|
206349
|
-
if (
|
|
206348
|
+
const basename10 = getBaseFileName(file);
|
|
206349
|
+
if (basename10 === "package.json" || basename10 === "bower.json") {
|
|
206350
206350
|
createProjectWatcher(
|
|
206351
206351
|
file,
|
|
206352
206352
|
"FileWatcher"
|
|
@@ -209092,9 +209092,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
209092
209092
|
this.filenameToScriptInfo.delete(info.path);
|
|
209093
209093
|
this.filenameToScriptInfoVersion.set(info.path, info.textStorage.version);
|
|
209094
209094
|
this.stopWatchingScriptInfo(info);
|
|
209095
|
-
const
|
|
209096
|
-
if (
|
|
209097
|
-
this.realpathToScriptInfos.remove(
|
|
209095
|
+
const realpath2 = info.getRealpathIfDifferent();
|
|
209096
|
+
if (realpath2) {
|
|
209097
|
+
this.realpathToScriptInfos.remove(realpath2, info);
|
|
209098
209098
|
}
|
|
209099
209099
|
info.closeSourceMapFileWatcher();
|
|
209100
209100
|
}
|
|
@@ -209983,9 +209983,9 @@ All files are: ${JSON.stringify(names)}`,
|
|
|
209983
209983
|
getSymlinkedProjects(info) {
|
|
209984
209984
|
let projects;
|
|
209985
209985
|
if (this.realpathToScriptInfos) {
|
|
209986
|
-
const
|
|
209987
|
-
if (
|
|
209988
|
-
forEach(this.realpathToScriptInfos.get(
|
|
209986
|
+
const realpath2 = info.getRealpathIfDifferent();
|
|
209987
|
+
if (realpath2) {
|
|
209988
|
+
forEach(this.realpathToScriptInfos.get(realpath2), combineProjects);
|
|
209989
209989
|
}
|
|
209990
209990
|
forEach(this.realpathToScriptInfos.get(info.path), combineProjects);
|
|
209991
209991
|
}
|
|
@@ -210030,8 +210030,8 @@ All files are: ${JSON.stringify(names)}`,
|
|
|
210030
210030
|
var _a3;
|
|
210031
210031
|
const fileOrDirectoryPath = removeIgnoredPath(this.toPath(fileOrDirectory));
|
|
210032
210032
|
if (!fileOrDirectoryPath) return;
|
|
210033
|
-
const
|
|
210034
|
-
if (((_a3 = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a3.size) && (
|
|
210033
|
+
const basename10 = getBaseFileName(fileOrDirectoryPath);
|
|
210034
|
+
if (((_a3 = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a3.size) && (basename10 === "package.json" || basename10 === "node_modules")) {
|
|
210035
210035
|
result.affectedModuleSpecifierCacheProjects.forEach((project) => {
|
|
210036
210036
|
var _a22;
|
|
210037
210037
|
(_a22 = project.getModuleSpecifierCache()) == null ? void 0 : _a22.clear();
|
|
@@ -216517,8 +216517,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
216517
216517
|
installPackage(options) {
|
|
216518
216518
|
this.packageInstallId++;
|
|
216519
216519
|
const request = { kind: "installPackage", ...options, id: this.packageInstallId };
|
|
216520
|
-
const promise = new Promise((
|
|
216521
|
-
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve:
|
|
216520
|
+
const promise = new Promise((resolve11, reject) => {
|
|
216521
|
+
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve: resolve11, reject });
|
|
216522
216522
|
});
|
|
216523
216523
|
this.installer.send(request);
|
|
216524
216524
|
return promise;
|
|
@@ -218778,7 +218778,7 @@ var require_path_browserify = __commonJS({
|
|
|
218778
218778
|
}
|
|
218779
218779
|
var posix = {
|
|
218780
218780
|
// path.resolve([from ...], to)
|
|
218781
|
-
resolve: function
|
|
218781
|
+
resolve: function resolve11() {
|
|
218782
218782
|
var resolvedPath = "";
|
|
218783
218783
|
var resolvedAbsolute = false;
|
|
218784
218784
|
var cwd;
|
|
@@ -218813,19 +218813,19 @@ var require_path_browserify = __commonJS({
|
|
|
218813
218813
|
normalize: function normalize(path3) {
|
|
218814
218814
|
assertPath(path3);
|
|
218815
218815
|
if (path3.length === 0) return ".";
|
|
218816
|
-
var
|
|
218816
|
+
var isAbsolute7 = path3.charCodeAt(0) === 47;
|
|
218817
218817
|
var trailingSeparator = path3.charCodeAt(path3.length - 1) === 47;
|
|
218818
|
-
path3 = normalizeStringPosix(path3, !
|
|
218819
|
-
if (path3.length === 0 && !
|
|
218818
|
+
path3 = normalizeStringPosix(path3, !isAbsolute7);
|
|
218819
|
+
if (path3.length === 0 && !isAbsolute7) path3 = ".";
|
|
218820
218820
|
if (path3.length > 0 && trailingSeparator) path3 += "/";
|
|
218821
|
-
if (
|
|
218821
|
+
if (isAbsolute7) return "/" + path3;
|
|
218822
218822
|
return path3;
|
|
218823
218823
|
},
|
|
218824
|
-
isAbsolute: function
|
|
218824
|
+
isAbsolute: function isAbsolute7(path3) {
|
|
218825
218825
|
assertPath(path3);
|
|
218826
218826
|
return path3.length > 0 && path3.charCodeAt(0) === 47;
|
|
218827
218827
|
},
|
|
218828
|
-
join: function
|
|
218828
|
+
join: function join19() {
|
|
218829
218829
|
if (arguments.length === 0)
|
|
218830
218830
|
return ".";
|
|
218831
218831
|
var joined;
|
|
@@ -218912,7 +218912,7 @@ var require_path_browserify = __commonJS({
|
|
|
218912
218912
|
_makeLong: function _makeLong(path3) {
|
|
218913
218913
|
return path3;
|
|
218914
218914
|
},
|
|
218915
|
-
dirname: function
|
|
218915
|
+
dirname: function dirname11(path3) {
|
|
218916
218916
|
assertPath(path3);
|
|
218917
218917
|
if (path3.length === 0) return ".";
|
|
218918
218918
|
var code = path3.charCodeAt(0);
|
|
@@ -218934,7 +218934,7 @@ var require_path_browserify = __commonJS({
|
|
|
218934
218934
|
if (hasRoot && end === 1) return "//";
|
|
218935
218935
|
return path3.slice(0, end);
|
|
218936
218936
|
},
|
|
218937
|
-
basename: function
|
|
218937
|
+
basename: function basename10(path3, ext2) {
|
|
218938
218938
|
if (ext2 !== void 0 && typeof ext2 !== "string") throw new TypeError('"ext" argument must be a string');
|
|
218939
218939
|
assertPath(path3);
|
|
218940
218940
|
var start = 0;
|
|
@@ -219035,9 +219035,9 @@ var require_path_browserify = __commonJS({
|
|
|
219035
219035
|
var ret = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
219036
219036
|
if (path3.length === 0) return ret;
|
|
219037
219037
|
var code = path3.charCodeAt(0);
|
|
219038
|
-
var
|
|
219038
|
+
var isAbsolute7 = code === 47;
|
|
219039
219039
|
var start;
|
|
219040
|
-
if (
|
|
219040
|
+
if (isAbsolute7) {
|
|
219041
219041
|
ret.root = "/";
|
|
219042
219042
|
start = 1;
|
|
219043
219043
|
} else {
|
|
@@ -219073,11 +219073,11 @@ var require_path_browserify = __commonJS({
|
|
|
219073
219073
|
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
219074
219074
|
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
219075
219075
|
if (end !== -1) {
|
|
219076
|
-
if (startPart === 0 &&
|
|
219076
|
+
if (startPart === 0 && isAbsolute7) ret.base = ret.name = path3.slice(1, end);
|
|
219077
219077
|
else ret.base = ret.name = path3.slice(startPart, end);
|
|
219078
219078
|
}
|
|
219079
219079
|
} else {
|
|
219080
|
-
if (startPart === 0 &&
|
|
219080
|
+
if (startPart === 0 && isAbsolute7) {
|
|
219081
219081
|
ret.name = path3.slice(1, startDot);
|
|
219082
219082
|
ret.base = path3.slice(1, end);
|
|
219083
219083
|
} else {
|
|
@@ -219087,7 +219087,7 @@ var require_path_browserify = __commonJS({
|
|
|
219087
219087
|
ret.ext = path3.slice(startDot, end);
|
|
219088
219088
|
}
|
|
219089
219089
|
if (startPart > 0) ret.dir = path3.slice(0, startPart - 1);
|
|
219090
|
-
else if (
|
|
219090
|
+
else if (isAbsolute7) ret.dir = "/";
|
|
219091
219091
|
return ret;
|
|
219092
219092
|
},
|
|
219093
219093
|
sep: "/",
|
|
@@ -221980,7 +221980,7 @@ var require_ts_morph_common = __commonJS({
|
|
|
221980
221980
|
}
|
|
221981
221981
|
}
|
|
221982
221982
|
};
|
|
221983
|
-
function matchFiles(path4, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getEntries,
|
|
221983
|
+
function matchFiles(path4, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getEntries, realpath2, directoryExists) {
|
|
221984
221984
|
return ts__namespace.matchFiles.apply(this, arguments);
|
|
221985
221985
|
}
|
|
221986
221986
|
function getFileMatcherPatterns(path4, excludes, includes, useCaseSensitiveFileNames, currentDirectory) {
|
|
@@ -222969,12 +222969,12 @@ ${nodeLocation}` : message;
|
|
|
222969
222969
|
};
|
|
222970
222970
|
var NodeRuntimeFileSystem = class {
|
|
222971
222971
|
delete(path4) {
|
|
222972
|
-
return new Promise((
|
|
222972
|
+
return new Promise((resolve11, reject) => {
|
|
222973
222973
|
fs__namespace.rm(path4, { recursive: true }, (err) => {
|
|
222974
222974
|
if (err)
|
|
222975
222975
|
reject(err);
|
|
222976
222976
|
else
|
|
222977
|
-
|
|
222977
|
+
resolve11();
|
|
222978
222978
|
});
|
|
222979
222979
|
});
|
|
222980
222980
|
}
|
|
@@ -222993,12 +222993,12 @@ ${nodeLocation}` : message;
|
|
|
222993
222993
|
}));
|
|
222994
222994
|
}
|
|
222995
222995
|
readFile(filePath, encoding = "utf-8") {
|
|
222996
|
-
return new Promise((
|
|
222996
|
+
return new Promise((resolve11, reject) => {
|
|
222997
222997
|
fs__namespace.readFile(filePath, encoding, (err, data) => {
|
|
222998
222998
|
if (err)
|
|
222999
222999
|
reject(err);
|
|
223000
223000
|
else
|
|
223001
|
-
|
|
223001
|
+
resolve11(data);
|
|
223002
223002
|
});
|
|
223003
223003
|
});
|
|
223004
223004
|
}
|
|
@@ -223006,12 +223006,12 @@ ${nodeLocation}` : message;
|
|
|
223006
223006
|
return fs__namespace.readFileSync(filePath, encoding);
|
|
223007
223007
|
}
|
|
223008
223008
|
async writeFile(filePath, fileText) {
|
|
223009
|
-
await new Promise((
|
|
223009
|
+
await new Promise((resolve11, reject) => {
|
|
223010
223010
|
fs__namespace.writeFile(filePath, fileText, (err) => {
|
|
223011
223011
|
if (err)
|
|
223012
223012
|
reject(err);
|
|
223013
223013
|
else
|
|
223014
|
-
|
|
223014
|
+
resolve11();
|
|
223015
223015
|
});
|
|
223016
223016
|
});
|
|
223017
223017
|
}
|
|
@@ -223025,12 +223025,12 @@ ${nodeLocation}` : message;
|
|
|
223025
223025
|
fs__namespace.mkdirSync(dirPath, { recursive: true });
|
|
223026
223026
|
}
|
|
223027
223027
|
move(srcPath, destPath) {
|
|
223028
|
-
return new Promise((
|
|
223028
|
+
return new Promise((resolve11, reject) => {
|
|
223029
223029
|
fs__namespace.rename(srcPath, destPath, (err) => {
|
|
223030
223030
|
if (err)
|
|
223031
223031
|
reject(err);
|
|
223032
223032
|
else
|
|
223033
|
-
|
|
223033
|
+
resolve11();
|
|
223034
223034
|
});
|
|
223035
223035
|
});
|
|
223036
223036
|
}
|
|
@@ -223038,12 +223038,12 @@ ${nodeLocation}` : message;
|
|
|
223038
223038
|
fs__namespace.renameSync(srcPath, destPath);
|
|
223039
223039
|
}
|
|
223040
223040
|
copy(srcPath, destPath) {
|
|
223041
|
-
return new Promise((
|
|
223041
|
+
return new Promise((resolve11, reject) => {
|
|
223042
223042
|
fs__namespace.copyFile(srcPath, destPath, (err) => {
|
|
223043
223043
|
if (err)
|
|
223044
223044
|
reject(err);
|
|
223045
223045
|
else
|
|
223046
|
-
|
|
223046
|
+
resolve11();
|
|
223047
223047
|
});
|
|
223048
223048
|
});
|
|
223049
223049
|
}
|
|
@@ -223051,15 +223051,15 @@ ${nodeLocation}` : message;
|
|
|
223051
223051
|
fs__namespace.copyFileSync(srcPath, destPath);
|
|
223052
223052
|
}
|
|
223053
223053
|
stat(path4) {
|
|
223054
|
-
return new Promise((
|
|
223054
|
+
return new Promise((resolve11, reject) => {
|
|
223055
223055
|
fs__namespace.stat(path4, (err, stat) => {
|
|
223056
223056
|
if (err) {
|
|
223057
223057
|
if (err.code === "ENOENT" || err.code === "ENOTDIR")
|
|
223058
|
-
|
|
223058
|
+
resolve11(void 0);
|
|
223059
223059
|
else
|
|
223060
223060
|
reject(err);
|
|
223061
223061
|
} else {
|
|
223062
|
-
|
|
223062
|
+
resolve11(stat);
|
|
223063
223063
|
}
|
|
223064
223064
|
});
|
|
223065
223065
|
});
|
|
@@ -247743,6 +247743,10 @@ init_process_lifecycle();
|
|
|
247743
247743
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
247744
247744
|
var runContextStorage = new AsyncLocalStorage2();
|
|
247745
247745
|
|
|
247746
|
+
// packages/execution/dist/shell-run-control.js
|
|
247747
|
+
init_process_lifecycle();
|
|
247748
|
+
init_process_kill();
|
|
247749
|
+
|
|
247746
247750
|
// packages/execution/dist/tools/shell.js
|
|
247747
247751
|
init_process_kill();
|
|
247748
247752
|
init_process_lifecycle();
|
|
@@ -296772,7 +296776,6 @@ var DEFAULT_INLINE_EPISODES_MAX_BYTES = 1024 * 1024 * 1024;
|
|
|
296772
296776
|
init_process_async();
|
|
296773
296777
|
|
|
296774
296778
|
// packages/execution/dist/tools/background-task.js
|
|
296775
|
-
init_process_kill();
|
|
296776
296779
|
init_process_lifecycle();
|
|
296777
296780
|
|
|
296778
296781
|
// packages/execution/dist/tools/image.js
|
|
@@ -299671,7 +299674,7 @@ async function getDaemonReportedIdentity(port) {
|
|
|
299671
299674
|
async function waitForDaemonReady(port, expectedVersion, attempts = 24) {
|
|
299672
299675
|
let observedVersion = null;
|
|
299673
299676
|
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
299674
|
-
await new Promise((
|
|
299677
|
+
await new Promise((resolve11) => setTimeout(resolve11, 500));
|
|
299675
299678
|
const identity = await getDaemonReportedIdentity(port);
|
|
299676
299679
|
if (!identity) continue;
|
|
299677
299680
|
observedVersion = identity.bootVersion;
|
|
@@ -299682,10 +299685,10 @@ async function waitForDaemonReady(port, expectedVersion, attempts = 24) {
|
|
|
299682
299685
|
return { ok: false, observedVersion };
|
|
299683
299686
|
}
|
|
299684
299687
|
function delay(ms) {
|
|
299685
|
-
return new Promise((
|
|
299688
|
+
return new Promise((resolve11) => setTimeout(resolve11, ms));
|
|
299686
299689
|
}
|
|
299687
299690
|
function runUtilityCommand(command, args, timeout) {
|
|
299688
|
-
return new Promise((
|
|
299691
|
+
return new Promise((resolve11) => {
|
|
299689
299692
|
let settled = false;
|
|
299690
299693
|
let stdout = "";
|
|
299691
299694
|
let stderr = "";
|
|
@@ -299695,7 +299698,7 @@ function runUtilityCommand(command, args, timeout) {
|
|
|
299695
299698
|
if (settled) return;
|
|
299696
299699
|
settled = true;
|
|
299697
299700
|
if (timer) clearTimeout(timer);
|
|
299698
|
-
|
|
299701
|
+
resolve11({ available, code, stdout, stderr });
|
|
299699
299702
|
};
|
|
299700
299703
|
let child;
|
|
299701
299704
|
try {
|
|
@@ -299704,7 +299707,7 @@ function runUtilityCommand(command, args, timeout) {
|
|
|
299704
299707
|
windowsHide: true
|
|
299705
299708
|
});
|
|
299706
299709
|
} catch {
|
|
299707
|
-
|
|
299710
|
+
resolve11({ available: false, code: null, stdout: "", stderr: "" });
|
|
299708
299711
|
return;
|
|
299709
299712
|
}
|
|
299710
299713
|
child.stdout?.setEncoding("utf8");
|
|
@@ -299860,13 +299863,13 @@ async function portHolderPids(port) {
|
|
|
299860
299863
|
return daemonListenerPids(port);
|
|
299861
299864
|
}
|
|
299862
299865
|
async function daemonPortIsFree(port) {
|
|
299863
|
-
return new Promise((
|
|
299866
|
+
return new Promise((resolve11) => {
|
|
299864
299867
|
const probe = createNetServer();
|
|
299865
299868
|
let settled = false;
|
|
299866
299869
|
const finish = (free) => {
|
|
299867
299870
|
if (settled) return;
|
|
299868
299871
|
settled = true;
|
|
299869
|
-
|
|
299872
|
+
resolve11(free);
|
|
299870
299873
|
};
|
|
299871
299874
|
probe.once("error", () => finish(false));
|
|
299872
299875
|
probe.once("listening", () => {
|
|
@@ -300173,7 +300176,7 @@ async function quiesceDaemonForUpdate(port = getDaemonPort()) {
|
|
|
300173
300176
|
|
|
300174
300177
|
// packages/cli/src/update-service.ts
|
|
300175
300178
|
import { spawn as spawn2 } from "node:child_process";
|
|
300176
|
-
import { createHash as
|
|
300179
|
+
import { createHash as createHash3, randomUUID as randomUUID3 } from "node:crypto";
|
|
300177
300180
|
import {
|
|
300178
300181
|
constants,
|
|
300179
300182
|
chmodSync,
|
|
@@ -300194,7 +300197,7 @@ import {
|
|
|
300194
300197
|
writeSync as writeSync2
|
|
300195
300198
|
} from "node:fs";
|
|
300196
300199
|
import { homedir as homedir15 } from "node:os";
|
|
300197
|
-
import { dirname as
|
|
300200
|
+
import { dirname as dirname9, join as join16 } from "node:path";
|
|
300198
300201
|
|
|
300199
300202
|
// packages/cli/src/service-version.ts
|
|
300200
300203
|
var OmniusVersionError = class extends Error {
|
|
@@ -300249,6 +300252,87 @@ function compareOmniusVersions(left, right) {
|
|
|
300249
300252
|
return 0;
|
|
300250
300253
|
}
|
|
300251
300254
|
|
|
300255
|
+
// packages/cli/src/npm-install-recovery.ts
|
|
300256
|
+
import { createHash as createHash2, randomUUID as randomUUID2 } from "node:crypto";
|
|
300257
|
+
import { lstat, realpath, rename, rm } from "node:fs/promises";
|
|
300258
|
+
import { basename as basename8, dirname as dirname8, isAbsolute as isAbsolute6, join as join15, resolve as resolve10 } from "node:path";
|
|
300259
|
+
function parseNpmRenameCollision(diagnostic) {
|
|
300260
|
+
const fields = /* @__PURE__ */ new Map();
|
|
300261
|
+
let previousPathField = false;
|
|
300262
|
+
for (const line of diagnostic.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, "").split(/\r?\n/)) {
|
|
300263
|
+
const match2 = /^\s*npm\s+(?:error|ERR!)\s+(code|syscall|path|dest)\s+(.+?)\s*$/.exec(line);
|
|
300264
|
+
if (previousPathField && line.trim() && !/^\s*npm\s+(?:error|ERR!)(?:\s|$)/.test(line)) return null;
|
|
300265
|
+
if (match2) {
|
|
300266
|
+
if (fields.has(match2[1])) return null;
|
|
300267
|
+
fields.set(match2[1], match2[2]);
|
|
300268
|
+
previousPathField = match2[1] === "path" || match2[1] === "dest";
|
|
300269
|
+
} else if (line.trim()) previousPathField = false;
|
|
300270
|
+
}
|
|
300271
|
+
const code = fields.get("code"), path3 = fields.get("path"), dest = fields.get("dest");
|
|
300272
|
+
if (code !== "ENOTEMPTY" && code !== "EEXIST" || fields.get("syscall") !== "rename" || !path3 || !dest || /[\x00-\x1f\x7f]/.test(path3 + dest)) return null;
|
|
300273
|
+
return { code, syscall: "rename", path: path3, dest };
|
|
300274
|
+
}
|
|
300275
|
+
function retiredNpmPackagePath(packagePath) {
|
|
300276
|
+
const suffix = createHash2("sha1").update(packagePath).digest("base64").replace(/[^a-zA-Z0-9]/g, "").slice(0, 8);
|
|
300277
|
+
return join15(dirname8(packagePath), `.${basename8(packagePath)}-${suffix}`);
|
|
300278
|
+
}
|
|
300279
|
+
function assertNotCancelled(signal) {
|
|
300280
|
+
signal?.throwIfAborted();
|
|
300281
|
+
}
|
|
300282
|
+
function sameIdentity(left, right) {
|
|
300283
|
+
return left.dev === right.dev && left.ino === right.ino;
|
|
300284
|
+
}
|
|
300285
|
+
function assertOwnedDirectory(metadata, label) {
|
|
300286
|
+
if (!metadata.isDirectory() || metadata.isSymbolicLink() || process.platform !== "win32" && (metadata.uid !== process.getuid?.() || (metadata.mode & 2) !== 0)) {
|
|
300287
|
+
throw new Error(`Cannot recover npm retirement collision: ${label} must be an owned directory, not a link.`);
|
|
300288
|
+
}
|
|
300289
|
+
}
|
|
300290
|
+
async function recoverNpmRetirementCollision(collision, modulesRoot, options = {}) {
|
|
300291
|
+
const current = () => {
|
|
300292
|
+
assertNotCancelled(options.signal);
|
|
300293
|
+
options.assertOwned?.();
|
|
300294
|
+
assertNotCancelled(options.signal);
|
|
300295
|
+
};
|
|
300296
|
+
current();
|
|
300297
|
+
if (collision.code !== "ENOTEMPTY" && collision.code !== "EEXIST" || collision.syscall !== "rename" || !isAbsolute6(modulesRoot) || /[\x00-\x1f\x7f]/.test(modulesRoot + collision.path + collision.dest)) return null;
|
|
300298
|
+
const root = resolve10(modulesRoot), source = join15(root, "omnius"), retired = retiredNpmPackagePath(source);
|
|
300299
|
+
if (collision.path !== source || collision.dest !== retired || dirname8(retired) !== root) return null;
|
|
300300
|
+
const rootBefore = await lstat(root);
|
|
300301
|
+
assertOwnedDirectory(rootBefore, "global modules root");
|
|
300302
|
+
const canonicalRoot = await realpath(root);
|
|
300303
|
+
let before;
|
|
300304
|
+
try {
|
|
300305
|
+
before = await lstat(retired);
|
|
300306
|
+
} catch (error) {
|
|
300307
|
+
if (error.code === "ENOENT") return null;
|
|
300308
|
+
throw error;
|
|
300309
|
+
}
|
|
300310
|
+
assertOwnedDirectory(before, "retired package");
|
|
300311
|
+
const backup = join15(root, `.omnius-update-recovery-${randomUUID2()}`);
|
|
300312
|
+
current();
|
|
300313
|
+
const [rootNow, candidateNow] = await Promise.all([lstat(root), lstat(retired)]);
|
|
300314
|
+
if (!sameIdentity(rootBefore, rootNow) || !sameIdentity(before, candidateNow) || await realpath(root) !== canonicalRoot) throw new Error("npm retirement directory changed before recovery; no cleanup was attempted.");
|
|
300315
|
+
assertOwnedDirectory(rootNow, "global modules root");
|
|
300316
|
+
assertOwnedDirectory(candidateNow, "retired package");
|
|
300317
|
+
current();
|
|
300318
|
+
await rename(retired, backup);
|
|
300319
|
+
return { modulesRoot: root, retiredPath: retired, backupPath: backup, device: before.dev, inode: before.ino };
|
|
300320
|
+
}
|
|
300321
|
+
async function removeVerifiedNpmRetirementBackup(backup) {
|
|
300322
|
+
const root = resolve10(backup.modulesRoot);
|
|
300323
|
+
if (!isAbsolute6(backup.modulesRoot) || dirname8(backup.backupPath) !== root || !/^\.omnius-update-recovery-[a-f0-9-]{36}$/.test(basename8(backup.backupPath)) || backup.retiredPath !== retiredNpmPackagePath(join15(root, "omnius"))) {
|
|
300324
|
+
throw new Error("Refusing cleanup outside the preserved npm retirement directory.");
|
|
300325
|
+
}
|
|
300326
|
+
const rootMetadata = await lstat(root);
|
|
300327
|
+
assertOwnedDirectory(rootMetadata, "global modules root");
|
|
300328
|
+
const metadata = await lstat(backup.backupPath);
|
|
300329
|
+
assertOwnedDirectory(metadata, "preserved retirement directory");
|
|
300330
|
+
if (metadata.dev !== backup.device || metadata.ino !== backup.inode) {
|
|
300331
|
+
throw new Error("Preserved npm retirement directory identity changed; its contents were retained.");
|
|
300332
|
+
}
|
|
300333
|
+
await rm(backup.backupPath, { recursive: true });
|
|
300334
|
+
}
|
|
300335
|
+
|
|
300252
300336
|
// packages/cli/src/update-service.ts
|
|
300253
300337
|
var UpdateCancelledError = class extends Error {
|
|
300254
300338
|
constructor(message = "Update cancelled. Package changes already made are retained; no rollback is claimed.") {
|
|
@@ -300260,7 +300344,7 @@ var UpdateOwnershipBusyError = class extends Error {
|
|
|
300260
300344
|
};
|
|
300261
300345
|
function cancellationPath(operationId, paths) {
|
|
300262
300346
|
if (!/^[a-zA-Z0-9_-]{1,128}$/.test(operationId)) throw new Error("Invalid update operation identity");
|
|
300263
|
-
return
|
|
300347
|
+
return join16(paths.stateDir, `cancel-${operationId}.json`);
|
|
300264
300348
|
}
|
|
300265
300349
|
function watchUpdateCancellation(operationId, paths = resolveUpdatePaths()) {
|
|
300266
300350
|
const controller = new AbortController();
|
|
@@ -300288,16 +300372,16 @@ function watchUpdateCancellation(operationId, paths = resolveUpdatePaths()) {
|
|
|
300288
300372
|
} };
|
|
300289
300373
|
}
|
|
300290
300374
|
function resolveUpdatePaths(env = process.env, platform2 = process.platform, home = homedir15()) {
|
|
300291
|
-
const stateBase = platform2 === "win32" ? env["LOCALAPPDATA"] ||
|
|
300292
|
-
const cacheBase = platform2 === "win32" ? env["LOCALAPPDATA"] ||
|
|
300293
|
-
const stateDir =
|
|
300294
|
-
const cacheDir =
|
|
300375
|
+
const stateBase = platform2 === "win32" ? env["LOCALAPPDATA"] || join16(home, "AppData", "Local") : platform2 === "darwin" ? join16(home, "Library", "Application Support") : env["XDG_STATE_HOME"] || join16(home, ".local", "state");
|
|
300376
|
+
const cacheBase = platform2 === "win32" ? env["LOCALAPPDATA"] || join16(home, "AppData", "Local") : platform2 === "darwin" ? join16(home, "Library", "Caches") : env["XDG_CACHE_HOME"] || join16(home, ".cache");
|
|
300377
|
+
const stateDir = join16(stateBase, platform2 === "win32" ? "Omnius" : "omnius", "update");
|
|
300378
|
+
const cacheDir = join16(cacheBase, platform2 === "win32" ? "Omnius" : "omnius", "npm-update");
|
|
300295
300379
|
return {
|
|
300296
300380
|
stateDir,
|
|
300297
300381
|
cacheDir,
|
|
300298
|
-
stateFile:
|
|
300299
|
-
lockFile:
|
|
300300
|
-
logFile:
|
|
300382
|
+
stateFile: join16(stateDir, "state.json"),
|
|
300383
|
+
lockFile: join16(stateDir, "update.lock"),
|
|
300384
|
+
logFile: join16(stateDir, "update.log")
|
|
300301
300385
|
};
|
|
300302
300386
|
}
|
|
300303
300387
|
function ensurePrivateDirectories(paths) {
|
|
@@ -300358,7 +300442,7 @@ function processIdentity(pid) {
|
|
|
300358
300442
|
}
|
|
300359
300443
|
function withUpdateOwnership(paths, mutation) {
|
|
300360
300444
|
ensurePrivateDirectories(paths);
|
|
300361
|
-
const path3 = paths.lockFile + ".guard", nonce =
|
|
300445
|
+
const path3 = paths.lockFile + ".guard", nonce = randomUUID3();
|
|
300362
300446
|
let fd;
|
|
300363
300447
|
try {
|
|
300364
300448
|
fd = openSync3(path3, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 384);
|
|
@@ -300412,7 +300496,7 @@ async function retryUpdateOwnership(attempt, timeoutMs = 2e3) {
|
|
|
300412
300496
|
} catch {
|
|
300413
300497
|
}
|
|
300414
300498
|
if (!live) throw error;
|
|
300415
|
-
await new Promise((
|
|
300499
|
+
await new Promise((resolve11) => setTimeout(resolve11, 25));
|
|
300416
300500
|
}
|
|
300417
300501
|
}
|
|
300418
300502
|
}
|
|
@@ -300421,7 +300505,7 @@ function releaseMatchingUpdateLock(paths, operationId, pid) {
|
|
|
300421
300505
|
if (lock?.operation_id === operationId && (pid === void 0 || lock.pid === pid)) unlinkSync3(paths.lockFile);
|
|
300422
300506
|
}
|
|
300423
300507
|
function atomicPrivateJson(path3, value) {
|
|
300424
|
-
const temp = `${path3}.${process.pid}.${
|
|
300508
|
+
const temp = `${path3}.${process.pid}.${randomUUID3()}.tmp`;
|
|
300425
300509
|
try {
|
|
300426
300510
|
writeFileSync4(temp, `${JSON.stringify(value, null, 2)}
|
|
300427
300511
|
`, {
|
|
@@ -300477,8 +300561,8 @@ function assertExactUpdateTarget(targetVersion, fromVersion) {
|
|
|
300477
300561
|
return target;
|
|
300478
300562
|
}
|
|
300479
300563
|
function npmCandidates(execPath = process.execPath) {
|
|
300480
|
-
const nodeDir =
|
|
300481
|
-
return process.platform === "win32" ? [
|
|
300564
|
+
const nodeDir = dirname9(execPath);
|
|
300565
|
+
return process.platform === "win32" ? [join16(nodeDir, "npm.cmd"), join16(nodeDir, "npm.exe"), "npm.cmd", "npm"] : [join16(nodeDir, "npm"), "/usr/local/bin/npm", "/usr/bin/npm", "npm"];
|
|
300482
300566
|
}
|
|
300483
300567
|
function runnableCommand(candidate) {
|
|
300484
300568
|
return candidate.includes("/") || candidate.includes("\\") ? existsSync6(candidate) : true;
|
|
@@ -300496,7 +300580,7 @@ async function runUpdateCommand(command, args, options = {}) {
|
|
|
300496
300580
|
if (options.signal?.aborted) {
|
|
300497
300581
|
return { status: null, stdout: "", stderr: "command cancelled", signal: null, error: new Error("command cancelled") };
|
|
300498
300582
|
}
|
|
300499
|
-
return await new Promise((
|
|
300583
|
+
return await new Promise((resolve11) => {
|
|
300500
300584
|
const child = spawn2(command, args, {
|
|
300501
300585
|
env: options.env ?? process.env,
|
|
300502
300586
|
cwd: options.cwd,
|
|
@@ -300542,7 +300626,7 @@ async function runUpdateCommand(command, args, options = {}) {
|
|
|
300542
300626
|
clearTimeout(timer);
|
|
300543
300627
|
if (forceTimer) clearTimeout(forceTimer);
|
|
300544
300628
|
options.signal?.removeEventListener("abort", onAbort);
|
|
300545
|
-
|
|
300629
|
+
resolve11(result);
|
|
300546
300630
|
};
|
|
300547
300631
|
const onAbort = () => {
|
|
300548
300632
|
terminate(new Error("command cancelled"));
|
|
@@ -300570,10 +300654,10 @@ async function runUpdateCommand(command, args, options = {}) {
|
|
|
300570
300654
|
}
|
|
300571
300655
|
var runCommand = runUpdateCommand;
|
|
300572
300656
|
function globalPackageCandidates(prefix) {
|
|
300573
|
-
return process.platform === "win32" ? [
|
|
300657
|
+
return process.platform === "win32" ? [join16(prefix, "node_modules", "omnius", "package.json"), join16(prefix, "omnius", "package.json")] : [join16(prefix, "lib", "node_modules", "omnius", "package.json"), join16(prefix, "node_modules", "omnius", "package.json")];
|
|
300574
300658
|
}
|
|
300575
300659
|
function globalExecutableCandidates(prefix) {
|
|
300576
|
-
return process.platform === "win32" ? [
|
|
300660
|
+
return process.platform === "win32" ? [join16(prefix, "omnius.cmd"), join16(prefix, "omnius.exe"), join16(prefix, "bin", "omnius.cmd")] : [join16(prefix, "bin", "omnius")];
|
|
300577
300661
|
}
|
|
300578
300662
|
async function inspectGlobalOmniusInstall(expectedVersion, options = {}) {
|
|
300579
300663
|
const npmPath = options.npmPath ?? resolveNpmPath();
|
|
@@ -300606,7 +300690,7 @@ ${versionResult.stderr}`) ?? "";
|
|
|
300606
300690
|
executablePath,
|
|
300607
300691
|
installedVersion,
|
|
300608
300692
|
executableVersion,
|
|
300609
|
-
packageHash:
|
|
300693
|
+
packageHash: createHash3("sha256").update(packageJsonRaw).digest("hex")
|
|
300610
300694
|
};
|
|
300611
300695
|
}
|
|
300612
300696
|
function transitionOnce(current, patch, paths) {
|
|
@@ -300632,7 +300716,7 @@ async function quiesceDaemonWithRetry(quiesce, attempts = 3, pauseMs = 250) {
|
|
|
300632
300716
|
} catch {
|
|
300633
300717
|
}
|
|
300634
300718
|
if (attempt < boundedAttempts && pauseMs > 0) {
|
|
300635
|
-
await new Promise((
|
|
300719
|
+
await new Promise((resolve11) => setTimeout(resolve11, pauseMs));
|
|
300636
300720
|
}
|
|
300637
300721
|
}
|
|
300638
300722
|
return false;
|
|
@@ -300654,14 +300738,16 @@ async function installGlobalPackageStreaming(input) {
|
|
|
300654
300738
|
onStderr: (text2) => process.stderr.write(text2)
|
|
300655
300739
|
});
|
|
300656
300740
|
const exitCode = result.status ?? -1;
|
|
300741
|
+
const renameCollision = parseNpmRenameCollision(result.stderr);
|
|
300657
300742
|
return { exitCode, ...result.error || exitCode !== 0 ? {
|
|
300658
300743
|
error: result.error?.message || result.stderr.slice(-8e3).trim() || `npm install exited with ${result.signal || exitCode}`
|
|
300659
|
-
} : {} };
|
|
300744
|
+
} : {}, ...renameCollision ? { renameCollision } : {} };
|
|
300660
300745
|
}
|
|
300661
300746
|
async function runVerifiedUpdateTransaction(initial, dependencies, paths = resolveUpdatePaths()) {
|
|
300662
300747
|
let state = initial;
|
|
300663
300748
|
let daemonQuiesced = false;
|
|
300664
300749
|
let installStarted = false;
|
|
300750
|
+
let retirementBackup = null;
|
|
300665
300751
|
let cancelPublication;
|
|
300666
300752
|
const throwIfCancelled = () => {
|
|
300667
300753
|
if (dependencies.signal?.aborted) throw new UpdateCancelledError();
|
|
@@ -300682,7 +300768,7 @@ async function runVerifiedUpdateTransaction(initial, dependencies, paths = resol
|
|
|
300682
300768
|
const npmPath = resolveNpmPath();
|
|
300683
300769
|
const env = {
|
|
300684
300770
|
...process.env,
|
|
300685
|
-
PATH: [
|
|
300771
|
+
PATH: [dirname9(process.execPath), process.env.PATH ?? ""].filter(Boolean).join(process.platform === "win32" ? ";" : ":"),
|
|
300686
300772
|
NPM_CONFIG_CACHE: paths.cacheDir,
|
|
300687
300773
|
npm_config_cache: paths.cacheDir,
|
|
300688
300774
|
npm_config_prefer_online: "true",
|
|
@@ -300711,10 +300797,39 @@ async function runVerifiedUpdateTransaction(initial, dependencies, paths = resol
|
|
|
300711
300797
|
throwIfCancelled();
|
|
300712
300798
|
const installer = dependencies.install ?? installGlobalPackageStreaming;
|
|
300713
300799
|
installStarted = true;
|
|
300714
|
-
|
|
300715
|
-
|
|
300716
|
-
|
|
300717
|
-
|
|
300800
|
+
for (let attempt = 1; attempt <= 2; attempt++) {
|
|
300801
|
+
state = await transition(state, { installer_attempt: attempt }, paths);
|
|
300802
|
+
throwIfCancelled();
|
|
300803
|
+
const installResult = await installer({ npmPath, targetVersion: target, env, signal: dependencies.signal });
|
|
300804
|
+
state = await transition(state, { installer_exit_code: installResult.exitCode }, paths);
|
|
300805
|
+
throwIfCancelled();
|
|
300806
|
+
if (installResult.exitCode === 0) break;
|
|
300807
|
+
const collision = installResult.renameCollision ?? parseNpmRenameCollision(installResult.error ?? "");
|
|
300808
|
+
if (attempt === 1 && collision) {
|
|
300809
|
+
const rootProbe = await runCommand(npmPath, ["root", "-g"], { env, timeout: 1e4, signal: dependencies.signal });
|
|
300810
|
+
throwIfCancelled();
|
|
300811
|
+
if (rootProbe.status === 0 && rootProbe.stdout.trim()) {
|
|
300812
|
+
retirementBackup = await recoverNpmRetirementCollision(collision, rootProbe.stdout.trim(), {
|
|
300813
|
+
signal: dependencies.signal,
|
|
300814
|
+
assertOwned: () => {
|
|
300815
|
+
const persisted = readUpdateState(paths);
|
|
300816
|
+
if (!persisted || persisted.operation_id !== state.operation_id || persisted.status !== "running" || state.worker_adopted_at && !ownsAdoptedWorker(persisted, state.operation_id, state.pid, paths)) {
|
|
300817
|
+
throw new Error("Update ownership changed before npm collision recovery; no directory was moved.");
|
|
300818
|
+
}
|
|
300819
|
+
}
|
|
300820
|
+
});
|
|
300821
|
+
if (retirementBackup) {
|
|
300822
|
+
state = await transition(state, { npm_recovery: {
|
|
300823
|
+
retired_path: retirementBackup.retiredPath,
|
|
300824
|
+
backup_path: retirementBackup.backupPath,
|
|
300825
|
+
status: "retained"
|
|
300826
|
+
} }, paths);
|
|
300827
|
+
process.stderr.write("[omnius update] Preserved the occupied npm retirement directory; retrying the same package once (attempt 2/2).\n");
|
|
300828
|
+
throwIfCancelled();
|
|
300829
|
+
continue;
|
|
300830
|
+
}
|
|
300831
|
+
}
|
|
300832
|
+
}
|
|
300718
300833
|
throw new Error(installResult.error || `npm install exited with code ${installResult.exitCode}`);
|
|
300719
300834
|
}
|
|
300720
300835
|
const evidence = dependencies.inspectInstall ? await dependencies.inspectInstall(target, npmPath, env) : await inspectGlobalOmniusInstall(target, { npmPath, env });
|
|
@@ -300739,7 +300854,7 @@ async function runVerifiedUpdateTransaction(initial, dependencies, paths = resol
|
|
|
300739
300854
|
if (daemon?.bootVersion === target && daemon.bootPackageHash === evidence.packageHash) {
|
|
300740
300855
|
break;
|
|
300741
300856
|
}
|
|
300742
|
-
if (attempt < 3) await new Promise((
|
|
300857
|
+
if (attempt < 3) await new Promise((resolve11) => setTimeout(resolve11, 1e3));
|
|
300743
300858
|
}
|
|
300744
300859
|
if (!daemon || daemon.bootVersion !== target) {
|
|
300745
300860
|
const observed = daemon?.bootVersion ?? "unreachable";
|
|
@@ -300771,6 +300886,21 @@ async function runVerifiedUpdateTransaction(initial, dependencies, paths = resol
|
|
|
300771
300886
|
state = await transition(state, { tray_restarted: true }, paths);
|
|
300772
300887
|
}
|
|
300773
300888
|
throwIfCancelled();
|
|
300889
|
+
if (retirementBackup && state.npm_recovery) {
|
|
300890
|
+
const recovery = state.npm_recovery;
|
|
300891
|
+
let cleanupWarning;
|
|
300892
|
+
try {
|
|
300893
|
+
await removeVerifiedNpmRetirementBackup(retirementBackup);
|
|
300894
|
+
} catch (error) {
|
|
300895
|
+
cleanupWarning = error instanceof Error ? error.message : String(error);
|
|
300896
|
+
}
|
|
300897
|
+
state = await transition(state, { npm_recovery: {
|
|
300898
|
+
...recovery,
|
|
300899
|
+
status: cleanupWarning ? "retained" : "removed",
|
|
300900
|
+
...cleanupWarning ? { cleanup_warning: cleanupWarning } : {}
|
|
300901
|
+
} }, paths);
|
|
300902
|
+
}
|
|
300903
|
+
throwIfCancelled();
|
|
300774
300904
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
300775
300905
|
state = await transition(state, {
|
|
300776
300906
|
status: "completed",
|
|
@@ -300801,6 +300931,7 @@ async function runVerifiedUpdateTransaction(initial, dependencies, paths = resol
|
|
|
300801
300931
|
error: cancelled ? "Update cancelled after the owned operation settled." : message,
|
|
300802
300932
|
remediation: [
|
|
300803
300933
|
cancelled && installStarted ? "Package files may have changed. No rollback was performed; verify the installed version before retrying." : void 0,
|
|
300934
|
+
state.npm_recovery?.status === "retained" ? `The prior npm retirement directory is preserved at ${state.npm_recovery.backup_path}.` : void 0,
|
|
300804
300935
|
permissionRemediation(message),
|
|
300805
300936
|
recoveryNote
|
|
300806
300937
|
].filter(Boolean).join(" ") || void 0
|
|
@@ -300830,7 +300961,7 @@ import {
|
|
|
300830
300961
|
writeSync as writeSync3
|
|
300831
300962
|
} from "node:fs";
|
|
300832
300963
|
import { homedir as homedir16, tmpdir as tmpdir6 } from "node:os";
|
|
300833
|
-
import { basename as
|
|
300964
|
+
import { basename as basename9, delimiter, dirname as dirname10, join as join18 } from "node:path";
|
|
300834
300965
|
|
|
300835
300966
|
// packages/cli/src/tray-menu.ts
|
|
300836
300967
|
import { execFile as execFile4 } from "node:child_process";
|
|
@@ -300854,10 +300985,10 @@ var cachedLimit = trayLabelLimit();
|
|
|
300854
300985
|
var run = promisify4(execFile4);
|
|
300855
300986
|
|
|
300856
300987
|
// packages/cli/src/updater.ts
|
|
300857
|
-
import { join as
|
|
300988
|
+
import { join as join17 } from "node:path";
|
|
300858
300989
|
var UPDATE_CHECK_INTERVAL_MS = 60 * 1e3;
|
|
300859
300990
|
var CACHE_DIR = resolveUpdatePaths().stateDir;
|
|
300860
|
-
var CACHE_FILE =
|
|
300991
|
+
var CACHE_FILE = join17(CACHE_DIR, "registry-check.json");
|
|
300861
300992
|
|
|
300862
300993
|
// packages/cli/src/tray.ts
|
|
300863
300994
|
var DEFAULT_ENDPOINT = "http://127.0.0.1:11435";
|
|
@@ -300865,19 +300996,19 @@ function uidSuffix() {
|
|
|
300865
300996
|
return typeof process.getuid === "function" ? String(process.getuid()) : "user";
|
|
300866
300997
|
}
|
|
300867
300998
|
function resolveTrayPaths(env = process.env, platform2 = process.platform, home = homedir16()) {
|
|
300868
|
-
const runtimeBase = env["XDG_RUNTIME_DIR"] ||
|
|
300869
|
-
const stateBase = platform2 === "win32" ? env["LOCALAPPDATA"] ||
|
|
300870
|
-
const configBase = platform2 === "win32" ? env["APPDATA"] ||
|
|
300871
|
-
const runtimeDir =
|
|
300872
|
-
const stateDir = platform2 === "win32" ?
|
|
300873
|
-
const autostartFile = platform2 === "darwin" ?
|
|
300999
|
+
const runtimeBase = env["XDG_RUNTIME_DIR"] || join18(tmpdir6(), `omnius-${uidSuffix()}`);
|
|
301000
|
+
const stateBase = platform2 === "win32" ? env["LOCALAPPDATA"] || join18(home, "AppData", "Local") : env["XDG_STATE_HOME"] || join18(home, ".local", "state");
|
|
301001
|
+
const configBase = platform2 === "win32" ? env["APPDATA"] || join18(home, "AppData", "Roaming") : env["XDG_CONFIG_HOME"] || join18(home, ".config");
|
|
301002
|
+
const runtimeDir = join18(runtimeBase, "omnius");
|
|
301003
|
+
const stateDir = platform2 === "win32" ? join18(stateBase, "Omnius") : join18(stateBase, "omnius");
|
|
301004
|
+
const autostartFile = platform2 === "darwin" ? join18(home, "Library", "LaunchAgents", "ai.omnius.tray.plist") : platform2 === "win32" ? join18(configBase, "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "omnius-tray.cmd") : join18(configBase, "autostart", "omnius-tray.desktop");
|
|
300874
301005
|
return {
|
|
300875
301006
|
runtimeDir,
|
|
300876
301007
|
stateDir,
|
|
300877
|
-
pidFile:
|
|
300878
|
-
stateFile:
|
|
300879
|
-
stdoutLog:
|
|
300880
|
-
stderrLog:
|
|
301008
|
+
pidFile: join18(runtimeDir, "tray.pid"),
|
|
301009
|
+
stateFile: join18(runtimeDir, "tray-state.json"),
|
|
301010
|
+
stdoutLog: join18(stateDir, "tray.log"),
|
|
301011
|
+
stderrLog: join18(stateDir, "tray.err.log"),
|
|
300881
301012
|
autostartFile
|
|
300882
301013
|
};
|
|
300883
301014
|
}
|
|
@@ -300965,7 +301096,7 @@ function readProcessState(path3) {
|
|
|
300965
301096
|
}
|
|
300966
301097
|
}
|
|
300967
301098
|
async function commandOutput(command, args, timeout = 2e3) {
|
|
300968
|
-
return await new Promise((
|
|
301099
|
+
return await new Promise((resolve11) => {
|
|
300969
301100
|
const child = spawn3(command, args, { stdio: ["ignore", "pipe", "ignore"], windowsHide: true });
|
|
300970
301101
|
let stdout = "";
|
|
300971
301102
|
let settled = false;
|
|
@@ -300973,7 +301104,7 @@ async function commandOutput(command, args, timeout = 2e3) {
|
|
|
300973
301104
|
if (settled) return;
|
|
300974
301105
|
settled = true;
|
|
300975
301106
|
clearTimeout(timer);
|
|
300976
|
-
|
|
301107
|
+
resolve11(stdout);
|
|
300977
301108
|
};
|
|
300978
301109
|
child.stdout?.on("data", (chunk) => {
|
|
300979
301110
|
stdout = `${stdout}${chunk.toString()}`.slice(-64 * 1024);
|
|
@@ -301070,7 +301201,7 @@ async function stopTray() {
|
|
|
301070
301201
|
}
|
|
301071
301202
|
return true;
|
|
301072
301203
|
}
|
|
301073
|
-
await new Promise((
|
|
301204
|
+
await new Promise((resolve11) => setTimeout(resolve11, 100));
|
|
301074
301205
|
}
|
|
301075
301206
|
if (!trayProcessCommandLooksOwned(await processCommandLine(pid))) return false;
|
|
301076
301207
|
try {
|
|
@@ -301089,7 +301220,7 @@ async function stopTray() {
|
|
|
301089
301220
|
}
|
|
301090
301221
|
return true;
|
|
301091
301222
|
}
|
|
301092
|
-
await new Promise((
|
|
301223
|
+
await new Promise((resolve11) => setTimeout(resolve11, 100));
|
|
301093
301224
|
}
|
|
301094
301225
|
return false;
|
|
301095
301226
|
}
|
|
@@ -301097,7 +301228,7 @@ async function stopTray() {
|
|
|
301097
301228
|
// packages/cli/src/update-worker-runtime.ts
|
|
301098
301229
|
async function restartTrayWithInstalledExecutable(executable, endpoint) {
|
|
301099
301230
|
await stopTray();
|
|
301100
|
-
const launched = await new Promise((
|
|
301231
|
+
const launched = await new Promise((resolve11) => {
|
|
301101
301232
|
const child = spawn4(executable, ["tray", "start", "--endpoint", endpoint], {
|
|
301102
301233
|
stdio: "ignore",
|
|
301103
301234
|
windowsHide: true
|
|
@@ -301107,15 +301238,15 @@ async function restartTrayWithInstalledExecutable(executable, endpoint) {
|
|
|
301107
301238
|
child.kill();
|
|
301108
301239
|
} catch {
|
|
301109
301240
|
}
|
|
301110
|
-
|
|
301241
|
+
resolve11(false);
|
|
301111
301242
|
}, 15e3);
|
|
301112
301243
|
child.once("error", () => {
|
|
301113
301244
|
clearTimeout(timer);
|
|
301114
|
-
|
|
301245
|
+
resolve11(false);
|
|
301115
301246
|
});
|
|
301116
301247
|
child.once("close", (code) => {
|
|
301117
301248
|
clearTimeout(timer);
|
|
301118
|
-
|
|
301249
|
+
resolve11(code === 0);
|
|
301119
301250
|
});
|
|
301120
301251
|
});
|
|
301121
301252
|
if (!launched) return false;
|
|
@@ -301123,7 +301254,7 @@ async function restartTrayWithInstalledExecutable(executable, endpoint) {
|
|
|
301123
301254
|
const status = await getTrayStatus(endpoint);
|
|
301124
301255
|
if (status.running && status.ready && status.endpoint === endpoint)
|
|
301125
301256
|
return true;
|
|
301126
|
-
await new Promise((
|
|
301257
|
+
await new Promise((resolve11) => setTimeout(resolve11, 250));
|
|
301127
301258
|
}
|
|
301128
301259
|
return false;
|
|
301129
301260
|
}
|