sootsim 0.1.85 → 0.1.87
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 +4 -4
- package/dist-cli/chunks/{agent-T3DUH5YJ.js → agent-JVF2PSHI.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-NSBF4THI.js → agent-wrapper-F2F4AOBI.js} +2 -2
- package/dist-cli/chunks/{assert-X3F7TRCZ.js → assert-YYD6OU4X.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-NUDEO3WI.js +2 -0
- package/dist-cli/chunks/beta-KQR3AUDC.js +2 -0
- package/dist-cli/chunks/{chunk-EKXK3SWK.js → chunk-356M3TGV.js} +2 -2
- package/dist-cli/chunks/{chunk-Y5PLPEEU.js → chunk-4QWGWI5X.js} +2 -2
- package/dist-cli/chunks/{chunk-EFM53PZ5.js → chunk-5UEPOBEU.js} +1 -1
- package/dist-cli/chunks/{chunk-QLJNSOS7.js → chunk-6JITQIIF.js} +1 -1
- package/dist-cli/chunks/{chunk-DWTLRPEN.js → chunk-7KZTQHB3.js} +2 -2
- package/dist-cli/chunks/{chunk-OXOARRKR.js → chunk-7SX73XWN.js} +10 -10
- package/dist-cli/chunks/{chunk-5DIGWOY7.js → chunk-BDMAV7YE.js} +1 -1
- package/dist-cli/chunks/{chunk-CF2LPRXD.js → chunk-BGA7UNHQ.js} +2 -2
- package/dist-cli/chunks/{chunk-MAO7F5PH.js → chunk-BREFZK7S.js} +3 -3
- package/dist-cli/chunks/chunk-CIRLGKNJ.js +2 -0
- package/dist-cli/chunks/{chunk-KUSQ4NNJ.js → chunk-CQGEFQ2O.js} +1 -1
- package/dist-cli/chunks/{chunk-5S6D7K4L.js → chunk-F2V2RDSF.js} +2 -2
- package/dist-cli/chunks/chunk-FYFVAKLG.js +1 -0
- package/dist-cli/chunks/{chunk-E2QE5FFP.js → chunk-G4DPGAY7.js} +1 -1
- package/dist-cli/chunks/{chunk-5N3V7OCG.js → chunk-HSIKVDO7.js} +2 -2
- package/dist-cli/chunks/{chunk-RZHREO3M.js → chunk-HUL7SDXP.js} +2 -2
- package/dist-cli/chunks/{chunk-HQDJ5BOF.js → chunk-IFTNXJFC.js} +1 -1
- package/dist-cli/chunks/{chunk-OISHLFON.js → chunk-JIGBO7T2.js} +1 -1
- package/dist-cli/chunks/{chunk-NVTL3JQG.js → chunk-JNC2KM5L.js} +1 -1
- package/dist-cli/chunks/{chunk-ZO3VHP6W.js → chunk-KHCGD2SK.js} +22 -10
- package/dist-cli/chunks/chunk-KOJH7M2Y.js +24 -0
- package/dist-cli/chunks/{chunk-BZL6D4TV.js → chunk-KRG3TVPS.js} +63 -62
- package/dist-cli/chunks/{chunk-OUNLJM56.js → chunk-L7NMKMAC.js} +2 -2
- package/dist-cli/chunks/{chunk-4EVSIUNB.js → chunk-LAFA2UUY.js} +2 -2
- package/dist-cli/chunks/{chunk-SBGOUA6F.js → chunk-LKF24E4V.js} +2 -2
- package/dist-cli/chunks/{chunk-AFNDVS4E.js → chunk-MAFNPEGR.js} +2 -2
- package/dist-cli/chunks/{chunk-GTAD6IUV.js → chunk-MDZ6HMDB.js} +1 -1
- package/dist-cli/chunks/chunk-NNBW2HSI.js +1 -0
- package/dist-cli/chunks/{chunk-EBEL6TTJ.js → chunk-OB6UTULM.js} +2 -2
- package/dist-cli/chunks/{chunk-7LKUN46F.js → chunk-OOMEG6UD.js} +2 -2
- package/dist-cli/chunks/{chunk-UYRGCJ4N.js → chunk-P7TSRSCR.js} +45 -45
- package/dist-cli/chunks/{chunk-BESAZ2HA.js → chunk-PJA4MECT.js} +2 -2
- package/dist-cli/chunks/{chunk-4QZHZ6BC.js → chunk-PQ64ESHO.js} +2 -2
- package/dist-cli/chunks/{chunk-AC6QGW22.js → chunk-PQIWV724.js} +2 -2
- package/dist-cli/chunks/{chunk-H44IQHKZ.js → chunk-PRQGETWQ.js} +1 -1
- package/dist-cli/chunks/{chunk-BHZJ6RIH.js → chunk-PV7UPMMH.js} +2 -2
- package/dist-cli/chunks/{chunk-PHPXGLME.js → chunk-QFHW7D44.js} +1 -1
- package/dist-cli/chunks/{chunk-O6N2CEET.js → chunk-QI3CAQIS.js} +2 -2
- package/dist-cli/chunks/{chunk-G7CIZ5S3.js → chunk-RFES5JTB.js} +3 -3
- package/dist-cli/chunks/chunk-SFGIFF2S.js +2 -0
- package/dist-cli/chunks/chunk-TRLVCBYL.js +1 -0
- package/dist-cli/chunks/{chunk-WGDL5V6C.js → chunk-Y2H2L6L7.js} +1 -1
- package/dist-cli/chunks/{chunk-3WGHC7JN.js → chunk-ZKJ42ZMK.js} +2 -2
- package/dist-cli/chunks/cli-version-QYZHMOJT.js +2 -0
- package/dist-cli/chunks/{compat-PCXGGZBZ.js → compat-46LSYJLF.js} +3 -3
- package/dist-cli/chunks/{config-LULEVEYL.js → config-P5NLMUL2.js} +2 -2
- package/dist-cli/chunks/{control-6P6HY7UF.js → control-3O7JEUFC.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-NOK73ZYW.js → cpu-profile-LDMMDC7S.js} +2 -2
- package/dist-cli/chunks/{daemon-4A3DMUYL.js → daemon-BL3MXXR3.js} +3 -3
- package/dist-cli/chunks/{debug-74BWB2ZG.js → debug-SQA6GG37.js} +3 -3
- package/dist-cli/chunks/{detox-HEOMINSC.js → detox-TY6AOSA7.js} +2 -2
- package/dist-cli/chunks/{device-TTXXBJFZ.js → device-QWFX4556.js} +2 -2
- package/dist-cli/chunks/{diagnose-QZ3GOHSE.js → diagnose-P2UVBUN6.js} +2 -2
- package/dist-cli/chunks/drivers-HPRXOC6D.js +2 -0
- package/dist-cli/chunks/{electron-QVOWV44R.js → electron-U3KDMBJM.js} +3 -3
- package/dist-cli/chunks/flow-XGMUH4JT.js +2 -0
- package/dist-cli/chunks/help-HZCKWAH5.js +2 -0
- package/dist-cli/chunks/{hints-YKWRNMJC.js → hints-2IYL3NF4.js} +2 -2
- package/dist-cli/chunks/{home-paths-SFADSTJM.js → home-paths-5SZOYDCC.js} +2 -2
- package/dist-cli/chunks/{inspect-LEWGQCIU.js → inspect-FA4L7WIE.js} +107 -107
- package/dist-cli/chunks/install-SYVS2T2T.js +2 -0
- package/dist-cli/chunks/{install-desktop-22HYQZ2G.js → install-desktop-OLT6LS5L.js} +3 -3
- package/dist-cli/chunks/{keys-3ZT3MICU.js → keys-3OXB23J4.js} +2 -2
- package/dist-cli/chunks/{launch-ZXW2NFLG.js → launch-HEXKSA3X.js} +3 -3
- package/dist-cli/chunks/{login-NJKJ7GZO.js → login-DKQYESDF.js} +4 -4
- package/dist-cli/chunks/{logout-VMMQL7CB.js → logout-FMJJ3BR2.js} +2 -2
- package/dist-cli/chunks/{maestro-OJY4MTI7.js → maestro-Z24ESGQW.js} +2 -2
- package/dist-cli/chunks/{preview-QU2GXTEV.js → preview-ODKBHTV5.js} +2 -2
- package/dist-cli/chunks/{profile-7APWK47T.js → profile-2PIY7B3L.js} +2 -2
- package/dist-cli/chunks/{react-RSVO5JZZ.js → react-HL4CHJS4.js} +2 -2
- package/dist-cli/chunks/{record-UWH4MDEO.js → record-4LYFSZUK.js} +2 -2
- package/dist-cli/chunks/runtime-JML6VARG.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-QMKGRV7N.js → runtime-delivery-U7WIYI7J.js} +2 -2
- package/dist-cli/chunks/{screenshot-43M27ALE.js → screenshot-YUA2BHDF.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-EBYYN6TY.js → screenshot-mode-UIL75CHP.js} +2 -2
- package/dist-cli/chunks/{screenshots-7TQZL6Z6.js → screenshots-YJWODQGP.js} +2 -2
- package/dist-cli/chunks/server-J644PTIB.js +40 -0
- package/dist-cli/chunks/setup-repo-GSEZY74V.js +2 -0
- package/dist-cli/chunks/{skills-RQA6EJQL.js → skills-PEBZZZTL.js} +2 -2
- package/dist-cli/chunks/{start-ZT6MBYND.js → start-JCJQRDDQ.js} +4 -4
- package/dist-cli/chunks/store-XGTUSOGS.js +2 -0
- package/dist-cli/chunks/telemetry-Y3IESY7P.js +2 -0
- package/dist-cli/chunks/{test-RNRX5SWV.js → test-Z3NU6IN7.js} +3 -3
- package/dist-cli/chunks/{three-mode-TQZH25ZO.js → three-mode-CFSZ2ZOW.js} +2 -2
- package/dist-cli/chunks/{timeline-GGN3AY6P.js → timeline-GEND6OI3.js} +2 -2
- package/dist-cli/chunks/{upgrade-XT22D67C.js → upgrade-6GFR2ZB7.js} +3 -3
- package/dist-cli/chunks/upload-OPMPP35I.js +2 -0
- package/dist-cli/chunks/{web-KEHVF5MB.js → web-7A27OUAC.js} +2 -2
- package/dist-cli/chunks/{what-happened-PATQRJ5T.js → what-happened-57G5T2GM.js} +2 -2
- package/dist-cli/chunks/{whoami-CXVY26VV.js → whoami-3ICC26FV.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 +1 -1
- package/dist-lib/beta.mjs +15 -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 +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 +244 -35
- package/dist-lib/host/fetch-proxy-handler.cjs +24 -4
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +33 -0
- package/dist-lib/host/websocket-proxy.cjs +207 -0
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/demo-app-registry.cjs +14 -3
- package/dist-lib/scripts/dev-server-scanner.cjs +14 -3
- package/dist-lib/skills.cjs +290 -73
- package/dist-lib/vite.cjs +1 -1
- package/package.json +7 -1
- package/scripts/demo-app-registry.ts +17 -1
- package/src/host/bridge-host.ts +8 -1
- package/src/host/fetch-proxy-handler.ts +26 -3
- package/src/host/websocket-proxy.ts +201 -0
- package/dist-cli/chunks/auto-bootstrap-47RN2V5G.js +0 -2
- package/dist-cli/chunks/beta-BRCGAF2N.js +0 -2
- package/dist-cli/chunks/chunk-36RPD6JI.js +0 -2
- package/dist-cli/chunks/chunk-4DBPNLGI.js +0 -1
- package/dist-cli/chunks/chunk-PQFFUJR6.js +0 -24
- package/dist-cli/chunks/chunk-QQAECG5B.js +0 -2
- package/dist-cli/chunks/chunk-SSCA2AEA.js +0 -1
- package/dist-cli/chunks/chunk-ZFAM4N5B.js +0 -1
- package/dist-cli/chunks/cli-version-WPFDM2A6.js +0 -2
- package/dist-cli/chunks/drivers-QRPWNOIT.js +0 -2
- package/dist-cli/chunks/flow-QMA7GVN6.js +0 -2
- package/dist-cli/chunks/install-7N2N7Q32.js +0 -2
- package/dist-cli/chunks/runtime-3FUENRHM.js +0 -2
- package/dist-cli/chunks/server-VCFM25Z6.js +0 -35
- package/dist-cli/chunks/setup-repo-HFH4VKJQ.js +0 -2
- package/dist-cli/chunks/store-BJBTDSZE.js +0 -2
- package/dist-cli/chunks/telemetry-ZZZKTILZ.js +0 -2
- package/dist-cli/chunks/upload-NC2AYLC5.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as y,L as x,y as F,z as T}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.87 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as y,L as x,y as F,z as T}from"./chunk-KHCGD2SK.js";import{c as S,e as N}from"./chunk-356M3TGV.js";import{b as k}from"./chunk-JIGBO7T2.js";import"./chunk-SFGIFF2S.js";import"./chunk-Y2H2L6L7.js";import"./chunk-PRQGETWQ.js";function _(n){let e=[];for(let t=0;t<n.length;t++)if(n[t]==="--since"&&t+1<n.length){e.push(t,t+1);let s=n[t+1].trim(),l=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(s);if(l){let a=Number(l[1]),m=l[2]??"ms",$=m==="s"?a*1e3:m==="m"?a*6e4:a;return{since:Date.now()-$,consumed:e}}let o=Number(s);if(Number.isFinite(o)&&o>1e12)return{since:o,consumed:e}}return{consumed:e}}function K(n){let e=[];for(let t=0;t<n.length;t++)if(n[t]==="--kinds"&&t+1<n.length)return e.push(t,t+1),{kinds:n[t+1].split(",").map(s=>s.trim()).filter(Boolean),consumed:e};return{consumed:e}}function O(n){let e=[];for(let t=0;t<n.length;t++)if(n[t]==="--limit"&&t+1<n.length){e.push(t,t+1);let s=Number(n[t+1]);if(Number.isFinite(s)&&s>0)return{limit:s,consumed:e}}return{consumed:e}}function j(n,e){if(e===null)return new Date(n).toLocaleTimeString();let t=(n-e)/1e3;return`${t>=0?"+":""}${t.toFixed(2)}s`}function B(n,e){switch(n){case"app-launch":return e.phase==="launch"?`launch ${e.appName??e.toAppId??""}`:`dismiss ${e.appName??e.fromAppId??""} \u2192 ${e.toAppId??""}`;case"toast":return`"${e.text??""}"${e.durationMs?` (${e.durationMs}ms)`:""}`;case"keyboard":return`${e.phase??"?"}${e.heightPx?` h=${e.heightPx}`:""}${e.mode?` ${e.mode}`:""}`;case"screen":return`${e.phase??"?"} ${e.name??e.activeName??""}`;case"route":return`${e.phase??"?"} ${e.path??e.pathname??""}`;case"alert":case"actionsheet":case"picker":return`${e.phase??"?"} ${e.title??e.message??""}`;case"notification":return`${e.title??""}${e.body?` \u2014 ${e.body}`:""}`;case"fetch":return`${e.method??"GET"} ${e.url??""}${e.status?` -> ${e.status}`:""}`;case"console":return`${e.level??"log"}: ${(e.message??"").toString().slice(0,120)}`;case"shell":return`${e.event??e.type??e.phase??""}`;case"scroll":return`${e.phase??"?"} ${e.target??""}`;case"gesture":return`${e.phase??"?"} ${e.type??""}`;case"text-input":return`${e.phase??"?"}${e.value!==void 0?` "${String(e.value).slice(0,40)}"`:""}`;case"layout":return`${e.kind??"?"} ${e.testID??e.type??""}${e.skipped?` skipped:${e.reason??"unknown"}`:""}`;case"react-commit":{let t=e.slowest;return`${e.fiberCount??"?"} fibers ${e.durationMs??"?"}ms${t?.displayName?` \xB7 ${t.displayName} ${t.durationMs??"?"}ms`:""}`}case"reanimated":case"animation":return`${e.kind??""} ${e.target??""}${e.durationMs?` ${e.durationMs}ms`:""}`}}function A(n,e){let t=j(n.t,e).padStart(8),s=n.context.padEnd(6),l=`[${n.kind}]`.padEnd(15),o="",a=n.data;return a&&typeof a=="object"&&(o=B(n.kind,a)),` ${t} ${s} ${l} ${o}`}function M(n){let e=[],t={label:"initial state",events:[],startedAt:n[0]?.t??null};e.push(t);for(let s of n)if(t.events.push(s),s.kind==="screen"||s.kind==="route"){let l=s.data,o=l?.phase;if(!o||o==="enter"||o==="appear"||o==="active"){let a=l?.name||l?.activeName||l?.path||l?.pathname||s.kind;e.length===1&&t.events.length===1?t.label=`${s.kind}: ${a}`:(t={label:`${s.kind}: ${a}`,events:[],startedAt:s.t},e.push(t))}}return e}async function J(n,e){let t=S(n,{port:e.port,stripBooleanFlags:["--summary","--all","--json","--no-advance","--help","-h","--flow","--noisy"],stripValueFlags:["--since","--kinds","--limit"]});(n.includes("--help")||n.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim what-happened \u2014 show recent events from the semantic timeline
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{d as i}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.87 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as i}from"./chunk-HSIKVDO7.js";import{d as n}from"./chunk-L7NMKMAC.js";import"./chunk-Y2H2L6L7.js";import"./chunk-PRQGETWQ.js";async function u(){let o=i();if(o||(console.log(" not signed in"),console.log(" set SOOTSIM_API_KEY=sk_sootsim_\u2026 or run `sootsim login`"),process.exit(1)),o.kind==="api-key"){let r=`${o.secret.slice(0,14)}\u2026`,t=o.source==="env"?"SOOTSIM_API_KEY env var":"saved key (~/.config/sootsim/credentials.json)";console.log(` api key ${r}`),console.log(` source: ${t}`);return}if(o.kind==="github"){console.log(` github token (${o.source})`),console.log(` repo: ${o.repoId}`);return}let e=await n(),s=e?.user;console.log(` ${s?.email||s?.name||s?.id||"signed in"}`),console.log(` origin: ${e?.origin??o.origin}`),e?.updatedAt&&console.log(` updated: ${e.updatedAt}`)}export{u as runWhoami};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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 __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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 __defProp = Object.defineProperty;
|
package/dist-lib/beta.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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 __defProp = Object.defineProperty;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*! sootsim v0.1.87 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
|
|
3
|
+
// src/beta.ts
|
|
4
|
+
var IS_BETA = true;
|
|
5
|
+
var BETA_VERSION_TARGET = "1.0.0";
|
|
6
|
+
var BETA_LABEL = "public beta";
|
|
7
|
+
var BETA_TAGLINE = `${BETA_LABEL} \xB7 free until ${BETA_VERSION_TARGET}`;
|
|
8
|
+
var BETA_ASK_HEADLINE = "free for everyone until 1.0 \u2014 we send anonymous error and dependency data while you use it";
|
|
9
|
+
export {
|
|
10
|
+
BETA_ASK_HEADLINE,
|
|
11
|
+
BETA_LABEL,
|
|
12
|
+
BETA_TAGLINE,
|
|
13
|
+
BETA_VERSION_TARGET,
|
|
14
|
+
IS_BETA
|
|
15
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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 __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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 __defProp = Object.defineProperty;
|
package/dist-lib/config.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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 __defProp = Object.defineProperty;
|
package/dist-lib/detox/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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 __defProp = Object.defineProperty;
|
package/dist-lib/home-paths.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.87 | (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,7 +39,7 @@ var import_child_process4 = require("child_process");
|
|
|
39
39
|
var import_fs3 = __toESM(require("fs"), 1);
|
|
40
40
|
var import_http3 = require("http");
|
|
41
41
|
var import_path3 = __toESM(require("path"), 1);
|
|
42
|
-
var
|
|
42
|
+
var import_ws2 = require("ws");
|
|
43
43
|
|
|
44
44
|
// scripts/dev-server-scanner.ts
|
|
45
45
|
var import_child_process = require("child_process");
|
|
@@ -663,11 +663,22 @@ var APPS = [
|
|
|
663
663
|
// be holding pglite locks on ~/takeout/.orez (soot can attach takeout as
|
|
664
664
|
// a project and spin up its own orez against the same data dir).
|
|
665
665
|
readyTimeoutMs: 24e4,
|
|
666
|
+
managedPorts: (p) => {
|
|
667
|
+
const offset = p - 8081;
|
|
668
|
+
return [5433 + offset, 4848 + offset, 9200 + offset];
|
|
669
|
+
},
|
|
666
670
|
command: (p) => ({
|
|
667
|
-
cmd: "bun lite",
|
|
671
|
+
cmd: "bun lite:demo",
|
|
668
672
|
env: {
|
|
673
|
+
TAKEOUT_ENV_MODE: "development",
|
|
669
674
|
PORT_OFFSET: String(p - 8081),
|
|
670
|
-
OREZ_DATA_DIR: `${HOME}/.cache/sootsim-demo/takeout-orez
|
|
675
|
+
OREZ_DATA_DIR: `${HOME}/.cache/sootsim-demo/takeout-orez`,
|
|
676
|
+
VITE_DEMO_MODE: "1",
|
|
677
|
+
ZERO_APP_ID: "takeout",
|
|
678
|
+
ZERO_APP_PUBLICATIONS: "zero_takeout",
|
|
679
|
+
ZERO_CVR_MAX_CONNS: "4",
|
|
680
|
+
ZERO_NUM_SYNC_WORKERS: "2",
|
|
681
|
+
ZERO_UPSTREAM_MAX_CONNS: "8"
|
|
671
682
|
}
|
|
672
683
|
})
|
|
673
684
|
},
|
|
@@ -2910,6 +2921,14 @@ var FETCH_PROXY_CORS_HEADERS = {
|
|
|
2910
2921
|
"access-control-expose-headers": "*",
|
|
2911
2922
|
"access-control-max-age": "3600"
|
|
2912
2923
|
};
|
|
2924
|
+
var APP_API_HEADER_REWRITES = /* @__PURE__ */ new Set([
|
|
2925
|
+
"host",
|
|
2926
|
+
"origin",
|
|
2927
|
+
"referer",
|
|
2928
|
+
"sec-fetch-site",
|
|
2929
|
+
"sec-fetch-mode",
|
|
2930
|
+
"sec-fetch-dest"
|
|
2931
|
+
]);
|
|
2913
2932
|
function applyFetchProxyCors(res) {
|
|
2914
2933
|
for (const [key, value] of Object.entries(FETCH_PROXY_CORS_HEADERS)) {
|
|
2915
2934
|
res.setHeader(key, value);
|
|
@@ -2942,6 +2961,18 @@ function buildFetchProxyHeaders(reqHeaders, targetUrl) {
|
|
|
2942
2961
|
);
|
|
2943
2962
|
return headers;
|
|
2944
2963
|
}
|
|
2964
|
+
function buildAppApiProxyHeaders(reqHeaders, targetUrl) {
|
|
2965
|
+
const headers = {};
|
|
2966
|
+
for (const [key, value] of Object.entries(reqHeaders)) {
|
|
2967
|
+
if (!value) continue;
|
|
2968
|
+
if (APP_API_HEADER_REWRITES.has(key.toLowerCase())) continue;
|
|
2969
|
+
headers[key] = value;
|
|
2970
|
+
}
|
|
2971
|
+
headers.host = targetUrl.host;
|
|
2972
|
+
headers.origin = targetUrl.origin;
|
|
2973
|
+
headers.referer = `${targetUrl.origin}/`;
|
|
2974
|
+
return headers;
|
|
2975
|
+
}
|
|
2945
2976
|
function isFetchProxyRequestUrl(rawUrl) {
|
|
2946
2977
|
return rawUrl?.startsWith("/__fetch-proxy?") || rawUrl?.startsWith("/__proxy?") || false;
|
|
2947
2978
|
}
|
|
@@ -3052,9 +3083,7 @@ function handleAppApiRequest(req, res) {
|
|
|
3052
3083
|
return true;
|
|
3053
3084
|
}
|
|
3054
3085
|
const transport = targetUrl.protocol === "https:" ? import_https.default : import_http2.default;
|
|
3055
|
-
const fwdHeaders =
|
|
3056
|
-
delete fwdHeaders.host;
|
|
3057
|
-
fwdHeaders.host = targetUrl.host;
|
|
3086
|
+
const fwdHeaders = buildAppApiProxyHeaders(req.headers, targetUrl);
|
|
3058
3087
|
const proxyReq = transport.request(
|
|
3059
3088
|
{
|
|
3060
3089
|
hostname: targetUrl.hostname,
|
|
@@ -3232,6 +3261,180 @@ async function openUrl(url, options = {}) {
|
|
|
3232
3261
|
await launchUrl(url, options);
|
|
3233
3262
|
}
|
|
3234
3263
|
|
|
3264
|
+
// src/host/websocket-proxy.ts
|
|
3265
|
+
var import_ws = require("ws");
|
|
3266
|
+
var WEBSOCKET_PROXY_PATH = "/__websocket-proxy";
|
|
3267
|
+
var STRIP_UPSTREAM_HEADERS = /* @__PURE__ */ new Set([
|
|
3268
|
+
"host",
|
|
3269
|
+
"connection",
|
|
3270
|
+
"upgrade",
|
|
3271
|
+
"transfer-encoding",
|
|
3272
|
+
"content-length",
|
|
3273
|
+
"sec-websocket-accept",
|
|
3274
|
+
"sec-websocket-extensions",
|
|
3275
|
+
"sec-websocket-key",
|
|
3276
|
+
"sec-websocket-protocol",
|
|
3277
|
+
"sec-websocket-version"
|
|
3278
|
+
]);
|
|
3279
|
+
function rejectUpgrade(socket, status, message) {
|
|
3280
|
+
try {
|
|
3281
|
+
socket.write(
|
|
3282
|
+
`HTTP/1.1 ${status} ${message}\r
|
|
3283
|
+
Connection: close\r
|
|
3284
|
+
Content-Type: text/plain\r
|
|
3285
|
+
Content-Length: ${message.length}\r
|
|
3286
|
+
\r
|
|
3287
|
+
${message}`
|
|
3288
|
+
);
|
|
3289
|
+
} catch {
|
|
3290
|
+
}
|
|
3291
|
+
socket.destroy();
|
|
3292
|
+
}
|
|
3293
|
+
function isSameOriginUpgrade(req) {
|
|
3294
|
+
const origin = req.headers.origin;
|
|
3295
|
+
const host = req.headers.host;
|
|
3296
|
+
if (!origin || !host) return false;
|
|
3297
|
+
try {
|
|
3298
|
+
return new URL(origin).host === host;
|
|
3299
|
+
} catch {
|
|
3300
|
+
return false;
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
function decodeProxyHeaders(encoded) {
|
|
3304
|
+
if (!encoded) return {};
|
|
3305
|
+
const base64 = encoded.replace(/-/g, "+").replace(/_/g, "/");
|
|
3306
|
+
const padded = base64 + "=".repeat((4 - base64.length % 4) % 4);
|
|
3307
|
+
const parsed = JSON.parse(Buffer.from(padded, "base64").toString("utf8"));
|
|
3308
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
3309
|
+
const headers = {};
|
|
3310
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
3311
|
+
if (value == null) continue;
|
|
3312
|
+
if (STRIP_UPSTREAM_HEADERS.has(key.toLowerCase())) continue;
|
|
3313
|
+
headers[key] = Array.isArray(value) ? value.join(", ") : String(value);
|
|
3314
|
+
}
|
|
3315
|
+
return headers;
|
|
3316
|
+
}
|
|
3317
|
+
function getDefaultWebSocketOrigin(targetUrl) {
|
|
3318
|
+
const origin = new URL(targetUrl.href);
|
|
3319
|
+
origin.protocol = targetUrl.protocol === "wss:" ? "https:" : "http:";
|
|
3320
|
+
return origin.origin;
|
|
3321
|
+
}
|
|
3322
|
+
function getRequestedProtocols(req) {
|
|
3323
|
+
const header = req.headers["sec-websocket-protocol"];
|
|
3324
|
+
const value = Array.isArray(header) ? header.join(",") : header || "";
|
|
3325
|
+
return value.split(",").map((part) => part.trim()).filter(Boolean);
|
|
3326
|
+
}
|
|
3327
|
+
function safeClose(ws, code, reason) {
|
|
3328
|
+
if (ws.readyState === import_ws.WebSocket.CLOSED || ws.readyState === import_ws.WebSocket.CLOSING) {
|
|
3329
|
+
return;
|
|
3330
|
+
}
|
|
3331
|
+
try {
|
|
3332
|
+
ws.close(code, reason);
|
|
3333
|
+
} catch {
|
|
3334
|
+
ws.terminate();
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
function connectProxyPair(clientWs, upstream) {
|
|
3338
|
+
let closing = false;
|
|
3339
|
+
const closeBoth = (source, target, code, reason) => {
|
|
3340
|
+
if (closing) return;
|
|
3341
|
+
closing = true;
|
|
3342
|
+
safeClose(target, code, reason.toString());
|
|
3343
|
+
if (source.readyState === import_ws.WebSocket.OPEN) {
|
|
3344
|
+
safeClose(source, code, reason.toString());
|
|
3345
|
+
}
|
|
3346
|
+
};
|
|
3347
|
+
clientWs.on("message", (data, isBinary) => {
|
|
3348
|
+
if (upstream.readyState === import_ws.WebSocket.OPEN) {
|
|
3349
|
+
upstream.send(data, { binary: isBinary });
|
|
3350
|
+
}
|
|
3351
|
+
});
|
|
3352
|
+
upstream.on("message", (data, isBinary) => {
|
|
3353
|
+
if (clientWs.readyState === import_ws.WebSocket.OPEN) {
|
|
3354
|
+
clientWs.send(data, { binary: isBinary });
|
|
3355
|
+
}
|
|
3356
|
+
});
|
|
3357
|
+
clientWs.on("close", (code, reason) => closeBoth(clientWs, upstream, code, reason));
|
|
3358
|
+
upstream.on("close", (code, reason) => closeBoth(upstream, clientWs, code, reason));
|
|
3359
|
+
clientWs.on("error", () => safeClose(upstream, 1011, "proxy client error"));
|
|
3360
|
+
upstream.on("error", () => safeClose(clientWs, 1011, "upstream websocket error"));
|
|
3361
|
+
}
|
|
3362
|
+
function createUpstreamWebSocket(targetUrl, protocols, headers) {
|
|
3363
|
+
const upstreamHeaders = { ...headers };
|
|
3364
|
+
if (!Object.keys(upstreamHeaders).some((key) => key.toLowerCase() === "origin")) {
|
|
3365
|
+
upstreamHeaders.origin = getDefaultWebSocketOrigin(targetUrl);
|
|
3366
|
+
}
|
|
3367
|
+
return new import_ws.WebSocket(targetUrl.href, protocols, {
|
|
3368
|
+
headers: upstreamHeaders
|
|
3369
|
+
});
|
|
3370
|
+
}
|
|
3371
|
+
function isWebSocketProxyRequestUrl(rawUrl) {
|
|
3372
|
+
if (!rawUrl) return false;
|
|
3373
|
+
try {
|
|
3374
|
+
return new URL(rawUrl, "http://localhost").pathname === WEBSOCKET_PROXY_PATH;
|
|
3375
|
+
} catch {
|
|
3376
|
+
return false;
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
function handleWebSocketProxyUpgrade(req, socket, head) {
|
|
3380
|
+
if (!isWebSocketProxyRequestUrl(req.url)) return false;
|
|
3381
|
+
if (!isSameOriginUpgrade(req)) {
|
|
3382
|
+
rejectUpgrade(socket, 403, "forbidden websocket proxy origin");
|
|
3383
|
+
return true;
|
|
3384
|
+
}
|
|
3385
|
+
let targetUrl;
|
|
3386
|
+
let headers;
|
|
3387
|
+
try {
|
|
3388
|
+
const requestUrl = new URL(req.url || "/", "http://localhost");
|
|
3389
|
+
const target = requestUrl.searchParams.get("url");
|
|
3390
|
+
if (!target) {
|
|
3391
|
+
rejectUpgrade(socket, 400, "missing websocket proxy url");
|
|
3392
|
+
return true;
|
|
3393
|
+
}
|
|
3394
|
+
targetUrl = new URL(target);
|
|
3395
|
+
if (targetUrl.protocol !== "ws:" && targetUrl.protocol !== "wss:") {
|
|
3396
|
+
rejectUpgrade(socket, 400, "invalid websocket proxy protocol");
|
|
3397
|
+
return true;
|
|
3398
|
+
}
|
|
3399
|
+
headers = decodeProxyHeaders(requestUrl.searchParams.get("headers"));
|
|
3400
|
+
} catch {
|
|
3401
|
+
rejectUpgrade(socket, 400, "invalid websocket proxy request");
|
|
3402
|
+
return true;
|
|
3403
|
+
}
|
|
3404
|
+
const protocols = getRequestedProtocols(req);
|
|
3405
|
+
const upstream = createUpstreamWebSocket(targetUrl, protocols, headers);
|
|
3406
|
+
let completed = false;
|
|
3407
|
+
socket.once("close", () => {
|
|
3408
|
+
if (!completed) upstream.terminate();
|
|
3409
|
+
});
|
|
3410
|
+
upstream.once("open", () => {
|
|
3411
|
+
if (completed) return;
|
|
3412
|
+
completed = true;
|
|
3413
|
+
const selectedProtocol = upstream.protocol;
|
|
3414
|
+
const proxyServer = new import_ws.WebSocketServer({
|
|
3415
|
+
noServer: true,
|
|
3416
|
+
clientTracking: false,
|
|
3417
|
+
handleProtocols(requestedProtocols) {
|
|
3418
|
+
return selectedProtocol || requestedProtocols.values().next().value || false;
|
|
3419
|
+
}
|
|
3420
|
+
});
|
|
3421
|
+
proxyServer.handleUpgrade(req, socket, head, (clientWs) => {
|
|
3422
|
+
connectProxyPair(clientWs, upstream);
|
|
3423
|
+
});
|
|
3424
|
+
});
|
|
3425
|
+
upstream.once("error", () => {
|
|
3426
|
+
if (completed) return;
|
|
3427
|
+
completed = true;
|
|
3428
|
+
rejectUpgrade(socket, 502, "upstream websocket error");
|
|
3429
|
+
});
|
|
3430
|
+
upstream.once("close", () => {
|
|
3431
|
+
if (completed) return;
|
|
3432
|
+
completed = true;
|
|
3433
|
+
rejectUpgrade(socket, 502, "upstream websocket closed");
|
|
3434
|
+
});
|
|
3435
|
+
return true;
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3235
3438
|
// src/host/bridge-host.ts
|
|
3236
3439
|
var WRITE_COMMAND_TYPES = /* @__PURE__ */ new Set(["tap", "keyboard"]);
|
|
3237
3440
|
var FORCE_CLOSE_GRACE_MS = 2e3;
|
|
@@ -3446,8 +3649,14 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3446
3649
|
`);
|
|
3447
3650
|
});
|
|
3448
3651
|
this.httpServer = server;
|
|
3449
|
-
this.wss = new
|
|
3652
|
+
this.wss = new import_ws2.WebSocketServer({ noServer: true });
|
|
3450
3653
|
this.wireWebSocketServer();
|
|
3654
|
+
server.on("upgrade", (req, socket, head) => {
|
|
3655
|
+
if (handleWebSocketProxyUpgrade(req, socket, head)) return;
|
|
3656
|
+
this.wss?.handleUpgrade(req, socket, head, (ws) => {
|
|
3657
|
+
this.wss?.emit("connection", ws, req);
|
|
3658
|
+
});
|
|
3659
|
+
});
|
|
3451
3660
|
resolve2();
|
|
3452
3661
|
});
|
|
3453
3662
|
});
|
|
@@ -3611,7 +3820,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3611
3820
|
config: next
|
|
3612
3821
|
});
|
|
3613
3822
|
for (const peer of this.sims.values()) {
|
|
3614
|
-
if (peer.ws.readyState !==
|
|
3823
|
+
if (peer.ws.readyState !== import_ws2.WebSocket.OPEN) continue;
|
|
3615
3824
|
try {
|
|
3616
3825
|
peer.ws.send(payload);
|
|
3617
3826
|
} catch {
|
|
@@ -3667,7 +3876,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3667
3876
|
const entry = this.cliBySentId.get(msg.id);
|
|
3668
3877
|
if (entry) {
|
|
3669
3878
|
this.cliBySentId.delete(msg.id);
|
|
3670
|
-
if (entry.ws.readyState ===
|
|
3879
|
+
if (entry.ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
3671
3880
|
const otherCliCount = this.getOtherCliIdentityCount(entry.ws, entry.simId);
|
|
3672
3881
|
const response = otherCliCount > 0 ? { ...msg, id: entry.originalId, _otherCliCount: otherCliCount } : { ...msg, id: entry.originalId };
|
|
3673
3882
|
entry.ws.send(JSON.stringify(response));
|
|
@@ -3695,7 +3904,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3695
3904
|
if (typeof msg.cliLabel === "string" && msg.cliLabel.trim()) {
|
|
3696
3905
|
this.cliLabelBySocket.set(ws, msg.cliLabel.trim());
|
|
3697
3906
|
}
|
|
3698
|
-
if (ws.readyState ===
|
|
3907
|
+
if (ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
3699
3908
|
ws.send(
|
|
3700
3909
|
JSON.stringify({
|
|
3701
3910
|
id: msg.id,
|
|
@@ -3710,7 +3919,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3710
3919
|
return;
|
|
3711
3920
|
}
|
|
3712
3921
|
if (msg.type === "bridge:list-sims") {
|
|
3713
|
-
if (ws.readyState ===
|
|
3922
|
+
if (ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
3714
3923
|
ws.send(
|
|
3715
3924
|
JSON.stringify({
|
|
3716
3925
|
id: msg.id,
|
|
@@ -3725,7 +3934,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3725
3934
|
throw new Error("bridge:open requires a url");
|
|
3726
3935
|
}
|
|
3727
3936
|
await this.openUrl(msg.url, { newWindow: msg.newWindow === true });
|
|
3728
|
-
if (ws.readyState ===
|
|
3937
|
+
if (ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
3729
3938
|
ws.send(
|
|
3730
3939
|
JSON.stringify({
|
|
3731
3940
|
id: msg.id,
|
|
@@ -3741,7 +3950,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3741
3950
|
force: msg.force === true
|
|
3742
3951
|
});
|
|
3743
3952
|
if (!outcome.granted) {
|
|
3744
|
-
if (ws.readyState ===
|
|
3953
|
+
if (ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
3745
3954
|
ws.send(
|
|
3746
3955
|
JSON.stringify({
|
|
3747
3956
|
id: msg.id,
|
|
@@ -3757,7 +3966,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3757
3966
|
targetSim2.id,
|
|
3758
3967
|
outcome.bootedCount > 0 ? `cli force-claimed sim (booted ${outcome.bootedCount})` : "cli claimed sim"
|
|
3759
3968
|
);
|
|
3760
|
-
if (ws.readyState ===
|
|
3969
|
+
if (ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
3761
3970
|
ws.send(
|
|
3762
3971
|
JSON.stringify({
|
|
3763
3972
|
id: msg.id,
|
|
@@ -3776,7 +3985,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3776
3985
|
if (shouldAcquireLease(msg)) {
|
|
3777
3986
|
const outcome = this.tryAcquireLease(ws, targetSim);
|
|
3778
3987
|
if (!outcome.granted) {
|
|
3779
|
-
if (ws.readyState ===
|
|
3988
|
+
if (ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
3780
3989
|
ws.send(
|
|
3781
3990
|
JSON.stringify({
|
|
3782
3991
|
id: msg.id,
|
|
@@ -3802,7 +4011,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3802
4011
|
targetSim.ws.send(JSON.stringify({ ...forwarded, id: sentId }));
|
|
3803
4012
|
if (forwarded.type === "close") {
|
|
3804
4013
|
this.cliBySentId.delete(sentId);
|
|
3805
|
-
if (ws.readyState ===
|
|
4014
|
+
if (ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
3806
4015
|
ws.send(
|
|
3807
4016
|
JSON.stringify({
|
|
3808
4017
|
id: msg.id,
|
|
@@ -3817,7 +4026,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3817
4026
|
unrefTimer(closeTimer);
|
|
3818
4027
|
}
|
|
3819
4028
|
} catch (err) {
|
|
3820
|
-
if (ws.readyState ===
|
|
4029
|
+
if (ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
3821
4030
|
ws.send(
|
|
3822
4031
|
JSON.stringify({
|
|
3823
4032
|
id: msg.id,
|
|
@@ -3842,7 +4051,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
3842
4051
|
}
|
|
3843
4052
|
for (const [sentId, entry] of this.cliBySentId) {
|
|
3844
4053
|
if (entry.simId !== sim.id) continue;
|
|
3845
|
-
if (entry.ws.readyState ===
|
|
4054
|
+
if (entry.ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
3846
4055
|
entry.ws.send(
|
|
3847
4056
|
JSON.stringify({
|
|
3848
4057
|
id: entry.originalId,
|
|
@@ -4048,7 +4257,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4048
4257
|
runtimeDir: this.activeRuntimeDirPath
|
|
4049
4258
|
});
|
|
4050
4259
|
for (const sim of this.sims.values()) {
|
|
4051
|
-
if (sim.ws.readyState ===
|
|
4260
|
+
if (sim.ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
4052
4261
|
try {
|
|
4053
4262
|
sim.ws.send(payload);
|
|
4054
4263
|
} catch {
|
|
@@ -4373,7 +4582,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4373
4582
|
sweepDeadWebSockets() {
|
|
4374
4583
|
if (!this.wss) return;
|
|
4375
4584
|
for (const ws of this.wss.clients) {
|
|
4376
|
-
if (ws.readyState !==
|
|
4585
|
+
if (ws.readyState !== import_ws2.WebSocket.OPEN) continue;
|
|
4377
4586
|
const alive = this.wsIsAlive.get(ws);
|
|
4378
4587
|
if (alive === false) {
|
|
4379
4588
|
try {
|
|
@@ -4394,7 +4603,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4394
4603
|
}
|
|
4395
4604
|
}
|
|
4396
4605
|
closeSimSocketFromHost(ws) {
|
|
4397
|
-
if (ws.readyState !==
|
|
4606
|
+
if (ws.readyState !== import_ws2.WebSocket.OPEN) return;
|
|
4398
4607
|
try {
|
|
4399
4608
|
ws.close(SOOTSIM_BRIDGE_SIM_CLOSE_CODE, SOOTSIM_BRIDGE_SIM_CLOSE_REASON);
|
|
4400
4609
|
} catch {
|
|
@@ -4405,7 +4614,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4405
4614
|
return;
|
|
4406
4615
|
}
|
|
4407
4616
|
const terminateTimer = setTimeout(() => {
|
|
4408
|
-
if (ws.readyState ===
|
|
4617
|
+
if (ws.readyState === import_ws2.WebSocket.CLOSED) return;
|
|
4409
4618
|
try {
|
|
4410
4619
|
ws.terminate();
|
|
4411
4620
|
} catch {
|
|
@@ -4554,7 +4763,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4554
4763
|
try {
|
|
4555
4764
|
readyState = sim.ws.readyState;
|
|
4556
4765
|
} catch {
|
|
4557
|
-
readyState =
|
|
4766
|
+
readyState = import_ws2.WebSocket.CLOSED;
|
|
4558
4767
|
}
|
|
4559
4768
|
const lease = this.getActiveLease(sim);
|
|
4560
4769
|
return {
|
|
@@ -4567,7 +4776,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4567
4776
|
lastSeenAt: sim.lastSeenAt,
|
|
4568
4777
|
lastActiveAt: sim.lastActiveAt || void 0,
|
|
4569
4778
|
isPrimary: sim.id === this.primarySimId,
|
|
4570
|
-
readyState: readyState ===
|
|
4779
|
+
readyState: readyState === import_ws2.WebSocket.OPEN ? "open" : readyState === import_ws2.WebSocket.CLOSING ? "closing" : "closed",
|
|
4571
4780
|
attachedCliCount: this.getAttachedCliCount(sim.id),
|
|
4572
4781
|
lockedBy: lease ? lease.cliLabel || lease.cliIdentityKey : void 0,
|
|
4573
4782
|
lockedByKind: lease ? lease.kind : void 0,
|
|
@@ -4684,18 +4893,18 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4684
4893
|
getOpenSim(simId) {
|
|
4685
4894
|
if (simId) {
|
|
4686
4895
|
const sim = this.sims.get(simId);
|
|
4687
|
-
if (sim?.ws.readyState ===
|
|
4896
|
+
if (sim?.ws.readyState === import_ws2.WebSocket.OPEN) return sim;
|
|
4688
4897
|
return null;
|
|
4689
4898
|
}
|
|
4690
4899
|
const primary = this.primarySimId != null ? this.sims.get(this.primarySimId) : null;
|
|
4691
|
-
if (primary?.ws.readyState ===
|
|
4900
|
+
if (primary?.ws.readyState === import_ws2.WebSocket.OPEN && primary.url) return primary;
|
|
4692
4901
|
let pagelessFallback = null;
|
|
4693
4902
|
for (const sim of this.sims.values()) {
|
|
4694
|
-
if (sim.ws.readyState !==
|
|
4903
|
+
if (sim.ws.readyState !== import_ws2.WebSocket.OPEN) continue;
|
|
4695
4904
|
if (sim.url) return sim;
|
|
4696
4905
|
pagelessFallback ??= sim;
|
|
4697
4906
|
}
|
|
4698
|
-
if (primary?.ws.readyState ===
|
|
4907
|
+
if (primary?.ws.readyState === import_ws2.WebSocket.OPEN) return primary;
|
|
4699
4908
|
return pagelessFallback;
|
|
4700
4909
|
}
|
|
4701
4910
|
async waitForSim(simId, options = {}) {
|
|
@@ -4711,7 +4920,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4711
4920
|
shouldPromoteSim(sim) {
|
|
4712
4921
|
const current = this.primarySimId ? this.sims.get(this.primarySimId) : null;
|
|
4713
4922
|
if (!sim.url) return !current;
|
|
4714
|
-
const currentAlive = current?.ws.readyState ===
|
|
4923
|
+
const currentAlive = current?.ws.readyState === import_ws2.WebSocket.OPEN;
|
|
4715
4924
|
if (!current || !currentAlive || !current.url) return true;
|
|
4716
4925
|
const isPrimaryCandidate = sim.origin?.includes(":5173");
|
|
4717
4926
|
const currentIsPrimary = current.origin?.includes(":5173");
|
|
@@ -4719,7 +4928,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4719
4928
|
}
|
|
4720
4929
|
broadcastSimAssignments() {
|
|
4721
4930
|
for (const sim of this.sims.values()) {
|
|
4722
|
-
if (sim.ws.readyState !==
|
|
4931
|
+
if (sim.ws.readyState !== import_ws2.WebSocket.OPEN) continue;
|
|
4723
4932
|
sim.ws.send(
|
|
4724
4933
|
JSON.stringify({
|
|
4725
4934
|
type: "bridge:welcome",
|
|
@@ -4731,7 +4940,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4731
4940
|
}
|
|
4732
4941
|
broadcastSimClientStates() {
|
|
4733
4942
|
for (const sim of this.sims.values()) {
|
|
4734
|
-
if (sim.ws.readyState !==
|
|
4943
|
+
if (sim.ws.readyState !== import_ws2.WebSocket.OPEN) continue;
|
|
4735
4944
|
const lease = this.getActiveLease(sim);
|
|
4736
4945
|
const message = {
|
|
4737
4946
|
type: "bridge:client-state",
|
|
@@ -4796,7 +5005,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4796
5005
|
const keys = /* @__PURE__ */ new Set();
|
|
4797
5006
|
for (const [ws, attachedSimId] of this.cliSimBySocket) {
|
|
4798
5007
|
if (attachedSimId !== simId) continue;
|
|
4799
|
-
if (ws.readyState !==
|
|
5008
|
+
if (ws.readyState !== import_ws2.WebSocket.OPEN) continue;
|
|
4800
5009
|
const key = this.cliIdentityKeyBySocket.get(ws);
|
|
4801
5010
|
keys.add(key ?? `ws-unknown-${keys.size}`);
|
|
4802
5011
|
}
|
|
@@ -4809,7 +5018,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4809
5018
|
const keys = /* @__PURE__ */ new Set();
|
|
4810
5019
|
for (const [ws, attachedSimId] of this.cliSimBySocket) {
|
|
4811
5020
|
if (attachedSimId !== simId) continue;
|
|
4812
|
-
if (ws.readyState !==
|
|
5021
|
+
if (ws.readyState !== import_ws2.WebSocket.OPEN) continue;
|
|
4813
5022
|
const key = this.cliIdentityKeyBySocket.get(ws);
|
|
4814
5023
|
if (key && key === selfKey) continue;
|
|
4815
5024
|
keys.add(key ?? `ws-unknown-${keys.size}`);
|
|
@@ -4834,7 +5043,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
4834
5043
|
const nextId = requestedId?.trim();
|
|
4835
5044
|
if (!nextId || nextId === sim.id) return false;
|
|
4836
5045
|
const existing = this.sims.get(nextId);
|
|
4837
|
-
if (existing && existing !== sim && existing.ws.readyState ===
|
|
5046
|
+
if (existing && existing !== sim && existing.ws.readyState === import_ws2.WebSocket.OPEN) {
|
|
4838
5047
|
return false;
|
|
4839
5048
|
}
|
|
4840
5049
|
const restorable = this.getRestorableSimState(nextId);
|