sootsim 0.0.1 → 0.0.3
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/README.md +12 -0
- package/dist-cli/bin.js +16 -10
- package/dist-cli/chunks/agent-D5NBV32O.js +61 -0
- package/dist-cli/chunks/agent-wrapper-Y7I5QGHM.js +15 -0
- package/dist-cli/chunks/assert-EJ7DQS2H.js +47 -0
- package/dist-cli/chunks/auto-bootstrap-Q7GNLISM.js +2 -0
- package/dist-cli/chunks/{chunk-7X6OPSRD.js → chunk-2FPPPJE5.js} +2 -2
- package/dist-cli/chunks/{chunk-G5MR66EB.js → chunk-3K6VDPVD.js} +2 -2
- package/dist-cli/chunks/{chunk-PWXPA745.js → chunk-3SLEIN6B.js} +1 -1
- package/dist-cli/chunks/chunk-3WPAEUOO.js +1 -0
- package/dist-cli/chunks/chunk-44CBTM22.js +2 -0
- package/dist-cli/chunks/chunk-46LRF7PH.js +5 -0
- package/dist-cli/chunks/chunk-4RYT6AQV.js +16 -0
- package/dist-cli/chunks/chunk-5AG24UFX.js +119 -0
- package/dist-cli/chunks/chunk-5IPP4HAW.js +5 -0
- package/dist-cli/chunks/{chunk-J2S3OCWA.js → chunk-AFTHIY3L.js} +1 -1
- package/dist-cli/chunks/chunk-BU3TZP4Y.js +11 -0
- package/dist-cli/chunks/chunk-BYLX2DO4.js +27 -0
- package/dist-cli/chunks/chunk-CPMW2QLM.js +1 -0
- package/dist-cli/chunks/{chunk-YCETS3B3.js → chunk-CQ6PX2EU.js} +2 -2
- package/dist-cli/chunks/chunk-D4JFMCXD.js +2 -0
- package/dist-cli/chunks/chunk-EEBR5YP5.js +62 -0
- package/dist-cli/chunks/chunk-EQ7G3UHS.js +4 -0
- package/dist-cli/chunks/{chunk-64TOMNZX.js → chunk-FTRI7SVV.js} +2 -2
- package/dist-cli/chunks/{chunk-GPVPHE2B.js → chunk-H3JVJXOC.js} +2 -2
- package/dist-cli/chunks/chunk-LV5U7TI4.js +1 -0
- package/dist-cli/chunks/chunk-NKJLTISU.js +4 -0
- package/dist-cli/chunks/chunk-O2HBPZW5.js +22 -0
- package/dist-cli/chunks/{chunk-KSACMDXK.js → chunk-OG5CKIPC.js} +2 -2
- package/dist-cli/chunks/{chunk-E522F5JW.js → chunk-P5C3UASK.js} +1 -1
- package/dist-cli/chunks/chunk-REYWQVAH.js +2 -0
- package/dist-cli/chunks/chunk-RLS6PHBW.js +4 -0
- package/dist-cli/chunks/chunk-SUZR2SZZ.js +34 -0
- package/dist-cli/chunks/{chunk-OROM7DZI.js → chunk-USRNDVQ3.js} +1 -1
- package/dist-cli/chunks/{chunk-JSF5LPNT.js → chunk-UZL5ZZ4E.js} +5 -5
- package/dist-cli/chunks/{chunk-QOBRRY5X.js → chunk-VI3VW5BL.js} +1 -1
- package/dist-cli/chunks/chunk-WUYJFYOW.js +2 -0
- package/dist-cli/chunks/chunk-X2W4IRXK.js +3 -0
- package/dist-cli/chunks/chunk-XJBPH4JR.js +308 -0
- package/dist-cli/chunks/chunk-ZSRMXBGK.js +2 -0
- package/dist-cli/chunks/{compat-MRN2ORY5.js → compat-5KSMOWLB.js} +4 -4
- package/dist-cli/chunks/{config-CO5IYWUY.js → config-NJB6PQHU.js} +5 -5
- package/dist-cli/chunks/control-2F3AGZAO.js +2 -0
- package/dist-cli/chunks/{daemon-G4XVRFHM.js → daemon-MLG65V4S.js} +2 -2
- package/dist-cli/chunks/{debug-ZNSZTWT6.js → debug-QVOBTTLP.js} +4 -4
- package/dist-cli/chunks/demo-app-registry-XRYNJ4GC.js +2 -0
- package/dist-cli/chunks/{detox-JEGYNTYV.js → detox-ZZSNZL4T.js} +2 -2
- package/dist-cli/chunks/{device-BS34FAFM.js → device-PQB3YGHN.js} +2 -2
- package/dist-cli/chunks/drivers-GWDQEGWD.js +2 -0
- package/dist-cli/chunks/electron-JB26VHOO.js +15 -0
- package/dist-cli/chunks/flow-7JRQXMFV.js +2 -0
- package/dist-cli/chunks/{hints-7Z656W4H.js → hints-IGYDXXDS.js} +2 -2
- package/dist-cli/chunks/home-paths-CEGSGQTD.js +2 -0
- package/dist-cli/chunks/{inspect-NAHXP2M5.js → inspect-DSU6ELRM.js} +153 -165
- package/dist-cli/chunks/install-K6IJKADG.js +65 -0
- package/dist-cli/chunks/{install-desktop-PYIZIH67.js → install-desktop-SC3LNFFF.js} +8 -4
- package/dist-cli/chunks/install-dev-desktop-4DP3UY2X.js +100 -0
- package/dist-cli/chunks/keys-R5LAPAAL.js +19 -0
- package/dist-cli/chunks/launch-K3WJV4QA.js +16 -0
- package/dist-cli/chunks/{login-Z5Z54HUJ.js → login-A23PYJAW.js} +5 -5
- package/dist-cli/chunks/{logout-T2QDYGCB.js → logout-AJ24PH5O.js} +2 -2
- package/dist-cli/chunks/{maestro-4AXTS7OE.js → maestro-YALWKKGU.js} +2 -2
- package/dist-cli/chunks/{preview-NMGWHWMX.js → preview-D35EEONY.js} +2 -2
- package/dist-cli/chunks/{profile-6RGJA4FR.js → profile-MAF7NM5Q.js} +3 -3
- package/dist-cli/chunks/record-ZCPQNGFW.js +37 -0
- package/dist-cli/chunks/runtime-Z2WIXYUN.js +25 -0
- package/dist-cli/chunks/{screenshot-R3GCCSCI.js → screenshot-NQVZYC3C.js} +3 -3
- package/dist-cli/chunks/screenshot-mode-E45D2ZFH.js +17 -0
- package/dist-cli/chunks/{screenshots-4UQJE4NC.js → screenshots-I4SQI4DA.js} +2 -2
- package/dist-cli/chunks/server-ZUXKJRR5.js +29 -0
- package/dist-cli/chunks/{skills-2PPKPL4B.js → skills-N4U63E5W.js} +2 -2
- package/dist-cli/chunks/store-4A6X4GBJ.js +2 -0
- package/dist-cli/chunks/{test-5LFKOQ4M.js → test-VBD6N3AR.js} +3 -3
- package/dist-cli/chunks/upload-Y6FZ5XF2.js +2 -0
- package/dist-cli/chunks/{whoami-H6FW34JS.js → whoami-4K6JGMWH.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +414 -0
- package/dist-lib/agent-events.cjs +48 -0
- package/dist-lib/agent-sessions.cjs +692 -0
- package/dist-lib/attached-projects.cjs +448 -0
- package/dist-lib/auth/shared-session.cjs +174 -0
- package/dist-lib/backend-origin.cjs +70 -0
- package/dist-lib/bridge-constants.cjs +32 -0
- package/dist-lib/cli-constants.cjs +32 -0
- package/dist-lib/config.cjs +88 -0
- package/dist-lib/dev-bundle-resolution.cjs +236 -0
- package/dist-lib/home-paths.cjs +234 -0
- package/dist-lib/host/bridge-host.cjs +3458 -0
- package/dist-lib/index.cjs +361 -0
- package/dist-lib/metro.cjs +215 -0
- package/dist-lib/render-mode.cjs +54 -0
- package/dist-lib/vite-base.cjs +4217 -0
- package/dist-lib/vite.cjs +178 -0
- package/package.json +80 -13
- package/scripts/postinstall.cjs +70 -0
- package/dist-cli/chunks/bridge-host-2EY7Z4AO.js +0 -2
- package/dist-cli/chunks/chunk-3C3ZH7PP.js +0 -4
- package/dist-cli/chunks/chunk-3R4ZZESY.js +0 -119
- package/dist-cli/chunks/chunk-74XPLOV4.js +0 -2
- package/dist-cli/chunks/chunk-7LMDCMSI.js +0 -8
- package/dist-cli/chunks/chunk-A2CZQIWO.js +0 -1
- package/dist-cli/chunks/chunk-CKZ376AY.js +0 -322
- package/dist-cli/chunks/chunk-E5UBZEYR.js +0 -2
- package/dist-cli/chunks/chunk-HOIHCO7S.js +0 -3
- package/dist-cli/chunks/chunk-KQWZZ56P.js +0 -2
- package/dist-cli/chunks/chunk-KSB6MSZ4.js +0 -34
- package/dist-cli/chunks/chunk-KXYKAYYB.js +0 -51
- package/dist-cli/chunks/chunk-MBFP2LVH.js +0 -3
- package/dist-cli/chunks/chunk-MPSZ5EWF.js +0 -16
- package/dist-cli/chunks/chunk-X2U72K7X.js +0 -1
- package/dist-cli/chunks/control-Y7TKKB6D.js +0 -2
- package/dist-cli/chunks/dev-ZUKCZQEX.js +0 -25
- package/dist-cli/chunks/dev-checkout-IEZVVTCN.js +0 -2
- package/dist-cli/chunks/drivers-46PFFIDF.js +0 -2
- package/dist-cli/chunks/electron-P2KOPX2S.js +0 -15
- package/dist-cli/chunks/flow-VVOF6UNC.js +0 -2
- package/dist-cli/chunks/install-EPUJX4AT.js +0 -67
- package/dist-cli/chunks/record-IE27Z2GA.js +0 -37
- package/dist-cli/chunks/screenshot-mode-SZQDNGYE.js +0 -17
- package/dist-cli/chunks/server-AN2G5KO4.js +0 -21
- package/dist-cli/chunks/store-PU5ES4YQ.js +0 -2
- package/dist-cli/chunks/upload-BYNPC54C.js +0 -2
- package/dist-cli/chunks/vite-plugin-5AEUUBKP.js +0 -9
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/vite-plugin-one.ts
|
|
33
|
+
var vite_plugin_one_exports = {};
|
|
34
|
+
__export(vite_plugin_one_exports, {
|
|
35
|
+
default: () => vite_plugin_one_default,
|
|
36
|
+
sootsimPlugin: () => sootsimPlugin
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(vite_plugin_one_exports);
|
|
39
|
+
var import_fs = __toESM(require("fs"), 1);
|
|
40
|
+
var import_path = __toESM(require("path"), 1);
|
|
41
|
+
var sootsimRoot = import_path.default.resolve(import_path.default.dirname(new URL(__sootsim_import_meta_url).pathname), "..");
|
|
42
|
+
var distDir = import_path.default.join(sootsimRoot, "dist-plugin");
|
|
43
|
+
var publicDir = import_path.default.join(sootsimRoot, "public");
|
|
44
|
+
var MIME_TYPES = {
|
|
45
|
+
".js": "application/javascript",
|
|
46
|
+
".mjs": "application/javascript",
|
|
47
|
+
".css": "text/css",
|
|
48
|
+
".html": "text/html",
|
|
49
|
+
".wasm": "application/wasm",
|
|
50
|
+
".json": "application/json",
|
|
51
|
+
".png": "image/png",
|
|
52
|
+
".svg": "image/svg+xml",
|
|
53
|
+
".ttf": "font/ttf",
|
|
54
|
+
".otf": "font/otf",
|
|
55
|
+
".woff": "font/woff",
|
|
56
|
+
".woff2": "font/woff2",
|
|
57
|
+
".mp3": "audio/mpeg",
|
|
58
|
+
".wav": "audio/wav",
|
|
59
|
+
".jpg": "image/jpeg",
|
|
60
|
+
".webp": "image/webp"
|
|
61
|
+
};
|
|
62
|
+
function sootsimPlugin(options = {}) {
|
|
63
|
+
if (options.enabled === false) return [];
|
|
64
|
+
const prefix = options.prefix || "/__soot";
|
|
65
|
+
return [
|
|
66
|
+
{
|
|
67
|
+
name: "sootsim-one",
|
|
68
|
+
configureServer(server) {
|
|
69
|
+
const bundleUrl = options.bundleUrl || "/node_modules/one/metro-entry.bundle?platform=ios&dev=true&minify=false";
|
|
70
|
+
server.middlewares.use((req, res, next) => {
|
|
71
|
+
const origWriteHead = res.writeHead.bind(res);
|
|
72
|
+
res.writeHead = function(statusCode, ...args) {
|
|
73
|
+
const setCookie = res.getHeader("set-cookie");
|
|
74
|
+
if (setCookie) {
|
|
75
|
+
const value = Array.isArray(setCookie) ? setCookie.join(", ") : String(setCookie);
|
|
76
|
+
res.setHeader("x-sootsim-set-cookie", value);
|
|
77
|
+
res.setHeader("access-control-expose-headers", "x-sootsim-set-cookie");
|
|
78
|
+
}
|
|
79
|
+
return origWriteHead(
|
|
80
|
+
statusCode,
|
|
81
|
+
...args
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
next();
|
|
85
|
+
});
|
|
86
|
+
server.middlewares.use((req, res, next) => {
|
|
87
|
+
const url = req.url || "";
|
|
88
|
+
if (url === prefix || url === prefix + "/" || url.startsWith(prefix + "/?")) {
|
|
89
|
+
const htmlPath = import_path.default.join(distDir, "index.html");
|
|
90
|
+
if (!import_fs.default.existsSync(htmlPath)) {
|
|
91
|
+
res.statusCode = 500;
|
|
92
|
+
res.end("[sootsim] dist-plugin not built. run: bun scripts/build-plugin.ts");
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
let html = import_fs.default.readFileSync(htmlPath, "utf8");
|
|
96
|
+
html = html.replace(
|
|
97
|
+
"</head>",
|
|
98
|
+
`<script>history.replaceState(null,'','${prefix}/?bundle=${encodeURIComponent(bundleUrl)}')</script></head>`
|
|
99
|
+
);
|
|
100
|
+
res.setHeader("content-type", "text/html");
|
|
101
|
+
res.end(html);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (url.startsWith(prefix + "/")) {
|
|
105
|
+
const filePath = url.slice(prefix.length).split("?")[0];
|
|
106
|
+
const fullPath = import_path.default.join(distDir, filePath);
|
|
107
|
+
if (import_fs.default.existsSync(fullPath) && import_fs.default.statSync(fullPath).isFile()) {
|
|
108
|
+
const ext = import_path.default.extname(fullPath);
|
|
109
|
+
res.setHeader("content-type", MIME_TYPES[ext] || "application/octet-stream");
|
|
110
|
+
res.setHeader("cache-control", "max-age=31536000,immutable");
|
|
111
|
+
import_fs.default.createReadStream(fullPath).pipe(res);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const publicPath = import_path.default.join(publicDir, filePath);
|
|
115
|
+
if (import_fs.default.existsSync(publicPath) && import_fs.default.statSync(publicPath).isFile()) {
|
|
116
|
+
const ext = import_path.default.extname(publicPath);
|
|
117
|
+
res.setHeader("content-type", MIME_TYPES[ext] || "application/octet-stream");
|
|
118
|
+
import_fs.default.createReadStream(publicPath).pipe(res);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const staticRoots = ["/canvaskit.wasm", "/fonts/", "/icons/", "/sounds/"];
|
|
123
|
+
if (staticRoots.some((p) => url.startsWith(p))) {
|
|
124
|
+
const fullPath = import_path.default.join(publicDir, url.split("?")[0]);
|
|
125
|
+
if (import_fs.default.existsSync(fullPath) && import_fs.default.statSync(fullPath).isFile()) {
|
|
126
|
+
const ext = import_path.default.extname(fullPath);
|
|
127
|
+
res.setHeader("content-type", MIME_TYPES[ext] || "application/octet-stream");
|
|
128
|
+
import_fs.default.createReadStream(fullPath).pipe(res);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
next();
|
|
133
|
+
});
|
|
134
|
+
const port = server.config.server.port || 8081;
|
|
135
|
+
const sootsimUrl = `http://localhost:${port}${prefix}/`;
|
|
136
|
+
console.log(`[sootsim] serving at ${sootsimUrl}`);
|
|
137
|
+
openElectronApp(sootsimUrl);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
async function openElectronApp(sootsimUrl) {
|
|
143
|
+
if (process.platform !== "darwin") return;
|
|
144
|
+
const { execSync, exec } = await import("child_process");
|
|
145
|
+
const schemeUrl = `sootsim://dev?url=${encodeURIComponent(sootsimUrl)}`;
|
|
146
|
+
try {
|
|
147
|
+
exec(`open "${schemeUrl}"`);
|
|
148
|
+
return;
|
|
149
|
+
} catch {
|
|
150
|
+
}
|
|
151
|
+
const candidates = [
|
|
152
|
+
"/Applications/sootsim.app",
|
|
153
|
+
import_path.default.join(process.env.HOME || "", "Applications/sootsim.app"),
|
|
154
|
+
import_path.default.join(sootsimRoot, "release/mac-arm64/sootsim.app")
|
|
155
|
+
];
|
|
156
|
+
let appPath = candidates.find((p) => import_fs.default.existsSync(p));
|
|
157
|
+
if (!appPath) {
|
|
158
|
+
try {
|
|
159
|
+
const found = execSync(
|
|
160
|
+
'mdfind "kMDItemCFBundleIdentifier == dev.sootsim.simulator"',
|
|
161
|
+
{ encoding: "utf8", timeout: 3e3 }
|
|
162
|
+
).trim();
|
|
163
|
+
if (found) appPath = found.split("\n")[0];
|
|
164
|
+
} catch {
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (appPath) {
|
|
168
|
+
try {
|
|
169
|
+
exec(`open -a "${appPath}" "${sootsimUrl}"`);
|
|
170
|
+
} catch {
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
var vite_plugin_one_default = sootsimPlugin;
|
|
175
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
176
|
+
0 && (module.exports = {
|
|
177
|
+
sootsimPlugin
|
|
178
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sootsim",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
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",
|
|
@@ -9,19 +9,76 @@
|
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
|
-
".":
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"./
|
|
17
|
-
|
|
12
|
+
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
14
|
+
"default": "./dist-lib/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./config": {
|
|
17
|
+
"source": "./src/config.ts",
|
|
18
|
+
"default": "./dist-lib/config.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./auth/shared-session": {
|
|
21
|
+
"source": "./src/auth/shared-session.ts",
|
|
22
|
+
"default": "./dist-lib/auth/shared-session.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./vite": {
|
|
25
|
+
"source": "./src/vite-plugin-one.ts",
|
|
26
|
+
"default": "./dist-lib/vite.cjs"
|
|
27
|
+
},
|
|
28
|
+
"./vite-base": {
|
|
29
|
+
"source": "./src/vite-plugin.ts",
|
|
30
|
+
"default": "./dist-lib/vite-base.cjs"
|
|
31
|
+
},
|
|
32
|
+
"./metro": {
|
|
33
|
+
"source": "./src/metro-plugin.ts",
|
|
34
|
+
"default": "./dist-lib/metro.cjs"
|
|
35
|
+
},
|
|
18
36
|
"./skills": "./src/skills/registry.ts",
|
|
19
37
|
"./cli/registry": "./cli/registry.ts",
|
|
20
|
-
"./
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"./
|
|
38
|
+
"./agent-events": {
|
|
39
|
+
"source": "./src/agent-events.ts",
|
|
40
|
+
"default": "./dist-lib/agent-events.cjs"
|
|
41
|
+
},
|
|
42
|
+
"./agent-sessions": {
|
|
43
|
+
"source": "./src/agent-sessions.ts",
|
|
44
|
+
"default": "./dist-lib/agent-sessions.cjs"
|
|
45
|
+
},
|
|
46
|
+
"./agent-daemon-client": {
|
|
47
|
+
"source": "./src/agent-daemon-client.ts",
|
|
48
|
+
"default": "./dist-lib/agent-daemon-client.cjs"
|
|
49
|
+
},
|
|
50
|
+
"./attached-projects": {
|
|
51
|
+
"source": "./src/attached-projects.ts",
|
|
52
|
+
"default": "./dist-lib/attached-projects.cjs"
|
|
53
|
+
},
|
|
54
|
+
"./backend-origin": {
|
|
55
|
+
"source": "./src/backend-origin.ts",
|
|
56
|
+
"default": "./dist-lib/backend-origin.cjs"
|
|
57
|
+
},
|
|
58
|
+
"./bridge-constants": {
|
|
59
|
+
"source": "./src/bridge-constants.ts",
|
|
60
|
+
"default": "./dist-lib/bridge-constants.cjs"
|
|
61
|
+
},
|
|
62
|
+
"./cli-constants": {
|
|
63
|
+
"source": "./src/cli-constants.ts",
|
|
64
|
+
"default": "./dist-lib/cli-constants.cjs"
|
|
65
|
+
},
|
|
66
|
+
"./home-paths": {
|
|
67
|
+
"source": "./src/home-paths.ts",
|
|
68
|
+
"default": "./dist-lib/home-paths.cjs"
|
|
69
|
+
},
|
|
70
|
+
"./dev-bundle-resolution": {
|
|
71
|
+
"source": "./src/dev-bundle-resolution.ts",
|
|
72
|
+
"default": "./dist-lib/dev-bundle-resolution.cjs"
|
|
73
|
+
},
|
|
74
|
+
"./render-mode": {
|
|
75
|
+
"source": "./src/render-mode.ts",
|
|
76
|
+
"default": "./dist-lib/render-mode.cjs"
|
|
77
|
+
},
|
|
78
|
+
"./host/bridge-host": {
|
|
79
|
+
"source": "./src/host/bridge-host.ts",
|
|
80
|
+
"default": "./dist-lib/host/bridge-host.cjs"
|
|
81
|
+
},
|
|
25
82
|
"./scripts/dev-server-scanner": "./scripts/dev-server-scanner.ts",
|
|
26
83
|
"./scripts/demo-app-registry": "./scripts/demo-app-registry.ts",
|
|
27
84
|
"./detox": "./detox/index.ts",
|
|
@@ -33,6 +90,8 @@
|
|
|
33
90
|
},
|
|
34
91
|
"files": [
|
|
35
92
|
"dist-cli/",
|
|
93
|
+
"dist-lib/",
|
|
94
|
+
"scripts/postinstall.cjs",
|
|
36
95
|
"README.md",
|
|
37
96
|
"LICENSE"
|
|
38
97
|
],
|
|
@@ -40,17 +99,25 @@
|
|
|
40
99
|
"build": "bun scripts/build-cli.ts",
|
|
41
100
|
"build:cli": "bun scripts/build-cli.ts",
|
|
42
101
|
"build:cli-binary": "bun scripts/build-cli-binary.ts",
|
|
43
|
-
"
|
|
102
|
+
"postinstall": "node ./scripts/postinstall.cjs"
|
|
44
103
|
},
|
|
45
104
|
"dependencies": {
|
|
46
105
|
"ws": "^8.18.0"
|
|
47
106
|
},
|
|
107
|
+
"peerDependencies": {
|
|
108
|
+
"vite": ">=5"
|
|
109
|
+
},
|
|
110
|
+
"peerDependenciesMeta": {
|
|
111
|
+
"vite": { "optional": true }
|
|
112
|
+
},
|
|
48
113
|
"devDependencies": {
|
|
114
|
+
"@soot/sootsim-globals": "workspace:*",
|
|
49
115
|
"@soot/sootsim-skills": "workspace:*",
|
|
50
116
|
"@types/ws": "^8.5.13",
|
|
51
117
|
"esbuild": ">=0.20.0",
|
|
52
118
|
"sootsim-engine": "workspace:*",
|
|
53
119
|
"typescript": "^5.7.0",
|
|
120
|
+
"vite": "^8.0.3",
|
|
54
121
|
"yaml": "^2.8.3"
|
|
55
122
|
}
|
|
56
123
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// postinstall — best-effort runtime install after `npm i -g sootsim`.
|
|
3
|
+
//
|
|
4
|
+
// runs as a child of npm. failures here are non-fatal: any first invocation
|
|
5
|
+
// of the CLI will retry the install via auto-bootstrap.
|
|
6
|
+
//
|
|
7
|
+
// skipped when running as root via sudo: $HOME would be /root, but the user
|
|
8
|
+
// who actually wants the runtime probably isn't root. their first sootsim
|
|
9
|
+
// invocation will install into their own ~/.sootsim instead.
|
|
10
|
+
|
|
11
|
+
const { spawnSync } = require('child_process')
|
|
12
|
+
const fs = require('fs')
|
|
13
|
+
const os = require('os')
|
|
14
|
+
const path = require('path')
|
|
15
|
+
|
|
16
|
+
if (process.env.SOOTSIM_SKIP_POSTINSTALL === '1') {
|
|
17
|
+
process.exit(0)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// in dev / workspace installs (i.e. running inside the soot monorepo, not
|
|
21
|
+
// installed as a dep), the package dir is `<repo>/packages/sootsim/` rather
|
|
22
|
+
// than `.../node_modules/sootsim/`. skip the runtime fetch in that case —
|
|
23
|
+
// the workspace already has the engine source.
|
|
24
|
+
const pkgDir = path.resolve(__dirname, '..')
|
|
25
|
+
if (!pkgDir.includes(`${path.sep}node_modules${path.sep}`)) {
|
|
26
|
+
process.exit(0)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const isRoot = typeof process.getuid === 'function' && process.getuid() === 0
|
|
30
|
+
if (isRoot && process.env.SUDO_USER) {
|
|
31
|
+
console.log(
|
|
32
|
+
'sootsim: postinstall skipped under sudo — runtime will install on first run',
|
|
33
|
+
)
|
|
34
|
+
process.exit(0)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const existingActiveRuntime = readExistingActiveRuntime()
|
|
38
|
+
if (existingActiveRuntime) {
|
|
39
|
+
console.log(
|
|
40
|
+
`sootsim: postinstall skipped — active runtime ${existingActiveRuntime} already installed`,
|
|
41
|
+
)
|
|
42
|
+
process.exit(0)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const bin = path.join(__dirname, '..', 'dist-cli', 'bin.js')
|
|
46
|
+
const res = spawnSync(process.execPath, [bin, 'runtime', 'install'], {
|
|
47
|
+
stdio: 'inherit',
|
|
48
|
+
timeout: 60_000,
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
if (res.status !== 0) {
|
|
52
|
+
console.log('sootsim: runtime install deferred to first run')
|
|
53
|
+
}
|
|
54
|
+
process.exit(0)
|
|
55
|
+
|
|
56
|
+
function readExistingActiveRuntime() {
|
|
57
|
+
const home =
|
|
58
|
+
process.env.SOOTSIM_HOME && process.env.SOOTSIM_HOME.length > 0
|
|
59
|
+
? path.resolve(process.env.SOOTSIM_HOME)
|
|
60
|
+
: path.join(os.homedir(), '.sootsim')
|
|
61
|
+
const runtimesDir = path.join(home, 'runtimes')
|
|
62
|
+
try {
|
|
63
|
+
const active = fs.readFileSync(path.join(runtimesDir, 'active'), 'utf8').trim()
|
|
64
|
+
if (!active) return null
|
|
65
|
+
const indexPath = path.join(runtimesDir, active, 'index.html')
|
|
66
|
+
return fs.existsSync(indexPath) ? active : null
|
|
67
|
+
} catch {
|
|
68
|
+
return null
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{existsSync as m,mkdirSync as A,readFileSync as w,readdirSync as x,rmSync as o,writeFileSync as _}from"fs";import{tmpdir as c}from"os";import{dirname as L,join as l,resolve as h}from"path";import{execFileSync as b}from"child_process";import{readFileSync as N}from"fs";import{createRequire as E}from"module";var s=null;function f(r){s||(s=g());try{return s(r)}catch{return null}}function g(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return O();if(process.platform==="darwin"){let t=T();return t||P()}return()=>null}function O(){return r=>{try{let t=N(`/proc/${r}/stat`,"utf8"),e=t.lastIndexOf(")");if(e<0)return null;let i=t.slice(e+1).trim().split(/\s+/),n=Number(i[1]);return Number.isFinite(n)&&n>0?n:null}catch{return null}}}var C=3,d=216,D=16;function T(){if(!process.versions?.bun)return null;try{let r=E(import.meta.url),{dlopen:t,FFIType:e}=r("bun:ffi"),i=t("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[e.i32,e.i32,e.u64,e.ptr,e.i32],returns:e.i32}}),n=Buffer.alloc(d);return y=>{if(Number(i.symbols.proc_pidinfo(y,C,0n,n,d))<=0)return null;let a=n.readUInt32LE(D);return a>0?a:null}}catch{return null}}function P(){return r=>{try{let e=b("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
|
-
`)[1];if(!e)return null;let i=e.trim().split(/\s+/),n=Number(i[2]);return Number.isFinite(n)&&n>1?n:null}catch{return null}}}var u=1,S="SOOTSIM_CLI_SESSION_PATH",v=["SOOTSIM_SESSION_ID","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 F(){for(let t of v){let e=process.env[t];if(e&&e.trim())return{key:`${t}:${e.trim()}`,source:t,stable:!0}}let r=f(process.ppid);return r&&r>1?{key:`gppid-${r}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}var I=l(c(),"sootsim-legacy-gc-done");function U(){if(!m(I)){try{_(I,String(Date.now()))}catch{return}try{let r=c();for(let t of x(r))if(t.startsWith("sootsim-gppid-"))try{o(l(r,t),{force:!0})}catch{}}catch{}}}function R(){return F().key}function p(){if(process.env[S])return h(process.env[S]);let r=R();return l(c(),`sootsim-cli-session-${r}.json`)}function k(){let r=p();if(!m(r))return null;try{let t=JSON.parse(w(r,"utf8"));return t.version!==u||typeof t.browserId!="string"||!t.browserId.trim()||typeof t.updatedAt!="string"?(o(r,{force:!0}),null):{version:u,browserId:t.browserId.trim(),updatedAt:t.updatedAt}}catch{return o(r,{force:!0}),null}}function j(){return k()?.browserId||null}function G(r){let t=r.trim();if(!t)return;let e=p();A(L(e),{recursive:!0}),_(e,JSON.stringify({version:u,browserId:t,updatedAt:new Date().toISOString()},null,2)+`
|
|
4
|
-
`)}function X(){o(p(),{force:!0})}export{F as a,U as b,R as c,j as d,G as e,X as f};
|