sootsim 0.1.83 → 0.1.85
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 +0 -1
- package/detox/colors.ts +54 -0
- package/detox/config-loader.ts +135 -0
- package/detox/element-types.ts +36 -0
- package/detox/expectations.ts +477 -0
- package/detox/gestures.ts +442 -0
- package/detox/index.ts +1403 -0
- package/detox/jest-environment.ts +86 -0
- package/detox/jest-preset.cjs +50 -0
- package/detox/matchers.ts +29 -0
- package/detox/navigation.ts +43 -0
- package/detox/run-test.ts +113 -0
- package/detox/screenshots/animated-color-test-rest-norngh.png +0 -0
- package/detox/screenshots/color-test-after-drag-norngh.png +0 -0
- package/detox/screenshots/color-test-rest-norngh.png +0 -0
- package/detox/screenshots/theme-blue-toggle.png +0 -0
- package/detox/screenshots/theme-blue.png +0 -0
- package/detox/screenshots/theme-red-toggle.png +0 -0
- package/detox/screenshots/theme-red.png +0 -0
- package/dist-cli/bin.js +3 -3
- package/dist-cli/chunks/{agent-MQ7GLVIB.js → agent-T3DUH5YJ.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-7KAFDQCN.js → agent-wrapper-NSBF4THI.js} +2 -2
- package/dist-cli/chunks/{assert-TV46GUNU.js → assert-X3F7TRCZ.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-47RN2V5G.js +2 -0
- package/dist-cli/chunks/beta-BRCGAF2N.js +2 -0
- package/dist-cli/chunks/chunk-36RPD6JI.js +2 -0
- package/dist-cli/chunks/{chunk-PM5NVKLP.js → chunk-3WGHC7JN.js} +2 -2
- package/dist-cli/chunks/chunk-4DBPNLGI.js +1 -0
- package/dist-cli/chunks/{chunk-J2GYISVJ.js → chunk-4EVSIUNB.js} +2 -2
- package/dist-cli/chunks/{chunk-JHJNODXN.js → chunk-4QZHZ6BC.js} +2 -2
- package/dist-cli/chunks/{chunk-F3HP444U.js → chunk-5DIGWOY7.js} +1 -1
- package/dist-cli/chunks/{chunk-DP7O5MHK.js → chunk-5N3V7OCG.js} +2 -2
- package/dist-cli/chunks/{chunk-Y4BUVURT.js → chunk-5S6D7K4L.js} +2 -2
- package/dist-cli/chunks/{chunk-ECJBV65H.js → chunk-7LKUN46F.js} +2 -2
- package/dist-cli/chunks/{chunk-WTKTOL3C.js → chunk-AC6QGW22.js} +2 -2
- package/dist-cli/chunks/{chunk-IBNRRAES.js → chunk-AFNDVS4E.js} +2 -2
- package/dist-cli/chunks/{chunk-6TNANCQC.js → chunk-BESAZ2HA.js} +2 -2
- package/dist-cli/chunks/{chunk-WN7M3QON.js → chunk-BHZJ6RIH.js} +2 -2
- package/dist-cli/chunks/{chunk-277XAALA.js → chunk-BZL6D4TV.js} +3 -3
- package/dist-cli/chunks/{chunk-CYV6Y6YV.js → chunk-CF2LPRXD.js} +2 -2
- package/dist-cli/chunks/chunk-DWTLRPEN.js +79 -0
- package/dist-cli/chunks/{chunk-CJY3AVI7.js → chunk-E2QE5FFP.js} +1 -1
- package/dist-cli/chunks/chunk-EBEL6TTJ.js +4 -0
- package/dist-cli/chunks/{chunk-DM6WT7QM.js → chunk-EFM53PZ5.js} +1 -1
- package/dist-cli/chunks/{chunk-YUELRHGB.js → chunk-EKXK3SWK.js} +2 -2
- package/dist-cli/chunks/{chunk-4LS5MZAI.js → chunk-G7CIZ5S3.js} +3 -3
- package/dist-cli/chunks/{chunk-6NN2D4EJ.js → chunk-GTAD6IUV.js} +1 -1
- package/dist-cli/chunks/{chunk-OYMFNU3M.js → chunk-H44IQHKZ.js} +1 -1
- package/dist-cli/chunks/{chunk-IP3QJLRH.js → chunk-HQDJ5BOF.js} +1 -1
- package/dist-cli/chunks/{chunk-5DJXZIFZ.js → chunk-KUSQ4NNJ.js} +1 -1
- package/dist-cli/chunks/{chunk-HAWOAQAG.js → chunk-MAO7F5PH.js} +3 -3
- package/dist-cli/chunks/{chunk-572VSFNP.js → chunk-NVTL3JQG.js} +1 -1
- package/dist-cli/chunks/{chunk-6XZOEBTZ.js → chunk-O6N2CEET.js} +2 -2
- package/dist-cli/chunks/{chunk-HNWEELAE.js → chunk-OISHLFON.js} +1 -1
- package/dist-cli/chunks/{chunk-2PY3UZVO.js → chunk-OUNLJM56.js} +2 -2
- package/dist-cli/chunks/chunk-OXOARRKR.js +67 -0
- package/dist-cli/chunks/{chunk-NXATOWWF.js → chunk-PHPXGLME.js} +1 -1
- package/dist-cli/chunks/{chunk-JQ7ZXOXJ.js → chunk-PQFFUJR6.js} +2 -2
- package/dist-cli/chunks/{chunk-KASUZ5XV.js → chunk-QLJNSOS7.js} +1 -1
- package/dist-cli/chunks/chunk-QQAECG5B.js +2 -0
- package/dist-cli/chunks/{chunk-FJYT7XL2.js → chunk-RZHREO3M.js} +2 -2
- package/dist-cli/chunks/{chunk-FRM355UL.js → chunk-SBGOUA6F.js} +2 -2
- package/dist-cli/chunks/chunk-SSCA2AEA.js +1 -0
- package/dist-cli/chunks/{chunk-Y2VJBRSP.js → chunk-UYRGCJ4N.js} +1 -1
- package/dist-cli/chunks/{chunk-2AWQ7OB2.js → chunk-WGDL5V6C.js} +1 -1
- package/dist-cli/chunks/{chunk-VMXWC2JO.js → chunk-Y5PLPEEU.js} +2 -2
- package/dist-cli/chunks/chunk-ZFAM4N5B.js +1 -0
- package/dist-cli/chunks/{chunk-RH4F2TF7.js → chunk-ZO3VHP6W.js} +1 -1
- package/dist-cli/chunks/cli-version-WPFDM2A6.js +2 -0
- package/dist-cli/chunks/{compat-QLLWBTS3.js → compat-PCXGGZBZ.js} +3 -3
- package/dist-cli/chunks/{config-2DSLDCXV.js → config-LULEVEYL.js} +2 -2
- package/dist-cli/chunks/control-6P6HY7UF.js +2 -0
- package/dist-cli/chunks/{cpu-profile-GEIKHCPC.js → cpu-profile-NOK73ZYW.js} +2 -2
- package/dist-cli/chunks/{daemon-4EBUFN4D.js → daemon-4A3DMUYL.js} +2 -2
- package/dist-cli/chunks/{debug-WGD6XWOF.js → debug-74BWB2ZG.js} +3 -3
- package/dist-cli/chunks/{detox-LNKGRZU6.js → detox-HEOMINSC.js} +2 -2
- package/dist-cli/chunks/{device-AYKXKVIQ.js → device-TTXXBJFZ.js} +2 -2
- package/dist-cli/chunks/{diagnose-TMXSDOOC.js → diagnose-QZ3GOHSE.js} +2 -2
- package/dist-cli/chunks/drivers-QRPWNOIT.js +2 -0
- package/dist-cli/chunks/{electron-QFPF7TBY.js → electron-QVOWV44R.js} +3 -3
- package/dist-cli/chunks/flow-QMA7GVN6.js +2 -0
- package/dist-cli/chunks/{hints-MXKRR4TG.js → hints-YKWRNMJC.js} +2 -2
- package/dist-cli/chunks/{home-paths-REMWQDAO.js → home-paths-SFADSTJM.js} +2 -2
- package/dist-cli/chunks/{inspect-XGSQNFV7.js → inspect-LEWGQCIU.js} +3 -3
- package/dist-cli/chunks/install-7N2N7Q32.js +2 -0
- package/dist-cli/chunks/{install-desktop-NQG3RZSA.js → install-desktop-22HYQZ2G.js} +3 -3
- package/dist-cli/chunks/{keys-5QZWXL3F.js → keys-3ZT3MICU.js} +2 -2
- package/dist-cli/chunks/{launch-SBXOZWKO.js → launch-ZXW2NFLG.js} +3 -3
- package/dist-cli/chunks/{login-EACQXE24.js → login-NJKJ7GZO.js} +4 -4
- package/dist-cli/chunks/{logout-IBQLMUML.js → logout-VMMQL7CB.js} +2 -2
- package/dist-cli/chunks/{maestro-LFYXUX7O.js → maestro-OJY4MTI7.js} +2 -2
- package/dist-cli/chunks/{preview-U4SBOEGQ.js → preview-QU2GXTEV.js} +2 -2
- package/dist-cli/chunks/{profile-GWS5ECMY.js → profile-7APWK47T.js} +2 -2
- package/dist-cli/chunks/{react-QDHLMVYL.js → react-RSVO5JZZ.js} +2 -2
- package/dist-cli/chunks/{record-BUEUWPDI.js → record-UWH4MDEO.js} +2 -2
- package/dist-cli/chunks/runtime-3FUENRHM.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-G7L6RVZ7.js → runtime-delivery-QMKGRV7N.js} +2 -2
- package/dist-cli/chunks/{screenshot-T2HBA3VI.js → screenshot-43M27ALE.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-EG5HMIH3.js → screenshot-mode-EBYYN6TY.js} +2 -2
- package/dist-cli/chunks/{screenshots-S52AFHTV.js → screenshots-7TQZL6Z6.js} +2 -2
- package/dist-cli/chunks/{server-MFFVYUGG.js → server-VCFM25Z6.js} +2 -2
- package/dist-cli/chunks/setup-repo-HFH4VKJQ.js +2 -0
- package/dist-cli/chunks/{skills-HQGWBS2O.js → skills-RQA6EJQL.js} +2 -2
- package/dist-cli/chunks/{start-E3DRYY7W.js → start-ZT6MBYND.js} +4 -4
- package/dist-cli/chunks/store-BJBTDSZE.js +2 -0
- package/dist-cli/chunks/telemetry-ZZZKTILZ.js +2 -0
- package/dist-cli/chunks/{test-ZY3EF62K.js → test-RNRX5SWV.js} +3 -3
- package/dist-cli/chunks/{three-mode-WSPKQCJ5.js → three-mode-TQZH25ZO.js} +2 -2
- package/dist-cli/chunks/{timeline-3XAB5EWZ.js → timeline-GGN3AY6P.js} +2 -2
- package/dist-cli/chunks/{upgrade-WNENPFM5.js → upgrade-XT22D67C.js} +2 -2
- package/dist-cli/chunks/upload-NC2AYLC5.js +2 -0
- package/dist-cli/chunks/{web-D2AOZY44.js → web-KEHVF5MB.js} +2 -2
- package/dist-cli/chunks/{what-happened-F43KNSG6.js → what-happened-PATQRJ5T.js} +2 -2
- package/dist-cli/chunks/{whoami-T22VBR7C.js → whoami-CXVY26VV.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/beta.cjs +44 -0
- 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 +1770 -0
- package/dist-lib/detox/jest-preset.cjs +50 -0
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/index.cjs +136 -138
- package/dist-lib/metro.cjs +31 -26
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/demo-app-registry.cjs +809 -0
- package/dist-lib/scripts/dev-server-scanner.cjs +1269 -0
- package/dist-lib/skills.cjs +17766 -0
- package/dist-lib/vite.cjs +129 -39
- package/package.json +39 -14
- package/scripts/demo-app-registry.ts +989 -0
- package/scripts/dev-server-scanner.ts +674 -0
- package/src/agent-daemon-client.ts +390 -0
- package/src/agent-events.ts +71 -0
- package/src/agent-prompt.ts +71 -0
- package/src/agent-sessions.ts +572 -0
- package/src/attached-projects.ts +536 -0
- package/src/auth/shared-session.ts +199 -0
- package/src/backend-origin.ts +49 -0
- package/src/beta.ts +21 -0
- package/src/bridge-constants.ts +10 -0
- package/src/cli-constants.ts +1 -0
- package/src/cli-version.ts +30 -0
- package/src/codex-client.ts +215 -0
- package/src/config.ts +110 -0
- package/src/dev-bundle-resolution.ts +180 -0
- package/src/home-paths.ts +382 -0
- package/src/host/agent-host.ts +576 -0
- package/src/host/bridge-host.ts +2293 -0
- package/src/host/fetch-proxy-handler.ts +288 -0
- package/src/host/fetch-proxy-overrides.ts +39 -0
- package/src/host/open-url.ts +234 -0
- package/src/index.ts +9 -0
- package/src/metro-plugin.ts +139 -0
- package/src/native-dev-bundle-url.ts +62 -0
- package/src/native-seam-manifest.ts +313 -0
- package/src/profiles.ts +179 -0
- package/src/render-mode.ts +27 -0
- package/src/runtime-assets.ts +84 -0
- package/src/runtime-delivery.ts +334 -0
- package/src/screenshots/compose.ts +422 -0
- package/src/screenshots/frame-compose.ts +438 -0
- package/src/screenshots/orchestrate.ts +244 -0
- package/src/screenshots/registry.ts +58 -0
- package/src/screenshots/schema.ts +364 -0
- package/src/skills/builtin/a11y-review.ts +126 -0
- package/src/skills/builtin/compat-check.ts +104 -0
- package/src/skills/builtin/perf-profile.ts +84 -0
- package/src/skills/builtin/screenshot-all.ts +46 -0
- package/src/skills/builtin/test-flow.ts +118 -0
- package/src/skills/builtin/visual-diff.ts +94 -0
- package/src/skills/registry.ts +107 -0
- package/src/skills/types.ts +41 -0
- package/src/vite-plugin-one.ts +189 -0
- package/src/vite-plugin.ts +1381 -0
- package/src/worklets-babel.ts +132 -0
- package/dist-cli/chunks/auto-bootstrap-FQS4ZD2K.js +0 -2
- package/dist-cli/chunks/beta-VG7CDY2U.js +0 -2
- package/dist-cli/chunks/chunk-2OIBDYHW.js +0 -1
- package/dist-cli/chunks/chunk-6BNLVMXA.js +0 -1
- package/dist-cli/chunks/chunk-6XD6CBJM.js +0 -2
- package/dist-cli/chunks/chunk-CHQTO426.js +0 -1
- package/dist-cli/chunks/chunk-FAPYGVIU.js +0 -4
- package/dist-cli/chunks/chunk-PEHFE3LG.js +0 -64
- package/dist-cli/chunks/chunk-RXH2SLKF.js +0 -2
- package/dist-cli/chunks/chunk-UXQWC5ZR.js +0 -79
- package/dist-cli/chunks/chunk-XFQL74PF.js +0 -5
- package/dist-cli/chunks/cli-version-PWF6I6LY.js +0 -2
- package/dist-cli/chunks/control-UIOXGYXU.js +0 -2
- package/dist-cli/chunks/demo-app-registry-G3BDOFWC.js +0 -2
- package/dist-cli/chunks/drivers-IDQF34HP.js +0 -2
- package/dist-cli/chunks/flow-3JN3Y7RF.js +0 -2
- package/dist-cli/chunks/install-2N3YOOSN.js +0 -2
- package/dist-cli/chunks/runtime-PVB4VGUH.js +0 -2
- package/dist-cli/chunks/setup-repo-YOF7NV5D.js +0 -2
- package/dist-cli/chunks/store-MAI6D3UO.js +0 -2
- package/dist-cli/chunks/telemetry-RCQKCJTH.js +0 -2
- package/dist-cli/chunks/upload-YLJ4RA73.js +0 -2
- package/dist-lib/vite-base.cjs +0 -6937
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.85 | (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;
|
|
@@ -36,11 +36,45 @@ __export(vite_plugin_one_exports, {
|
|
|
36
36
|
sootsimPlugin: () => sootsimPlugin
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(vite_plugin_one_exports);
|
|
39
|
+
var import_fs2 = __toESM(require("fs"), 1);
|
|
40
|
+
var import_path2 = __toESM(require("path"), 1);
|
|
41
|
+
|
|
42
|
+
// src/runtime-assets.ts
|
|
39
43
|
var import_fs = __toESM(require("fs"), 1);
|
|
40
44
|
var import_path = __toESM(require("path"), 1);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var
|
|
45
|
+
|
|
46
|
+
// src/home-paths.ts
|
|
47
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
48
|
+
var import_node_os = require("node:os");
|
|
49
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
50
|
+
var SOOTSIM_HOME_ENV = "SOOTSIM_HOME";
|
|
51
|
+
var ACTIVE_RUNTIME_FILE = "active";
|
|
52
|
+
function sootsimHomeDir() {
|
|
53
|
+
const override = process.env[SOOTSIM_HOME_ENV];
|
|
54
|
+
if (override && override.length > 0) return import_node_path.default.resolve(override);
|
|
55
|
+
return import_node_path.default.join((0, import_node_os.homedir)(), ".sootsim");
|
|
56
|
+
}
|
|
57
|
+
function runtimesDir() {
|
|
58
|
+
return import_node_path.default.join(sootsimHomeDir(), "runtimes");
|
|
59
|
+
}
|
|
60
|
+
function runtimeDir(version) {
|
|
61
|
+
return import_node_path.default.join(runtimesDir(), version);
|
|
62
|
+
}
|
|
63
|
+
function activeRuntimeFile() {
|
|
64
|
+
return import_node_path.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
|
|
65
|
+
}
|
|
66
|
+
function readActiveRuntime() {
|
|
67
|
+
try {
|
|
68
|
+
const value = import_node_fs.default.readFileSync(activeRuntimeFile(), "utf8").trim();
|
|
69
|
+
return value.length > 0 ? value : null;
|
|
70
|
+
} catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
75
|
+
|
|
76
|
+
// src/runtime-assets.ts
|
|
77
|
+
var SOOTSIM_RUNTIME_MISSING_MESSAGE = "[sootsim] no engine runtime installed \u2014 run `sootsim setup-repo` in your project, or `sootsim runtime install`";
|
|
44
78
|
var MIME_TYPES = {
|
|
45
79
|
".js": "application/javascript",
|
|
46
80
|
".mjs": "application/javascript",
|
|
@@ -48,17 +82,64 @@ var MIME_TYPES = {
|
|
|
48
82
|
".html": "text/html",
|
|
49
83
|
".wasm": "application/wasm",
|
|
50
84
|
".json": "application/json",
|
|
85
|
+
".jpg": "image/jpeg",
|
|
86
|
+
".jpeg": "image/jpeg",
|
|
51
87
|
".png": "image/png",
|
|
52
88
|
".svg": "image/svg+xml",
|
|
89
|
+
".webp": "image/webp",
|
|
90
|
+
".glb": "model/gltf-binary",
|
|
53
91
|
".ttf": "font/ttf",
|
|
54
92
|
".otf": "font/otf",
|
|
55
93
|
".woff": "font/woff",
|
|
56
94
|
".woff2": "font/woff2",
|
|
57
95
|
".mp3": "audio/mpeg",
|
|
58
|
-
".wav": "audio/wav"
|
|
59
|
-
".jpg": "image/jpeg",
|
|
60
|
-
".webp": "image/webp"
|
|
96
|
+
".wav": "audio/wav"
|
|
61
97
|
};
|
|
98
|
+
var ROOT_RUNTIME_PATHS = [
|
|
99
|
+
"/assets/",
|
|
100
|
+
"/engine/",
|
|
101
|
+
"/engine-tenant/",
|
|
102
|
+
"/photos/",
|
|
103
|
+
"/three-mode/",
|
|
104
|
+
"/canvaskit.wasm",
|
|
105
|
+
"/fonts/",
|
|
106
|
+
"/icons/",
|
|
107
|
+
"/sounds/",
|
|
108
|
+
"/spike/",
|
|
109
|
+
"/test-wallpaper.jpg",
|
|
110
|
+
"/preview-sw.js"
|
|
111
|
+
];
|
|
112
|
+
function resolveActiveRuntimeRoot() {
|
|
113
|
+
const active = readActiveRuntime();
|
|
114
|
+
if (!active) return null;
|
|
115
|
+
const dir = runtimeDir(active);
|
|
116
|
+
if (!import_fs.default.existsSync(import_path.default.join(dir, "index.html"))) return null;
|
|
117
|
+
return dir;
|
|
118
|
+
}
|
|
119
|
+
function isRootRuntimeAssetPath(pathname) {
|
|
120
|
+
return ROOT_RUNTIME_PATHS.some((p) => pathname === p || pathname.startsWith(p));
|
|
121
|
+
}
|
|
122
|
+
function resolveRuntimeFilePath(runtimeRoot, pathname) {
|
|
123
|
+
if (!pathname.startsWith("/")) return null;
|
|
124
|
+
if (pathname.includes("\0") || pathname.includes("\\")) return null;
|
|
125
|
+
for (const segment of pathname.split("/")) {
|
|
126
|
+
if (segment === "..") return null;
|
|
127
|
+
}
|
|
128
|
+
const fullPath = import_path.default.resolve(runtimeRoot, pathname.replace(/^\/+/, ""));
|
|
129
|
+
const rootWithSep = runtimeRoot.endsWith(import_path.default.sep) ? runtimeRoot : runtimeRoot + import_path.default.sep;
|
|
130
|
+
if (!fullPath.startsWith(rootWithSep) && fullPath !== runtimeRoot) return null;
|
|
131
|
+
if (!import_fs.default.existsSync(fullPath) || !import_fs.default.statSync(fullPath).isFile()) return null;
|
|
132
|
+
return fullPath;
|
|
133
|
+
}
|
|
134
|
+
function serveRuntimeFile(res, fullPath) {
|
|
135
|
+
const ext = import_path.default.extname(fullPath);
|
|
136
|
+
res.setHeader("content-type", MIME_TYPES[ext] || "application/octet-stream");
|
|
137
|
+
res.setHeader("cache-control", "max-age=31536000,immutable");
|
|
138
|
+
import_fs.default.createReadStream(fullPath).pipe(res);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// src/vite-plugin-one.ts
|
|
142
|
+
var sootsimRoot = import_path2.default.resolve(import_path2.default.dirname(new URL(__sootsim_import_meta_url).pathname), "..");
|
|
62
143
|
function sootsimPlugin(options = {}) {
|
|
63
144
|
if (options.enabled === false) return [];
|
|
64
145
|
const prefix = options.prefix || "/__soot";
|
|
@@ -85,14 +166,27 @@ function sootsimPlugin(options = {}) {
|
|
|
85
166
|
});
|
|
86
167
|
server.middlewares.use((req, res, next) => {
|
|
87
168
|
const url = req.url || "";
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
169
|
+
const pathname = url.split("?")[0];
|
|
170
|
+
const runtimeRoot = resolveActiveRuntimeRoot();
|
|
171
|
+
if (!runtimeRoot) {
|
|
172
|
+
if (pathname === prefix || pathname === prefix + "/" || pathname.startsWith(prefix + "/")) {
|
|
91
173
|
res.statusCode = 500;
|
|
92
|
-
res.end(
|
|
174
|
+
res.end(SOOTSIM_RUNTIME_MISSING_MESSAGE);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
next();
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (isRootRuntimeAssetPath(pathname)) {
|
|
181
|
+
const fullPath = resolveRuntimeFilePath(runtimeRoot, pathname);
|
|
182
|
+
if (fullPath) {
|
|
183
|
+
serveRuntimeFile(res, fullPath);
|
|
93
184
|
return;
|
|
94
185
|
}
|
|
95
|
-
|
|
186
|
+
}
|
|
187
|
+
if (pathname === prefix || pathname === prefix + "/") {
|
|
188
|
+
const htmlPath = import_path2.default.join(runtimeRoot, "index.html");
|
|
189
|
+
let html = import_fs2.default.readFileSync(htmlPath, "utf8");
|
|
96
190
|
html = html.replace(
|
|
97
191
|
"</head>",
|
|
98
192
|
`<script>history.replaceState(null,'','${prefix}/?bundle=${encodeURIComponent(bundleUrl)}')</script></head>`
|
|
@@ -101,31 +195,25 @@ function sootsimPlugin(options = {}) {
|
|
|
101
195
|
res.end(html);
|
|
102
196
|
return;
|
|
103
197
|
}
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
res
|
|
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);
|
|
198
|
+
if (pathname.startsWith(prefix + "/")) {
|
|
199
|
+
const fullPath = resolveRuntimeFilePath(
|
|
200
|
+
runtimeRoot,
|
|
201
|
+
pathname.slice(prefix.length)
|
|
202
|
+
);
|
|
203
|
+
if (fullPath) {
|
|
204
|
+
serveRuntimeFile(res, fullPath);
|
|
119
205
|
return;
|
|
120
206
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
207
|
+
const ext = import_path2.default.extname(pathname);
|
|
208
|
+
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
|
+
res.setHeader("content-type", "text/html");
|
|
216
|
+
res.end(html);
|
|
129
217
|
return;
|
|
130
218
|
}
|
|
131
219
|
}
|
|
@@ -134,7 +222,9 @@ function sootsimPlugin(options = {}) {
|
|
|
134
222
|
const port = server.config.server.port || 8081;
|
|
135
223
|
const sootsimUrl = `http://localhost:${port}${prefix}/`;
|
|
136
224
|
console.log(`[sootsim] serving at ${sootsimUrl}`);
|
|
137
|
-
|
|
225
|
+
if (options.open !== false) {
|
|
226
|
+
openElectronApp(sootsimUrl);
|
|
227
|
+
}
|
|
138
228
|
}
|
|
139
229
|
}
|
|
140
230
|
];
|
|
@@ -150,10 +240,10 @@ async function openElectronApp(sootsimUrl) {
|
|
|
150
240
|
}
|
|
151
241
|
const candidates = [
|
|
152
242
|
"/Applications/sootsim.app",
|
|
153
|
-
|
|
154
|
-
|
|
243
|
+
import_path2.default.join(process.env.HOME || "", "Applications/sootsim.app"),
|
|
244
|
+
import_path2.default.join(sootsimRoot, "release/mac-arm64/sootsim.app")
|
|
155
245
|
];
|
|
156
|
-
let appPath = candidates.find((p) =>
|
|
246
|
+
let appPath = candidates.find((p) => import_fs2.default.existsSync(p));
|
|
157
247
|
if (!appPath) {
|
|
158
248
|
try {
|
|
159
249
|
const found = execSync(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sootsim",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.85",
|
|
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",
|
|
@@ -25,17 +25,18 @@
|
|
|
25
25
|
"source": "./src/vite-plugin-one.ts",
|
|
26
26
|
"default": "./dist-lib/vite.cjs"
|
|
27
27
|
},
|
|
28
|
-
"./vite-base": {
|
|
29
|
-
"source": "./src/vite-plugin.ts",
|
|
30
|
-
"default": "./dist-lib/vite-base.cjs"
|
|
31
|
-
},
|
|
32
28
|
"./metro": {
|
|
33
29
|
"source": "./src/metro-plugin.ts",
|
|
34
30
|
"default": "./dist-lib/metro.cjs"
|
|
35
31
|
},
|
|
36
|
-
"./skills":
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
"./skills": {
|
|
33
|
+
"source": "./src/skills/registry.ts",
|
|
34
|
+
"default": "./dist-lib/skills.cjs"
|
|
35
|
+
},
|
|
36
|
+
"./beta": {
|
|
37
|
+
"source": "./src/beta.ts",
|
|
38
|
+
"default": "./dist-lib/beta.cjs"
|
|
39
|
+
},
|
|
39
40
|
"./agent-events": {
|
|
40
41
|
"source": "./src/agent-events.ts",
|
|
41
42
|
"default": "./dist-lib/agent-events.cjs"
|
|
@@ -84,12 +85,30 @@
|
|
|
84
85
|
"source": "./src/host/bridge-host.ts",
|
|
85
86
|
"default": "./dist-lib/host/bridge-host.cjs"
|
|
86
87
|
},
|
|
87
|
-
"./host/fetch-proxy-handler":
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"./
|
|
92
|
-
|
|
88
|
+
"./host/fetch-proxy-handler": {
|
|
89
|
+
"source": "./src/host/fetch-proxy-handler.ts",
|
|
90
|
+
"default": "./dist-lib/host/fetch-proxy-handler.cjs"
|
|
91
|
+
},
|
|
92
|
+
"./host/fetch-proxy-overrides": {
|
|
93
|
+
"source": "./src/host/fetch-proxy-overrides.ts",
|
|
94
|
+
"default": "./dist-lib/host/fetch-proxy-overrides.cjs"
|
|
95
|
+
},
|
|
96
|
+
"./scripts/dev-server-scanner": {
|
|
97
|
+
"source": "./scripts/dev-server-scanner.ts",
|
|
98
|
+
"default": "./dist-lib/scripts/dev-server-scanner.cjs"
|
|
99
|
+
},
|
|
100
|
+
"./scripts/demo-app-registry": {
|
|
101
|
+
"source": "./scripts/demo-app-registry.ts",
|
|
102
|
+
"default": "./dist-lib/scripts/demo-app-registry.cjs"
|
|
103
|
+
},
|
|
104
|
+
"./detox": {
|
|
105
|
+
"source": "./detox/index.ts",
|
|
106
|
+
"default": "./dist-lib/detox/index.cjs"
|
|
107
|
+
},
|
|
108
|
+
"./detox/jest-preset": {
|
|
109
|
+
"source": "./detox/jest-preset.cjs",
|
|
110
|
+
"default": "./dist-lib/detox/jest-preset.cjs"
|
|
111
|
+
},
|
|
93
112
|
"./package.json": "./package.json"
|
|
94
113
|
},
|
|
95
114
|
"bin": {
|
|
@@ -98,6 +117,10 @@
|
|
|
98
117
|
"files": [
|
|
99
118
|
"dist-cli/",
|
|
100
119
|
"dist-lib/",
|
|
120
|
+
"src/",
|
|
121
|
+
"scripts/dev-server-scanner.ts",
|
|
122
|
+
"scripts/demo-app-registry.ts",
|
|
123
|
+
"detox/",
|
|
101
124
|
"scripts/postinstall.cjs",
|
|
102
125
|
"README.md",
|
|
103
126
|
"LICENSE"
|
|
@@ -106,6 +129,7 @@
|
|
|
106
129
|
"build": "bun scripts/build-cli.ts",
|
|
107
130
|
"build:cli": "bun scripts/build-cli.ts",
|
|
108
131
|
"build:cli-binary": "bun scripts/build-cli-binary.ts",
|
|
132
|
+
"pack:smoke": "bun scripts/pack-smoke.ts",
|
|
109
133
|
"postinstall": "node ./scripts/postinstall.cjs"
|
|
110
134
|
},
|
|
111
135
|
"dependencies": {
|
|
@@ -120,6 +144,7 @@
|
|
|
120
144
|
}
|
|
121
145
|
},
|
|
122
146
|
"devDependencies": {
|
|
147
|
+
"@soot/compat": "workspace:*",
|
|
123
148
|
"@soot/sootsim-globals": "workspace:*",
|
|
124
149
|
"@soot/sootsim-skills": "workspace:*",
|
|
125
150
|
"@types/ws": "^8.5.13",
|