sootsim 0.1.39 → 0.1.40
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-cli/bin.js +16 -15
- package/dist-cli/chunks/{agent-HZP3LUGJ.js → agent-3F5PO4NL.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-CS6TV5UR.js → agent-wrapper-LVUUZRWL.js} +2 -2
- package/dist-cli/chunks/{assert-WVTX4CNR.js → assert-4WMVS3WU.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-Q4A3PTF5.js +2 -0
- package/dist-cli/chunks/beta-CLLKUB5X.js +2 -0
- package/dist-cli/chunks/{chunk-MIE6NMPJ.js → chunk-4IAKB3C4.js} +6 -6
- package/dist-cli/chunks/{chunk-ZBB7YS6C.js → chunk-4L45Q3YX.js} +2 -2
- package/dist-cli/chunks/{chunk-UWRBEBML.js → chunk-553OZX4H.js} +2 -2
- package/dist-cli/chunks/{chunk-CBPTHIJV.js → chunk-5GK4YX7O.js} +1 -1
- package/dist-cli/chunks/{runtime-YJPWA3XA.js → chunk-5IAIIX7B.js} +3 -3
- package/dist-cli/chunks/{chunk-223TXYOC.js → chunk-6X5NQJT7.js} +3 -3
- package/dist-cli/chunks/{chunk-JXKW62SL.js → chunk-6XI4VHIL.js} +2 -2
- package/dist-cli/chunks/{chunk-B2SCT4DL.js → chunk-BZED27B2.js} +2 -2
- package/dist-cli/chunks/{chunk-5L5SZXXG.js → chunk-CAJ247SC.js} +2 -2
- package/dist-cli/chunks/{chunk-YUKH7HF6.js → chunk-CCZHRBXJ.js} +1 -1
- package/dist-cli/chunks/{chunk-DSDLGFWH.js → chunk-D2ZMP7G4.js} +2 -2
- package/dist-cli/chunks/{chunk-WHQWINDB.js → chunk-D4Z7MWQY.js} +2 -2
- package/dist-cli/chunks/{chunk-WD54RD4K.js → chunk-DEBXVPIE.js} +1 -1
- package/dist-cli/chunks/{chunk-SLQ2GTYF.js → chunk-DHJIXXWG.js} +2 -2
- package/dist-cli/chunks/chunk-DPZDTJVQ.js +1 -0
- package/dist-cli/chunks/{chunk-NYZGZDHI.js → chunk-DSTHAISO.js} +1 -1
- package/dist-cli/chunks/{chunk-C6GUAXKO.js → chunk-EOWN4ZFJ.js} +1 -1
- package/dist-cli/chunks/chunk-FFR7EA4U.js +1 -0
- package/dist-cli/chunks/chunk-FNIL6BYS.js +108 -0
- package/dist-cli/chunks/chunk-I7KXFJDK.js +1 -0
- package/dist-cli/chunks/{chunk-OB3TB4AN.js → chunk-J6BPROH4.js} +1 -1
- package/dist-cli/chunks/{chunk-NJ4WXWKO.js → chunk-KGVH3YAG.js} +2 -2
- package/dist-cli/chunks/{chunk-RJQ73DLG.js → chunk-KVOMVYG6.js} +4 -4
- package/dist-cli/chunks/{chunk-FEMOLCB5.js → chunk-LCES5ZJI.js} +2 -2
- package/dist-cli/chunks/{chunk-NF65BNJR.js → chunk-LXR5EI74.js} +2 -2
- package/dist-cli/chunks/{chunk-YHYSOUIJ.js → chunk-MLCBIX7O.js} +2 -2
- package/dist-cli/chunks/{chunk-2ESCYOZW.js → chunk-OV5TY7M3.js} +2 -2
- package/dist-cli/chunks/chunk-PKB6IEGM.js +2 -0
- package/dist-cli/chunks/chunk-PNGBWMQH.js +17 -0
- package/dist-cli/chunks/{chunk-P6F636LU.js → chunk-QMBYRPRK.js} +1 -1
- package/dist-cli/chunks/{chunk-4YUHJ5FX.js → chunk-QUULF2II.js} +2 -2
- package/dist-cli/chunks/chunk-S4PJMUC7.js +2 -0
- package/dist-cli/chunks/{chunk-MGVTLDI3.js → chunk-TK2IPNHL.js} +2 -2
- package/dist-cli/chunks/chunk-U3JD6X75.js +4 -0
- package/dist-cli/chunks/{chunk-VLUFTHBB.js → chunk-W2XRHDQQ.js} +2 -2
- package/dist-cli/chunks/{chunk-XYTDYBXJ.js → chunk-WPS3TIOB.js} +1 -1
- package/dist-cli/chunks/{chunk-GUHXSXNO.js → chunk-WQXG4I5N.js} +2 -2
- package/dist-cli/chunks/{chunk-YGUQSPU6.js → chunk-WZE6T3GT.js} +1 -1
- package/dist-cli/chunks/chunk-XWXFUFB2.js +1 -0
- package/dist-cli/chunks/{chunk-7J4UIBA5.js → chunk-Y5CFIRLN.js} +2 -2
- package/dist-cli/chunks/{chunk-RLGCJT2D.js → chunk-Y66CDFAT.js} +1 -1
- package/dist-cli/chunks/chunk-YJMXGTP4.js +2 -0
- package/dist-cli/chunks/{chunk-ECDPQ6S7.js → chunk-YKEBL6GE.js} +1 -1
- package/dist-cli/chunks/{chunk-E5RYQUFB.js → chunk-Z3I2I4IO.js} +3 -3
- package/dist-cli/chunks/{compat-UMJ2IXUW.js → compat-NBFWHK5S.js} +2 -2
- package/dist-cli/chunks/{config-YMJK426V.js → config-JEDQ3NHA.js} +2 -2
- package/dist-cli/chunks/control-IMWZVYC3.js +2 -0
- package/dist-cli/chunks/{cpu-profile-67MCPAA2.js → cpu-profile-MQPUSRHG.js} +2 -2
- package/dist-cli/chunks/{daemon-LIVCJZR3.js → daemon-HOL7J3BI.js} +2 -2
- package/dist-cli/chunks/{debug-EV73WC7H.js → debug-LNVMIWD6.js} +20 -20
- package/dist-cli/chunks/demo-app-registry-4RFMJ4FM.js +2 -0
- package/dist-cli/chunks/{detox-NBT5BVX3.js → detox-EEZPH3DZ.js} +2 -2
- package/dist-cli/chunks/{device-MMROWQZ3.js → device-GVLYQI7X.js} +2 -2
- package/dist-cli/chunks/{diagnose-WXOKGBAJ.js → diagnose-JQ7DPTSL.js} +2 -2
- package/dist-cli/chunks/drivers-JUW6JBWH.js +2 -0
- package/dist-cli/chunks/{electron-F5DT7CFY.js → electron-UDV6K3IH.js} +3 -3
- package/dist-cli/chunks/flow-JOW23WNH.js +2 -0
- package/dist-cli/chunks/{hints-RODH4XE4.js → hints-46PJLATZ.js} +2 -2
- package/dist-cli/chunks/{home-paths-PCUMN33Z.js → home-paths-XD7AOYU7.js} +2 -2
- package/dist-cli/chunks/inspect-EDIKZ6O2.js +993 -0
- package/dist-cli/chunks/install-CCC3IF5S.js +2 -0
- package/dist-cli/chunks/{install-desktop-ASRNFHZU.js → install-desktop-CX6ATQTR.js} +3 -3
- package/dist-cli/chunks/{keys-DOOCGNTD.js → keys-CXQIYEVW.js} +2 -2
- package/dist-cli/chunks/{launch-DTVAQMZG.js → launch-DCFRKVD3.js} +3 -3
- package/dist-cli/chunks/{login-JA6VEDEP.js → login-HCIZL5GT.js} +4 -4
- package/dist-cli/chunks/{logout-H4WFWTPC.js → logout-7X2YHJY3.js} +2 -2
- package/dist-cli/chunks/{maestro-4TR7U6TS.js → maestro-TY622MIW.js} +2 -2
- package/dist-cli/chunks/{preview-GP7XXDW6.js → preview-DYI6ESOK.js} +2 -2
- package/dist-cli/chunks/{profile-3FESGAZD.js → profile-7SXJEJTG.js} +2 -2
- package/dist-cli/chunks/{react-SJD2DQQV.js → react-VGSDY766.js} +2 -2
- package/dist-cli/chunks/{record-PQUAMW5K.js → record-7JX2SMVP.js} +2 -2
- package/dist-cli/chunks/runtime-FTOQD7QK.js +2 -0
- package/dist-cli/chunks/runtime-delivery-PWLODFCY.js +2 -0
- package/dist-cli/chunks/{screenshot-45SAK7EW.js → screenshot-PTKY4UU4.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-TCY7FBGR.js → screenshot-mode-HSV7VY4G.js} +2 -2
- package/dist-cli/chunks/{screenshots-KZ364S2O.js → screenshots-VY7VAGSV.js} +2 -2
- package/dist-cli/chunks/server-EDB3EK4K.js +35 -0
- package/dist-cli/chunks/setup-repo-S2GFZR7F.js +2 -0
- package/dist-cli/chunks/{skills-SMXCCJCM.js → skills-KEPQLCMR.js} +2 -2
- package/dist-cli/chunks/start-5CJTBNRM.js +23 -0
- package/dist-cli/chunks/store-SCRULNVS.js +2 -0
- package/dist-cli/chunks/telemetry-RC3OT67I.js +2 -0
- package/dist-cli/chunks/{test-ZXTSA5GV.js → test-REKHGKFE.js} +3 -3
- package/dist-cli/chunks/{three-mode-4Q65J2ZA.js → three-mode-FZYHB4ZQ.js} +2 -2
- package/dist-cli/chunks/{timeline-ISEDS6XR.js → timeline-CWZAY52K.js} +2 -2
- package/dist-cli/chunks/upgrade-AIUJEF5F.js +4 -0
- package/dist-cli/chunks/upload-UDA5ITTE.js +2 -0
- package/dist-cli/chunks/what-happened-JSQQVQGE.js +15 -0
- package/dist-cli/chunks/{whoami-VKRQOG2U.js → whoami-5WUUPIRN.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +115 -82
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/vite-base.cjs +140 -88
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-3TUCG2BC.js +0 -2
- package/dist-cli/chunks/beta-3SCMB3IN.js +0 -2
- package/dist-cli/chunks/chunk-4LHQRDSN.js +0 -2
- package/dist-cli/chunks/chunk-4UI5OHEO.js +0 -1
- package/dist-cli/chunks/chunk-5RSSCKBF.js +0 -1
- package/dist-cli/chunks/chunk-6TSUQHSC.js +0 -4
- package/dist-cli/chunks/chunk-B3OEHV2C.js +0 -1
- package/dist-cli/chunks/chunk-HWRR23AJ.js +0 -17
- package/dist-cli/chunks/chunk-NFJDHJHK.js +0 -1
- package/dist-cli/chunks/chunk-W4QHQT64.js +0 -2
- package/dist-cli/chunks/control-DJR3DUAB.js +0 -2
- package/dist-cli/chunks/demo-app-registry-NZBZVJ52.js +0 -2
- package/dist-cli/chunks/drivers-NSPV5S6T.js +0 -2
- package/dist-cli/chunks/flow-T6DZQWHE.js +0 -2
- package/dist-cli/chunks/inspect-BIMFJFDR.js +0 -1101
- package/dist-cli/chunks/install-5YPVP466.js +0 -2
- package/dist-cli/chunks/server-S5CRYXXZ.js +0 -35
- package/dist-cli/chunks/setup-repo-TH3GXOP7.js +0 -2
- package/dist-cli/chunks/start-KLSAQM3C.js +0 -23
- package/dist-cli/chunks/store-E2N5NOUS.js +0 -2
- package/dist-cli/chunks/telemetry-RJXVYJSN.js +0 -2
- package/dist-cli/chunks/upload-KB7INQRC.js +0 -2
- package/dist-cli/chunks/what-happened-STY3AOCQ.js +0 -15
package/dist-lib/vite-base.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.40 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -967,8 +967,8 @@ async function discoverListeningProcesses(excludePorts = []) {
|
|
|
967
967
|
}
|
|
968
968
|
async function resolveProcessCwd(pid) {
|
|
969
969
|
if (pid <= 0) return null;
|
|
970
|
-
const
|
|
971
|
-
if (
|
|
970
|
+
const cached2 = cwdByPid.get(pid);
|
|
971
|
+
if (cached2) return cached2;
|
|
972
972
|
try {
|
|
973
973
|
const { stdout } = await execP(`lsof -p ${pid} -a -d cwd -Fn 2>/dev/null`, {
|
|
974
974
|
encoding: "utf8",
|
|
@@ -1170,12 +1170,12 @@ async function scanDevServers(opts = {}) {
|
|
|
1170
1170
|
const results = [];
|
|
1171
1171
|
const toProbe = [];
|
|
1172
1172
|
for (const { port, pid } of processes) {
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1175
|
-
if (
|
|
1173
|
+
const cached2 = portCache.get(port);
|
|
1174
|
+
if (cached2 && __shouldReuseScannerCacheEntry(cached2, pid)) {
|
|
1175
|
+
if (cached2.result) results.push(cached2.result);
|
|
1176
1176
|
continue;
|
|
1177
1177
|
}
|
|
1178
|
-
if (
|
|
1178
|
+
if (cached2 && cached2.pid !== pid) {
|
|
1179
1179
|
knownNonPatched.delete(port);
|
|
1180
1180
|
knownNonExpo.delete(port);
|
|
1181
1181
|
knownOne.delete(port);
|
|
@@ -1247,6 +1247,37 @@ var init_dev_server_scanner = __esm({
|
|
|
1247
1247
|
}
|
|
1248
1248
|
});
|
|
1249
1249
|
|
|
1250
|
+
// src/cli-version.ts
|
|
1251
|
+
function getCliVersion() {
|
|
1252
|
+
if (cached != null) return cached;
|
|
1253
|
+
const candidates = [
|
|
1254
|
+
() => (0, import_node_url3.fileURLToPath)(import_meta.resolve("sootsim/package.json")),
|
|
1255
|
+
() => (0, import_node_url3.fileURLToPath)(new URL("../package.json", __sootsim_import_meta_url))
|
|
1256
|
+
];
|
|
1257
|
+
for (const resolve2 of candidates) {
|
|
1258
|
+
try {
|
|
1259
|
+
const version = JSON.parse((0, import_node_fs2.readFileSync)(resolve2(), "utf8")).version;
|
|
1260
|
+
if (typeof version === "string" && version) {
|
|
1261
|
+
cached = version;
|
|
1262
|
+
return cached;
|
|
1263
|
+
}
|
|
1264
|
+
} catch {
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
cached = "0.0.0";
|
|
1268
|
+
return cached;
|
|
1269
|
+
}
|
|
1270
|
+
var import_node_fs2, import_node_url3, import_meta, cached;
|
|
1271
|
+
var init_cli_version = __esm({
|
|
1272
|
+
"src/cli-version.ts"() {
|
|
1273
|
+
"use strict";
|
|
1274
|
+
import_node_fs2 = require("node:fs");
|
|
1275
|
+
import_node_url3 = require("node:url");
|
|
1276
|
+
import_meta = {};
|
|
1277
|
+
cached = null;
|
|
1278
|
+
}
|
|
1279
|
+
});
|
|
1280
|
+
|
|
1250
1281
|
// src/home-paths.ts
|
|
1251
1282
|
function sootsimHomeDir() {
|
|
1252
1283
|
const override = process.env[SOOTSIM_HOME_ENV];
|
|
@@ -1282,7 +1313,7 @@ function configFilePath() {
|
|
|
1282
1313
|
}
|
|
1283
1314
|
function readSharedConfig() {
|
|
1284
1315
|
try {
|
|
1285
|
-
const raw =
|
|
1316
|
+
const raw = import_node_fs3.default.readFileSync(configFilePath(), "utf8");
|
|
1286
1317
|
const parsed = JSON.parse(raw);
|
|
1287
1318
|
return parsed && typeof parsed === "object" ? parsed : {};
|
|
1288
1319
|
} catch {
|
|
@@ -1300,34 +1331,34 @@ function writeSharedConfig(patch) {
|
|
|
1300
1331
|
};
|
|
1301
1332
|
}
|
|
1302
1333
|
const tmp = `${configFilePath()}.tmp`;
|
|
1303
|
-
|
|
1334
|
+
import_node_fs3.default.writeFileSync(tmp, `${JSON.stringify(next, null, 2)}
|
|
1304
1335
|
`, "utf8");
|
|
1305
|
-
|
|
1336
|
+
import_node_fs3.default.renameSync(tmp, configFilePath());
|
|
1306
1337
|
return next;
|
|
1307
1338
|
}
|
|
1308
1339
|
function ensureSootsimHome() {
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1340
|
+
import_node_fs3.default.mkdirSync(sootsimHomeDir(), { recursive: true });
|
|
1341
|
+
import_node_fs3.default.mkdirSync(runtimesDir(), { recursive: true });
|
|
1342
|
+
import_node_fs3.default.mkdirSync(electronDir(), { recursive: true });
|
|
1343
|
+
import_node_fs3.default.mkdirSync(profilesDir(), { recursive: true });
|
|
1344
|
+
import_node_fs3.default.mkdirSync(cacheDir(), { recursive: true });
|
|
1314
1345
|
}
|
|
1315
1346
|
function readActiveRuntime() {
|
|
1316
1347
|
try {
|
|
1317
|
-
const value =
|
|
1348
|
+
const value = import_node_fs3.default.readFileSync(activeRuntimeFile(), "utf8").trim();
|
|
1318
1349
|
return value.length > 0 ? value : null;
|
|
1319
1350
|
} catch {
|
|
1320
1351
|
return null;
|
|
1321
1352
|
}
|
|
1322
1353
|
}
|
|
1323
1354
|
function writeActiveRuntime(version) {
|
|
1324
|
-
|
|
1325
|
-
|
|
1355
|
+
import_node_fs3.default.mkdirSync(runtimesDir(), { recursive: true });
|
|
1356
|
+
import_node_fs3.default.writeFileSync(activeRuntimeFile(), `${version}
|
|
1326
1357
|
`, "utf8");
|
|
1327
1358
|
}
|
|
1328
1359
|
function listInstalledRuntimes() {
|
|
1329
1360
|
try {
|
|
1330
|
-
return
|
|
1361
|
+
return import_node_fs3.default.readdirSync(runtimesDir(), { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort(compareSemver);
|
|
1331
1362
|
} catch {
|
|
1332
1363
|
return [];
|
|
1333
1364
|
}
|
|
@@ -1358,17 +1389,17 @@ function activeRuntimeDir() {
|
|
|
1358
1389
|
if (!version) return null;
|
|
1359
1390
|
const dir = runtimeDir(version);
|
|
1360
1391
|
try {
|
|
1361
|
-
if (
|
|
1392
|
+
if (import_node_fs3.default.statSync(dir).isDirectory()) return dir;
|
|
1362
1393
|
} catch {
|
|
1363
1394
|
}
|
|
1364
1395
|
return null;
|
|
1365
1396
|
}
|
|
1366
1397
|
function readDaemonLockfile() {
|
|
1367
1398
|
try {
|
|
1368
|
-
const fd =
|
|
1399
|
+
const fd = import_node_fs3.default.openSync(daemonLockfilePath(), "r");
|
|
1369
1400
|
try {
|
|
1370
1401
|
const buf = Buffer.alloc(DAEMON_LOCKFILE_MAX_BYTES);
|
|
1371
|
-
const bytesRead =
|
|
1402
|
+
const bytesRead = import_node_fs3.default.readSync(fd, buf, 0, DAEMON_LOCKFILE_MAX_BYTES, 0);
|
|
1372
1403
|
const raw = buf.subarray(0, bytesRead).toString("utf8");
|
|
1373
1404
|
const parsed = JSON.parse(raw);
|
|
1374
1405
|
if (parsed && parsed.schema === 1 && typeof parsed.pid === "number" && typeof parsed.bridgePort === "number" && typeof parsed.runtimePort === "number" && typeof parsed.startedAt === "number" && typeof parsed.heartbeatAt === "number") {
|
|
@@ -1376,7 +1407,7 @@ function readDaemonLockfile() {
|
|
|
1376
1407
|
}
|
|
1377
1408
|
return null;
|
|
1378
1409
|
} finally {
|
|
1379
|
-
|
|
1410
|
+
import_node_fs3.default.closeSync(fd);
|
|
1380
1411
|
}
|
|
1381
1412
|
} catch {
|
|
1382
1413
|
return null;
|
|
@@ -1395,9 +1426,9 @@ function isDaemonLockfileFresh(lock, now = Date.now()) {
|
|
|
1395
1426
|
function writeDaemonLockfile(data) {
|
|
1396
1427
|
ensureSootsimHome();
|
|
1397
1428
|
const tmp = `${daemonLockfilePath()}.tmp`;
|
|
1398
|
-
|
|
1429
|
+
import_node_fs3.default.writeFileSync(tmp, `${JSON.stringify(data, null, 2)}
|
|
1399
1430
|
`, "utf8");
|
|
1400
|
-
|
|
1431
|
+
import_node_fs3.default.renameSync(tmp, daemonLockfilePath());
|
|
1401
1432
|
}
|
|
1402
1433
|
function claimDaemonLockfile(data) {
|
|
1403
1434
|
ensureSootsimHome();
|
|
@@ -1410,15 +1441,15 @@ function claimDaemonLockfile(data) {
|
|
|
1410
1441
|
}
|
|
1411
1442
|
function removeDaemonLockfile() {
|
|
1412
1443
|
try {
|
|
1413
|
-
|
|
1444
|
+
import_node_fs3.default.unlinkSync(daemonLockfilePath());
|
|
1414
1445
|
} catch {
|
|
1415
1446
|
}
|
|
1416
1447
|
}
|
|
1417
|
-
var
|
|
1448
|
+
var import_node_fs3, import_node_os2, import_node_path4, SOOTSIM_HOME_ENV, ACTIVE_RUNTIME_FILE, DAEMON_LOCKFILE, CONFIG_FILE, DAEMON_HEARTBEAT_STALE_MS, DAEMON_LOCKFILE_MAX_BYTES;
|
|
1418
1449
|
var init_home_paths = __esm({
|
|
1419
1450
|
"src/home-paths.ts"() {
|
|
1420
1451
|
"use strict";
|
|
1421
|
-
|
|
1452
|
+
import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
1422
1453
|
import_node_os2 = require("node:os");
|
|
1423
1454
|
import_node_path4 = __toESM(require("node:path"), 1);
|
|
1424
1455
|
SOOTSIM_HOME_ENV = "SOOTSIM_HOME";
|
|
@@ -1723,7 +1754,7 @@ function loadStore() {
|
|
|
1723
1754
|
const file = storeFile();
|
|
1724
1755
|
let raw;
|
|
1725
1756
|
try {
|
|
1726
|
-
raw =
|
|
1757
|
+
raw = import_node_fs4.default.readFileSync(file, "utf8");
|
|
1727
1758
|
} catch (err) {
|
|
1728
1759
|
if (err.code === "ENOENT") return cloneEmpty();
|
|
1729
1760
|
throw err;
|
|
@@ -1740,7 +1771,7 @@ function loadStore() {
|
|
|
1740
1771
|
} catch (err) {
|
|
1741
1772
|
const quarantine = `${file}.corrupt-${Date.now()}`;
|
|
1742
1773
|
try {
|
|
1743
|
-
|
|
1774
|
+
import_node_fs4.default.renameSync(file, quarantine);
|
|
1744
1775
|
console.warn(
|
|
1745
1776
|
`[sootsim] attached-projects.json was unparseable; quarantined to ${quarantine}. original error: ${err.message}`
|
|
1746
1777
|
);
|
|
@@ -1751,16 +1782,16 @@ function loadStore() {
|
|
|
1751
1782
|
}
|
|
1752
1783
|
function writeStore(store) {
|
|
1753
1784
|
const file = storeFile();
|
|
1754
|
-
|
|
1785
|
+
import_node_fs4.default.mkdirSync(import_node_path5.default.dirname(file), { recursive: true });
|
|
1755
1786
|
const tmp = `${file}.tmp-${process.pid}-${Date.now()}`;
|
|
1756
|
-
const fd =
|
|
1787
|
+
const fd = import_node_fs4.default.openSync(tmp, "w", 384);
|
|
1757
1788
|
try {
|
|
1758
|
-
|
|
1759
|
-
|
|
1789
|
+
import_node_fs4.default.writeFileSync(fd, JSON.stringify(store, null, 2));
|
|
1790
|
+
import_node_fs4.default.fsyncSync(fd);
|
|
1760
1791
|
} finally {
|
|
1761
|
-
|
|
1792
|
+
import_node_fs4.default.closeSync(fd);
|
|
1762
1793
|
}
|
|
1763
|
-
|
|
1794
|
+
import_node_fs4.default.renameSync(tmp, file);
|
|
1764
1795
|
}
|
|
1765
1796
|
function mutateStore(fn) {
|
|
1766
1797
|
const store = loadStore();
|
|
@@ -1940,7 +1971,7 @@ async function seedFromDemoAppRegistry() {
|
|
|
1940
1971
|
const apps = APPS2;
|
|
1941
1972
|
mutateStore((store) => {
|
|
1942
1973
|
for (const app of apps) {
|
|
1943
|
-
if (!
|
|
1974
|
+
if (!import_node_fs4.default.existsSync(app.dir)) continue;
|
|
1944
1975
|
const cwd = import_node_path5.default.resolve(app.dir);
|
|
1945
1976
|
const id = projectIdForCwd(cwd);
|
|
1946
1977
|
if (store.attachedProjects.some((p) => p.id === id)) continue;
|
|
@@ -1962,12 +1993,12 @@ async function seedFromDemoAppRegistry() {
|
|
|
1962
1993
|
}
|
|
1963
1994
|
});
|
|
1964
1995
|
}
|
|
1965
|
-
var import_node_crypto,
|
|
1996
|
+
var import_node_crypto, import_node_fs4, import_node_path5, overrideDir, COST_HISTORY_MAX_AGE_MS;
|
|
1966
1997
|
var init_attached_projects = __esm({
|
|
1967
1998
|
"src/attached-projects.ts"() {
|
|
1968
1999
|
"use strict";
|
|
1969
2000
|
import_node_crypto = require("node:crypto");
|
|
1970
|
-
|
|
2001
|
+
import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
1971
2002
|
import_node_path5 = __toESM(require("node:path"), 1);
|
|
1972
2003
|
init_home_paths();
|
|
1973
2004
|
overrideDir = null;
|
|
@@ -1996,7 +2027,7 @@ function pidIsAlive(pid, sessionId) {
|
|
|
1996
2027
|
return false;
|
|
1997
2028
|
}
|
|
1998
2029
|
if (sessionId) {
|
|
1999
|
-
if (!
|
|
2030
|
+
if (!import_node_fs5.default.existsSync(sessionDir(sessionId))) return false;
|
|
2000
2031
|
}
|
|
2001
2032
|
return true;
|
|
2002
2033
|
}
|
|
@@ -2012,7 +2043,7 @@ function resolveSootsimInvocation() {
|
|
|
2012
2043
|
import_node_path6.default.join(resourcesPath, "bin", `sootsim-${process.platform}-${process.arch}`)
|
|
2013
2044
|
];
|
|
2014
2045
|
for (const c of candidates) {
|
|
2015
|
-
if (
|
|
2046
|
+
if (import_node_fs5.default.existsSync(c)) return { cmd: c, prefixArgs: [] };
|
|
2016
2047
|
}
|
|
2017
2048
|
}
|
|
2018
2049
|
}
|
|
@@ -2036,14 +2067,14 @@ function tryWorkspaceSootsim() {
|
|
|
2036
2067
|
if (!sootsimDir) return null;
|
|
2037
2068
|
const binaryName = `sootsim-${process.platform}-${process.arch}`;
|
|
2038
2069
|
const distBinary = import_node_path6.default.join(sootsimDir, "dist-bin", binaryName);
|
|
2039
|
-
if (
|
|
2070
|
+
if (import_node_fs5.default.existsSync(distBinary)) return { cmd: distBinary, prefixArgs: [] };
|
|
2040
2071
|
const distBin = import_node_path6.default.join(sootsimDir, "dist-cli", "bin.js");
|
|
2041
|
-
if (
|
|
2072
|
+
if (import_node_fs5.default.existsSync(distBin)) {
|
|
2042
2073
|
try {
|
|
2043
2074
|
const src = import_node_path6.default.join(sootsimDir, "cli", "commands", "agent-wrapper.ts");
|
|
2044
|
-
if (
|
|
2045
|
-
const srcMtime =
|
|
2046
|
-
const buildMtime =
|
|
2075
|
+
if (import_node_fs5.default.existsSync(src)) {
|
|
2076
|
+
const srcMtime = import_node_fs5.default.statSync(src).mtimeMs;
|
|
2077
|
+
const buildMtime = import_node_fs5.default.statSync(distBin).mtimeMs;
|
|
2047
2078
|
if (buildMtime < srcMtime) {
|
|
2048
2079
|
console.warn(
|
|
2049
2080
|
`[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with \`bun run --cwd packages/sootsim build:cli\` (watch:cli:binary builds dist-bin/ instead).`
|
|
@@ -2071,8 +2102,8 @@ function resolveSootsimPackageDir() {
|
|
|
2071
2102
|
for (let i = 0; i < 8; i++) {
|
|
2072
2103
|
const pkg = import_node_path6.default.join(cur, "package.json");
|
|
2073
2104
|
try {
|
|
2074
|
-
if (
|
|
2075
|
-
const parsed = JSON.parse(
|
|
2105
|
+
if (import_node_fs5.default.existsSync(pkg)) {
|
|
2106
|
+
const parsed = JSON.parse(import_node_fs5.default.readFileSync(pkg, "utf8"));
|
|
2076
2107
|
if (parsed.name === "sootsim") return cur;
|
|
2077
2108
|
}
|
|
2078
2109
|
} catch {
|
|
@@ -2094,9 +2125,9 @@ function fileFromImportMeta() {
|
|
|
2094
2125
|
}
|
|
2095
2126
|
async function withStartLock(projectId, provider, fn) {
|
|
2096
2127
|
const lockDir = import_node_path6.default.join(getUserDataDir(), "locks");
|
|
2097
|
-
|
|
2128
|
+
import_node_fs5.default.mkdirSync(lockDir, { recursive: true });
|
|
2098
2129
|
try {
|
|
2099
|
-
|
|
2130
|
+
import_node_fs5.default.chmodSync(lockDir, 448);
|
|
2100
2131
|
} catch {
|
|
2101
2132
|
}
|
|
2102
2133
|
const lockPath = import_node_path6.default.join(lockDir, `start-${projectId}-${provider}.lock`);
|
|
@@ -2104,17 +2135,17 @@ async function withStartLock(projectId, provider, fn) {
|
|
|
2104
2135
|
let fd = null;
|
|
2105
2136
|
while (fd === null) {
|
|
2106
2137
|
try {
|
|
2107
|
-
fd =
|
|
2138
|
+
fd = import_node_fs5.default.openSync(
|
|
2108
2139
|
lockPath,
|
|
2109
|
-
|
|
2140
|
+
import_node_fs5.constants.O_WRONLY | import_node_fs5.constants.O_CREAT | import_node_fs5.constants.O_EXCL,
|
|
2110
2141
|
384
|
|
2111
2142
|
);
|
|
2112
2143
|
} catch (err) {
|
|
2113
2144
|
if (err.code !== "EEXIST") throw err;
|
|
2114
2145
|
try {
|
|
2115
|
-
const stale = Number(
|
|
2146
|
+
const stale = Number(import_node_fs5.default.readFileSync(lockPath, "utf8").trim());
|
|
2116
2147
|
if (stale && !isProcessAlive(stale)) {
|
|
2117
|
-
|
|
2148
|
+
import_node_fs5.default.unlinkSync(lockPath);
|
|
2118
2149
|
continue;
|
|
2119
2150
|
}
|
|
2120
2151
|
} catch {
|
|
@@ -2128,15 +2159,15 @@ async function withStartLock(projectId, provider, fn) {
|
|
|
2128
2159
|
}
|
|
2129
2160
|
}
|
|
2130
2161
|
try {
|
|
2131
|
-
|
|
2162
|
+
import_node_fs5.default.writeFileSync(fd, String(process.pid));
|
|
2132
2163
|
return await fn();
|
|
2133
2164
|
} finally {
|
|
2134
2165
|
try {
|
|
2135
|
-
|
|
2166
|
+
import_node_fs5.default.closeSync(fd);
|
|
2136
2167
|
} catch {
|
|
2137
2168
|
}
|
|
2138
2169
|
try {
|
|
2139
|
-
|
|
2170
|
+
import_node_fs5.default.unlinkSync(lockPath);
|
|
2140
2171
|
} catch {
|
|
2141
2172
|
}
|
|
2142
2173
|
}
|
|
@@ -2151,24 +2182,24 @@ function isProcessAlive(pid) {
|
|
|
2151
2182
|
}
|
|
2152
2183
|
function mkfifoSync(p) {
|
|
2153
2184
|
const parent = import_node_path6.default.dirname(p);
|
|
2154
|
-
|
|
2185
|
+
import_node_fs5.default.mkdirSync(parent, { recursive: true });
|
|
2155
2186
|
try {
|
|
2156
|
-
|
|
2187
|
+
import_node_fs5.default.chmodSync(parent, 448);
|
|
2157
2188
|
} catch {
|
|
2158
2189
|
}
|
|
2159
|
-
if (
|
|
2190
|
+
if (import_node_fs5.default.existsSync(p)) {
|
|
2160
2191
|
try {
|
|
2161
|
-
const stat =
|
|
2192
|
+
const stat = import_node_fs5.default.statSync(p);
|
|
2162
2193
|
if (stat.isFIFO()) {
|
|
2163
2194
|
try {
|
|
2164
|
-
|
|
2195
|
+
import_node_fs5.default.chmodSync(p, 384);
|
|
2165
2196
|
} catch {
|
|
2166
2197
|
}
|
|
2167
2198
|
return;
|
|
2168
2199
|
}
|
|
2169
|
-
|
|
2200
|
+
import_node_fs5.default.unlinkSync(p);
|
|
2170
2201
|
} catch {
|
|
2171
|
-
|
|
2202
|
+
import_node_fs5.default.unlinkSync(p);
|
|
2172
2203
|
}
|
|
2173
2204
|
}
|
|
2174
2205
|
const result = (0, import_node_child_process.spawnSync)("mkfifo", ["-m", "600", p]);
|
|
@@ -2209,9 +2240,9 @@ async function startSession(opts) {
|
|
|
2209
2240
|
mkfifoSync(promptIn);
|
|
2210
2241
|
mkfifoSync(eventsOut);
|
|
2211
2242
|
const transcriptDir = import_node_path6.default.dirname(transcript);
|
|
2212
|
-
|
|
2243
|
+
import_node_fs5.default.mkdirSync(transcriptDir, { recursive: true });
|
|
2213
2244
|
try {
|
|
2214
|
-
|
|
2245
|
+
import_node_fs5.default.chmodSync(transcriptDir, 448);
|
|
2215
2246
|
} catch {
|
|
2216
2247
|
}
|
|
2217
2248
|
const { cmd, prefixArgs } = resolveSootsimInvocation();
|
|
@@ -2262,7 +2293,7 @@ async function startSession(opts) {
|
|
|
2262
2293
|
}
|
|
2263
2294
|
}
|
|
2264
2295
|
try {
|
|
2265
|
-
|
|
2296
|
+
import_node_fs5.default.rmSync(sessionDir(session.id), { recursive: true, force: true });
|
|
2266
2297
|
} catch {
|
|
2267
2298
|
}
|
|
2268
2299
|
updateSessionStatus(session.id, { status: "ended" });
|
|
@@ -2290,18 +2321,18 @@ async function sendPrompt(sessionId, prompt) {
|
|
|
2290
2321
|
);
|
|
2291
2322
|
}
|
|
2292
2323
|
const fifo = promptFifoPath(sessionId);
|
|
2293
|
-
if (!
|
|
2324
|
+
if (!import_node_fs5.default.existsSync(fifo)) {
|
|
2294
2325
|
throw new AgentSessionError("NO_FIFO", `prompt FIFO missing: ${fifo}`);
|
|
2295
2326
|
}
|
|
2296
|
-
const fd =
|
|
2327
|
+
const fd = import_node_fs5.default.openSync(fifo, import_node_fs5.constants.O_WRONLY);
|
|
2297
2328
|
try {
|
|
2298
2329
|
const wireText = encodeAgentPromptEnvelope(prompt);
|
|
2299
2330
|
if (!wireText) {
|
|
2300
2331
|
throw new AgentSessionError("EMPTY_PROMPT", "prompt text is empty");
|
|
2301
2332
|
}
|
|
2302
|
-
|
|
2333
|
+
import_node_fs5.default.writeSync(fd, wireText + "\n");
|
|
2303
2334
|
} finally {
|
|
2304
|
-
|
|
2335
|
+
import_node_fs5.default.closeSync(fd);
|
|
2305
2336
|
}
|
|
2306
2337
|
updateSessionStatus(sessionId, {
|
|
2307
2338
|
lastPrompt: prompt.displayText ?? prompt.text,
|
|
@@ -2323,7 +2354,7 @@ async function endSession(sessionId) {
|
|
|
2323
2354
|
const base = getUserDataDir();
|
|
2324
2355
|
if (dir.startsWith(base)) {
|
|
2325
2356
|
try {
|
|
2326
|
-
|
|
2357
|
+
import_node_fs5.default.rmSync(dir, { recursive: true, force: true });
|
|
2327
2358
|
} catch {
|
|
2328
2359
|
}
|
|
2329
2360
|
}
|
|
@@ -2331,11 +2362,11 @@ async function endSession(sessionId) {
|
|
|
2331
2362
|
}
|
|
2332
2363
|
function subscribeEvents(sessionId, onEvent) {
|
|
2333
2364
|
const fifo = eventsFifoPath(sessionId);
|
|
2334
|
-
if (!
|
|
2365
|
+
if (!import_node_fs5.default.existsSync(fifo)) {
|
|
2335
2366
|
throw new AgentSessionError("NO_FIFO", `events FIFO missing: ${fifo}`);
|
|
2336
2367
|
}
|
|
2337
|
-
const fd =
|
|
2338
|
-
const stream =
|
|
2368
|
+
const fd = import_node_fs5.default.openSync(fifo, import_node_fs5.constants.O_RDWR);
|
|
2369
|
+
const stream = import_node_fs5.default.createReadStream("", { fd, autoClose: true });
|
|
2339
2370
|
const rl = import_node_readline.default.createInterface({ input: stream, crlfDelay: Infinity });
|
|
2340
2371
|
rl.on("line", (line) => {
|
|
2341
2372
|
const event = parseAgentEventLine(line);
|
|
@@ -2356,7 +2387,7 @@ function subscribeEvents(sessionId, onEvent) {
|
|
|
2356
2387
|
};
|
|
2357
2388
|
}
|
|
2358
2389
|
async function waitForFirstEvent(fifo, predicate, timeoutMs) {
|
|
2359
|
-
const fd =
|
|
2390
|
+
const fd = import_node_fs5.default.openSync(fifo, import_node_fs5.constants.O_RDWR | import_node_fs5.constants.O_NONBLOCK);
|
|
2360
2391
|
const buf = Buffer.alloc(8192);
|
|
2361
2392
|
let leftover = "";
|
|
2362
2393
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -2364,7 +2395,7 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
|
|
|
2364
2395
|
while (Date.now() < deadline) {
|
|
2365
2396
|
let n = 0;
|
|
2366
2397
|
try {
|
|
2367
|
-
n =
|
|
2398
|
+
n = import_node_fs5.default.readSync(fd, buf, 0, buf.length, null);
|
|
2368
2399
|
} catch (err) {
|
|
2369
2400
|
if (err.code !== "EAGAIN") throw err;
|
|
2370
2401
|
n = 0;
|
|
@@ -2384,16 +2415,16 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
|
|
|
2384
2415
|
}
|
|
2385
2416
|
return null;
|
|
2386
2417
|
} finally {
|
|
2387
|
-
|
|
2418
|
+
import_node_fs5.default.closeSync(fd);
|
|
2388
2419
|
}
|
|
2389
2420
|
}
|
|
2390
|
-
var import_node_child_process, import_node_crypto2,
|
|
2421
|
+
var import_node_child_process, import_node_crypto2, import_node_fs5, import_node_path6, import_node_readline, AgentSessionError;
|
|
2391
2422
|
var init_agent_sessions = __esm({
|
|
2392
2423
|
"src/agent-sessions.ts"() {
|
|
2393
2424
|
"use strict";
|
|
2394
2425
|
import_node_child_process = require("node:child_process");
|
|
2395
2426
|
import_node_crypto2 = require("node:crypto");
|
|
2396
|
-
|
|
2427
|
+
import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
2397
2428
|
import_node_path6 = __toESM(require("node:path"), 1);
|
|
2398
2429
|
import_node_readline = __toESM(require("node:readline"), 1);
|
|
2399
2430
|
init_agent_events();
|
|
@@ -2423,11 +2454,11 @@ function mapFrameworkToProjectFramework(fw) {
|
|
|
2423
2454
|
if (fw === "one" || fw === "vxrn") return "one";
|
|
2424
2455
|
return "unknown";
|
|
2425
2456
|
}
|
|
2426
|
-
var
|
|
2457
|
+
var import_node_fs6, import_node_path7, WS_OPEN, AgentHost;
|
|
2427
2458
|
var init_agent_host = __esm({
|
|
2428
2459
|
"src/host/agent-host.ts"() {
|
|
2429
2460
|
"use strict";
|
|
2430
|
-
|
|
2461
|
+
import_node_fs6 = __toESM(require("node:fs"), 1);
|
|
2431
2462
|
import_node_path7 = __toESM(require("node:path"), 1);
|
|
2432
2463
|
init_dev_server_scanner();
|
|
2433
2464
|
init_agent_sessions();
|
|
@@ -2601,10 +2632,10 @@ var init_agent_host = __esm({
|
|
|
2601
2632
|
}
|
|
2602
2633
|
getTranscript(sessionId) {
|
|
2603
2634
|
const p = transcriptPath(sessionId);
|
|
2604
|
-
if (!
|
|
2635
|
+
if (!import_node_fs6.default.existsSync(p)) {
|
|
2605
2636
|
return { error: "transcript not found", code: "NO_TRANSCRIPT" };
|
|
2606
2637
|
}
|
|
2607
|
-
return
|
|
2638
|
+
return import_node_fs6.default.readFileSync(p, "utf8");
|
|
2608
2639
|
}
|
|
2609
2640
|
getPaths() {
|
|
2610
2641
|
const dir = getUserDataDir();
|
|
@@ -3250,7 +3281,7 @@ function injectSharedConfigIntoHtml(data) {
|
|
|
3250
3281
|
} catch {
|
|
3251
3282
|
payload = "{}";
|
|
3252
3283
|
}
|
|
3253
|
-
const tag = `<script>window.__sootsimSharedConfig=${payload};</script>`;
|
|
3284
|
+
const tag = `<script>window.__sootsimSharedConfig=${payload};window.__sootsimCliVersion=${JSON.stringify(getCliVersion())};</script>`;
|
|
3254
3285
|
const html = data.toString("utf8");
|
|
3255
3286
|
if (html.includes("</head>")) return html.replace("</head>", tag + "</head>");
|
|
3256
3287
|
if (html.includes("</body>")) return html.replace("</body>", tag + "</body>");
|
|
@@ -3267,6 +3298,7 @@ var init_bridge_host = __esm({
|
|
|
3267
3298
|
import_ws = require("ws");
|
|
3268
3299
|
init_dev_server_scanner();
|
|
3269
3300
|
init_bridge_constants();
|
|
3301
|
+
init_cli_version();
|
|
3270
3302
|
init_home_paths();
|
|
3271
3303
|
init_runtime_delivery();
|
|
3272
3304
|
init_agent_host();
|
|
@@ -3558,6 +3590,12 @@ var init_bridge_host = __esm({
|
|
|
3558
3590
|
sim.url = registration.url;
|
|
3559
3591
|
sim.title = registration.title;
|
|
3560
3592
|
sim.userAgent = registration.userAgent;
|
|
3593
|
+
if (typeof registration.kind === "string" && registration.kind.trim()) {
|
|
3594
|
+
sim.kind = registration.kind.trim();
|
|
3595
|
+
}
|
|
3596
|
+
if (registration.meta && typeof registration.meta === "object") {
|
|
3597
|
+
sim.meta = registration.meta;
|
|
3598
|
+
}
|
|
3561
3599
|
if (restored) {
|
|
3562
3600
|
this.broadcastSimAssignments();
|
|
3563
3601
|
this.broadcastSimClientStates();
|
|
@@ -4482,7 +4520,9 @@ var init_bridge_host = __esm({
|
|
|
4482
4520
|
lockedBy: lease ? lease.cliLabel || lease.cliIdentityKey : void 0,
|
|
4483
4521
|
lockedByKind: lease ? lease.kind : void 0,
|
|
4484
4522
|
lockExpiresAt: lease ? lease.expiresAt : void 0,
|
|
4485
|
-
userFocused: sim.userFocused || void 0
|
|
4523
|
+
userFocused: sim.userFocused || void 0,
|
|
4524
|
+
kind: sim.kind,
|
|
4525
|
+
meta: sim.meta
|
|
4486
4526
|
};
|
|
4487
4527
|
}
|
|
4488
4528
|
getActiveLease(sim) {
|
|
@@ -5298,6 +5338,18 @@ var COMPAT_REACT_NATIVE_DEEP_STUBS = {
|
|
|
5298
5338
|
runtimeTier: "core",
|
|
5299
5339
|
buildResolvers: ["vite"]
|
|
5300
5340
|
},
|
|
5341
|
+
rendererImplementation: {
|
|
5342
|
+
specifier: "react-native/Libraries/ReactNative/RendererImplementation",
|
|
5343
|
+
stubFile: "rn-libraries/RendererImplementation.ts",
|
|
5344
|
+
runtimeTier: "core",
|
|
5345
|
+
buildResolvers: ["vite"]
|
|
5346
|
+
},
|
|
5347
|
+
rendererProxy: {
|
|
5348
|
+
specifier: "react-native/Libraries/ReactNative/RendererProxy",
|
|
5349
|
+
stubFile: "rn-libraries/RendererProxy.ts",
|
|
5350
|
+
runtimeTier: "core",
|
|
5351
|
+
buildResolvers: ["vite"]
|
|
5352
|
+
},
|
|
5301
5353
|
getDevServer: {
|
|
5302
5354
|
specifier: "react-native/Libraries/Core/Devtools/getDevServer",
|
|
5303
5355
|
stubFile: "rn-libraries/getDevServer.ts",
|
|
@@ -6648,8 +6700,8 @@ ${result}` : result;
|
|
|
6648
6700
|
function stubMissingNativeDeps(appDir) {
|
|
6649
6701
|
const checked = /* @__PURE__ */ new Map();
|
|
6650
6702
|
function packageExists(pkgName) {
|
|
6651
|
-
const
|
|
6652
|
-
if (
|
|
6703
|
+
const cached2 = checked.get(pkgName);
|
|
6704
|
+
if (cached2 !== void 0) return cached2;
|
|
6653
6705
|
let exists = moduleExistsIn(pkgName, sootsimRoot2);
|
|
6654
6706
|
if (!exists && appDir) exists = moduleExistsIn(pkgName, appDir);
|
|
6655
6707
|
checked.set(pkgName, exists);
|
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.40 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.39 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a,b,c,d}from"./chunk-E5RYQUFB.js";import"./chunk-HWRR23AJ.js";import"./chunk-RLGCJT2D.js";import"./chunk-B3OEHV2C.js";import"./chunk-ECDPQ6S7.js";import"./chunk-WD54RD4K.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.39 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.39 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.39 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{A as R,C as y,i as p,r as w,t as x,y as v,z as d}from"./chunk-ECDPQ6S7.js";import{spawn as I}from"child_process";import M from"crypto";import s from"fs";import l from"path";import{Readable as C}from"stream";import{pipeline as N}from"stream/promises";var E="https://sootbean.com",k="SOOTSIM_CDN_ORIGIN",D="SOOTSIM_RUNTIME_CHANNEL";function S(){try{let e=JSON.parse(s.readFileSync(x(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function h(e){let n=S();return(e||process.env[k]||n.cdnOrigin||E).replace(/\/+$/,"")}function $(e){let n=S();return e||process.env[D]||n.runtimeChannel||"stable"}function T(e){let n=new URL(`${h(e)}/runtimes/manifest.json`);return n.searchParams.set("t",String(Date.now())),n.toString()}function V(e,n){return`${h(n)}/runtimes/sootsim-runtime-${e}.tar.gz`}async function b(e){let n=T(e),r=await fetch(n,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${n})`);return await r.json()}function P(e,n={}){let r=$(n.channel),t=n.version||e.channels[r]?.latest;if(!t)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let i=e.versions[t];if(!i)throw new Error(`version ${t} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:t,channel:r,entry:i}}async function _(e={}){v();let n=h(e.cdnOrigin),r=await b(n),{version:t,channel:i,entry:a}=P(r,e),o=p(t),c=e.setActive!==!1;if(!e.force&&s.existsSync(l.join(o,"index.html")))return c&&R(t),{version:t,channel:i,cdnOrigin:n,runtimeDir:o,installed:!1,activated:c,manifest:r};let g=a.tarball||V(t,n),m=l.join(w(),`sootsim-runtime-${t}.tar.gz`);process.stderr.write(`sootsim: downloading runtime ${t}\u2026
|
|
3
|
-
`),await U(g,m),process.stderr.write(`sootsim: extracting runtime ${t}\u2026
|
|
4
|
-
`);let f=await j(m);if(f!==a.sha256)throw s.rmSync(m,{force:!0}),new Error(`sha256 mismatch for runtime ${t}: expected ${a.sha256}, actual ${f}`);let u=l.join(l.dirname(o),`.installing-${t}-${process.pid}`);s.rmSync(u,{recursive:!0,force:!0}),s.mkdirSync(u,{recursive:!0});try{if(await A(m,u),!s.existsSync(l.join(u,"index.html")))throw new Error(`extracted tarball for runtime ${t} is missing index.html`);s.rmSync(o,{recursive:!0,force:!0}),s.renameSync(u,o)}catch(O){throw s.rmSync(u,{recursive:!0,force:!0}),O}return c&&R(t),{version:t,channel:i,cdnOrigin:n,runtimeDir:o,installed:!0,activated:c,manifest:r}}async function q(e={}){v();let n=h(e.cdnOrigin),r=$(e.channel),t=await b(n),i=t.channels[r]?.latest;if(!i)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:d()};if(!t.versions[i])return{checked:!0,updated:!1,reason:`manifest is missing version ${i}`,activeVersion:d(),latestVersion:i};let o=d(),c=o?p(o):null,g=c?s.existsSync(l.join(c,"index.html")):!1;if(!(!o||!g||y(i,o)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:o,latestVersion:i};let f=await _({version:i,channel:r,cdnOrigin:n,setActive:!1});return{checked:!0,updated:!0,activeVersion:i,latestVersion:i,install:f}}async function U(e,n){let r=await fetch(e);if(!r.ok||!r.body)throw new Error(`download failed: ${r.status} ${r.statusText} (${e})`);s.mkdirSync(l.dirname(n),{recursive:!0});let t=`${n}.partial`;try{await N(C.fromWeb(r.body),s.createWriteStream(t)),s.renameSync(t,n)}catch(i){try{s.unlinkSync(t)}catch{}throw i}}function j(e){return new Promise((n,r)=>{let t=M.createHash("sha256"),i=s.createReadStream(e);i.on("data",a=>t.update(a)),i.on("error",r),i.on("end",()=>n(t.digest("hex")))})}function A(e,n){return new Promise((r,t)=>{let i=I("tar",["-xzf",e,"-C",n],{stdio:["ignore","inherit","inherit"]});i.on("error",t),i.on("exit",a=>{a===0?r():t(new Error(`tar exited with code ${a}`))})})}export{E as a,h as b,b as c,_ as d,q as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.39 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.39 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a as T,c as P,e as v}from"./chunk-RLGCJT2D.js";import{E as B,F as k}from"./chunk-ECDPQ6S7.js";import{WebSocket as I}from"ws";function C(){let e=B();return e&&k(e)?e.bridgePort:7668}var h=class extends Error{lock;constructor(t,s){super(t),this.name="BridgeSimLockedError",this.lock=s}};function x(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function $(e,t={}){let s=new Set,c=t.port??C(),l=t.commandTimeoutMs??15e3,d,u="none",p=new Set(t.stripBooleanFlags??[]),g=new Set(t.stripValueFlags??[]);for(let i=0;i<e.length;i++){let a=e[i];if(a==="--port"||a==="-p"){s.add(i),i+1<e.length&&(s.add(i+1),c=Number(e[i+1])),i++;continue}if(a.startsWith("--port=")){s.add(i),c=Number(a.slice(7));continue}if(a==="--timeout"){s.add(i),i+1<e.length&&(s.add(i+1),l=Number(e[i+1])),i++;continue}if(a==="--sim"){s.add(i),i+1<e.length&&(s.add(i+1),d=e[i+1]?.trim()||void 0,u="flag"),i++;continue}if(p.has(a)){s.add(i);continue}g.has(a)&&(s.add(i),i+1<e.length&&s.add(i+1),i++)}if(!d){let i=P();i&&(d=i.trim()||void 0,u="saved")}return{positional:e.filter((i,a)=>!s.has(a)),wsPort:c,simId:d,simIdSource:u,commandTimeoutMs:l}}function O(e,t={}){let s=1,c=t.commandTimeoutMs??15e3,l=new Map,d=new I(`ws://localhost:${e}`),u=t.simId?{key:`sim:${t.simId}`,source:"explicit-sim-id",stable:!0}:T(),p=new Promise((n,r)=>{d.on("open",()=>{try{d.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:u.key,cliIdentitySource:u.source,cliLabel:t.cliLabel}))}catch{}n()}),d.on("error",o=>r(new Error(`could not connect to ws://localhost:${e}: ${o.message}`)))}),g=!1,i=!1;function a(n,r){if(i||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||n.startsWith("bridge:")||n==="focus"||n==="close")return;i=!0;let o=r??"primary",m=x(r?t.simIdSource:"none");process.stderr.write(` \u2192 ${o} (${m})
|
|
3
|
-
`)}return d.on("message",n=>{let r;try{r=JSON.parse(n.toString())}catch{return}if(r.id===0)return;let o=l.get(r.id);o&&(l.delete(r.id),r.i>0&&!g&&(g=!0,process.stderr.write(`
|
|
4
|
-
\u26A0 ${r.i} other CLI identity/identities are driving this sim
|
|
5
|
-
taps, scrolls, and keyboard input from multiple agents will collide on
|
|
6
|
-
the same screen state (this is not a bridge throughput limit).
|
|
7
|
-
use \`sootsim open --new\` for an isolated sim per agent.
|
|
8
|
-
|
|
9
|
-
`)),r.error?r.o?o.reject(new h(r.error,r.o)):o.reject(new Error(r.error)):o.resolve(r.result))}),d.on("close",(n,r)=>{let o=r?.toString()||"connection closed";for(let[m,y]of l)l.delete(m),y.reject(new Error(`sim disconnected: ${o} (code ${n})`))}),{async send(n){let r=async o=>{await p;let m=s++;return new Promise((y,w)=>{let S=setTimeout(()=>{l.delete(m),w(new Error(`command timed out after ${Math.round(c/1e3)}s`))},c);l.set(m,{resolve:b=>{clearTimeout(S),y(b)},reject:b=>{clearTimeout(S),w(b)}});let f={...n,id:m};f.simId===void 0&&o&&(f.simId=o),a(n.type??"",f.simId),d.send(JSON.stringify(f))})};try{return await r(t.simId)}catch(o){let m=o instanceof Error?o.message:String(o);if(t.fallbackOnMissingSimId&&t.simId&&n.simId===void 0&&m===`no sim connected with id ${t.simId}`)return v(),process.stderr.write(` \u26A0 saved sim ${t.simId} is gone \u2014 falling back to primary
|
|
10
|
-
pin a sim with: sootsim use <sim>
|
|
11
|
-
`),i=!1,r(void 0);throw o}},async listSims(){let n=await this.send({type:"bridge:list-sims"});return Array.isArray(n)?n:[]},async openUrl(n,r={}){return this.send({type:"bridge:open",url:n,newWindow:r.newWindow===!0})},async focusSim(n){return this.send({type:"focus",simId:n})},async closeSim(n){return this.send({type:"close",simId:n})},async claim(n,r={}){return await this.send({type:"bridge:claim",simId:n,force:r.force===!0})},close(){try{d.readyState===I.OPEN&&d.send(JSON.stringify({type:"bridge:bye",id:0}))}catch{}d.close();let n=setTimeout(()=>{d.readyState!==I.CLOSED&&d.terminate()},250)}}}function F(e){return O(e.wsPort,{commandTimeoutMs:e.commandTimeoutMs,simId:e.simId,fallbackOnMissingSimId:e.simIdSource==="saved",simIdSource:e.simIdSource})}async function N(e){try{return await e.send({type:"evaluate",code:"document.hidden"})===!0?(process.stderr.write(`
|
|
12
|
-
\u26A0 target sim is hidden (document.hidden = true)
|
|
13
|
-
animations and rAF callbacks are throttled \u2014 coordinates may be wrong
|
|
14
|
-
and launch/transition animations will not complete.
|
|
15
|
-
bring the sim to the foreground or use: sootsim debug eval "window.focus()"
|
|
16
|
-
|
|
17
|
-
`),{hidden:!0,warned:!0}):{hidden:!1,warned:!1}}catch{return{hidden:!1,warned:!1}}}async function R(e,t,s={}){let c={type:"evaluate",code:t};return s.acquireLock&&(c.acquireLock=!0),e.send(c)}async function _(e,t,...s){return e.send({type:"call",path:t,args:s})}async function D(e,t,...s){return e.send({type:"call",path:t,args:s,acquireLock:!0})}export{C as a,h as b,$ as c,O as d,F as e,N as f,R as g,_ as h,D as i};
|