@runweave/server-linux-x64 0.1.4 → 0.1.5
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/manifest.json +150 -150
- package/native.tar.gz +0 -0
- package/package.json +1 -1
- package/payload/app-server/build-info.json +4 -4
- package/payload/app-server/index.cjs +127 -95
- package/payload/app-server/index.cjs.map +1 -1
- package/payload/backend/activity-sqlite-worker.cjs +7593 -44
- package/payload/backend/build-info.json +4 -4
- package/payload/backend/dev-resources/control.cjs +211 -160
- package/payload/backend/index.cjs +210 -176
- package/payload/bin/runtime.cjs +22 -5
- package/payload/frontend/dist/assets/{_baseUniq-2DZJ97aQ.js → _baseUniq-Cca1dJQ9.js} +1 -1
- package/payload/frontend/dist/assets/{access-Jw5gZrYY.js → access-DUFDE5w4.js} +1 -1
- package/payload/frontend/dist/assets/{advanced-DRe-Doxo.js → advanced-COAr8Hid.js} +1 -1
- package/payload/frontend/dist/assets/{appearance-D1wpkdXT.js → appearance-DwT_3HyT.js} +1 -1
- package/payload/frontend/dist/assets/{arc-keTQ5uhA.js → arc-BiCpkEHN.js} +1 -1
- package/payload/frontend/dist/assets/{architectureDiagram-Q4EWVU46-BXbCJ77m.js → architectureDiagram-Q4EWVU46-DMulbydF.js} +1 -1
- package/payload/frontend/dist/assets/{blockDiagram-DXYQGD6D-De0Ki8tO.js → blockDiagram-DXYQGD6D-DP3EKW2h.js} +1 -1
- package/payload/frontend/dist/assets/{c4Diagram-AHTNJAMY-EfazoSVi.js → c4Diagram-AHTNJAMY-BLS8RP7a.js} +1 -1
- package/payload/frontend/dist/assets/channel-CKmnPCpJ.js +1 -0
- package/payload/frontend/dist/assets/{chunk-4BX2VUAB-BXCGPL07.js → chunk-4BX2VUAB-BUV-Uw18.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-4TB4RGXK-ByjQ1_yc.js → chunk-4TB4RGXK-94c9VfB5.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-55IACEB6-D-KjMbGJ.js → chunk-55IACEB6-RfLXGW3_.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-EDXVE4YY-tAgLMZ4w.js → chunk-EDXVE4YY-pPo_Q141.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-FMBD7UC4-D3J3ERtV.js → chunk-FMBD7UC4-DS6emz7j.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-OYMX7WX6-DZHtmvkW.js → chunk-OYMX7WX6-G-gZUTTY.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-QZHKN3VN-D6IIGd1d.js → chunk-QZHKN3VN-BTTlBOxb.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-YZCP3GAM-KD19-lMa.js → chunk-YZCP3GAM-BE7Nnglr.js} +1 -1
- package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-B50rK7Wd.js +1 -0
- package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-B50rK7Wd.js +1 -0
- package/payload/frontend/dist/assets/clone-Cgs355hK.js +1 -0
- package/payload/frontend/dist/assets/{connection-Cm6G1HOW.js → connection--S1gQxJQ.js} +1 -1
- package/payload/frontend/dist/assets/{connections-B8tSRWt9.js → connections-BKIzytUO.js} +1 -1
- package/payload/frontend/dist/assets/{cose-bilkent-S5V4N54A-AYXbL8jP.js → cose-bilkent-S5V4N54A-C0uj9jlE.js} +1 -1
- package/payload/frontend/dist/assets/{dagre-KV5264BT-DCunJ-sG.js → dagre-KV5264BT-C21BxT9x.js} +1 -1
- package/payload/frontend/dist/assets/{desktop-DnY652OH.js → desktop-BrFP7uD8.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-5BDNPKRD-Ch2b63ll.js → diagram-5BDNPKRD-Dm_Sv1fY.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-G4DWMVQ6-BAuc_Uar.js → diagram-G4DWMVQ6-CyBlXHYE.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-MMDJMWI5-DH8qMuDA.js → diagram-MMDJMWI5-DlzAJAhf.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-TYMM5635-BflD7Kjb.js → diagram-TYMM5635-BUHbMszI.js} +1 -1
- package/payload/frontend/dist/assets/{erDiagram-SMLLAGMA-BGzvzTP9.js → erDiagram-SMLLAGMA-B_KFaTkr.js} +1 -1
- package/payload/frontend/dist/assets/{flowDiagram-DWJPFMVM-BR4mXArp.js → flowDiagram-DWJPFMVM-Ci8c_uVM.js} +1 -1
- package/payload/frontend/dist/assets/{ganttDiagram-T4ZO3ILL-uXtJoz5O.js → ganttDiagram-T4ZO3ILL-CuX6Iq0t.js} +1 -1
- package/payload/frontend/dist/assets/{gitGraphDiagram-UUTBAWPF-BeLB68OO.js → gitGraphDiagram-UUTBAWPF-g07Rr7cC.js} +1 -1
- package/payload/frontend/dist/assets/{graph-DakNuFNs.js → graph-BFZFDWHT.js} +1 -1
- package/payload/frontend/dist/assets/{image-BICNaNq8.js → image-Bqf_JqcW.js} +1 -1
- package/payload/frontend/dist/assets/{index-Cf9Vl4GJ.js → index-CfimLLEm.js} +5 -5
- package/payload/frontend/dist/assets/{infoDiagram-42DDH7IO-CAGn0b04.js → infoDiagram-42DDH7IO-swg7grwk.js} +1 -1
- package/payload/frontend/dist/assets/{ishikawaDiagram-UXIWVN3A-fbaDUCpd.js → ishikawaDiagram-UXIWVN3A-9RP9c7cN.js} +1 -1
- package/payload/frontend/dist/assets/{journeyDiagram-VCZTEJTY-ZOmjleqG.js → journeyDiagram-VCZTEJTY-Bh523JBl.js} +1 -1
- package/payload/frontend/dist/assets/{kanban-definition-6JOO6SKY-BmODq4tv.js → kanban-definition-6JOO6SKY-BxGTS30A.js} +1 -1
- package/payload/frontend/dist/assets/{layout-CLfuo3Vs.js → layout-BA90oBmS.js} +1 -1
- package/payload/frontend/dist/assets/{linear-csTsZ7Al.js → linear-BVOBmfu-.js} +1 -1
- package/payload/frontend/dist/assets/{main-DwDuhfcr.js → main-wqeDvHCJ.js} +22 -22
- package/payload/frontend/dist/assets/{min-B4B7Rr4j.js → min-CTb5zZxd.js} +1 -1
- package/payload/frontend/dist/assets/{mindmap-definition-QFDTVHPH-CiV2UasH.js → mindmap-definition-QFDTVHPH-D77Oju5l.js} +1 -1
- package/payload/frontend/dist/assets/{monitoring-1_Fnxura.js → monitoring-BcgpwXyO.js} +1 -1
- package/payload/frontend/dist/assets/{notifications-VJaMbzoX.js → notifications-Cp6tD-Df.js} +1 -1
- package/payload/frontend/dist/assets/{pieDiagram-DEJITSTG-DwazVxKI.js → pieDiagram-DEJITSTG-Dp1SSOdP.js} +1 -1
- package/payload/frontend/dist/assets/{quadrantDiagram-34T5L4WZ-CAn9HHbO.js → quadrantDiagram-34T5L4WZ-D2_VBifB.js} +1 -1
- package/payload/frontend/dist/assets/{record-content-Bewq09_f.js → record-content-DawrQ3vI.js} +1 -1
- package/payload/frontend/dist/assets/{requirementDiagram-MS252O5E-CFot9peV.js → requirementDiagram-MS252O5E-CZUQO9c-.js} +1 -1
- package/payload/frontend/dist/assets/{sankeyDiagram-XADWPNL6-CdRX6WuA.js → sankeyDiagram-XADWPNL6-DMw6E77g.js} +1 -1
- package/payload/frontend/dist/assets/{sequenceDiagram-FGHM5R23-vRc1a5W1.js → sequenceDiagram-FGHM5R23-CCF4Uyr1.js} +1 -1
- package/payload/frontend/dist/assets/{stateDiagram-FHFEXIEX-Bxcr7s70.js → stateDiagram-FHFEXIEX-BrnJj_YC.js} +1 -1
- package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-i7xNd2ZA.js +1 -0
- package/payload/frontend/dist/assets/{status-9tZZeoV7.js → status-B-_-GXiJ.js} +1 -1
- package/payload/frontend/dist/assets/suiji-BB8bFtuh.js +1 -0
- package/payload/frontend/dist/assets/{svg-qpyWsADE.js → svg-DOzReQUk.js} +1 -1
- package/payload/frontend/dist/assets/{tabs-CwPtRQY0.js → tabs-1W6wgg8j.js} +1 -1
- package/payload/frontend/dist/assets/{timeline-definition-GMOUNBTQ-2mD2ePS6.js → timeline-definition-GMOUNBTQ-DTlM3m_q.js} +1 -1
- package/payload/frontend/dist/assets/{vennDiagram-DHZGUBPP-w4DbLykx.js → vennDiagram-DHZGUBPP-D_9TXuLu.js} +1 -1
- package/payload/frontend/dist/assets/{wardley-RL74JXVD-C3H8SQaZ.js → wardley-RL74JXVD-U4S2yDk_.js} +1 -1
- package/payload/frontend/dist/assets/{wardleyDiagram-NUSXRM2D-DEI0kC2c.js → wardleyDiagram-NUSXRM2D-BCUzTDXi.js} +1 -1
- package/payload/frontend/dist/assets/{xychartDiagram-5P7HB3ND-DDVlpQ28.js → xychartDiagram-5P7HB3ND-BksV4M9z.js} +1 -1
- package/payload/frontend/dist/build-info.json +4 -4
- package/payload/frontend/dist/companion.html +1 -1
- package/payload/frontend/dist/index.html +2 -2
- package/payload/server/index.cjs +165 -107
- package/payload/frontend/dist/assets/channel-CExZE0tD.js +0 -1
- package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-DNOAkizi.js +0 -1
- package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-DNOAkizi.js +0 -1
- package/payload/frontend/dist/assets/clone-CzOxlTa8.js +0 -1
- package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-YGvbZNwL.js +0 -1
- package/payload/frontend/dist/assets/suiji-DX2ioZ0I.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* runweave:build-info */var __RUNWEAVE_BUILD_INFO__={"version":"0.1.0","buildId":"
|
|
1
|
+
/* runweave:build-info */var __RUNWEAVE_BUILD_INFO__={"version":"0.1.0","buildId":"20261108T004030826Z-168d13f1","sourceRevision":"168d13f138a29af9055863e4ccec018125af5644","sourceDirty":false,"builtAt":"2026-11-08T00:40:30.826Z","contentSha256":"394f0c720b78d371bf221f4f8905acd58f0bc74de7937f0bf692d45c61f0fabb"};
|
|
2
2
|
const __IMPORT_META_URL__ = require('url').pathToFileURL(__filename).href;
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -63470,7 +63470,6 @@ function createScreenRecordingRouter(service, auth) {
|
|
|
63470
63470
|
// backend/src/routes/server-management.ts
|
|
63471
63471
|
var import_express3 = __toESM(require_express2(), 1);
|
|
63472
63472
|
var import_node_crypto5 = require("node:crypto");
|
|
63473
|
-
var import_node_fs7 = require("node:fs");
|
|
63474
63473
|
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
63475
63474
|
|
|
63476
63475
|
// packages/config-node/src/context.ts
|
|
@@ -63492,21 +63491,57 @@ var ConfigurationError = class extends Error {
|
|
|
63492
63491
|
|
|
63493
63492
|
// packages/config-node/src/private-file.ts
|
|
63494
63493
|
var import_node_fs = require("node:fs");
|
|
63494
|
+
|
|
63495
|
+
// packages/config-node/src/windows-permissions.ts
|
|
63496
|
+
var import_node_child_process = require("node:child_process");
|
|
63497
|
+
function assertWindowsPrivatePath(file) {
|
|
63498
|
+
if (process.platform !== "win32") return;
|
|
63499
|
+
const script = `
|
|
63500
|
+
$ErrorActionPreference = 'Stop'
|
|
63501
|
+
# Use .NET directly: a parent pwsh may export a PSModulePath incompatible with Windows PowerShell.
|
|
63502
|
+
$acl = if ([IO.Directory]::Exists($env:RUNWEAVE_PRIVATE_PATH)) {
|
|
63503
|
+
[IO.Directory]::GetAccessControl($env:RUNWEAVE_PRIVATE_PATH)
|
|
63504
|
+
} else { [IO.File]::GetAccessControl($env:RUNWEAVE_PRIVATE_PATH) }
|
|
63505
|
+
$sid = [Security.Principal.WindowsIdentity]::GetCurrent().User
|
|
63506
|
+
$allowed = @($sid.Value, 'S-1-5-18', 'S-1-5-32-544')
|
|
63507
|
+
if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -notin $allowed) { throw 'owner' }
|
|
63508
|
+
foreach ($rule in $acl.GetAccessRules($true, $true, [Security.Principal.SecurityIdentifier])) {
|
|
63509
|
+
if ($rule.AccessControlType -eq 'Allow' -and $rule.IdentityReference.Value -notin $allowed) { throw 'access' }
|
|
63510
|
+
}
|
|
63511
|
+
`;
|
|
63512
|
+
try {
|
|
63513
|
+
(0, import_node_child_process.execFileSync)("powershell.exe", ["-NoProfile", "-NonInteractive", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")], {
|
|
63514
|
+
env: { ...process.env, RUNWEAVE_PRIVATE_PATH: file },
|
|
63515
|
+
stdio: "ignore",
|
|
63516
|
+
timeout: 1e4,
|
|
63517
|
+
windowsHide: true
|
|
63518
|
+
});
|
|
63519
|
+
} catch {
|
|
63520
|
+
throw new ConfigurationError("CONFIG_WINDOWS_ACL_NOT_PRIVATE", [file]);
|
|
63521
|
+
}
|
|
63522
|
+
}
|
|
63523
|
+
|
|
63524
|
+
// packages/config-node/src/private-file.ts
|
|
63495
63525
|
function assertPrivateDirectory(directory3) {
|
|
63496
63526
|
const stat20 = (0, import_node_fs.lstatSync)(directory3);
|
|
63497
|
-
if (!stat20.isDirectory() || stat20.isSymbolicLink() || stat20.mode & 63 || typeof process.getuid === "function" && stat20.uid !== process.getuid()) throw new ConfigurationError("CONFIG_ROOT_PERMISSIONS_INVALID");
|
|
63527
|
+
if (!stat20.isDirectory() || stat20.isSymbolicLink() || process.platform !== "win32" && stat20.mode & 63 || typeof process.getuid === "function" && stat20.uid !== process.getuid()) throw new ConfigurationError("CONFIG_ROOT_PERMISSIONS_INVALID");
|
|
63528
|
+
assertWindowsPrivatePath(directory3);
|
|
63498
63529
|
}
|
|
63499
|
-
function assertPrivateDescriptor(fd, maxBytes = 1024 * 1024) {
|
|
63530
|
+
function assertPrivateDescriptor(fd, maxBytes = 1024 * 1024, file) {
|
|
63500
63531
|
const stat20 = (0, import_node_fs.fstatSync)(fd);
|
|
63501
63532
|
if (!stat20.isFile() || stat20.nlink !== 1) throw new ConfigurationError("CONFIG_FILE_NOT_PRIVATE_REGULAR");
|
|
63502
63533
|
if (typeof process.getuid === "function" && stat20.uid !== process.getuid()) throw new ConfigurationError("CONFIG_FILE_OWNER_MISMATCH");
|
|
63503
|
-
if (stat20.mode & 63) throw new ConfigurationError("CONFIG_FILE_PERMISSIONS_INVALID");
|
|
63534
|
+
if (process.platform !== "win32" && stat20.mode & 63) throw new ConfigurationError("CONFIG_FILE_PERMISSIONS_INVALID");
|
|
63535
|
+
if (process.platform === "win32") {
|
|
63536
|
+
if (!file) throw new ConfigurationError("CONFIG_PRIVATE_PATH_REQUIRED");
|
|
63537
|
+
assertWindowsPrivatePath(file);
|
|
63538
|
+
}
|
|
63504
63539
|
if (stat20.size > maxBytes) throw new ConfigurationError("CONFIG_FILE_TOO_LARGE");
|
|
63505
63540
|
}
|
|
63506
63541
|
function readPrivateFile(file, maxBytes = 1024 * 1024) {
|
|
63507
63542
|
const fd = (0, import_node_fs.openSync)(file, import_node_fs.constants.O_RDONLY | import_node_fs.constants.O_NOFOLLOW);
|
|
63508
63543
|
try {
|
|
63509
|
-
assertPrivateDescriptor(fd, maxBytes);
|
|
63544
|
+
assertPrivateDescriptor(fd, maxBytes, file);
|
|
63510
63545
|
const source2 = (0, import_node_fs.readFileSync)(fd, "utf8");
|
|
63511
63546
|
if (Buffer.byteLength(source2) > maxBytes) throw new ConfigurationError("CONFIG_FILE_TOO_LARGE");
|
|
63512
63547
|
return source2;
|
|
@@ -63581,15 +63616,27 @@ function assertOwnedPath(context, value) {
|
|
|
63581
63616
|
}
|
|
63582
63617
|
}
|
|
63583
63618
|
|
|
63584
|
-
// packages/config-node/src/
|
|
63619
|
+
// packages/config-node/src/platform.ts
|
|
63585
63620
|
var import_node_fs3 = require("node:fs");
|
|
63621
|
+
function syncDirectory(directory3) {
|
|
63622
|
+
if (process.platform === "win32") return;
|
|
63623
|
+
const fd = (0, import_node_fs3.openSync)(directory3, "r");
|
|
63624
|
+
try {
|
|
63625
|
+
(0, import_node_fs3.fsyncSync)(fd);
|
|
63626
|
+
} finally {
|
|
63627
|
+
(0, import_node_fs3.closeSync)(fd);
|
|
63628
|
+
}
|
|
63629
|
+
}
|
|
63630
|
+
|
|
63631
|
+
// packages/config-node/src/owner.ts
|
|
63632
|
+
var import_node_fs4 = require("node:fs");
|
|
63586
63633
|
var import_node_path3 = __toESM(require("node:path"), 1);
|
|
63587
63634
|
var import_node_os3 = __toESM(require("node:os"), 1);
|
|
63588
63635
|
var import_node_crypto2 = require("node:crypto");
|
|
63589
63636
|
var import_fs_native_extensions = require("fs-native-extensions");
|
|
63590
63637
|
function ownerDirectory(context) {
|
|
63591
63638
|
const directory3 = context.kind === "stable" ? import_node_path3.default.join(import_node_os3.default.userInfo().homedir, ".runweave", "runtime") : import_node_path3.default.join(context.configRoot, "runtime");
|
|
63592
|
-
(0,
|
|
63639
|
+
(0, import_node_fs4.mkdirSync)(directory3, { recursive: true, mode: 448 });
|
|
63593
63640
|
assertPrivateDirectory(import_node_path3.default.dirname(directory3));
|
|
63594
63641
|
assertPrivateDirectory(directory3);
|
|
63595
63642
|
return directory3;
|
|
@@ -63598,11 +63645,11 @@ function registerStableConfigurationRoot(context) {
|
|
|
63598
63645
|
if (context.kind !== "stable") return;
|
|
63599
63646
|
const directory3 = ownerDirectory(context);
|
|
63600
63647
|
const registry2 = import_node_path3.default.join(directory3, "stable-root.json");
|
|
63601
|
-
const registryFd = (0,
|
|
63648
|
+
const registryFd = (0, import_node_fs4.openSync)(import_node_path3.default.join(directory3, "stable-root.lock"), import_node_fs4.constants.O_CREAT | import_node_fs4.constants.O_RDWR | import_node_fs4.constants.O_NOFOLLOW, 384);
|
|
63602
63649
|
try {
|
|
63603
|
-
assertPrivateDescriptor(registryFd);
|
|
63650
|
+
assertPrivateDescriptor(registryFd, void 0, import_node_path3.default.join(directory3, "stable-root.lock"));
|
|
63604
63651
|
if (!(0, import_fs_native_extensions.tryLock)(registryFd)) throw new ConfigurationError("CONFIG_ROOT_REGISTRATION_BUSY");
|
|
63605
|
-
if ((0,
|
|
63652
|
+
if ((0, import_node_fs4.existsSync)(registry2)) {
|
|
63606
63653
|
let stored;
|
|
63607
63654
|
try {
|
|
63608
63655
|
stored = JSON.parse(readPrivateFile(registry2));
|
|
@@ -63612,34 +63659,29 @@ function registerStableConfigurationRoot(context) {
|
|
|
63612
63659
|
if (!stored || typeof stored !== "object" || !("root" in stored) || stored.root !== canonicalPath(context.configRoot)) throw new ConfigurationError("CONFIG_STABLE_ROOT_CONFLICT");
|
|
63613
63660
|
} else {
|
|
63614
63661
|
const temporary = `${registry2}.${(0, import_node_crypto2.randomUUID)()}.tmp`;
|
|
63615
|
-
const file = (0,
|
|
63616
|
-
try {
|
|
63617
|
-
(0, import_node_fs3.writeFileSync)(file, JSON.stringify({ root: canonicalPath(context.configRoot) }));
|
|
63618
|
-
(0, import_node_fs3.fsyncSync)(file);
|
|
63619
|
-
} finally {
|
|
63620
|
-
(0, import_node_fs3.closeSync)(file);
|
|
63621
|
-
}
|
|
63622
|
-
(0, import_node_fs3.renameSync)(temporary, registry2);
|
|
63623
|
-
const parent = (0, import_node_fs3.openSync)(directory3, "r");
|
|
63662
|
+
const file = (0, import_node_fs4.openSync)(temporary, "wx", 384);
|
|
63624
63663
|
try {
|
|
63625
|
-
(0,
|
|
63664
|
+
(0, import_node_fs4.writeFileSync)(file, JSON.stringify({ root: canonicalPath(context.configRoot) }));
|
|
63665
|
+
(0, import_node_fs4.fsyncSync)(file);
|
|
63626
63666
|
} finally {
|
|
63627
|
-
(0,
|
|
63667
|
+
(0, import_node_fs4.closeSync)(file);
|
|
63628
63668
|
}
|
|
63669
|
+
(0, import_node_fs4.renameSync)(temporary, registry2);
|
|
63670
|
+
syncDirectory(directory3);
|
|
63629
63671
|
}
|
|
63630
63672
|
} finally {
|
|
63631
|
-
(0,
|
|
63673
|
+
(0, import_node_fs4.closeSync)(registryFd);
|
|
63632
63674
|
}
|
|
63633
63675
|
}
|
|
63634
63676
|
function withUpgradeGate(context, shared, run2) {
|
|
63635
63677
|
const directory3 = ownerDirectory(context);
|
|
63636
|
-
const fd = (0,
|
|
63678
|
+
const fd = (0, import_node_fs4.openSync)(import_node_path3.default.join(directory3, "configuration-upgrade.lock"), import_node_fs4.constants.O_CREAT | import_node_fs4.constants.O_RDWR | import_node_fs4.constants.O_NOFOLLOW, 384);
|
|
63637
63679
|
try {
|
|
63638
|
-
assertPrivateDescriptor(fd);
|
|
63680
|
+
assertPrivateDescriptor(fd, void 0, import_node_path3.default.join(directory3, "configuration-upgrade.lock"));
|
|
63639
63681
|
if (!(0, import_fs_native_extensions.tryLock)(fd, 0, 0, { shared })) throw new ConfigurationError("CONFIG_UPGRADE_BUSY");
|
|
63640
63682
|
return run2();
|
|
63641
63683
|
} finally {
|
|
63642
|
-
(0,
|
|
63684
|
+
(0, import_node_fs4.closeSync)(fd);
|
|
63643
63685
|
}
|
|
63644
63686
|
}
|
|
63645
63687
|
function withConfigurationUpgradeOwnership(context, run2, ignoredRoles = []) {
|
|
@@ -63647,16 +63689,16 @@ function withConfigurationUpgradeOwnership(context, run2, ignoredRoles = []) {
|
|
|
63647
63689
|
const directory3 = ownerDirectory(context);
|
|
63648
63690
|
const held = [];
|
|
63649
63691
|
try {
|
|
63650
|
-
for (const file of (0,
|
|
63692
|
+
for (const file of (0, import_node_fs4.readdirSync)(directory3).filter((name) => name.endsWith(".owner.lock"))) {
|
|
63651
63693
|
if (ignoredRoles.includes(file.replace(/\.owner\.lock$/, ""))) continue;
|
|
63652
|
-
const fd = (0,
|
|
63694
|
+
const fd = (0, import_node_fs4.openSync)(import_node_path3.default.join(directory3, file), import_node_fs4.constants.O_RDWR | import_node_fs4.constants.O_NOFOLLOW);
|
|
63653
63695
|
held.push(fd);
|
|
63654
|
-
assertPrivateDescriptor(fd);
|
|
63696
|
+
assertPrivateDescriptor(fd, void 0, import_node_path3.default.join(directory3, file));
|
|
63655
63697
|
if (!(0, import_fs_native_extensions.tryLock)(fd)) throw new ConfigurationError("CONFIG_UPGRADE_CONSUMER_RUNNING", [file.replace(/\.owner\.lock$/, "")]);
|
|
63656
63698
|
}
|
|
63657
63699
|
return run2();
|
|
63658
63700
|
} finally {
|
|
63659
|
-
for (const fd of held) (0,
|
|
63701
|
+
for (const fd of held) (0, import_node_fs4.closeSync)(fd);
|
|
63660
63702
|
}
|
|
63661
63703
|
});
|
|
63662
63704
|
}
|
|
@@ -63665,16 +63707,16 @@ function acquireConfigurationOwner(context, role) {
|
|
|
63665
63707
|
}
|
|
63666
63708
|
function acquireOwner(context, role) {
|
|
63667
63709
|
const directory3 = ownerDirectory(context);
|
|
63668
|
-
const fd = (0,
|
|
63710
|
+
const fd = (0, import_node_fs4.openSync)(import_node_path3.default.join(directory3, `${role}.owner.lock`), import_node_fs4.constants.O_CREAT | import_node_fs4.constants.O_RDWR | import_node_fs4.constants.O_NOFOLLOW, 384);
|
|
63669
63711
|
let closed = false;
|
|
63670
63712
|
const release = () => {
|
|
63671
63713
|
if (!closed) {
|
|
63672
63714
|
closed = true;
|
|
63673
|
-
(0,
|
|
63715
|
+
(0, import_node_fs4.closeSync)(fd);
|
|
63674
63716
|
}
|
|
63675
63717
|
};
|
|
63676
63718
|
try {
|
|
63677
|
-
assertPrivateDescriptor(fd);
|
|
63719
|
+
assertPrivateDescriptor(fd, void 0, import_node_path3.default.join(directory3, `${role}.owner.lock`));
|
|
63678
63720
|
if (!(0, import_fs_native_extensions.tryLock)(fd)) throw new ConfigurationError("CONFIG_INSTANCE_ALREADY_RUNNING", [role]);
|
|
63679
63721
|
registerStableConfigurationRoot(context);
|
|
63680
63722
|
return { release };
|
|
@@ -63997,7 +64039,7 @@ function migrateConfigurationDocument(document2) {
|
|
|
63997
64039
|
}
|
|
63998
64040
|
|
|
63999
64041
|
// packages/config-node/src/store.ts
|
|
64000
|
-
var
|
|
64042
|
+
var import_node_fs5 = require("node:fs");
|
|
64001
64043
|
var import_node_path5 = __toESM(require("node:path"), 1);
|
|
64002
64044
|
var import_node_crypto3 = require("node:crypto");
|
|
64003
64045
|
var import_yaml = __toESM(require_dist(), 1);
|
|
@@ -64192,10 +64234,11 @@ function parseConfigurationYaml(source2, context) {
|
|
|
64192
64234
|
return { document: document2, value, digest: (0, import_node_crypto3.createHash)("sha256").update(source2).digest("hex"), issues: validateDomains(value, context) };
|
|
64193
64235
|
}
|
|
64194
64236
|
function assertPrivateFile(file, fd) {
|
|
64195
|
-
const stat20 = fd === void 0 ? (0,
|
|
64237
|
+
const stat20 = fd === void 0 ? (0, import_node_fs5.lstatSync)(file) : (0, import_node_fs5.fstatSync)(fd);
|
|
64196
64238
|
if (!stat20.isFile() || stat20.isSymbolicLink() || stat20.nlink !== 1) throw new ConfigurationError("CONFIG_FILE_NOT_PRIVATE_REGULAR");
|
|
64197
64239
|
if (typeof process.getuid === "function" && stat20.uid !== process.getuid()) throw new ConfigurationError("CONFIG_FILE_OWNER_MISMATCH");
|
|
64198
|
-
if ((stat20.mode & 63) !== 0) throw new ConfigurationError("CONFIG_FILE_PERMISSIONS_INVALID");
|
|
64240
|
+
if (process.platform !== "win32" && (stat20.mode & 63) !== 0) throw new ConfigurationError("CONFIG_FILE_PERMISSIONS_INVALID");
|
|
64241
|
+
assertWindowsPrivatePath(file);
|
|
64199
64242
|
if (stat20.size > MAX_BYTES) throw new ConfigurationError("CONFIG_FILE_TOO_LARGE", [], { line: 1, column: 1 });
|
|
64200
64243
|
}
|
|
64201
64244
|
var ConfigurationStore = class {
|
|
@@ -64205,30 +64248,29 @@ var ConfigurationStore = class {
|
|
|
64205
64248
|
}
|
|
64206
64249
|
file;
|
|
64207
64250
|
read() {
|
|
64208
|
-
if (!(0,
|
|
64209
|
-
|
|
64210
|
-
if (!root.isDirectory() || root.isSymbolicLink() || root.mode & 63 || typeof process.getuid === "function" && root.uid !== process.getuid()) throw new ConfigurationError("CONFIG_ROOT_PERMISSIONS_INVALID");
|
|
64251
|
+
if (!(0, import_node_fs5.existsSync)(this.file)) throw new ConfigurationError("CONFIG_MIGRATION_REQUIRED");
|
|
64252
|
+
assertPrivateDirectory(this.context.configRoot);
|
|
64211
64253
|
assertPrivateFile(this.file);
|
|
64212
|
-
const fd = (0,
|
|
64254
|
+
const fd = (0, import_node_fs5.openSync)(this.file, import_node_fs5.constants.O_RDONLY | import_node_fs5.constants.O_NOFOLLOW);
|
|
64213
64255
|
try {
|
|
64214
64256
|
assertPrivateFile(this.file, fd);
|
|
64215
|
-
return parseConfigurationYaml((0,
|
|
64257
|
+
return parseConfigurationYaml((0, import_node_fs5.readFileSync)(fd, "utf8"), this.context);
|
|
64216
64258
|
} finally {
|
|
64217
|
-
(0,
|
|
64259
|
+
(0, import_node_fs5.closeSync)(fd);
|
|
64218
64260
|
}
|
|
64219
64261
|
}
|
|
64220
64262
|
locked(run2) {
|
|
64221
|
-
(0,
|
|
64222
|
-
const dirStat = (0,
|
|
64263
|
+
(0, import_node_fs5.mkdirSync)(this.context.configRoot, { recursive: true, mode: 448 });
|
|
64264
|
+
const dirStat = (0, import_node_fs5.lstatSync)(this.context.configRoot);
|
|
64223
64265
|
if (!dirStat.isDirectory() || dirStat.isSymbolicLink() || typeof process.getuid === "function" && dirStat.uid !== process.getuid()) throw new ConfigurationError("CONFIG_ROOT_OWNER_MISMATCH");
|
|
64224
|
-
|
|
64225
|
-
const fd = (0,
|
|
64266
|
+
assertPrivateDirectory(this.context.configRoot);
|
|
64267
|
+
const fd = (0, import_node_fs5.openSync)(import_node_path5.default.join(this.context.configRoot, "settings.lock"), import_node_fs5.constants.O_CREAT | import_node_fs5.constants.O_RDWR | import_node_fs5.constants.O_NOFOLLOW, 384);
|
|
64226
64268
|
try {
|
|
64227
64269
|
assertPrivateFile(import_node_path5.default.join(this.context.configRoot, "settings.lock"), fd);
|
|
64228
64270
|
if (!(0, import_fs_native_extensions2.tryLock)(fd)) throw new ConfigurationError("CONFIG_WRITE_BUSY");
|
|
64229
64271
|
return run2();
|
|
64230
64272
|
} finally {
|
|
64231
|
-
(0,
|
|
64273
|
+
(0, import_node_fs5.closeSync)(fd);
|
|
64232
64274
|
}
|
|
64233
64275
|
}
|
|
64234
64276
|
publish(document2, previous, backupId) {
|
|
@@ -64238,41 +64280,35 @@ var ConfigurationStore = class {
|
|
|
64238
64280
|
const temporary = `${this.file}.${(0, import_node_crypto3.randomUUID)()}.tmp`;
|
|
64239
64281
|
if (previous !== void 0) {
|
|
64240
64282
|
const backupRoot = import_node_path5.default.join(this.context.configRoot, "config-backups");
|
|
64241
|
-
(0,
|
|
64242
|
-
|
|
64243
|
-
if (!backupStat.isDirectory() || backupStat.isSymbolicLink() || backupStat.mode & 63 || typeof process.getuid === "function" && backupStat.uid !== process.getuid()) throw new ConfigurationError("CONFIG_BACKUP_ROOT_INVALID");
|
|
64283
|
+
(0, import_node_fs5.mkdirSync)(backupRoot, { recursive: true, mode: 448 });
|
|
64284
|
+
assertPrivateDirectory(backupRoot);
|
|
64244
64285
|
const backup = import_node_path5.default.join(backupRoot, backupId ?? `${Date.now()}-${(0, import_node_crypto3.randomUUID)()}.yaml`);
|
|
64245
|
-
const fd2 = (0,
|
|
64286
|
+
const fd2 = (0, import_node_fs5.openSync)(backup, "wx", 384);
|
|
64246
64287
|
try {
|
|
64247
|
-
(0,
|
|
64248
|
-
(0,
|
|
64288
|
+
(0, import_node_fs5.writeFileSync)(fd2, previous);
|
|
64289
|
+
(0, import_node_fs5.fsyncSync)(fd2);
|
|
64249
64290
|
} finally {
|
|
64250
|
-
(0,
|
|
64291
|
+
(0, import_node_fs5.closeSync)(fd2);
|
|
64251
64292
|
}
|
|
64252
64293
|
}
|
|
64253
|
-
const fd = (0,
|
|
64294
|
+
const fd = (0, import_node_fs5.openSync)(temporary, "wx", 384);
|
|
64254
64295
|
try {
|
|
64255
|
-
(0,
|
|
64256
|
-
(0,
|
|
64296
|
+
(0, import_node_fs5.writeFileSync)(fd, source2);
|
|
64297
|
+
(0, import_node_fs5.fsyncSync)(fd);
|
|
64257
64298
|
} finally {
|
|
64258
|
-
(0,
|
|
64299
|
+
(0, import_node_fs5.closeSync)(fd);
|
|
64259
64300
|
}
|
|
64260
64301
|
try {
|
|
64261
|
-
(0,
|
|
64262
|
-
|
|
64263
|
-
try {
|
|
64264
|
-
(0, import_node_fs4.fsyncSync)(parent);
|
|
64265
|
-
} finally {
|
|
64266
|
-
(0, import_node_fs4.closeSync)(parent);
|
|
64267
|
-
}
|
|
64302
|
+
(0, import_node_fs5.renameSync)(temporary, this.file);
|
|
64303
|
+
syncDirectory(this.context.configRoot);
|
|
64268
64304
|
} finally {
|
|
64269
|
-
if ((0,
|
|
64305
|
+
if ((0, import_node_fs5.existsSync)(temporary)) (0, import_node_fs5.unlinkSync)(temporary);
|
|
64270
64306
|
}
|
|
64271
64307
|
return checked;
|
|
64272
64308
|
}
|
|
64273
64309
|
initialize(value) {
|
|
64274
64310
|
return this.locked(() => {
|
|
64275
|
-
if ((0,
|
|
64311
|
+
if ((0, import_node_fs5.existsSync)(this.file)) throw new ConfigurationError("CONFIG_ALREADY_EXISTS");
|
|
64276
64312
|
validateEnvelope(value, this.context);
|
|
64277
64313
|
const issues = validateDomains(value, this.context);
|
|
64278
64314
|
if (Object.keys(issues).length) throw new ConfigurationError("CONFIG_VALIDATION_FAILED", Object.values(issues).flat().map((item) => item.path));
|
|
@@ -64312,9 +64348,9 @@ var ConfigurationStore = class {
|
|
|
64312
64348
|
}
|
|
64313
64349
|
backups() {
|
|
64314
64350
|
const root = import_node_path5.default.join(this.context.configRoot, "config-backups");
|
|
64315
|
-
if (!(0,
|
|
64351
|
+
if (!(0, import_node_fs5.existsSync)(root)) return [];
|
|
64316
64352
|
assertPrivateDirectory(root);
|
|
64317
|
-
return (0,
|
|
64353
|
+
return (0, import_node_fs5.readdirSync)(root).filter((id7) => /^\d+-[a-f0-9-]+\.yaml$/.test(id7)).sort().reverse().map((id7) => {
|
|
64318
64354
|
try {
|
|
64319
64355
|
const backup = this.readBackup(id7);
|
|
64320
64356
|
return { id: id7, revision: backup.value.revision, schemaVersion: backup.value.schemaVersion, compatible: true };
|
|
@@ -64392,23 +64428,18 @@ var ConfigurationStore = class {
|
|
|
64392
64428
|
recordUpgrade(value) {
|
|
64393
64429
|
const file = import_node_path5.default.join(this.context.configRoot, "config-upgrade.json");
|
|
64394
64430
|
const temporary = `${file}.${(0, import_node_crypto3.randomUUID)()}.tmp`;
|
|
64395
|
-
const fd = (0,
|
|
64431
|
+
const fd = (0, import_node_fs5.openSync)(temporary, "wx", 384);
|
|
64396
64432
|
try {
|
|
64397
|
-
(0,
|
|
64398
|
-
(0,
|
|
64433
|
+
(0, import_node_fs5.writeFileSync)(fd, JSON.stringify(value, null, 2) + "\n");
|
|
64434
|
+
(0, import_node_fs5.fsyncSync)(fd);
|
|
64399
64435
|
} finally {
|
|
64400
|
-
(0,
|
|
64436
|
+
(0, import_node_fs5.closeSync)(fd);
|
|
64401
64437
|
}
|
|
64402
64438
|
try {
|
|
64403
|
-
(0,
|
|
64404
|
-
|
|
64405
|
-
try {
|
|
64406
|
-
(0, import_node_fs4.fsyncSync)(parent);
|
|
64407
|
-
} finally {
|
|
64408
|
-
(0, import_node_fs4.closeSync)(parent);
|
|
64409
|
-
}
|
|
64439
|
+
(0, import_node_fs5.renameSync)(temporary, file);
|
|
64440
|
+
syncDirectory(this.context.configRoot);
|
|
64410
64441
|
} finally {
|
|
64411
|
-
if ((0,
|
|
64442
|
+
if ((0, import_node_fs5.existsSync)(temporary)) (0, import_node_fs5.unlinkSync)(temporary);
|
|
64412
64443
|
}
|
|
64413
64444
|
}
|
|
64414
64445
|
upgrade(expected) {
|
|
@@ -64417,7 +64448,7 @@ var ConfigurationStore = class {
|
|
|
64417
64448
|
if (preview.expectedRevision !== expected.revision || preview.expectedDigest !== expected.digest) throw new ConfigurationError("CONFIG_REVISION_CONFLICT");
|
|
64418
64449
|
if (!preview.changed) {
|
|
64419
64450
|
const receiptFile = import_node_path5.default.join(this.context.configRoot, "config-upgrade.json");
|
|
64420
|
-
if ((0,
|
|
64451
|
+
if ((0, import_node_fs5.existsSync)(receiptFile)) {
|
|
64421
64452
|
const receipt = JSON.parse(readPrivateFile(receiptFile));
|
|
64422
64453
|
if (isConfigurationObject(receipt) && receipt.phase === "prepared" && receipt.plannedDigest === expected.digest)
|
|
64423
64454
|
this.recordUpgrade({ ...receipt, phase: "committed", savedRevision: expected.revision, digest: expected.digest });
|
|
@@ -64451,9 +64482,9 @@ var ConfigurationStore = class {
|
|
|
64451
64482
|
previous(keys) {
|
|
64452
64483
|
const current = this.read();
|
|
64453
64484
|
const root = import_node_path5.default.join(this.context.configRoot, "config-backups");
|
|
64454
|
-
if (!(0,
|
|
64485
|
+
if (!(0, import_node_fs5.existsSync)(root)) throw new ConfigurationError("CONFIG_BACKUP_UNAVAILABLE");
|
|
64455
64486
|
assertPrivateDirectory(root);
|
|
64456
|
-
const candidates = (0,
|
|
64487
|
+
const candidates = (0, import_node_fs5.readdirSync)(root).filter((file) => /^\d+-[a-f0-9-]+\.yaml$/.test(file)).sort().reverse();
|
|
64457
64488
|
for (const candidate of candidates) {
|
|
64458
64489
|
const file = import_node_path5.default.join(root, candidate);
|
|
64459
64490
|
const previous = parseConfigurationYaml(readPrivateFile(file), this.context);
|
|
@@ -64465,7 +64496,7 @@ var ConfigurationStore = class {
|
|
|
64465
64496
|
}
|
|
64466
64497
|
migrate(value, expected) {
|
|
64467
64498
|
return this.locked(() => {
|
|
64468
|
-
const current = (0,
|
|
64499
|
+
const current = (0, import_node_fs5.existsSync)(this.file) ? this.read() : null;
|
|
64469
64500
|
if (current ? !expected || current.value.revision !== expected.revision || current.digest !== expected.digest : expected !== null) throw new ConfigurationError("CONFIG_REVISION_CONFLICT");
|
|
64470
64501
|
validateEnvelope(value, this.context);
|
|
64471
64502
|
const issues = validateDomains(value, this.context);
|
|
@@ -64679,14 +64710,14 @@ function configurationPath(key2, relativeDefault) {
|
|
|
64679
64710
|
}
|
|
64680
64711
|
|
|
64681
64712
|
// packages/config-node/src/research-mcp.ts
|
|
64682
|
-
var
|
|
64713
|
+
var import_node_fs6 = require("node:fs");
|
|
64683
64714
|
var import_node_path7 = __toESM(require("node:path"), 1);
|
|
64684
64715
|
function researchMcpHome() {
|
|
64685
64716
|
return import_node_path7.default.join(resolveConfigurationContext().configRoot, "research-mcp");
|
|
64686
64717
|
}
|
|
64687
64718
|
function readResearchMcpInstallation() {
|
|
64688
64719
|
const file = import_node_path7.default.join(researchMcpHome(), "installation.json");
|
|
64689
|
-
if (!(0,
|
|
64720
|
+
if (!(0, import_node_fs6.existsSync)(file)) return null;
|
|
64690
64721
|
const value = JSON.parse(readPrivateFile(file));
|
|
64691
64722
|
if (value.version !== 1 || value.instanceId !== resolveConfigurationContext().instanceId || typeof value.enabled !== "boolean" || !Number.isInteger(value.port) || value.port < 1 || value.port > 65535 || ![value.entry, value.node, value.cwd].every((v) => typeof v === "string" && import_node_path7.default.isAbsolute(v)) || typeof value.sourceRevision !== "string" || typeof value.releaseId !== "string" || !Number.isFinite(value.installedAt) || value.tunnel !== null && (!value.tunnel || !/^[a-zA-Z0-9_-]+$/.test(value.tunnel.profile) || ![value.tunnel.executable, value.tunnel.profileDir, value.tunnel.healthFile].every((v) => typeof v === "string" && import_node_path7.default.isAbsolute(v)))) {
|
|
64692
64723
|
throw new Error("Invalid research MCP installation identity");
|
|
@@ -64695,7 +64726,7 @@ function readResearchMcpInstallation() {
|
|
|
64695
64726
|
}
|
|
64696
64727
|
|
|
64697
64728
|
// packages/config-node/src/runtime-status.ts
|
|
64698
|
-
var
|
|
64729
|
+
var import_node_fs7 = require("node:fs");
|
|
64699
64730
|
var import_node_path8 = __toESM(require("node:path"), 1);
|
|
64700
64731
|
var import_node_os4 = __toESM(require("node:os"), 1);
|
|
64701
64732
|
|
|
@@ -64942,14 +64973,14 @@ function validateLocalRuntimeStatusReport(value, source2) {
|
|
|
64942
64973
|
function readNativeHostRuntimeStatusReport() {
|
|
64943
64974
|
const root = import_node_path8.default.join(import_node_os4.default.homedir(), "Library", "Application Support", "RemoteDesk");
|
|
64944
64975
|
const file = import_node_path8.default.join(root, "runtime-status.json");
|
|
64945
|
-
if (!(0,
|
|
64976
|
+
if (!(0, import_node_fs7.existsSync)(file)) return null;
|
|
64946
64977
|
assertPrivateDirectory(root);
|
|
64947
|
-
return { report: validateLocalRuntimeStatusReport(JSON.parse(readPrivateFile(file, 64 * 1024)), "remote-desktop-host"), receivedAt: (0,
|
|
64978
|
+
return { report: validateLocalRuntimeStatusReport(JSON.parse(readPrivateFile(file, 64 * 1024)), "remote-desktop-host"), receivedAt: (0, import_node_fs7.statSync)(file).mtimeMs };
|
|
64948
64979
|
}
|
|
64949
64980
|
function readNativeHostSharingEnabled() {
|
|
64950
64981
|
const root = import_node_path8.default.join(import_node_os4.default.homedir(), "Library", "Application Support", "RemoteDesk");
|
|
64951
64982
|
const file = import_node_path8.default.join(root, "local-host.json");
|
|
64952
|
-
if (!(0,
|
|
64983
|
+
if (!(0, import_node_fs7.existsSync)(file)) return false;
|
|
64953
64984
|
assertPrivateDirectory(root);
|
|
64954
64985
|
const value = JSON.parse(readPrivateFile(file, 16 * 1024));
|
|
64955
64986
|
if (value.schemaVersion !== 1 || typeof value.running !== "boolean") throw new Error("Invalid native Host sharing intent");
|
|
@@ -64958,13 +64989,13 @@ function readNativeHostSharingEnabled() {
|
|
|
64958
64989
|
function readLocalRuntimeStatusReport(source2) {
|
|
64959
64990
|
const root = directory();
|
|
64960
64991
|
const file = import_node_path8.default.join(root, `${source2}.json`);
|
|
64961
|
-
if (!(0,
|
|
64992
|
+
if (!(0, import_node_fs7.existsSync)(file)) return null;
|
|
64962
64993
|
assertPrivateDirectory(root);
|
|
64963
64994
|
const value = JSON.parse(readPrivateFile(file, 256 * 1024));
|
|
64964
64995
|
if (value.instanceId !== configuration().context.instanceId) throw new Error("Local runtime status instance mismatch");
|
|
64965
64996
|
const report2 = validateLocalRuntimeStatusReport(value.report, source2);
|
|
64966
64997
|
if (value.stopped === true && report2.items.some((item) => item.state !== "disabled")) throw new Error("Invalid stopped owner report");
|
|
64967
|
-
return { report: report2, receivedAt: (0,
|
|
64998
|
+
return { report: report2, receivedAt: (0, import_node_fs7.statSync)(file).mtimeMs, stopped: value.stopped === true };
|
|
64968
64999
|
}
|
|
64969
65000
|
function readInstalledRuntimeBuild(entry) {
|
|
64970
65001
|
if (!entry || !import_node_path8.default.isAbsolute(entry)) return null;
|
|
@@ -64976,23 +65007,23 @@ function readInstalledRuntimeBuild(entry) {
|
|
|
64976
65007
|
const root = entry.slice(0, index);
|
|
64977
65008
|
const relative = entry.slice(index + marker.length).split(import_node_path8.default.sep).slice(1);
|
|
64978
65009
|
const pointer = import_node_path8.default.join(root, "current.json");
|
|
64979
|
-
if ((0,
|
|
64980
|
-
const selected = JSON.parse((0,
|
|
65010
|
+
if ((0, import_node_fs7.existsSync)(pointer)) {
|
|
65011
|
+
const selected = JSON.parse((0, import_node_fs7.readFileSync)(pointer, "utf8"));
|
|
64981
65012
|
if (!/^[a-zA-Z0-9._-]+$/.test(selected.releaseId) || [".", ".."].includes(selected.releaseId)) return null;
|
|
64982
65013
|
entry = import_node_path8.default.join(root, "releases", selected.releaseId, ...relative);
|
|
64983
65014
|
}
|
|
64984
65015
|
}
|
|
64985
|
-
fd = (0,
|
|
65016
|
+
fd = (0, import_node_fs7.openSync)(entry, "r");
|
|
64986
65017
|
const buffer = Buffer.alloc(8192);
|
|
64987
|
-
const length = (0,
|
|
65018
|
+
const length = (0, import_node_fs7.readSync)(fd, buffer, 0, buffer.length, 0);
|
|
64988
65019
|
const match = buffer.subarray(0, length).toString("utf8").split("\n", 1)[0]?.match(/var __RUNWEAVE_BUILD_INFO__=(\{.*\});/);
|
|
64989
65020
|
const metadata = import_node_path8.default.join(import_node_path8.default.dirname(entry), "release.json");
|
|
64990
|
-
const value = match ? JSON.parse(match[1]) : JSON.parse((0,
|
|
65021
|
+
const value = match ? JSON.parse(match[1]) : JSON.parse((0, import_node_fs7.readFileSync)((0, import_node_fs7.existsSync)(metadata) ? metadata : import_node_path8.default.join(import_node_path8.default.dirname(entry), "build-info.json"), "utf8"));
|
|
64991
65022
|
return typeof value.version === "string" && typeof value.buildId === "string" ? value : null;
|
|
64992
65023
|
} catch {
|
|
64993
65024
|
return null;
|
|
64994
65025
|
} finally {
|
|
64995
|
-
if (fd !== void 0) (0,
|
|
65026
|
+
if (fd !== void 0) (0, import_node_fs7.closeSync)(fd);
|
|
64996
65027
|
}
|
|
64997
65028
|
}
|
|
64998
65029
|
|
|
@@ -65093,10 +65124,7 @@ function createServerManagementRouter(runtime, registry2) {
|
|
|
65093
65124
|
"server",
|
|
65094
65125
|
"management-token"
|
|
65095
65126
|
);
|
|
65096
|
-
const
|
|
65097
|
-
if (!stat20.isFile() || stat20.mode & 63 || stat20.uid !== process.getuid?.())
|
|
65098
|
-
throw new Error("Invalid management token file");
|
|
65099
|
-
const expected = Buffer.from((0, import_node_fs7.readFileSync)(file, "utf8").trim());
|
|
65127
|
+
const expected = Buffer.from(readPrivateFile(file, 4096).trim());
|
|
65100
65128
|
const actual = Buffer.from(req.header("x-runweave-server-token") ?? "");
|
|
65101
65129
|
if (!expected.length || actual.length !== expected.length || !(0, import_node_crypto5.timingSafeEqual)(expected, actual))
|
|
65102
65130
|
throw new Error("Invalid token");
|
|
@@ -69895,7 +69923,7 @@ function isCodexConversationContext(value) {
|
|
|
69895
69923
|
}
|
|
69896
69924
|
|
|
69897
69925
|
// backend/src/voice/codex-app-server-client.ts
|
|
69898
|
-
var
|
|
69926
|
+
var import_node_child_process2 = require("node:child_process");
|
|
69899
69927
|
var import_node_fs10 = require("node:fs");
|
|
69900
69928
|
var import_node_os6 = __toESM(require("node:os"), 1);
|
|
69901
69929
|
var import_node_path15 = __toESM(require("node:path"), 1);
|
|
@@ -70367,7 +70395,7 @@ var CodexAppServerClient = class {
|
|
|
70367
70395
|
this.stdoutBuffer = "";
|
|
70368
70396
|
this.stderrBuffer = "";
|
|
70369
70397
|
const launchPlan = resolveCodexLaunchPlan(process.env, this.provider);
|
|
70370
|
-
const child = (0,
|
|
70398
|
+
const child = (0, import_node_child_process2.spawn)(launchPlan.command, launchPlan.args, {
|
|
70371
70399
|
env: buildCodexProcessEnv(process.env, launchPlan),
|
|
70372
70400
|
stdio: ["pipe", "pipe", "pipe"]
|
|
70373
70401
|
});
|
|
@@ -71839,10 +71867,6 @@ function normalizeCommand(command) {
|
|
|
71839
71867
|
}
|
|
71840
71868
|
function resolveDefaultTerminalCommand() {
|
|
71841
71869
|
if (process.platform === "win32") {
|
|
71842
|
-
const configured2 = process.env.COMSPEC?.trim();
|
|
71843
|
-
if (configured2) {
|
|
71844
|
-
return configured2;
|
|
71845
|
-
}
|
|
71846
71870
|
return "powershell.exe";
|
|
71847
71871
|
}
|
|
71848
71872
|
const configured = process.env.SHELL?.trim();
|
|
@@ -72275,7 +72299,7 @@ function isDisabledColorFlag(value) {
|
|
|
72275
72299
|
// backend/src/terminal/tmux/process.ts
|
|
72276
72300
|
var import_node_fs16 = require("node:fs");
|
|
72277
72301
|
var import_promises8 = require("node:fs/promises");
|
|
72278
|
-
var
|
|
72302
|
+
var import_node_child_process3 = require("node:child_process");
|
|
72279
72303
|
var import_node_crypto13 = require("node:crypto");
|
|
72280
72304
|
var import_node_os8 = __toESM(require("node:os"), 1);
|
|
72281
72305
|
var import_node_path24 = __toESM(require("node:path"), 1);
|
|
@@ -72557,7 +72581,7 @@ function shellQuote2(value) {
|
|
|
72557
72581
|
}
|
|
72558
72582
|
|
|
72559
72583
|
// backend/src/terminal/tmux/process.ts
|
|
72560
|
-
var execFileAsync = (0, import_node_util.promisify)(
|
|
72584
|
+
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process3.execFile);
|
|
72561
72585
|
var TmuxProcess = class {
|
|
72562
72586
|
execFileImpl;
|
|
72563
72587
|
env;
|
|
@@ -75388,7 +75412,7 @@ var ResourceCounters = class {
|
|
|
75388
75412
|
};
|
|
75389
75413
|
|
|
75390
75414
|
// backend/src/resource-monitor/sampler.ts
|
|
75391
|
-
var
|
|
75415
|
+
var import_node_child_process4 = require("node:child_process");
|
|
75392
75416
|
var import_node_crypto17 = require("node:crypto");
|
|
75393
75417
|
var import_node_os10 = __toESM(require("node:os"), 1);
|
|
75394
75418
|
var import_node_path25 = __toESM(require("node:path"), 1);
|
|
@@ -75449,7 +75473,7 @@ function signedBatteryCurrent(value) {
|
|
|
75449
75473
|
// backend/src/resource-monitor/sampler.ts
|
|
75450
75474
|
function runCommand(command, args, signal) {
|
|
75451
75475
|
return new Promise((resolve, reject) => {
|
|
75452
|
-
(0,
|
|
75476
|
+
(0, import_node_child_process4.execFile)(
|
|
75453
75477
|
command,
|
|
75454
75478
|
args,
|
|
75455
75479
|
{
|
|
@@ -78499,12 +78523,12 @@ async function readFinalReply(read, event, signal) {
|
|
|
78499
78523
|
}
|
|
78500
78524
|
|
|
78501
78525
|
// backend/src/task-supervision/deliverables.ts
|
|
78502
|
-
var
|
|
78526
|
+
var import_node_child_process5 = require("node:child_process");
|
|
78503
78527
|
var import_node_fs18 = require("node:fs");
|
|
78504
78528
|
var import_promises13 = require("node:fs/promises");
|
|
78505
78529
|
var import_node_path28 = __toESM(require("node:path"), 1);
|
|
78506
78530
|
var import_node_util2 = require("node:util");
|
|
78507
|
-
var run = (0, import_node_util2.promisify)(
|
|
78531
|
+
var run = (0, import_node_util2.promisify)(import_node_child_process5.execFile);
|
|
78508
78532
|
var MAX_ITEMS = 5;
|
|
78509
78533
|
var MAX_DOCUMENT_BYTES = 24e3;
|
|
78510
78534
|
var MAX_TOTAL_BYTES = 48e3;
|
|
@@ -79673,7 +79697,7 @@ var import_promises16 = require("node:fs/promises");
|
|
|
79673
79697
|
var import_node_path30 = __toESM(require("node:path"), 1);
|
|
79674
79698
|
|
|
79675
79699
|
// backend/src/evolution/providers/process-runner.ts
|
|
79676
|
-
var
|
|
79700
|
+
var import_node_child_process6 = require("node:child_process");
|
|
79677
79701
|
var import_node_path29 = __toESM(require("node:path"), 1);
|
|
79678
79702
|
|
|
79679
79703
|
// backend/src/evolution/providers/output.ts
|
|
@@ -79759,7 +79783,7 @@ async function runProviderProcess(params) {
|
|
|
79759
79783
|
params.request.workingDirectory,
|
|
79760
79784
|
"last-message.json"
|
|
79761
79785
|
);
|
|
79762
|
-
const child = (0,
|
|
79786
|
+
const child = (0, import_node_child_process6.spawn)(
|
|
79763
79787
|
params.binary,
|
|
79764
79788
|
[...params.args, "--output-last-message", outputFile, "-"],
|
|
79765
79789
|
{
|
|
@@ -81773,12 +81797,12 @@ var feedbackSchema = external_exports.object({
|
|
|
81773
81797
|
var cwdSchema = external_exports.string().trim().min(1).max(4e3);
|
|
81774
81798
|
|
|
81775
81799
|
// backend/src/repository/identity.ts
|
|
81776
|
-
var
|
|
81800
|
+
var import_node_child_process7 = require("node:child_process");
|
|
81777
81801
|
var import_node_crypto28 = require("node:crypto");
|
|
81778
81802
|
var import_promises20 = require("node:fs/promises");
|
|
81779
81803
|
var import_node_path36 = __toESM(require("node:path"), 1);
|
|
81780
81804
|
var import_node_util3 = require("node:util");
|
|
81781
|
-
var exec = (0, import_node_util3.promisify)(
|
|
81805
|
+
var exec = (0, import_node_util3.promisify)(import_node_child_process7.execFile);
|
|
81782
81806
|
async function resolveRepositoryIdentity(cwd) {
|
|
81783
81807
|
if (!import_node_path36.default.isAbsolute(cwd)) throw new Error("repository_cwd_must_be_absolute");
|
|
81784
81808
|
const env = { ...process.env };
|
|
@@ -85415,7 +85439,7 @@ function createAuthRouter(authService, options) {
|
|
|
85415
85439
|
var import_express21 = __toESM(require_express2(), 1);
|
|
85416
85440
|
|
|
85417
85441
|
// backend/src/terminal/git/home-branch-status.ts
|
|
85418
|
-
var
|
|
85442
|
+
var import_node_child_process8 = require("node:child_process");
|
|
85419
85443
|
var import_promises23 = require("node:fs/promises");
|
|
85420
85444
|
var import_node_util5 = require("node:util");
|
|
85421
85445
|
|
|
@@ -85428,7 +85452,7 @@ var BranchUpdatesTargetChangedError = class extends Error {
|
|
|
85428
85452
|
super("Branch updates target changed");
|
|
85429
85453
|
}
|
|
85430
85454
|
};
|
|
85431
|
-
var exec2 = (0, import_node_util5.promisify)(
|
|
85455
|
+
var exec2 = (0, import_node_util5.promisify)(import_node_child_process8.execFile);
|
|
85432
85456
|
var TTL = 10 * 6e4;
|
|
85433
85457
|
var RECHECK_TTL = 2e3;
|
|
85434
85458
|
async function git(cwd, args) {
|
|
@@ -86287,7 +86311,7 @@ function createAgentModelCatalogRouter(service) {
|
|
|
86287
86311
|
var import_express25 = __toESM(require_express2(), 1);
|
|
86288
86312
|
|
|
86289
86313
|
// backend/src/race/race-service.ts
|
|
86290
|
-
var
|
|
86314
|
+
var import_node_child_process10 = require("node:child_process");
|
|
86291
86315
|
var import_node_crypto35 = require("node:crypto");
|
|
86292
86316
|
|
|
86293
86317
|
// packages/shared/src/terminal/project-context.ts
|
|
@@ -87067,7 +87091,7 @@ function delay5(ms) {
|
|
|
87067
87091
|
}
|
|
87068
87092
|
|
|
87069
87093
|
// backend/src/race/race-worktree-supply.ts
|
|
87070
|
-
var
|
|
87094
|
+
var import_node_child_process9 = require("node:child_process");
|
|
87071
87095
|
var import_promises26 = require("node:fs/promises");
|
|
87072
87096
|
var import_node_path44 = __toESM(require("node:path"), 1);
|
|
87073
87097
|
var MAX_GIT_OUTPUT_BYTES = 4 * 1024 * 1024;
|
|
@@ -87080,7 +87104,7 @@ var RaceWorktreeSupplyError = class extends Error {
|
|
|
87080
87104
|
};
|
|
87081
87105
|
function runGit(cwd, args, timeout = 3e4) {
|
|
87082
87106
|
return new Promise((resolve, reject) => {
|
|
87083
|
-
(0,
|
|
87107
|
+
(0, import_node_child_process9.execFile)(
|
|
87084
87108
|
"git",
|
|
87085
87109
|
["-C", cwd, ...args],
|
|
87086
87110
|
{
|
|
@@ -87357,7 +87381,7 @@ function parseTraexModels(output) {
|
|
|
87357
87381
|
}
|
|
87358
87382
|
function listTraexModels() {
|
|
87359
87383
|
return new Promise((resolve) => {
|
|
87360
|
-
(0,
|
|
87384
|
+
(0, import_node_child_process10.execFile)(
|
|
87361
87385
|
"traex",
|
|
87362
87386
|
["models"],
|
|
87363
87387
|
{
|
|
@@ -90519,7 +90543,7 @@ function registerBrowserAssistanceRoutes(router, manager, options) {
|
|
|
90519
90543
|
}
|
|
90520
90544
|
|
|
90521
90545
|
// backend/src/terminal/preview/change-content.ts
|
|
90522
|
-
var
|
|
90546
|
+
var import_node_child_process11 = require("node:child_process");
|
|
90523
90547
|
var import_node_crypto42 = require("node:crypto");
|
|
90524
90548
|
var import_node_fs24 = require("node:fs");
|
|
90525
90549
|
var import_promises27 = require("node:fs/promises");
|
|
@@ -90559,7 +90583,7 @@ function detectImageMimeType(buffer, filePath) {
|
|
|
90559
90583
|
}
|
|
90560
90584
|
|
|
90561
90585
|
// backend/src/terminal/preview/change-content.ts
|
|
90562
|
-
var exec3 = (0, import_node_util6.promisify)(
|
|
90586
|
+
var exec3 = (0, import_node_util6.promisify)(import_node_child_process11.execFile);
|
|
90563
90587
|
var TEXT_LIMIT = 1024 * 1024;
|
|
90564
90588
|
async function git2(root, args, maxBuffer = 1024 * 1024) {
|
|
90565
90589
|
return (await exec3("git", args, {
|
|
@@ -90698,11 +90722,11 @@ async function readChangeContent(options) {
|
|
|
90698
90722
|
}
|
|
90699
90723
|
|
|
90700
90724
|
// backend/src/terminal/preview/git.ts
|
|
90701
|
-
var
|
|
90725
|
+
var import_node_child_process12 = require("node:child_process");
|
|
90702
90726
|
var import_promises28 = require("node:fs/promises");
|
|
90703
90727
|
var import_node_path47 = __toESM(require("node:path"), 1);
|
|
90704
90728
|
var import_node_util7 = require("node:util");
|
|
90705
|
-
var execFileAsync2 = (0, import_node_util7.promisify)(
|
|
90729
|
+
var execFileAsync2 = (0, import_node_util7.promisify)(import_node_child_process12.execFile);
|
|
90706
90730
|
var GitRepositoryMissingError = class extends TerminalPreviewError {
|
|
90707
90731
|
constructor() {
|
|
90708
90732
|
super("This project is not a Git repository.", 400);
|
|
@@ -90995,11 +91019,11 @@ var import_promises30 = require("node:fs/promises");
|
|
|
90995
91019
|
var import_node_path49 = __toESM(require("node:path"), 1);
|
|
90996
91020
|
|
|
90997
91021
|
// backend/src/terminal/preview/search-candidates.ts
|
|
90998
|
-
var
|
|
91022
|
+
var import_node_child_process13 = require("node:child_process");
|
|
90999
91023
|
var import_promises29 = require("node:fs/promises");
|
|
91000
91024
|
var import_node_path48 = __toESM(require("node:path"), 1);
|
|
91001
91025
|
var import_node_util8 = require("node:util");
|
|
91002
|
-
var execFileAsync3 = (0, import_node_util8.promisify)(
|
|
91026
|
+
var execFileAsync3 = (0, import_node_util8.promisify)(import_node_child_process13.execFile);
|
|
91003
91027
|
var terminalPreviewLogger = logger.child({ component: "terminal-preview" });
|
|
91004
91028
|
var RG_SEARCH_TIMEOUT_MS = 15e3;
|
|
91005
91029
|
var RG_SEARCH_MAX_BUFFER_BYTES = 32 * 1024 * 1024;
|
|
@@ -91785,7 +91809,7 @@ async function searchPreviewFolders(params) {
|
|
|
91785
91809
|
}
|
|
91786
91810
|
|
|
91787
91811
|
// backend/src/terminal/preview/content-search.ts
|
|
91788
|
-
var
|
|
91812
|
+
var import_node_child_process14 = require("node:child_process");
|
|
91789
91813
|
var import_promises31 = require("node:fs/promises");
|
|
91790
91814
|
var import_node_path51 = __toESM(require("node:path"), 1);
|
|
91791
91815
|
var DEFAULT_CONTENT_SEARCH_LIMIT = 50;
|
|
@@ -91941,7 +91965,7 @@ function findLiteralRanges(params) {
|
|
|
91941
91965
|
function searchContentWithRipgrep(params) {
|
|
91942
91966
|
throwIfSearchStopped(params.signal);
|
|
91943
91967
|
return new Promise((resolve, reject) => {
|
|
91944
|
-
const child = (0,
|
|
91968
|
+
const child = (0, import_node_child_process14.spawn)("rg", buildRgContentArgs(params.query), {
|
|
91945
91969
|
cwd: params.projectPath,
|
|
91946
91970
|
stdio: ["ignore", "pipe", "pipe"]
|
|
91947
91971
|
});
|
|
@@ -93019,7 +93043,7 @@ function registerTerminalPreviewRoutes(router, terminalSessionManager) {
|
|
|
93019
93043
|
}
|
|
93020
93044
|
|
|
93021
93045
|
// backend/src/routes/terminal/projects/index.ts
|
|
93022
|
-
var
|
|
93046
|
+
var import_node_child_process15 = require("node:child_process");
|
|
93023
93047
|
var import_node_util9 = require("node:util");
|
|
93024
93048
|
|
|
93025
93049
|
// backend/src/terminal/workspace-service/errors.ts
|
|
@@ -93172,7 +93196,7 @@ async function resolveMainBranchInput(raw) {
|
|
|
93172
93196
|
const branch = raw?.trim() || null;
|
|
93173
93197
|
if (branch === null) return null;
|
|
93174
93198
|
try {
|
|
93175
|
-
const { stdout } = await (0, import_node_util9.promisify)(
|
|
93199
|
+
const { stdout } = await (0, import_node_util9.promisify)(import_node_child_process15.execFile)("git", ["check-ref-format", "--branch", branch], { timeout: 5e3 });
|
|
93176
93200
|
if (stdout.trim() === branch) return branch;
|
|
93177
93201
|
} catch {
|
|
93178
93202
|
}
|
|
@@ -93350,17 +93374,17 @@ function registerTerminalProjectRoutes(router, terminalSessionManager, options)
|
|
|
93350
93374
|
}
|
|
93351
93375
|
|
|
93352
93376
|
// backend/src/terminal/workspace-service/worktree-deletion.ts
|
|
93353
|
-
var
|
|
93377
|
+
var import_node_child_process17 = require("node:child_process");
|
|
93354
93378
|
var import_promises35 = require("node:fs/promises");
|
|
93355
93379
|
var import_node_path56 = __toESM(require("node:path"), 1);
|
|
93356
93380
|
|
|
93357
93381
|
// backend/src/terminal/workspace-service/dev-session-cleanup.ts
|
|
93358
|
-
var
|
|
93382
|
+
var import_node_child_process16 = require("node:child_process");
|
|
93359
93383
|
var import_promises34 = require("node:fs/promises");
|
|
93360
93384
|
var import_node_os13 = __toESM(require("node:os"), 1);
|
|
93361
93385
|
var import_node_path55 = __toESM(require("node:path"), 1);
|
|
93362
93386
|
var import_node_util10 = require("node:util");
|
|
93363
|
-
var execFileAsync4 = (0, import_node_util10.promisify)(
|
|
93387
|
+
var execFileAsync4 = (0, import_node_util10.promisify)(import_node_child_process16.execFile);
|
|
93364
93388
|
var CLEANUP_TIMEOUT_MS = 3e4;
|
|
93365
93389
|
function isReleased(manifest) {
|
|
93366
93390
|
return manifest.state === "stopped" || manifest.state === "failed" && manifest.failure?.leaseRetained === false;
|
|
@@ -93484,7 +93508,7 @@ var TerminalWorktreeDeletionError = class extends Error {
|
|
|
93484
93508
|
};
|
|
93485
93509
|
function runGit3(cwd, args) {
|
|
93486
93510
|
return new Promise((resolve, reject) => {
|
|
93487
|
-
(0,
|
|
93511
|
+
(0, import_node_child_process17.execFile)(
|
|
93488
93512
|
"git",
|
|
93489
93513
|
["-C", cwd, ...args],
|
|
93490
93514
|
{
|
|
@@ -95400,6 +95424,7 @@ var TerminalTextAttachmentService = class {
|
|
|
95400
95424
|
await handle2.close();
|
|
95401
95425
|
}
|
|
95402
95426
|
await (0, import_promises38.rename)(temporary, file);
|
|
95427
|
+
if (process.platform === "win32") return;
|
|
95403
95428
|
const directory3 = await (0, import_promises38.open)(import_node_path59.default.dirname(file), import_node_fs27.constants.O_RDONLY);
|
|
95404
95429
|
try {
|
|
95405
95430
|
await directory3.sync();
|
|
@@ -96741,12 +96766,12 @@ function registerTerminalInputRoutes(router, terminalSessionManager, options) {
|
|
|
96741
96766
|
var import_node_crypto47 = require("node:crypto");
|
|
96742
96767
|
|
|
96743
96768
|
// backend/src/agent-model-catalog/types.ts
|
|
96744
|
-
var
|
|
96769
|
+
var import_node_child_process18 = require("node:child_process");
|
|
96745
96770
|
var CATALOG_COMMAND_TIMEOUT_MS = 15e3;
|
|
96746
96771
|
var CATALOG_COMMAND_MAX_BUFFER = 8 * 1024 * 1024;
|
|
96747
96772
|
function runCatalogCommand(command, args, env) {
|
|
96748
96773
|
return new Promise((resolve, reject) => {
|
|
96749
|
-
(0,
|
|
96774
|
+
(0, import_node_child_process18.execFile)(
|
|
96750
96775
|
command,
|
|
96751
96776
|
args,
|
|
96752
96777
|
{
|
|
@@ -98441,7 +98466,7 @@ function registerRuntimeStatusRoutes(app, requireAuth, status) {
|
|
|
98441
98466
|
var import_express38 = __toESM(require_express2(), 1);
|
|
98442
98467
|
|
|
98443
98468
|
// backend/src/dev-resources/control.ts
|
|
98444
|
-
var
|
|
98469
|
+
var import_node_child_process19 = require("node:child_process");
|
|
98445
98470
|
var import_node_fs28 = require("node:fs");
|
|
98446
98471
|
var import_node_path64 = __toESM(require("node:path"), 1);
|
|
98447
98472
|
var import_node_url2 = require("node:url");
|
|
@@ -98469,7 +98494,7 @@ async function runDevResourceControl(payload, onSpawn) {
|
|
|
98469
98494
|
ELECTRON_RUN_AS_NODE: "1"
|
|
98470
98495
|
};
|
|
98471
98496
|
delete environment2.RUNWEAVE_DEV_SESSION_ID;
|
|
98472
|
-
const child = (0,
|
|
98497
|
+
const child = (0, import_node_child_process19.spawn)(process.execPath, [entry], {
|
|
98473
98498
|
stdio: ["pipe", "pipe", "ignore"],
|
|
98474
98499
|
env: environment2
|
|
98475
98500
|
});
|
|
@@ -110483,7 +110508,7 @@ function createHttpUpgradeRouter(server) {
|
|
|
110483
110508
|
|
|
110484
110509
|
// backend/src/server/profile-lock.ts
|
|
110485
110510
|
var import_node_crypto49 = require("node:crypto");
|
|
110486
|
-
var
|
|
110511
|
+
var import_node_child_process20 = require("node:child_process");
|
|
110487
110512
|
var import_promises42 = require("node:fs/promises");
|
|
110488
110513
|
var import_node_path66 = __toESM(require("node:path"), 1);
|
|
110489
110514
|
var BackendProfileLockConflictError = class extends Error {
|
|
@@ -110529,7 +110554,7 @@ async function acquireBackendProfileLock(options) {
|
|
|
110529
110554
|
const lockFile = getBrowserProfileLockFile(options.profileDir);
|
|
110530
110555
|
const owner = createBackendProfileLockOwner(options);
|
|
110531
110556
|
try {
|
|
110532
|
-
owner.processSignature = (0,
|
|
110557
|
+
owner.processSignature = (0, import_node_child_process20.execFileSync)(
|
|
110533
110558
|
"/bin/ps",
|
|
110534
110559
|
["-p", String(process.pid), "-o", "lstart=", "-o", "command="],
|
|
110535
110560
|
{
|
|
@@ -112986,7 +113011,7 @@ child.once('error',()=>cleanup(1));child.once('close',code=>cleanup(stopped?124:
|
|
|
112986
113011
|
`;
|
|
112987
113012
|
|
|
112988
113013
|
// backend/src/screen-recording-analysis/provider.ts
|
|
112989
|
-
var
|
|
113014
|
+
var import_node_child_process21 = require("node:child_process");
|
|
112990
113015
|
var import_node_util11 = require("node:util");
|
|
112991
113016
|
var import_promises45 = require("node:fs/promises");
|
|
112992
113017
|
var import_node_path70 = __toESM(require("node:path"), 1);
|
|
@@ -113099,7 +113124,7 @@ var AnalysisProvider = class {
|
|
|
113099
113124
|
usage;
|
|
113100
113125
|
async probe() {
|
|
113101
113126
|
if (this.probed) return;
|
|
113102
|
-
const { stdout } = await (0, import_node_util11.promisify)(
|
|
113127
|
+
const { stdout } = await (0, import_node_util11.promisify)(import_node_child_process21.execFile)(this.config.binary, ["exec", "--help"], { timeout: 5e3, maxBuffer: 128 * 1024 });
|
|
113103
113128
|
for (const flag of ["--image", "--output-schema", "--output-last-message", "--ephemeral", "--ignore-user-config"]) if (!stdout.includes(flag)) throw new Error("PROVIDER_UNSUPPORTED");
|
|
113104
113129
|
this.probed = true;
|
|
113105
113130
|
}
|
|
@@ -113145,7 +113170,7 @@ var AnalysisProvider = class {
|
|
|
113145
113170
|
if (value !== void 0) environment2[key2] = value;
|
|
113146
113171
|
}
|
|
113147
113172
|
const deadline = Math.min(Date.now() + 12e4, ...manifest.captures.map((frame) => frame.availableUntilMs));
|
|
113148
|
-
const child = (0,
|
|
113173
|
+
const child = (0, import_node_child_process21.spawn)(process.execPath, ["-e", analysisProviderRunner, this.config.binary, JSON.stringify(args), directory3, String(deadline)], { cwd: directory3, stdio: ["pipe", "pipe", "pipe", "ipc"], detached: process.platform !== "win32", env: environment2 });
|
|
113149
113174
|
let reason, bytes = 0, killTimer;
|
|
113150
113175
|
const kill = (force) => {
|
|
113151
113176
|
if (!child.pid || child.exitCode !== null) return;
|
|
@@ -113440,7 +113465,7 @@ var import_node_crypto58 = require("node:crypto");
|
|
|
113440
113465
|
|
|
113441
113466
|
// backend/src/side-chat/provider.ts
|
|
113442
113467
|
var import_node_crypto57 = require("node:crypto");
|
|
113443
|
-
var
|
|
113468
|
+
var import_node_child_process22 = require("node:child_process");
|
|
113444
113469
|
var import_node_fs31 = require("node:fs");
|
|
113445
113470
|
var import_node_path72 = __toESM(require("node:path"), 1);
|
|
113446
113471
|
var import_node_url3 = require("node:url");
|
|
@@ -113508,7 +113533,7 @@ var SideChatProvider = class {
|
|
|
113508
113533
|
for (const key2 of Object.keys(env)) {
|
|
113509
113534
|
if (key2.startsWith("RUNWEAVE_") || key2 === "TMUX" || key2 === "TMUX_PANE" || key2.startsWith("CODEX_THREAD") || key2.startsWith("CODEX_INTERNAL")) delete env[key2];
|
|
113510
113535
|
}
|
|
113511
|
-
const child = (0,
|
|
113536
|
+
const child = (0, import_node_child_process22.spawn)(this.binary, [...args, "app-server", "--stdio"], { cwd, env, stdio: ["pipe", "pipe", "pipe"] });
|
|
113512
113537
|
this.child = child;
|
|
113513
113538
|
this.exit = new Promise((resolve) => child.once("close", () => resolve()));
|
|
113514
113539
|
child.stdout.setEncoding("utf8");
|
|
@@ -114315,7 +114340,8 @@ var ConnectionIdentityService = class _ConnectionIdentityService {
|
|
|
114315
114340
|
}
|
|
114316
114341
|
}
|
|
114317
114342
|
const stat20 = await (0, import_promises47.lstat)(file);
|
|
114318
|
-
if (!stat20.isFile() || (stat20.mode & 63) !== 0 || stat20.size > 4096) throw new Error("Invalid identity file");
|
|
114343
|
+
if (!stat20.isFile() || process.platform !== "win32" && (stat20.mode & 63) !== 0 || stat20.size > 4096) throw new Error("Invalid identity file");
|
|
114344
|
+
assertWindowsPrivatePath(file);
|
|
114319
114345
|
const stored = JSON.parse(await (0, import_promises47.readFile)(file, "utf8"));
|
|
114320
114346
|
if (stored.schemaVersion !== 1 || stored.privateKey?.crv !== "Ed25519" || !stored.privateKey.d) throw new Error("Invalid identity key");
|
|
114321
114347
|
const key2 = (0, import_node_crypto59.createPrivateKey)({ key: stored.privateKey, format: "jwk" });
|
|
@@ -115007,10 +115033,10 @@ var import_node_fs34 = require("node:fs");
|
|
|
115007
115033
|
var import_promises51 = __toESM(require("node:fs/promises"), 1);
|
|
115008
115034
|
var import_node_os17 = __toESM(require("node:os"), 1);
|
|
115009
115035
|
var import_node_path78 = __toESM(require("node:path"), 1);
|
|
115010
|
-
var
|
|
115036
|
+
var import_node_child_process23 = require("node:child_process");
|
|
115011
115037
|
function signature(pid) {
|
|
115012
115038
|
try {
|
|
115013
|
-
return (0,
|
|
115039
|
+
return (0, import_node_child_process23.execFileSync)(
|
|
115014
115040
|
"ps",
|
|
115015
115041
|
["-p", String(pid), "-o", "lstart=", "-o", "command="],
|
|
115016
115042
|
{
|
|
@@ -116320,17 +116346,17 @@ var DesktopBadgeAccess = class {
|
|
|
116320
116346
|
var import_node_crypto70 = require("node:crypto");
|
|
116321
116347
|
|
|
116322
116348
|
// backend/src/terminal/questions/executor.ts
|
|
116323
|
-
var
|
|
116349
|
+
var import_node_child_process25 = require("node:child_process");
|
|
116324
116350
|
var import_node_util13 = require("node:util");
|
|
116325
116351
|
var import_promises56 = require("node:fs/promises");
|
|
116326
116352
|
|
|
116327
116353
|
// backend/src/terminal/attachments/codex-execution.ts
|
|
116328
|
-
var
|
|
116354
|
+
var import_node_child_process24 = require("node:child_process");
|
|
116329
116355
|
var import_node_util12 = require("node:util");
|
|
116330
116356
|
var import_node_path83 = __toESM(require("node:path"), 1);
|
|
116331
116357
|
var import_node_url5 = require("node:url");
|
|
116332
116358
|
var import_promises55 = require("node:fs/promises");
|
|
116333
|
-
var exec4 = (0, import_node_util12.promisify)(
|
|
116359
|
+
var exec4 = (0, import_node_util12.promisify)(import_node_child_process24.execFile);
|
|
116334
116360
|
var directory2 = import_node_path83.default.dirname((0, import_node_url5.fileURLToPath)(__IMPORT_META_URL__));
|
|
116335
116361
|
var helper = import_node_path83.default.basename(directory2) === "attachments" ? import_node_path83.default.resolve(directory2, "../../../.native-artifacts/resource-sampler") : import_node_path83.default.join(directory2, "resource-sampler");
|
|
116336
116362
|
async function readCodexProcessArguments(pid) {
|
|
@@ -116356,7 +116382,7 @@ async function readCodexProcessArguments(pid) {
|
|
|
116356
116382
|
}
|
|
116357
116383
|
|
|
116358
116384
|
// backend/src/terminal/questions/executor.ts
|
|
116359
|
-
var exec5 = (0, import_node_util13.promisify)(
|
|
116385
|
+
var exec5 = (0, import_node_util13.promisify)(import_node_child_process25.execFile);
|
|
116360
116386
|
function remoteSocket(args) {
|
|
116361
116387
|
const values = /* @__PURE__ */ new Set(["-c", "--config", "-m", "--model", "-p", "--profile", "-C", "--cd", "--enable", "--disable", "--add-dir", "-i", "--image", "--local-provider", "--sandbox", "-s", "--ask-for-approval", "-a"]);
|
|
116362
116388
|
let socket = null;
|
|
@@ -118759,9 +118785,9 @@ function matchesCron(cron, value) {
|
|
|
118759
118785
|
}
|
|
118760
118786
|
|
|
118761
118787
|
// backend/src/evolution/providers/availability.ts
|
|
118762
|
-
var
|
|
118788
|
+
var import_node_child_process26 = require("node:child_process");
|
|
118763
118789
|
var import_node_util14 = require("node:util");
|
|
118764
|
-
var execFileAsync5 = (0, import_node_util14.promisify)(
|
|
118790
|
+
var execFileAsync5 = (0, import_node_util14.promisify)(import_node_child_process26.execFile);
|
|
118765
118791
|
var PROBE_TIMEOUT_MS = 5e3;
|
|
118766
118792
|
var CACHE_TTL_MS = 3e4;
|
|
118767
118793
|
var EvolutionProviderAvailabilityService = class {
|
|
@@ -119728,7 +119754,7 @@ async function auditRepositoryMigration(dataDir) {
|
|
|
119728
119754
|
// backend/src/evolution/storage/repository-migration-files.ts
|
|
119729
119755
|
var import_node_os20 = __toESM(require("node:os"), 1);
|
|
119730
119756
|
var import_node_fs36 = require("node:fs");
|
|
119731
|
-
var
|
|
119757
|
+
var import_node_child_process27 = require("node:child_process");
|
|
119732
119758
|
var import_node_fs37 = require("node:fs");
|
|
119733
119759
|
var import_node_path90 = __toESM(require("node:path"), 1);
|
|
119734
119760
|
function privateJson(file, value) {
|
|
@@ -119741,7 +119767,7 @@ function assertOffline(files) {
|
|
|
119741
119767
|
for (const file of files) {
|
|
119742
119768
|
let output = "";
|
|
119743
119769
|
try {
|
|
119744
|
-
output = (0,
|
|
119770
|
+
output = (0, import_node_child_process27.execFileSync)(
|
|
119745
119771
|
process.platform === "darwin" ? "/usr/sbin/lsof" : "lsof",
|
|
119746
119772
|
["-t", "--", file, `${file}-wal`, `${file}-shm`],
|
|
119747
119773
|
{ encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }
|
|
@@ -120674,11 +120700,11 @@ var BatteryAlerts = class {
|
|
|
120674
120700
|
var import_node_crypto83 = require("node:crypto");
|
|
120675
120701
|
|
|
120676
120702
|
// backend/src/device-monitor/sampler.ts
|
|
120677
|
-
var
|
|
120703
|
+
var import_node_child_process28 = require("node:child_process");
|
|
120678
120704
|
var sampleBattery = async (signal) => {
|
|
120679
120705
|
if (process.platform !== "darwin") return null;
|
|
120680
120706
|
const output = await new Promise((resolve, reject) => {
|
|
120681
|
-
(0,
|
|
120707
|
+
(0, import_node_child_process28.execFile)(
|
|
120682
120708
|
"/usr/bin/pmset",
|
|
120683
120709
|
["-g", "batt"],
|
|
120684
120710
|
{
|
|
@@ -123400,6 +123426,11 @@ function buildPtyEnv(baseEnv, sessionEnv, command) {
|
|
|
123400
123426
|
if (!isUnsetEnvValue2(baseEnv.GOOGLE_API_KEY) && merged.GOOGLE_API_KEY === baseEnv.GOOGLE_API_KEY) {
|
|
123401
123427
|
delete merged.GOOGLE_API_KEY;
|
|
123402
123428
|
}
|
|
123429
|
+
if (process.platform === "win32" && import_node_path104.default.basename(command).toLowerCase() === "powershell.exe") {
|
|
123430
|
+
for (const key2 of Object.keys(merged)) {
|
|
123431
|
+
if (key2.toLowerCase() === "psmodulepath") delete merged[key2];
|
|
123432
|
+
}
|
|
123433
|
+
}
|
|
123403
123434
|
normalizePathForAppImage(merged);
|
|
123404
123435
|
return applyShellIntegration(command, merged);
|
|
123405
123436
|
}
|
|
@@ -123491,7 +123522,10 @@ var PtyService = class {
|
|
|
123491
123522
|
ptyProcess.resize(cols, rows);
|
|
123492
123523
|
},
|
|
123493
123524
|
signal(signal) {
|
|
123494
|
-
|
|
123525
|
+
if (process.platform === "win32") {
|
|
123526
|
+
if (signal === "SIGINT") ptyProcess.write("");
|
|
123527
|
+
else ptyProcess.kill();
|
|
123528
|
+
} else ptyProcess.kill(toTerminalSignal(signal));
|
|
123495
123529
|
},
|
|
123496
123530
|
dispose() {
|
|
123497
123531
|
if (ptyProcess.destroy) {
|
|
@@ -125346,12 +125380,12 @@ function hashPrompt2(text3) {
|
|
|
125346
125380
|
}
|
|
125347
125381
|
|
|
125348
125382
|
// backend/src/terminal/workspace-service/worktree-project-registry.ts
|
|
125349
|
-
var
|
|
125383
|
+
var import_node_child_process29 = require("node:child_process");
|
|
125350
125384
|
var import_promises65 = require("node:fs/promises");
|
|
125351
125385
|
var import_node_path107 = __toESM(require("node:path"), 1);
|
|
125352
125386
|
function runGitWorktreeList(projectPath) {
|
|
125353
125387
|
return new Promise((resolve, reject) => {
|
|
125354
|
-
(0,
|
|
125388
|
+
(0, import_node_child_process29.execFile)(
|
|
125355
125389
|
"git",
|
|
125356
125390
|
["-C", projectPath, "worktree", "list", "--porcelain", "-z"],
|
|
125357
125391
|
{ encoding: "utf8", maxBuffer: 4 * 1024 * 1024 },
|
|
@@ -127280,7 +127314,7 @@ function isWorkspaceServiceHostnameCandidate(hostname2) {
|
|
|
127280
127314
|
}
|
|
127281
127315
|
|
|
127282
127316
|
// backend/src/terminal/workspace-service/owned-process.ts
|
|
127283
|
-
var
|
|
127317
|
+
var import_node_child_process30 = require("node:child_process");
|
|
127284
127318
|
var OUTPUT_TAIL_BYTES = 8 * 1024;
|
|
127285
127319
|
var SUPERVISOR_START_TIMEOUT_MS = 5e3;
|
|
127286
127320
|
var SUPERVISOR_SOURCE = String.raw`
|
|
@@ -127374,7 +127408,7 @@ function signalSupervisor(child) {
|
|
|
127374
127408
|
if (child.connected) child.send({ type: "stop" });
|
|
127375
127409
|
}
|
|
127376
127410
|
async function startOwnedWorkspaceServiceProcess(input2) {
|
|
127377
|
-
const supervisor = (0,
|
|
127411
|
+
const supervisor = (0, import_node_child_process30.spawn)(process.execPath, ["-e", SUPERVISOR_SOURCE], {
|
|
127378
127412
|
env: { ...process.env, ELECTRON_RUN_AS_NODE: "1" },
|
|
127379
127413
|
stdio: ["ignore", "pipe", "pipe", "ipc"]
|
|
127380
127414
|
});
|
|
@@ -131930,9 +131964,9 @@ var package_default2 = {
|
|
|
131930
131964
|
};
|
|
131931
131965
|
|
|
131932
131966
|
// backend/src/runtime-status/cli-version.ts
|
|
131933
|
-
var
|
|
131967
|
+
var import_node_child_process31 = require("node:child_process");
|
|
131934
131968
|
var import_node_util16 = require("node:util");
|
|
131935
|
-
var execute = (0, import_node_util16.promisify)(
|
|
131969
|
+
var execute = (0, import_node_util16.promisify)(import_node_child_process31.execFile);
|
|
131936
131970
|
var cached2 = null;
|
|
131937
131971
|
var pending = null;
|
|
131938
131972
|
async function readNodeCliVersion() {
|
|
@@ -132405,11 +132439,11 @@ var BackendRuntimeStatusService = class {
|
|
|
132405
132439
|
};
|
|
132406
132440
|
|
|
132407
132441
|
// backend/src/scheduled-tasks/providers/capabilities.ts
|
|
132408
|
-
var
|
|
132442
|
+
var import_node_child_process34 = require("node:child_process");
|
|
132409
132443
|
var import_node_util18 = require("node:util");
|
|
132410
132444
|
|
|
132411
132445
|
// backend/src/scheduled-tasks/providers/codex-resume.ts
|
|
132412
|
-
var
|
|
132446
|
+
var import_node_child_process32 = require("node:child_process");
|
|
132413
132447
|
var import_promises75 = require("node:fs/promises");
|
|
132414
132448
|
var import_node_util17 = require("node:util");
|
|
132415
132449
|
|
|
@@ -132440,7 +132474,7 @@ function codexScheduledArgs(config2) {
|
|
|
132440
132474
|
}
|
|
132441
132475
|
|
|
132442
132476
|
// backend/src/scheduled-tasks/providers/codex-resume.ts
|
|
132443
|
-
var exec6 = (0, import_node_util17.promisify)(
|
|
132477
|
+
var exec6 = (0, import_node_util17.promisify)(import_node_child_process32.execFile);
|
|
132444
132478
|
async function checkpointCodexResume(threadId, cwd) {
|
|
132445
132479
|
try {
|
|
132446
132480
|
const result = await codexAppServerClient.sendRequest("thread/read", {
|
|
@@ -132567,7 +132601,7 @@ async function ownsResumeHistory(pid, checkpoint, cwd) {
|
|
|
132567
132601
|
}
|
|
132568
132602
|
|
|
132569
132603
|
// backend/src/scheduled-tasks/providers/codex.ts
|
|
132570
|
-
var
|
|
132604
|
+
var import_node_child_process33 = require("node:child_process");
|
|
132571
132605
|
var import_promises76 = require("node:fs/promises");
|
|
132572
132606
|
var import_node_os21 = __toESM(require("node:os"), 1);
|
|
132573
132607
|
var import_node_path116 = __toESM(require("node:path"), 1);
|
|
@@ -132725,7 +132759,7 @@ var CodexScheduledTaskProvider = class {
|
|
|
132725
132759
|
...request2.resumeThreadId ? ["resume", request2.resumeThreadId] : [],
|
|
132726
132760
|
"-"
|
|
132727
132761
|
];
|
|
132728
|
-
const child = (0,
|
|
132762
|
+
const child = (0, import_node_child_process33.spawn)(this.binary, args, {
|
|
132729
132763
|
cwd: request2.workingDirectory,
|
|
132730
132764
|
env: codexScheduledEnvironment(
|
|
132731
132765
|
process.env,
|
|
@@ -132955,7 +132989,7 @@ function waitForExit2(child) {
|
|
|
132955
132989
|
}
|
|
132956
132990
|
|
|
132957
132991
|
// backend/src/scheduled-tasks/providers/capabilities.ts
|
|
132958
|
-
var execFileAsync6 = (0, import_node_util18.promisify)(
|
|
132992
|
+
var execFileAsync6 = (0, import_node_util18.promisify)(import_node_child_process34.execFile);
|
|
132959
132993
|
function detectCodexScheduledFeatures(help) {
|
|
132960
132994
|
return {
|
|
132961
132995
|
autoReview: help.includes("--approve-for-me"),
|