sootsim 0.1.176 → 0.1.178
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 +3 -3
- package/dist-cli/chunks/{agent-XZERN2SO.js → agent-FPRPN42P.js} +3 -3
- package/dist-cli/chunks/{agent-wrapper-SAIMSLSO.js → agent-wrapper-KABXHSDP.js} +2 -2
- package/dist-cli/chunks/{app-fonts-SQVNXLI5.js → app-fonts-GEL63MTY.js} +2 -2
- package/dist-cli/chunks/{assert-EWL6BYVH.js → assert-T55K3RFP.js} +2 -2
- package/dist-cli/chunks/beta-74JMB2XJ.js +2 -0
- package/dist-cli/chunks/{camera-FFYSKETF.js → camera-RPYSAI2K.js} +2 -2
- package/dist-cli/chunks/{chunk-VBUURELX.js → chunk-2IYQJHNS.js} +2 -2
- package/dist-cli/chunks/{chunk-6BU5E655.js → chunk-2SM7WWDI.js} +1 -1
- package/dist-cli/chunks/{chunk-MWTWVX32.js → chunk-3DSTCWVF.js} +2 -2
- package/dist-cli/chunks/{chunk-OAOQVBIR.js → chunk-42SYOZVV.js} +2 -2
- package/dist-cli/chunks/{chunk-Y2ZSLUGO.js → chunk-64VAJYXX.js} +2 -2
- package/dist-cli/chunks/{chunk-OORRMRMI.js → chunk-7BHPGH6Q.js} +1 -1
- package/dist-cli/chunks/{chunk-J2BOYJ2U.js → chunk-7KFBB76L.js} +2 -2
- package/dist-cli/chunks/{chunk-HAW6OMNW.js → chunk-B2Z36B4N.js} +2 -2
- package/dist-cli/chunks/{chunk-W5QHYSDJ.js → chunk-B5KTNMPL.js} +2 -2
- package/dist-cli/chunks/{chunk-JXZYXTBM.js → chunk-B77YOZBY.js} +2 -2
- package/dist-cli/chunks/{chunk-PA5EARX2.js → chunk-CJV7PX2Y.js} +2 -2
- package/dist-cli/chunks/{chunk-D6GUXY2L.js → chunk-CVBCNRKC.js} +2 -2
- package/dist-cli/chunks/chunk-DVBRRNWE.js +2 -0
- package/dist-cli/chunks/{chunk-2SUR2RR2.js → chunk-EHKLQO7I.js} +1 -1
- package/dist-cli/chunks/{chunk-XKVI3H2G.js → chunk-EUIPNUT4.js} +2 -2
- package/dist-cli/chunks/{chunk-CEMRS6UL.js → chunk-EY3XEEE4.js} +1 -1
- package/dist-cli/chunks/{chunk-W2AZ7ASM.js → chunk-H26BCZLV.js} +1 -1
- package/dist-cli/chunks/{chunk-BGP3OZID.js → chunk-IFJU3COY.js} +1 -1
- package/dist-cli/chunks/{chunk-STWES7DO.js → chunk-ITOXSEMN.js} +1 -1
- package/dist-cli/chunks/{chunk-Q4YNZFJF.js → chunk-JFQFJLTV.js} +4 -4
- package/dist-cli/chunks/{chunk-T3576IDX.js → chunk-K66BWMVS.js} +1 -1
- package/dist-cli/chunks/{chunk-PVIMLBMX.js → chunk-LJ2DIDX3.js} +3 -3
- package/dist-cli/chunks/{chunk-ZHFUIBAE.js → chunk-M7MO47BR.js} +1 -1
- package/dist-cli/chunks/{chunk-CFPELTGN.js → chunk-NE55HRAU.js} +2 -2
- package/dist-cli/chunks/{chunk-PPUEG6C4.js → chunk-O5SQ2RZE.js} +1 -1
- package/dist-cli/chunks/{chunk-N53VJ3FY.js → chunk-OK22FXGF.js} +2 -2
- package/dist-cli/chunks/{chunk-EU54PRND.js → chunk-PG42I7UQ.js} +2 -2
- package/dist-cli/chunks/{chunk-CF3NJNBJ.js → chunk-PHLMZYE4.js} +2 -2
- package/dist-cli/chunks/chunk-PNFYOQ4N.js +1 -0
- package/dist-cli/chunks/{chunk-SR7DWNZ3.js → chunk-PQLLJLSM.js} +1 -1
- package/dist-cli/chunks/{chunk-6S2MBFBN.js → chunk-PTBJZ3IO.js} +1 -1
- package/dist-cli/chunks/{chunk-ZAAITWNI.js → chunk-Q4PUVMFU.js} +1 -1
- package/dist-cli/chunks/{chunk-XKNXS6EC.js → chunk-RVVFK6CF.js} +1 -1
- package/dist-cli/chunks/{chunk-Y3NDHGEY.js → chunk-TBWJVJXW.js} +2 -2
- package/dist-cli/chunks/{chunk-HZSJ6FL3.js → chunk-UYKA44Y4.js} +2 -2
- package/dist-cli/chunks/chunk-V3N55LMK.js +4 -0
- package/dist-cli/chunks/{chunk-4WLI2STY.js → chunk-WY3B2Y5J.js} +2 -2
- package/dist-cli/chunks/{chunk-L2CTRBGR.js → chunk-XGU672KO.js} +1 -1
- package/dist-cli/chunks/{chunk-NMP6YTXS.js → chunk-YD3CNK36.js} +1 -1
- package/dist-cli/chunks/chunk-YFLYSJL6.js +1 -0
- package/dist-cli/chunks/{chunk-55LUU75I.js → chunk-YKV52CQX.js} +2 -2
- package/dist-cli/chunks/{chunk-OQ3N5IOK.js → chunk-YLQE2RO4.js} +3 -3
- package/dist-cli/chunks/{chunk-GBZNVWFP.js → chunk-YXBC4N6Z.js} +2 -2
- package/dist-cli/chunks/{chunk-63VEHUYI.js → chunk-ZKGEGXVG.js} +2 -2
- package/dist-cli/chunks/{chunk-NA2KJSP6.js → chunk-ZVZMM2RT.js} +1 -1
- package/dist-cli/chunks/cli-version-PVBTBN2X.js +2 -0
- package/dist-cli/chunks/{compat-ZFBUC4BH.js → compat-VDOLM4JY.js} +3 -3
- package/dist-cli/chunks/{control-3JJLR4W5.js → control-N6IWKWQ7.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-FCEFZTYY.js → cpu-profile-CR4EKOPN.js} +2 -2
- package/dist-cli/chunks/daemon-HORAEEZR.js +2 -0
- package/dist-cli/chunks/{debug-CUBIZBSH.js → debug-4FCBFVDX.js} +3 -3
- package/dist-cli/chunks/{detox-4225EYR3.js → detox-TP77ADA2.js} +2 -2
- package/dist-cli/chunks/{device-S6BWDHPM.js → device-YRU6RDD2.js} +2 -2
- package/dist-cli/chunks/{diagnose-6CIKXRQI.js → diagnose-ZU4XLIKW.js} +2 -2
- package/dist-cli/chunks/drivers-BSP2USRT.js +2 -0
- package/dist-cli/chunks/{electron-37AEV4TD.js → electron-UWTORKRO.js} +3 -3
- package/dist-cli/chunks/flow-ZXUEU6WL.js +2 -0
- package/dist-cli/chunks/help-6OSM7CI4.js +2 -0
- package/dist-cli/chunks/{hints-NNX3XRHL.js → hints-X5YLALUQ.js} +2 -2
- package/dist-cli/chunks/{home-paths-GOXDTTLM.js → home-paths-LMEDDTAQ.js} +2 -2
- package/dist-cli/chunks/{inspect-YSYKYPAO.js → inspect-IFCVFMIW.js} +4 -4
- package/dist-cli/chunks/{install-desktop-OHGSHF3I.js → install-desktop-VVQIBZRU.js} +3 -3
- package/dist-cli/chunks/{keys-U7AANCE7.js → keys-GDX235ZQ.js} +2 -2
- package/dist-cli/chunks/{login-HQ7IGHOQ.js → login-MUIJHNM7.js} +4 -4
- package/dist-cli/chunks/{logout-CDVV56NI.js → logout-GV3H23TK.js} +2 -2
- package/dist-cli/chunks/{maestro-ZSO5MEL7.js → maestro-IFTHFVUR.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-26DVI7SE.js +2 -0
- package/dist-cli/chunks/{preview-QHRLVFZ3.js → preview-COYJHGIY.js} +2 -2
- package/dist-cli/chunks/{profile-JQ2VTWDK.js → profile-726ZBBXY.js} +2 -2
- package/dist-cli/chunks/{react-FZAOHKVR.js → react-LLN5L6NM.js} +2 -2
- package/dist-cli/chunks/{record-6SKJBVDV.js → record-TMJG2SMU.js} +2 -2
- package/dist-cli/chunks/runtime-3NQVPRES.js +2 -0
- package/dist-cli/chunks/{screenshot-ZWWD7RKD.js → screenshot-UFKR5MDO.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-AVGIIPOT.js → screenshot-mode-3ZGQR45L.js} +2 -2
- package/dist-cli/chunks/{screenshots-HNAQHHEZ.js → screenshots-JXS7HP2B.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-GR3JCQEV.js → screenshots-capture-ZBUHYPJJ.js} +2 -2
- package/dist-cli/chunks/{serve-E5JSN7LL.js → serve-ZG3KCDUO.js} +16 -16
- package/dist-cli/chunks/{setup-2M6ZQHFS.js → setup-2XT4LRR5.js} +2 -2
- package/dist-cli/chunks/{skills-EK6EIZKG.js → skills-3I7UWGIB.js} +2 -2
- package/dist-cli/chunks/{slides-7LMX75H7.js → slides-SCGGLDQQ.js} +2 -2
- package/dist-cli/chunks/store-7LKGHVAR.js +2 -0
- package/dist-cli/chunks/telemetry-SQRPQEGO.js +2 -0
- package/dist-cli/chunks/{test-GTYC4F55.js → test-ZRWZBUMK.js} +3 -3
- package/dist-cli/chunks/{three-mode-2PYZFZSU.js → three-mode-LJHDX4PK.js} +2 -2
- package/dist-cli/chunks/{timeline-MIFLVHUE.js → timeline-5OFJISEU.js} +2 -2
- package/dist-cli/chunks/{upgrade-ZVV5XJUB.js → upgrade-M7HFPN57.js} +2 -2
- package/dist-cli/chunks/upload-OOTFDONE.js +2 -0
- package/dist-cli/chunks/{version-IDZEL6JB.js → version-DHZQAZ66.js} +2 -2
- package/dist-cli/chunks/web-43QEU5SE.js +2 -0
- package/dist-cli/chunks/{what-happened-2YDLA4TU.js → what-happened-RNVAVGKL.js} +2 -2
- package/dist-cli/chunks/{whoami-MHMILIEP.js → whoami-F5EYWJCY.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +10 -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/beta.cjs +1 -1
- package/dist-lib/beta.mjs +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/detox/index.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 +126 -12
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +64 -21
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +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/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +244 -102
- package/dist-lib/vite.cjs +64 -18
- package/package.json +7 -1
- package/src/agent-daemon-client.ts +13 -0
- package/src/agent-identity.ts +21 -0
- package/src/agentbus-prompt.ts +80 -0
- package/src/host/agent-host.ts +42 -0
- package/src/host/bridge-host.ts +14 -1
- package/src/native-seam-manifest.ts +11 -0
- package/src/vite-plugin-one.ts +63 -16
- package/dist-cli/chunks/beta-2CPZK3F2.js +0 -2
- package/dist-cli/chunks/chunk-3LI5PWSP.js +0 -2
- package/dist-cli/chunks/chunk-6WURQDZI.js +0 -1
- package/dist-cli/chunks/chunk-NPPSB4KE.js +0 -1
- package/dist-cli/chunks/chunk-XC3EDXUI.js +0 -4
- package/dist-cli/chunks/cli-version-ZQBDNAUR.js +0 -2
- package/dist-cli/chunks/daemon-3GBPTTR7.js +0 -2
- package/dist-cli/chunks/drivers-LI6YV5M7.js +0 -2
- package/dist-cli/chunks/flow-VBH4BQSB.js +0 -2
- package/dist-cli/chunks/help-23IS4JFP.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-RG5TBVMN.js +0 -2
- package/dist-cli/chunks/runtime-KFHRVRZQ.js +0 -2
- package/dist-cli/chunks/store-VOGIKQFW.js +0 -2
- package/dist-cli/chunks/telemetry-7TUUNCCB.js +0 -2
- package/dist-cli/chunks/upload-AW66MDC5.js +0 -2
- package/dist-cli/chunks/web-IGOSYQWE.js +0 -2
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.178 | (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;
|
|
@@ -39,9 +39,8 @@ module.exports = __toCommonJS(vite_plugin_one_exports);
|
|
|
39
39
|
var import_fs2 = __toESM(require("fs"), 1);
|
|
40
40
|
var import_path2 = __toESM(require("path"), 1);
|
|
41
41
|
|
|
42
|
-
// src/
|
|
43
|
-
var
|
|
44
|
-
var import_path = __toESM(require("path"), 1);
|
|
42
|
+
// src/bridge-constants.ts
|
|
43
|
+
var DEFAULT_SOOTSIM_BRIDGE_PORT = 7668;
|
|
45
44
|
|
|
46
45
|
// src/home-paths.ts
|
|
47
46
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
@@ -49,6 +48,8 @@ var import_node_os = require("node:os");
|
|
|
49
48
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
50
49
|
var SOOTSIM_HOME_ENV = "SOOTSIM_HOME";
|
|
51
50
|
var ACTIVE_RUNTIME_FILE = "active";
|
|
51
|
+
var DAEMON_LOCKFILE = "daemon.json";
|
|
52
|
+
var DAEMON_HEARTBEAT_STALE_MS = 3e4;
|
|
52
53
|
function sootsimHomeDir() {
|
|
53
54
|
const override = process.env[SOOTSIM_HOME_ENV];
|
|
54
55
|
if (override && override.length > 0) return import_node_path.default.resolve(override);
|
|
@@ -63,6 +64,9 @@ function runtimeDir(version) {
|
|
|
63
64
|
function activeRuntimeFile() {
|
|
64
65
|
return import_node_path.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
|
|
65
66
|
}
|
|
67
|
+
function daemonLockfilePath() {
|
|
68
|
+
return import_node_path.default.join(sootsimHomeDir(), DAEMON_LOCKFILE);
|
|
69
|
+
}
|
|
66
70
|
function readActiveRuntime() {
|
|
67
71
|
try {
|
|
68
72
|
const value = import_node_fs.default.readFileSync(activeRuntimeFile(), "utf8").trim();
|
|
@@ -72,8 +76,39 @@ function readActiveRuntime() {
|
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
79
|
+
function readDaemonLockfile() {
|
|
80
|
+
try {
|
|
81
|
+
const fd = import_node_fs.default.openSync(daemonLockfilePath(), "r");
|
|
82
|
+
try {
|
|
83
|
+
const buf = Buffer.alloc(DAEMON_LOCKFILE_MAX_BYTES);
|
|
84
|
+
const bytesRead = import_node_fs.default.readSync(fd, buf, 0, DAEMON_LOCKFILE_MAX_BYTES, 0);
|
|
85
|
+
const raw = buf.subarray(0, bytesRead).toString("utf8");
|
|
86
|
+
const parsed = JSON.parse(raw);
|
|
87
|
+
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") {
|
|
88
|
+
return parsed;
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
} finally {
|
|
92
|
+
import_node_fs.default.closeSync(fd);
|
|
93
|
+
}
|
|
94
|
+
} catch {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function isDaemonLockfileFresh(lock, now = Date.now()) {
|
|
99
|
+
if (!lock) return false;
|
|
100
|
+
if (now - lock.heartbeatAt > DAEMON_HEARTBEAT_STALE_MS) return false;
|
|
101
|
+
try {
|
|
102
|
+
process.kill(lock.pid, 0);
|
|
103
|
+
return true;
|
|
104
|
+
} catch {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
75
108
|
|
|
76
109
|
// src/runtime-assets.ts
|
|
110
|
+
var import_fs = __toESM(require("fs"), 1);
|
|
111
|
+
var import_path = __toESM(require("path"), 1);
|
|
77
112
|
var SOOTSIM_RUNTIME_MISSING_MESSAGE = "[sootsim] no engine runtime installed \u2014 run `sootsim setup`, or `sootsim runtime install`";
|
|
78
113
|
var MIME_TYPES = {
|
|
79
114
|
".js": "application/javascript",
|
|
@@ -148,6 +183,13 @@ function sootsimPlugin(options = {}) {
|
|
|
148
183
|
name: "sootsim-one",
|
|
149
184
|
configureServer(server) {
|
|
150
185
|
const bundleUrl = options.bundleUrl || "/node_modules/one/metro-entry.bundle?platform=ios&dev=true&minify=false";
|
|
186
|
+
const buildShellHtml = (runtimeRoot) => {
|
|
187
|
+
const html = import_fs2.default.readFileSync(import_path2.default.join(runtimeRoot, "index.html"), "utf8");
|
|
188
|
+
const lock = readDaemonLockfile();
|
|
189
|
+
const bridgePort = lock && isDaemonLockfileFresh(lock) && lock.bridgePort > 0 ? lock.bridgePort : DEFAULT_SOOTSIM_BRIDGE_PORT;
|
|
190
|
+
const inject = `<script>(function(){var u=new URL(location.href);if(!u.searchParams.has('bundle'))u.searchParams.set('bundle',${JSON.stringify(bundleUrl)});window.__sootsimBridgePort=${bridgePort};history.replaceState(null,'','${prefix}/'+u.search)})()</script>`;
|
|
191
|
+
return html.replace("</head>", inject + "</head>");
|
|
192
|
+
};
|
|
151
193
|
server.middlewares.use((req, res, next) => {
|
|
152
194
|
const origWriteHead = res.writeHead.bind(res);
|
|
153
195
|
res.writeHead = function(statusCode, ...args) {
|
|
@@ -164,6 +206,22 @@ function sootsimPlugin(options = {}) {
|
|
|
164
206
|
};
|
|
165
207
|
next();
|
|
166
208
|
});
|
|
209
|
+
server.middlewares.use((req, res, next) => {
|
|
210
|
+
if ((req.url || "").split("?")[0] !== "/__server-scan") return next();
|
|
211
|
+
const scanPort = server.config.server.port || 8081;
|
|
212
|
+
const absoluteBundleUrl = bundleUrl.startsWith("http") ? bundleUrl : `http://localhost:${scanPort}${bundleUrl}`;
|
|
213
|
+
res.setHeader("content-type", "application/json");
|
|
214
|
+
res.end(
|
|
215
|
+
JSON.stringify([
|
|
216
|
+
{
|
|
217
|
+
port: scanPort,
|
|
218
|
+
framework: "one",
|
|
219
|
+
bundleUrl: absoluteBundleUrl,
|
|
220
|
+
lastSeen: Date.now()
|
|
221
|
+
}
|
|
222
|
+
])
|
|
223
|
+
);
|
|
224
|
+
});
|
|
167
225
|
server.middlewares.use((req, res, next) => {
|
|
168
226
|
const url = req.url || "";
|
|
169
227
|
const pathname = url.split("?")[0];
|
|
@@ -185,14 +243,8 @@ function sootsimPlugin(options = {}) {
|
|
|
185
243
|
}
|
|
186
244
|
}
|
|
187
245
|
if (pathname === prefix || pathname === prefix + "/") {
|
|
188
|
-
const htmlPath = import_path2.default.join(runtimeRoot, "index.html");
|
|
189
|
-
let html = import_fs2.default.readFileSync(htmlPath, "utf8");
|
|
190
|
-
html = html.replace(
|
|
191
|
-
"</head>",
|
|
192
|
-
`<script>history.replaceState(null,'','${prefix}/?bundle=${encodeURIComponent(bundleUrl)}')</script></head>`
|
|
193
|
-
);
|
|
194
246
|
res.setHeader("content-type", "text/html");
|
|
195
|
-
res.end(
|
|
247
|
+
res.end(buildShellHtml(runtimeRoot));
|
|
196
248
|
return;
|
|
197
249
|
}
|
|
198
250
|
if (pathname.startsWith(prefix + "/")) {
|
|
@@ -206,14 +258,8 @@ function sootsimPlugin(options = {}) {
|
|
|
206
258
|
}
|
|
207
259
|
const ext = import_path2.default.extname(pathname);
|
|
208
260
|
if (!ext) {
|
|
209
|
-
const htmlPath = import_path2.default.join(runtimeRoot, "index.html");
|
|
210
|
-
let html = import_fs2.default.readFileSync(htmlPath, "utf8");
|
|
211
|
-
html = html.replace(
|
|
212
|
-
"</head>",
|
|
213
|
-
`<script>history.replaceState(null,'','${prefix}/?bundle=${encodeURIComponent(bundleUrl)}')</script></head>`
|
|
214
|
-
);
|
|
215
261
|
res.setHeader("content-type", "text/html");
|
|
216
|
-
res.end(
|
|
262
|
+
res.end(buildShellHtml(runtimeRoot));
|
|
217
263
|
return;
|
|
218
264
|
}
|
|
219
265
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sootsim",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.178",
|
|
4
4
|
"description": "sootsim CLI + vite/metro plugins + skills registry. bridge client for driving the proprietary sootsim-engine over WebSocket.",
|
|
5
5
|
"author": "Tamagui LLC",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,6 +66,12 @@
|
|
|
66
66
|
"source": "./src/agent-daemon-client.ts",
|
|
67
67
|
"default": "./dist-lib/agent-daemon-client.cjs"
|
|
68
68
|
},
|
|
69
|
+
"./agent-identity": {
|
|
70
|
+
"source": "./src/agent-identity.ts",
|
|
71
|
+
"bun": "./src/agent-identity.ts",
|
|
72
|
+
"import": "./src/agent-identity.ts",
|
|
73
|
+
"default": "./dist-lib/agent-identity.cjs"
|
|
74
|
+
},
|
|
69
75
|
"./attached-projects": {
|
|
70
76
|
"source": "./src/attached-projects.ts",
|
|
71
77
|
"default": "./dist-lib/attached-projects.cjs"
|
|
@@ -165,6 +165,19 @@ export class AgentDaemonClient {
|
|
|
165
165
|
})
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
async sendClaimedPrompt(
|
|
169
|
+
simId: string,
|
|
170
|
+
prompt: AgentPromptEnvelope,
|
|
171
|
+
): Promise<{ ok: true; routed: 'agentbus'; sessionId: string }> {
|
|
172
|
+
return this.send<{ ok: true; routed: 'agentbus'; sessionId: string }>(
|
|
173
|
+
'agent:send-claimed-prompt',
|
|
174
|
+
{
|
|
175
|
+
simId,
|
|
176
|
+
prompt,
|
|
177
|
+
},
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
168
181
|
async endSession(sessionId: string): Promise<{ ok: true }> {
|
|
169
182
|
return this.send<{ ok: true }>('agent:end-session', { sessionId })
|
|
170
183
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const AGENTBUS_SESSION_RE = /^[A-Za-z0-9._:-]{1,160}$/
|
|
2
|
+
|
|
3
|
+
export function agentSessionIdFromCliIdentity(identity: string | null): string | null {
|
|
4
|
+
if (!identity) return null
|
|
5
|
+
const colon = identity.indexOf(':')
|
|
6
|
+
if (colon < 0) return identity.trim() || null
|
|
7
|
+
const source = identity.slice(0, colon)
|
|
8
|
+
const value = identity.slice(colon + 1).trim()
|
|
9
|
+
return source === 'SOOTSIM_CLI_IDENTITY' && value ? value : null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function agentbusSessionIdFromCliIdentity(identity: string | null): string | null {
|
|
13
|
+
if (!identity?.startsWith('AGENTBUS_SESSION:')) return null
|
|
14
|
+
const sessionId = identity.slice('AGENTBUS_SESSION:'.length).trim()
|
|
15
|
+
if (!AGENTBUS_SESSION_RE.test(sessionId)) return null
|
|
16
|
+
return sessionId
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function isValidAgentbusSessionId(sessionId: string): boolean {
|
|
20
|
+
return AGENTBUS_SESSION_RE.test(sessionId)
|
|
21
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process'
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import os from 'node:os'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import {
|
|
6
|
+
agentbusSessionIdFromCliIdentity,
|
|
7
|
+
isValidAgentbusSessionId,
|
|
8
|
+
} from './agent-identity.ts'
|
|
9
|
+
import type { AgentPromptEnvelope } from './agent-prompt.ts'
|
|
10
|
+
|
|
11
|
+
export { agentbusSessionIdFromCliIdentity } from './agent-identity.ts'
|
|
12
|
+
|
|
13
|
+
export function formatAgentbusPromptText(prompt: AgentPromptEnvelope): string {
|
|
14
|
+
return typeof prompt.text === 'string' ? prompt.text.trim() : ''
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function resolveAgentbusCommand(explicit?: string): string {
|
|
18
|
+
const fromArg = explicit?.trim()
|
|
19
|
+
if (fromArg) return fromArg
|
|
20
|
+
const fromEnv = process.env.AGENTBUS_COMMAND?.trim()
|
|
21
|
+
if (fromEnv) return fromEnv
|
|
22
|
+
const localBin = path.join(os.homedir(), '.local', 'bin', 'agentbus')
|
|
23
|
+
if (fs.existsSync(localBin)) return localBin
|
|
24
|
+
return 'agentbus'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function sendPromptToAgentbusSession(input: {
|
|
28
|
+
sessionId: string
|
|
29
|
+
prompt: AgentPromptEnvelope
|
|
30
|
+
command?: string
|
|
31
|
+
timeoutMs?: number
|
|
32
|
+
}): Promise<void> {
|
|
33
|
+
const sessionId = input.sessionId.trim()
|
|
34
|
+
if (!isValidAgentbusSessionId(sessionId)) {
|
|
35
|
+
throw new Error(`invalid agentbus session id: ${sessionId || '<empty>'}`)
|
|
36
|
+
}
|
|
37
|
+
const text = formatAgentbusPromptText(input.prompt)
|
|
38
|
+
if (!text) {
|
|
39
|
+
throw new Error('prompt text is empty')
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const command = resolveAgentbusCommand(input.command)
|
|
43
|
+
const timeoutMs = input.timeoutMs ?? 15_000
|
|
44
|
+
await new Promise<void>((resolve, reject) => {
|
|
45
|
+
const child = spawn(command, ['send', sessionId, text], {
|
|
46
|
+
stdio: ['ignore', 'ignore', 'pipe'],
|
|
47
|
+
env: process.env,
|
|
48
|
+
})
|
|
49
|
+
let stderr = ''
|
|
50
|
+
const timer = setTimeout(() => {
|
|
51
|
+
try {
|
|
52
|
+
child.kill('SIGTERM')
|
|
53
|
+
} catch {}
|
|
54
|
+
reject(new Error(`agentbus send timed out after ${Math.round(timeoutMs / 1000)}s`))
|
|
55
|
+
}, timeoutMs)
|
|
56
|
+
|
|
57
|
+
child.stderr?.setEncoding('utf8')
|
|
58
|
+
child.stderr?.on('data', (chunk) => {
|
|
59
|
+
if (stderr.length < 4000) stderr += String(chunk)
|
|
60
|
+
})
|
|
61
|
+
child.on('error', (err) => {
|
|
62
|
+
clearTimeout(timer)
|
|
63
|
+
reject(err)
|
|
64
|
+
})
|
|
65
|
+
child.on('exit', (code, signal) => {
|
|
66
|
+
clearTimeout(timer)
|
|
67
|
+
if (code === 0) {
|
|
68
|
+
resolve()
|
|
69
|
+
return
|
|
70
|
+
}
|
|
71
|
+
const detail = stderr.trim()
|
|
72
|
+
reject(
|
|
73
|
+
new Error(
|
|
74
|
+
detail ||
|
|
75
|
+
`agentbus send exited with ${signal ? `signal ${signal}` : `code ${code ?? 'unknown'}`}`,
|
|
76
|
+
),
|
|
77
|
+
)
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
}
|
package/src/host/agent-host.ts
CHANGED
|
@@ -28,6 +28,10 @@ import {
|
|
|
28
28
|
transcriptPath,
|
|
29
29
|
type Provider,
|
|
30
30
|
} from '../agent-sessions.ts'
|
|
31
|
+
import {
|
|
32
|
+
agentbusSessionIdFromCliIdentity,
|
|
33
|
+
sendPromptToAgentbusSession,
|
|
34
|
+
} from '../agentbus-prompt.ts'
|
|
31
35
|
import {
|
|
32
36
|
deleteProject,
|
|
33
37
|
findProjectById,
|
|
@@ -64,6 +68,15 @@ export interface AgentHostOptions {
|
|
|
64
68
|
* the rest of the repo uses, so `sootsim serve` standalone does the
|
|
65
69
|
* right thing. */
|
|
66
70
|
getExcludePorts?: () => number[]
|
|
71
|
+
/** returns the active CLI lease for a sim. used only for prompt routing to
|
|
72
|
+
* an external agentbus-wrapped agent that claimed the tab. */
|
|
73
|
+
resolveCliLease?: (simId: string) => AgentCliLeaseSnapshot | null
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface AgentCliLeaseSnapshot {
|
|
77
|
+
kind: 'cli' | 'user-active'
|
|
78
|
+
cliIdentityKey: string
|
|
79
|
+
expiresAt: number
|
|
67
80
|
}
|
|
68
81
|
|
|
69
82
|
/** default excludes keep the dev-server scanner from hitting soot's own
|
|
@@ -183,6 +196,8 @@ export class AgentHost {
|
|
|
183
196
|
return listSessions(msg.projectId ? String(msg.projectId) : undefined)
|
|
184
197
|
case 'agent:start-session':
|
|
185
198
|
return this.doStartSession(msg.input ?? {})
|
|
199
|
+
case 'agent:send-claimed-prompt':
|
|
200
|
+
return this.sendClaimedPrompt(msg)
|
|
186
201
|
case 'agent:send-prompt': {
|
|
187
202
|
const sessionId = String(msg.sessionId)
|
|
188
203
|
const session = findSessionById(sessionId)
|
|
@@ -216,6 +231,33 @@ export class AgentHost {
|
|
|
216
231
|
|
|
217
232
|
// --- operation impls ---
|
|
218
233
|
|
|
234
|
+
private async sendClaimedPrompt(msg: any): Promise<{
|
|
235
|
+
ok: true
|
|
236
|
+
routed: 'agentbus'
|
|
237
|
+
sessionId: string
|
|
238
|
+
}> {
|
|
239
|
+
const simId = typeof msg.simId === 'string' ? msg.simId.trim() : ''
|
|
240
|
+
if (!simId) {
|
|
241
|
+
throw new AgentSessionError('NO_SIM', 'agent:send-claimed-prompt requires simId')
|
|
242
|
+
}
|
|
243
|
+
const lease = this.opts.resolveCliLease?.(simId) ?? null
|
|
244
|
+
if (!lease || lease.kind !== 'cli' || lease.expiresAt <= Date.now()) {
|
|
245
|
+
throw new AgentSessionError('NO_CLAIM', `sim ${simId} has no active CLI claim`)
|
|
246
|
+
}
|
|
247
|
+
const sessionId = agentbusSessionIdFromCliIdentity(lease.cliIdentityKey)
|
|
248
|
+
if (!sessionId) {
|
|
249
|
+
throw new AgentSessionError(
|
|
250
|
+
'UNSUPPORTED_CLAIM',
|
|
251
|
+
`sim ${simId} is claimed by a CLI identity that is not promptable`,
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
await sendPromptToAgentbusSession({
|
|
255
|
+
sessionId,
|
|
256
|
+
prompt: this.normalizePromptEnvelope(msg),
|
|
257
|
+
})
|
|
258
|
+
return { ok: true, routed: 'agentbus', sessionId }
|
|
259
|
+
}
|
|
260
|
+
|
|
219
261
|
private async doStartSession(input: {
|
|
220
262
|
projectId: string
|
|
221
263
|
provider?: Provider
|
package/src/host/bridge-host.ts
CHANGED
|
@@ -439,7 +439,20 @@ export class SootSimBridgeHost {
|
|
|
439
439
|
// respawned it forever.
|
|
440
440
|
this.portFallbackCount = Math.max(1, opts.portFallbackCount ?? 10)
|
|
441
441
|
this.openUrlHandler = opts.openUrl
|
|
442
|
-
this.agentHost = new AgentHost({
|
|
442
|
+
this.agentHost = new AgentHost({
|
|
443
|
+
getExcludePorts: opts.agentScanExcludes,
|
|
444
|
+
resolveCliLease: (simId) => {
|
|
445
|
+
const sim = this.sims.get(simId)
|
|
446
|
+
const lease = sim ? this.getActiveLease(sim) : null
|
|
447
|
+
return lease
|
|
448
|
+
? {
|
|
449
|
+
kind: lease.kind,
|
|
450
|
+
cliIdentityKey: lease.cliIdentityKey,
|
|
451
|
+
expiresAt: lease.expiresAt,
|
|
452
|
+
}
|
|
453
|
+
: null
|
|
454
|
+
},
|
|
455
|
+
})
|
|
443
456
|
this.sootbeanOrigin = opts.sootbeanOrigin?.replace(/\/$/, '') || null
|
|
444
457
|
this.simIdleReapTtlMs =
|
|
445
458
|
opts.simIdleReapTtlMs ?? SootSimBridgeHost.SIM_IDLE_REAP_TTL_MS
|
|
@@ -320,4 +320,15 @@ export const NATIVE_SEAM_MANIFEST: NativeSeamEntry[] = [
|
|
|
320
320
|
notes:
|
|
321
321
|
'expo-notifications native modules — routes scheduling/badge/installation-id through engine NotificationBus; tap callbacks fan out via the bus event emitters',
|
|
322
322
|
},
|
|
323
|
+
{
|
|
324
|
+
pkg: 'react-native-enriched-markdown',
|
|
325
|
+
seamBasenames: [
|
|
326
|
+
'EnrichedMarkdownTextNativeComponent',
|
|
327
|
+
'EnrichedMarkdownNativeComponent',
|
|
328
|
+
'EnrichedMarkdownTextInputNativeComponent',
|
|
329
|
+
],
|
|
330
|
+
target: seamPath('react-native-enriched-markdown'),
|
|
331
|
+
notes:
|
|
332
|
+
'generated Fabric markdown host components; upstream Streamdown/enriched-markdown JS runs unchanged',
|
|
333
|
+
},
|
|
323
334
|
]
|
package/src/vite-plugin-one.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import fs from 'fs'
|
|
9
9
|
import path from 'path'
|
|
10
|
+
import { DEFAULT_SOOTSIM_BRIDGE_PORT } from './bridge-constants'
|
|
11
|
+
import { isDaemonLockfileFresh, readDaemonLockfile } from './home-paths'
|
|
10
12
|
import {
|
|
11
13
|
isRootRuntimeAssetPath,
|
|
12
14
|
resolveActiveRuntimeRoot,
|
|
@@ -43,6 +45,36 @@ export function sootsimPlugin(options: SootPluginOptions = {}): Plugin[] {
|
|
|
43
45
|
options.bundleUrl ||
|
|
44
46
|
'/node_modules/one/metro-entry.bundle?platform=ios&dev=true&minify=false'
|
|
45
47
|
|
|
48
|
+
// build the shell HTML, injecting the bundle URL (so main.tsx loads this
|
|
49
|
+
// app's bundle) AND window.__sootsimBridgePort. the bridge-port injection
|
|
50
|
+
// mirrors the dev-stack bridge-host: without it the engine's
|
|
51
|
+
// resolveBridgePort() falls back to a location-derived guess that mis-maps
|
|
52
|
+
// a non-soot app port (the mobile template's :4400 -> 9068) and the sim
|
|
53
|
+
// can't reach the bridge. resolved per-request from the daemon lockfile
|
|
54
|
+
// (the CLI's `open` writes/uses it before the shell loads) so the engine
|
|
55
|
+
// targets the SAME bridge the CLI does; default port otherwise.
|
|
56
|
+
const buildShellHtml = (runtimeRoot: string): string => {
|
|
57
|
+
const html = fs.readFileSync(path.join(runtimeRoot, 'index.html'), 'utf8')
|
|
58
|
+
const lock = readDaemonLockfile()
|
|
59
|
+
const bridgePort =
|
|
60
|
+
lock && isDaemonLockfileFresh(lock) && lock.bridgePort > 0
|
|
61
|
+
? lock.bridgePort
|
|
62
|
+
: DEFAULT_SOOTSIM_BRIDGE_PORT
|
|
63
|
+
// inject the bridge port + a default bundle (only when the URL has none,
|
|
64
|
+
// so the CLI's resolved bundle wins), and PRESERVE the existing query.
|
|
65
|
+
// preserving the query is essential: `sootsim open` stamps the open URL
|
|
66
|
+
// with `inspectOpen=<token>` and matches the registered sim by that
|
|
67
|
+
// token (waitForSimMatch). the old code forced `?bundle=` only and
|
|
68
|
+
// stripped inspectOpen, so the sim registered but never matched and
|
|
69
|
+
// `open` timed out after 60s.
|
|
70
|
+
const inject =
|
|
71
|
+
`<script>(function(){var u=new URL(location.href);` +
|
|
72
|
+
`if(!u.searchParams.has('bundle'))u.searchParams.set('bundle',${JSON.stringify(bundleUrl)});` +
|
|
73
|
+
`window.__sootsimBridgePort=${bridgePort};` +
|
|
74
|
+
`history.replaceState(null,'','${prefix}/'+u.search)})()</script>`
|
|
75
|
+
return html.replace('</head>', inject + '</head>')
|
|
76
|
+
}
|
|
77
|
+
|
|
46
78
|
// mirror Set-Cookie into a readable header for sootsim's fetch wrapper
|
|
47
79
|
server.middlewares.use((req, res, next) => {
|
|
48
80
|
const origWriteHead = res.writeHead.bind(res)
|
|
@@ -63,6 +95,34 @@ export function sootsimPlugin(options: SootPluginOptions = {}): Plugin[] {
|
|
|
63
95
|
next()
|
|
64
96
|
})
|
|
65
97
|
|
|
98
|
+
// serve a minimal /__server-scan describing THIS vite dev server, so a
|
|
99
|
+
// sootsim shell loaded from <port>/__soot can resolve this app's native
|
|
100
|
+
// bundle. dev-bundle-resolution's resolvePortViaServerScan fetches
|
|
101
|
+
// `/__server-scan` RELATIVE to the shell origin; when the shell is loaded
|
|
102
|
+
// from this target origin, that hits here. without it the request SPA-
|
|
103
|
+
// falls-back to 404 and the bundle never resolves (sootsim open hangs).
|
|
104
|
+
// we describe only this server (the shell drives THIS app) — no localhost-
|
|
105
|
+
// wide scan, so the published plugin pulls in no shell-only scanner
|
|
106
|
+
// internals. shape matches DiscoveredServer enough for the resolver.
|
|
107
|
+
server.middlewares.use((req, res, next) => {
|
|
108
|
+
if ((req.url || '').split('?')[0] !== '/__server-scan') return next()
|
|
109
|
+
const scanPort = server.config.server.port || 8081
|
|
110
|
+
const absoluteBundleUrl = bundleUrl.startsWith('http')
|
|
111
|
+
? bundleUrl
|
|
112
|
+
: `http://localhost:${scanPort}${bundleUrl}`
|
|
113
|
+
res.setHeader('content-type', 'application/json')
|
|
114
|
+
res.end(
|
|
115
|
+
JSON.stringify([
|
|
116
|
+
{
|
|
117
|
+
port: scanPort,
|
|
118
|
+
framework: 'one',
|
|
119
|
+
bundleUrl: absoluteBundleUrl,
|
|
120
|
+
lastSeen: Date.now(),
|
|
121
|
+
},
|
|
122
|
+
]),
|
|
123
|
+
)
|
|
124
|
+
})
|
|
125
|
+
|
|
66
126
|
server.middlewares.use((req, res, next) => {
|
|
67
127
|
const url = req.url || ''
|
|
68
128
|
const pathname = url.split('?')[0]
|
|
@@ -92,17 +152,10 @@ export function sootsimPlugin(options: SootPluginOptions = {}): Plugin[] {
|
|
|
92
152
|
}
|
|
93
153
|
}
|
|
94
154
|
|
|
95
|
-
// serve the sootsim HTML shell — inject bundle URL
|
|
155
|
+
// serve the sootsim HTML shell — inject bundle URL + bridge port
|
|
96
156
|
if (pathname === prefix || pathname === prefix + '/') {
|
|
97
|
-
const htmlPath = path.join(runtimeRoot, 'index.html')
|
|
98
|
-
let html = fs.readFileSync(htmlPath, 'utf8')
|
|
99
|
-
// inject bundle URL as a query param so main.tsx picks it up
|
|
100
|
-
html = html.replace(
|
|
101
|
-
'</head>',
|
|
102
|
-
`<script>history.replaceState(null,'','${prefix}/?bundle=${encodeURIComponent(bundleUrl)}')</script></head>`,
|
|
103
|
-
)
|
|
104
157
|
res.setHeader('content-type', 'text/html')
|
|
105
|
-
res.end(
|
|
158
|
+
res.end(buildShellHtml(runtimeRoot))
|
|
106
159
|
return
|
|
107
160
|
}
|
|
108
161
|
|
|
@@ -120,14 +173,8 @@ export function sootsimPlugin(options: SootPluginOptions = {}): Plugin[] {
|
|
|
120
173
|
// extensionless in-shell routes should still load the shell.
|
|
121
174
|
const ext = path.extname(pathname)
|
|
122
175
|
if (!ext) {
|
|
123
|
-
const htmlPath = path.join(runtimeRoot, 'index.html')
|
|
124
|
-
let html = fs.readFileSync(htmlPath, 'utf8')
|
|
125
|
-
html = html.replace(
|
|
126
|
-
'</head>',
|
|
127
|
-
`<script>history.replaceState(null,'','${prefix}/?bundle=${encodeURIComponent(bundleUrl)}')</script></head>`,
|
|
128
|
-
)
|
|
129
176
|
res.setHeader('content-type', 'text/html')
|
|
130
|
-
res.end(
|
|
177
|
+
res.end(buildShellHtml(runtimeRoot))
|
|
131
178
|
return
|
|
132
179
|
}
|
|
133
180
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.176 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.176 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.176 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{existsSync as D,mkdirSync as O,readFileSync as g,rmSync as s,writeFileSync as P}from"fs";import{tmpdir as R}from"os";import{dirname as x,join as A,resolve as v}from"path";import{execFileSync as I}from"child_process";import{readFileSync as S}from"fs";import{createRequire as _}from"module";var o=null;function u(r){o||(o=b());try{return o(r)}catch{return null}}function b(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return y();if(process.platform==="darwin"){let n=T();return n||C()}return()=>null}function y(){return r=>{try{let n=S(`/proc/${r}/stat`,"utf8"),t=n.lastIndexOf(")");if(t<0)return null;let i=n.slice(t+1).trim().split(/\s+/),e=Number(i[1]);return Number.isFinite(e)&&e>0?e:null}catch{return null}}}var N=3,d=216,E=16;function T(){if(!process.versions?.bun)return null;try{let r=_(import.meta.url),{dlopen:n,FFIType:t}=r("bun:ffi"),i=n("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[t.i32,t.i32,t.u64,t.ptr,t.i32],returns:t.i32}}),e=Buffer.alloc(d);return a=>{if(Number(i.symbols.proc_pidinfo(a,N,0n,e,d))<=0)return null;let p=e.readUInt32LE(E);return p>0?p:null}}catch{return null}}function C(){return r=>{try{let t=I("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
|
-
`)[1];if(!t)return null;let i=t.trim().split(/\s+/),e=Number(i[2]);return Number.isFinite(e)&&e>1?e:null}catch{return null}}}var c=1,f="SOOTSIM_CLI_CURRENT_SIM_PATH",F=["SOOTSIM_CLI_IDENTITY","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"];function m(r,n=20){let t=u(r);if(!t||t<=1)return null;for(let i=0;i<n;i++){let e=u(t);if(!e||e<=1)return t;t=e}return t}function k(){for(let n of F){let t=process.env[n];if(t&&t.trim())return{key:`${n}:${t.trim()}`,source:n,stable:!0}}let r=m(process.ppid);return r&&r>1?{key:`gppid-${r}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function L(){return k().key}function J(){return m(process.ppid)}function l(){if(process.env[f])return v(process.env[f]);let r=L();return A(R(),`sootsim-current-sim-${r}.json`)}function h(){let r=l();if(!D(r))return null;try{let n=JSON.parse(g(r,"utf8"));return n.version!==c||typeof n.simId!="string"||!n.simId.trim()||typeof n.updatedAt!="string"?(s(r,{force:!0}),null):{version:c,simId:n.simId.trim(),updatedAt:n.updatedAt}}catch{return s(r,{force:!0}),null}}function j(){return h()?.simId||null}function K(r){let n=r.trim();if(!n)return;let t=l();O(x(t),{recursive:!0}),P(t,JSON.stringify({version:c,simId:n,updatedAt:new Date().toISOString()},null,2)+`
|
|
4
|
-
`)}function X(){s(l(),{force:!0})}export{k as a,L as b,J as c,j as d,K as e,X as f};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.176 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-CF3NJNBJ.js";import"./chunk-55LUU75I.js";import"./chunk-OAOQVBIR.js";import"./chunk-J2BOYJ2U.js";import"./chunk-GBZNVWFP.js";import"./chunk-NA2KJSP6.js";import"./chunk-HZSJ6FL3.js";import"./chunk-63VEHUYI.js";import"./chunk-3LI5PWSP.js";import"./chunk-STWES7DO.js";import"./chunk-XC3EDXUI.js";import"./chunk-OORRMRMI.js";import"./chunk-L2CTRBGR.js";import"./chunk-NMP6YTXS.js";import"./chunk-6S2MBFBN.js";import"./chunk-ZHFUIBAE.js";export{c as daemonInstall,b as getDaemonServiceStatus,a as runDaemon,d as teardownDaemonService,e as teardownSootsimHome};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.176 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import"./chunk-NPPSB4KE.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-XKVI3H2G.js";import"./chunk-ZAAITWNI.js";import"./chunk-D6GUXY2L.js";import"./chunk-PPUEG6C4.js";import"./chunk-XC3EDXUI.js";import"./chunk-OORRMRMI.js";import"./chunk-ZHFUIBAE.js";export{e as ALL_DRIVERS,i as buildDriverListRows,a as chromiumDriver,b as electronDriver,f as getAllDrivers,g as getDriver,c as playwrightDriver,h as resolveDriver,d as systemDriver};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.176 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a as c,b as d,c as e,d as f}from"./chunk-PVIMLBMX.js";import"./chunk-Y2ZSLUGO.js";import"./chunk-6WURQDZI.js";import"./chunk-W5QHYSDJ.js";import{c as a,d as b}from"./chunk-EU54PRND.js";import"./chunk-Q4YNZFJF.js";import"./chunk-CFPELTGN.js";import"./chunk-MWTWVX32.js";import"./chunk-6BU5E655.js";import"./chunk-BGP3OZID.js";import"./chunk-XKVI3H2G.js";import"./chunk-ZAAITWNI.js";import"./chunk-D6GUXY2L.js";import"./chunk-VBUURELX.js";import"./chunk-4WLI2STY.js";import"./chunk-W2AZ7ASM.js";import"./chunk-SR7DWNZ3.js";import"./chunk-HAW6OMNW.js";import"./chunk-PPUEG6C4.js";import"./chunk-55LUU75I.js";import"./chunk-OAOQVBIR.js";import"./chunk-63VEHUYI.js";import"./chunk-3LI5PWSP.js";import"./chunk-STWES7DO.js";import"./chunk-XC3EDXUI.js";import"./chunk-OORRMRMI.js";import"./chunk-Y3NDHGEY.js";import"./chunk-6S2MBFBN.js";import"./chunk-ZHFUIBAE.js";export{c as discoverSootsimUrl,e as hoistLeadingSimFlag,a as parseFlowFile,f as runFlow,d as runFlowPlayback,b as validateFlowFile};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.176 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a,b,c}from"./chunk-J2BOYJ2U.js";import"./chunk-GBZNVWFP.js";import"./chunk-NA2KJSP6.js";import"./chunk-HZSJ6FL3.js";import"./chunk-63VEHUYI.js";import"./chunk-3LI5PWSP.js";import"./chunk-STWES7DO.js";import"./chunk-XC3EDXUI.js";import"./chunk-OORRMRMI.js";import"./chunk-L2CTRBGR.js";import"./chunk-NMP6YTXS.js";import"./chunk-6S2MBFBN.js";import"./chunk-ZHFUIBAE.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.176 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a}from"./chunk-OQ3N5IOK.js";import"./chunk-JXZYXTBM.js";import"./chunk-HAW6OMNW.js";import"./chunk-STWES7DO.js";import"./chunk-XC3EDXUI.js";import"./chunk-OORRMRMI.js";import"./chunk-ZHFUIBAE.js";export{a as runRuntime};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.176 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a,b,c}from"./chunk-VBUURELX.js";import"./chunk-4WLI2STY.js";import"./chunk-W2AZ7ASM.js";import"./chunk-SR7DWNZ3.js";import"./chunk-HAW6OMNW.js";import"./chunk-PPUEG6C4.js";import"./chunk-55LUU75I.js";import"./chunk-OAOQVBIR.js";import"./chunk-STWES7DO.js";import"./chunk-XC3EDXUI.js";import"./chunk-OORRMRMI.js";import"./chunk-ZHFUIBAE.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
|