sootsim 0.1.47 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cli/bin.js +3 -3
- package/dist-cli/chunks/{agent-DVZ2FTL3.js → agent-RIH2MB5X.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-BHUOIX3I.js → agent-wrapper-R2MFZVRV.js} +2 -2
- package/dist-cli/chunks/{assert-WV4T6TXU.js → assert-JLQWOTX6.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-AQ6Q4GHZ.js +2 -0
- package/dist-cli/chunks/beta-JPE3O53E.js +2 -0
- package/dist-cli/chunks/{chunk-FJI4AINP.js → chunk-2GKUXZWK.js} +1 -1
- package/dist-cli/chunks/{chunk-HUTOGZON.js → chunk-3H4WRU4P.js} +2 -2
- package/dist-cli/chunks/{chunk-L5S5J5BG.js → chunk-3PP3IWBX.js} +2 -2
- package/dist-cli/chunks/{chunk-YVXGOSGQ.js → chunk-45N4MXK2.js} +1 -1
- package/dist-cli/chunks/chunk-55O3YYWS.js +1 -0
- package/dist-cli/chunks/{chunk-XIYSWKTC.js → chunk-6A6FR2CJ.js} +1 -1
- package/dist-cli/chunks/chunk-7KCT4PGT.js +1 -0
- package/dist-cli/chunks/{chunk-JB34DJFV.js → chunk-7X7G5LUX.js} +2 -2
- package/dist-cli/chunks/{chunk-5AKCUQYD.js → chunk-BK6LB2J2.js} +2 -2
- package/dist-cli/chunks/{chunk-KQY2HNQ6.js → chunk-BKOFXQX4.js} +2 -2
- package/dist-cli/chunks/{chunk-APSGJKY2.js → chunk-CDA7FZAZ.js} +2 -2
- package/dist-cli/chunks/chunk-EALHLLVY.js +2 -0
- package/dist-cli/chunks/{chunk-ADXBIPYV.js → chunk-EB3HUXF3.js} +1 -1
- package/dist-cli/chunks/{chunk-WTROBJLO.js → chunk-F3CDHMRT.js} +2 -2
- package/dist-cli/chunks/{chunk-DGZICRVS.js → chunk-FGWKT2BG.js} +1 -1
- package/dist-cli/chunks/chunk-FIBNBYEC.js +1 -0
- package/dist-cli/chunks/{chunk-XRL56I76.js → chunk-FKC2YBG4.js} +16 -16
- package/dist-cli/chunks/{chunk-YUMKRWBL.js → chunk-H6MLMLDA.js} +2 -2
- package/dist-cli/chunks/{chunk-NEMOWUEX.js → chunk-I2FJJCIM.js} +1 -1
- package/dist-cli/chunks/chunk-I6QTUUXO.js +66 -0
- package/dist-cli/chunks/{chunk-NI5J5TZV.js → chunk-IKTUA2CO.js} +1 -1
- package/dist-cli/chunks/{chunk-VFXR25CC.js → chunk-JL46FF4H.js} +2 -2
- package/dist-cli/chunks/{chunk-MKXXVX5O.js → chunk-KIFVYBHP.js} +2 -2
- package/dist-cli/chunks/{chunk-O7GXRTI4.js → chunk-KNDSZOFN.js} +1 -1
- package/dist-cli/chunks/{chunk-4EMPTDHQ.js → chunk-LI5EVOPD.js} +2 -2
- package/dist-cli/chunks/{chunk-CSVO25XX.js → chunk-MBYU2XAP.js} +1 -1
- package/dist-cli/chunks/{chunk-6CYHUYVJ.js → chunk-NH3HVEBX.js} +2 -2
- package/dist-cli/chunks/{chunk-DTTMGVNF.js → chunk-NQHG45SY.js} +1 -1
- package/dist-cli/chunks/{chunk-DCDQHR5E.js → chunk-NY4NHSFE.js} +1 -1
- package/dist-cli/chunks/{chunk-PHAMTMIG.js → chunk-OHEI4R6Z.js} +2 -2
- package/dist-cli/chunks/{chunk-AQG2YLSG.js → chunk-Q4U25XDO.js} +2 -2
- package/dist-cli/chunks/{chunk-MXYBXUHW.js → chunk-QFEFKXKP.js} +2 -2
- package/dist-cli/chunks/{chunk-KEEV7X2T.js → chunk-QRZORMLG.js} +3 -3
- package/dist-cli/chunks/{chunk-CGVYZWCT.js → chunk-SGPKAZCV.js} +2 -2
- package/dist-cli/chunks/chunk-SNGLDQLQ.js +1 -0
- package/dist-cli/chunks/{chunk-TQBMODUP.js → chunk-TX64GCH3.js} +2 -2
- package/dist-cli/chunks/{chunk-D3HQM5KA.js → chunk-U5LVLKCJ.js} +1 -1
- package/dist-cli/chunks/{chunk-F7UTADXQ.js → chunk-UEWDRHF5.js} +2 -2
- package/dist-cli/chunks/chunk-UJ32JSVY.js +11 -0
- package/dist-cli/chunks/{chunk-5KXXF3CH.js → chunk-UJ6RXY6G.js} +2 -2
- package/dist-cli/chunks/{chunk-ULWUCBT3.js → chunk-VDO4QIU7.js} +2 -2
- package/dist-cli/chunks/{chunk-KIIVURH6.js → chunk-WHPM3DER.js} +3 -3
- package/dist-cli/chunks/{chunk-42GVNK5B.js → chunk-WISEXGFB.js} +1 -1
- package/dist-cli/chunks/{chunk-RRAB5GFG.js → chunk-YBAH7I4N.js} +1 -1
- package/dist-cli/chunks/{compat-TEO5T7KU.js → compat-QOIDS7MZ.js} +3 -3
- package/dist-cli/chunks/{config-VM6G5BRT.js → config-EY4HKFQ7.js} +2 -2
- package/dist-cli/chunks/control-YWRLJWJ2.js +2 -0
- package/dist-cli/chunks/cpu-profile-PUNOCOLC.js +2 -0
- package/dist-cli/chunks/{daemon-QIDS2AQ3.js → daemon-5O6DIBDJ.js} +3 -3
- package/dist-cli/chunks/{debug-TPJCUMEQ.js → debug-6AO2VBRJ.js} +3 -3
- package/dist-cli/chunks/demo-app-registry-ZK4VFIIO.js +2 -0
- package/dist-cli/chunks/{detox-BCMWW5SH.js → detox-DEFSI2KS.js} +3 -3
- package/dist-cli/chunks/{device-U2CN2RMX.js → device-QU55EQRU.js} +2 -2
- package/dist-cli/chunks/{diagnose-ZUZQMLFG.js → diagnose-SIEVP5B4.js} +2 -2
- package/dist-cli/chunks/drivers-Z7KIP2FQ.js +2 -0
- package/dist-cli/chunks/{electron-74BXQ7TG.js → electron-FPVMIKJT.js} +3 -3
- package/dist-cli/chunks/flow-YDGY7D7Z.js +2 -0
- package/dist-cli/chunks/{hints-KJG2CVTV.js → hints-KCLDHB7T.js} +2 -2
- package/dist-cli/chunks/{home-paths-2BEHRXFS.js → home-paths-IBJQU7RM.js} +2 -2
- package/dist-cli/chunks/{inspect-36DNEFVN.js → inspect-BKIZONOF.js} +3 -3
- package/dist-cli/chunks/install-YEY7MINA.js +2 -0
- package/dist-cli/chunks/{install-desktop-OLCMIGVU.js → install-desktop-GP33EN2X.js} +3 -3
- package/dist-cli/chunks/{keys-3L3E3JFX.js → keys-TBDYXC4R.js} +2 -2
- package/dist-cli/chunks/{launch-CAB5BCPL.js → launch-JZQMS4NW.js} +3 -3
- package/dist-cli/chunks/{login-366IKOAJ.js → login-4DLUDLZ3.js} +4 -4
- package/dist-cli/chunks/{logout-U5NDZ3RQ.js → logout-E34Y6MXJ.js} +2 -2
- package/dist-cli/chunks/{maestro-KUZ2R2BX.js → maestro-RRCPPV2E.js} +15 -15
- package/dist-cli/chunks/{preview-4WNL2K44.js → preview-CWJICLK5.js} +2 -2
- package/dist-cli/chunks/{profile-7C4EOCUL.js → profile-6VAPGSFI.js} +2 -2
- package/dist-cli/chunks/{react-KTN2DQ6A.js → react-6MPJCXKW.js} +2 -2
- package/dist-cli/chunks/{record-PKZIPTFE.js → record-HOG5VIB2.js} +2 -2
- package/dist-cli/chunks/runtime-6MVRXE4J.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-V346DZME.js → runtime-delivery-RYYDAQ46.js} +2 -2
- package/dist-cli/chunks/screenshot-AHVWVGYI.js +28 -0
- package/dist-cli/chunks/{screenshot-mode-6AK3B4WO.js → screenshot-mode-6LHQHMQW.js} +2 -2
- package/dist-cli/chunks/{screenshots-QZA563YR.js → screenshots-B3DT4RLC.js} +2 -2
- package/dist-cli/chunks/{server-DKFZVIDB.js → server-ZZ4ITL2F.js} +2 -2
- package/dist-cli/chunks/setup-repo-3EOWP4RO.js +2 -0
- package/dist-cli/chunks/{skills-EMITV6GH.js → skills-3VZQLEIN.js} +2 -2
- package/dist-cli/chunks/{start-MWDRLP75.js → start-I3DGKLZW.js} +4 -4
- package/dist-cli/chunks/store-JHPWUUUD.js +2 -0
- package/dist-cli/chunks/telemetry-HHOWU464.js +2 -0
- package/dist-cli/chunks/{test-QRD665WW.js → test-P7YNHGTK.js} +3 -3
- package/dist-cli/chunks/{three-mode-W56LM6NY.js → three-mode-J6KQLL2D.js} +2 -2
- package/dist-cli/chunks/{timeline-WEOXFWHS.js → timeline-JKUQP6UJ.js} +2 -2
- package/dist-cli/chunks/{upgrade-P2566CKZ.js → upgrade-N5ZOEIM2.js} +2 -2
- package/dist-cli/chunks/upload-IXQH633Z.js +2 -0
- package/dist-cli/chunks/{web-2C2KNV6T.js → web-F42XPZXB.js} +2 -2
- package/dist-cli/chunks/{what-happened-2246B63B.js → what-happened-6OJNCJOZ.js} +2 -2
- package/dist-cli/chunks/{whoami-QBQT5CFD.js → whoami-6B3HFJX6.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +2 -16
- 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/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/vite-base.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-I7BBIIDD.js +0 -2
- package/dist-cli/chunks/beta-ZWIXNONS.js +0 -2
- package/dist-cli/chunks/chunk-7KLZ6ATV.js +0 -66
- package/dist-cli/chunks/chunk-A6GF46BA.js +0 -1
- package/dist-cli/chunks/chunk-GQOQJ7OU.js +0 -1
- package/dist-cli/chunks/chunk-KVJFAZC3.js +0 -1
- package/dist-cli/chunks/chunk-O2T6HGXN.js +0 -2
- package/dist-cli/chunks/chunk-ZIFJHVAY.js +0 -1
- package/dist-cli/chunks/chunk-ZZGIIE7M.js +0 -11
- package/dist-cli/chunks/control-H5TFQUI2.js +0 -2
- package/dist-cli/chunks/cpu-profile-F6JVZGYT.js +0 -2
- package/dist-cli/chunks/demo-app-registry-YFJYUHLG.js +0 -2
- package/dist-cli/chunks/drivers-VDMPGXOE.js +0 -2
- package/dist-cli/chunks/flow-7HPOCXUG.js +0 -2
- package/dist-cli/chunks/install-PXALSQHT.js +0 -2
- package/dist-cli/chunks/runtime-LACOYGZO.js +0 -2
- package/dist-cli/chunks/screenshot-FR6BUFSV.js +0 -28
- package/dist-cli/chunks/setup-repo-CIL6IYKH.js +0 -2
- package/dist-cli/chunks/store-ENJNAMEW.js +0 -2
- package/dist-cli/chunks/telemetry-FXOJQG3D.js +0 -2
- package/dist-cli/chunks/upload-IDJRL6Y5.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as R}from"./chunk-XIYSWKTC.js";import{l as D}from"./chunk-FJI4AINP.js";import{a as T}from"./chunk-NI5J5TZV.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import m from"node:fs";import y from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||D()}function h(){return _()}function U(){return y.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=m.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{m.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=U();m.mkdirSync(y.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=m.openSync(r,"w",384);try{m.writeFileSync(n,JSON.stringify(e,null,2)),m.fsyncSync(n)}finally{m.closeSync(n)}m.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function B(e){return q("sha256").update(y.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ge(e){let t=y.resolve(e.cwd),r=B(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??y.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function ye(){return S().attachedProjects}var Q=336*60*60*1e3;function he(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-Q,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Se(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function we(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function ve(){if(S().attachedProjects.length>0)return;let t;try{t=(await import("./demo-app-registry-YFJYUHLG.js")).APPS}catch(n){console.warn("[sootsim] seedFromDemoAppRegistry: could not load demo registry:",n.message);return}if(!Array.isArray(t))return;let r=t;w(n=>{for(let o of r){if(!m.existsSync(o.dir))continue;let s=y.resolve(o.dir),a=B(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as V,spawnSync as z}from"node:child_process";import{randomUUID as Z}from"node:crypto";import i,{constants as f}from"node:fs";import u from"node:path";import ee from"node:readline";function j(e){return u.join(h(),"sessions",e)}function W(e){return u.join(j(e),"prompt.in")}function J(e){return u.join(j(e),"events.out")}function te(e){return u.join(h(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(j(t)))}function re(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ne();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ne(){try{let e=se();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function se(){try{let r=T.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=oe();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function oe(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ie(e,t,r){let n=u.join(h(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,f.O_WRONLY|f.O_CREAT|f.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ce(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ce(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ie(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?Z():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=W(s.id),d=J(s.id),c=te(s.id);L(a),L(d);let g=u.dirname(c);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=re(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=V(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:h()}});x.unref();let E=e.readyTimeoutMs??6e3,b=await ae(d,p=>p.type==="ready"||p.type==="error",E);if(!b||b.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(j(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=b&&b.type==="error"?b.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function De(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,f.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R}from"./chunk-6A6FR2CJ.js";import{l as D}from"./chunk-2GKUXZWK.js";import{a as T}from"./chunk-IKTUA2CO.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import m from"node:fs";import y from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||D()}function h(){return _()}function U(){return y.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=m.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{m.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=U();m.mkdirSync(y.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=m.openSync(r,"w",384);try{m.writeFileSync(n,JSON.stringify(e,null,2)),m.fsyncSync(n)}finally{m.closeSync(n)}m.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function B(e){return q("sha256").update(y.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ge(e){let t=y.resolve(e.cwd),r=B(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??y.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function ye(){return S().attachedProjects}var Q=336*60*60*1e3;function he(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-Q,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Se(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function we(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function ve(){if(S().attachedProjects.length>0)return;let t;try{t=(await import("./demo-app-registry-ZK4VFIIO.js")).APPS}catch(n){console.warn("[sootsim] seedFromDemoAppRegistry: could not load demo registry:",n.message);return}if(!Array.isArray(t))return;let r=t;w(n=>{for(let o of r){if(!m.existsSync(o.dir))continue;let s=y.resolve(o.dir),a=B(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as V,spawnSync as z}from"node:child_process";import{randomUUID as Z}from"node:crypto";import i,{constants as f}from"node:fs";import u from"node:path";import ee from"node:readline";function j(e){return u.join(h(),"sessions",e)}function W(e){return u.join(j(e),"prompt.in")}function J(e){return u.join(j(e),"events.out")}function te(e){return u.join(h(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(j(t)))}function re(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ne();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ne(){try{let e=se();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function se(){try{let r=T.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=oe();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function oe(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ie(e,t,r){let n=u.join(h(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,f.O_WRONLY|f.O_CREAT|f.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ce(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ce(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ie(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?Z():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=W(s.id),d=J(s.id),c=te(s.id);L(a),L(d);let g=u.dirname(c);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=re(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=V(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:h()}});x.unref();let E=e.readyTimeoutMs??6e3,b=await ae(d,p=>p.type==="ready"||p.type==="error",E);if(!b||b.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(j(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=b&&b.type==="error"?b.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function De(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,f.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
|
|
3
3
|
`)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function Re(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(O(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=j(e),n=h();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function Ne(e,t){let r=J(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,f.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=ee.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let c=I(d);c&&t(c)});let a=!1;return()=>{if(!a){a=!0;try{s.close()}catch{}try{o.destroy()}catch{}}}}async function ae(e,t,r){let n=i.openSync(e,f.O_RDWR|f.O_NONBLOCK),o=Buffer.alloc(8192),s="",a=Date.now()+r;try{for(;Date.now()<a;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(c){if(c.code!=="EAGAIN")throw c;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let c;for(;(c=s.indexOf(`
|
|
4
4
|
`))>=0;){let g=s.slice(0,c);s=s.slice(c+1);let A=I(g);if(A&&t(A))return A}}else await new Promise(c=>setTimeout(c,30))}return null}finally{i.closeSync(n)}}export{I as a,h as b,ge as c,F as d,ye as e,he as f,Se as g,we as h,k as i,C as j,v as k,ve as l,j as m,W as n,J as o,te as p,O as q,re as r,l as s,Te as t,De as u,Re as v,Ne as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function t(_){return`(async () => {
|
|
3
3
|
const __t = window.__sootsimTest
|
|
4
4
|
if (!__t) throw new Error('__sootsimTest not available')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P,c as v,e as A}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P,c as v,e as A}from"./chunk-WISEXGFB.js";import{E as k,F as T}from"./chunk-2GKUXZWK.js";import{WebSocket as w}from"ws";function M(){let e=k();return e&&T(e)?e.bridgePort:7668}var h=class extends Error{lock;constructor(t,s){super(t),this.name="BridgeSimLockedError",this.lock=s}};function O(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function N(e,t={}){let s=new Set,l=t.port??M(),c=t.commandTimeoutMs??15e3,o,g="none",b=new Set(t.stripBooleanFlags??[]),p=new Set(t.stripValueFlags??[]);for(let i=0;i<e.length;i++){let a=e[i];if(a==="--port"||a==="-p"){s.add(i),i+1<e.length&&(s.add(i+1),l=Number(e[i+1])),i++;continue}if(a.startsWith("--port=")){s.add(i),l=Number(a.slice(7));continue}if(a==="--timeout"){s.add(i),i+1<e.length&&(s.add(i+1),c=Number(e[i+1])),i++;continue}if(a==="--sim"){s.add(i),i+1<e.length&&(s.add(i+1),o=e[i+1]?.trim()||void 0,g="flag"),i++;continue}if(b.has(a)){s.add(i);continue}p.has(a)&&(s.add(i),i+1<e.length&&s.add(i+1),i++)}if(!o){let i=v();i&&(o=i.trim()||void 0,g="saved")}return{positional:e.filter((i,a)=>!s.has(a)),wsPort:l,simId:o,simIdSource:g,commandTimeoutMs:c}}function W(e,t={}){let s=1,l=t.commandTimeoutMs??15e3,c=new Map,o=new w(`ws://localhost:${e}`),g=t.simId?{key:`sim:${t.simId}`,source:"explicit-sim-id",stable:!0}:P(),b=new Promise((n,r)=>{o.on("open",()=>{try{o.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:g.key,cliIdentitySource:g.source,cliLabel:t.cliLabel}))}catch{}n()}),o.on("error",d=>{let u=d.message?`: ${d.message}`:"";r(new Error(`could not connect to ws://localhost:${e}${u}`))})}),p=!1,i=!1;function a(n,r){if(i||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||n.startsWith("bridge:")||n==="focus"||n==="close")return;i=!0;let d=r??"primary",u=O(r?t.simIdSource:"none");process.stderr.write(` \u2192 ${d} (${u})
|
|
3
3
|
`)}return o.on("message",n=>{let r;try{r=JSON.parse(n.toString())}catch{return}if(r.id===0)return;let d=c.get(r.id);d&&(c.delete(r.id),r.i>0&&!p&&(p=!0,process.stderr.write(`
|
|
4
4
|
\u26A0 ${r.i} other CLI identity/identities are driving this sim
|
|
5
5
|
taps, scrolls, and keyboard input from multiple agents will collide on
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(o){return new Promise(n=>{let r=c();r.question(o,t=>{r.close(),n(t.trim())})})}async function u(o,n=!0){let r=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${o} ${r} ${n?"y":"n"} (non-interactive)`),n;let t=await s(` ${o} ${r} `);return t===""?n:t.toLowerCase().startsWith("y")}async function a(o,n){console.log(`
|
|
3
3
|
${o}
|
|
4
4
|
`);for(let e=0;e<n.length;e++)console.log(` ${e+1}. ${n[e]}`);if(console.log(),!process.stdin.isTTY)return console.log(` choose [1-${n.length}]: 1 (non-interactive)`),0;let r=await s(` choose [1-${n.length}]: `),t=parseInt(r,10);return t>=1&&t<=n.length?t-1:0}export{u as a,a as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as p}from"./chunk-I6QTUUXO.js";import{d as c,e as l}from"./chunk-OHEI4R6Z.js";import{a}from"./chunk-QFEFKXKP.js";async function g(e,t){if(t)return t.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let i=a();return i?.origin?i.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function m(e,t={}){let i=c();if(i||(process.stderr.write(`
|
|
3
3
|
sootsim ${e} needs auth before it can check recording access.
|
|
4
4
|
|
|
5
5
|
pick one:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{execFileSync as p,spawn as l}from"child_process";import{existsSync as s}from"fs";import{homedir as u}from"os";import{join as d}from"path";var g=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","~/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","~/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","~/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","~/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Arc.app/Contents/MacOS/Arc","~/Applications/Arc.app/Contents/MacOS/Arc"],f=["/usr/bin/google-chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/microsoft-edge","/usr/bin/brave-browser","/snap/bin/chromium"],h=["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe","C:\\Program Files (x86)\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"],C=["google-chrome","chromium","chromium-browser","microsoft-edge","brave-browser"],O=["chrome","msedge","brave"];function w(r){return r.startsWith("~/")?d(u(),r.slice(2)):r}function a(r){for(let n of r){let o=w(n);if(s(o))return o}return null}function U(r,n){try{let e=p(n==="win32"?"where":"which",[r],{encoding:"utf8",timeout:1500,stdio:["ignore","pipe","ignore"]}).trim();return e?e.split(/\r?\n/)[0]:null}catch{return null}}function M(r=process.platform){let n=process.env.CHROME_PATH||process.env.CHROMIUM_PATH;if(n&&s(n))return n;let o=a(r==="darwin"?g:r==="win32"?h:f);if(o)return o;let e=r==="win32"?O:C;for(let t of e){let i=U(t,r);if(i)return i}return null}function A(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform;return n.newWindow?c(r,{...n,platform:o,newWindow:!0}):o==="darwin"?{command:"open",args:n.background===!1?[r]:["-g",r],via:"system"}:o==="win32"?{command:"cmd",args:["/c","start","",r],via:"system"}:{command:"xdg-open",args:[r],via:"system"}}function c(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform,e="chromiumBinary"in n?n.chromiumBinary:M(o);if(!e)throw new Error("browser launch requires Chrome, Chromium, Edge, Brave, or Arc");let t=[];return n.newWindow!==!1&&t.push("--new-window"),t.push(r),{command:e,args:t,via:"chromium",target:e}}async function m(r,n,o){return new Promise((e,t)=>{let i=l(r,n,{detached:o,stdio:"ignore"});i.once("error",t),i.once("spawn",()=>{o&&i.unref(),e(i.pid)})})}async function x(r,n={}){let o=A(r,n),e=await m(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function y(r,n={}){let o=c(r,n),e=await m(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function E(r,n={}){await x(r,n)}export{M as a,x as b,y as c,E as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function d(t){let e=t.displayUrl||t.url;return t.status!=null?`${t.method} ${e} -> ${t.status}${t.statusText?` ${t.statusText}`:""}`:t.error?`${t.method} ${e} -> ${t.error}`:`${t.method} ${e}`}async function u(t,e,...o){return t.send({type:"call",path:`__sootsimTest.${e}`,args:o})}async function g(t,e={}){let o=await t.send({type:"evaluate",code:"window.__sootsimConsole?.count?.() || { errors: 0, warnings: 0, total: 0 }"});if(!o||typeof o!="object")return;let n=Math.max(0,Number(o.errors)||0),s=Math.max(0,Number(o.warnings)||0);if(n===0&&s===0)return;let r=[];if(n>0&&r.push(`${n} console error${n===1?"":"s"}`),s>0&&r.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
3
3
|
console: ${r.join(", ")}`),e.errorsCommand&&console.log(` inspect: ${e.errorsCommand}`),s>0&&e.warningsCommand&&console.log(` inspect: ${e.warningsCommand}`),!e.includeTail||n===0)return;let i=await t.send({type:"evaluate",code:"window.__sootsimConsole?.getErrors?.(5) || []"});if(!(!Array.isArray(i)||i.length===0)){console.log(`
|
|
4
4
|
recent console errors:
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as o}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as o}from"./chunk-QFEFKXKP.js";import{l as s}from"./chunk-2GKUXZWK.js";import{chmodSync as c,existsSync as a,mkdirSync as l,readFileSync as d,rmSync as p,writeFileSync as h}from"node:fs";import{dirname as g,join as f,resolve as k}from"node:path";function i(){return f(s(),"credentials.json")}function _(){let t=i();if(!a(t))return null;try{let e=JSON.parse(d(t,"utf8"));return e.version!==1||typeof e.apiKey!="string"||!e.apiKey.startsWith("sk_sootsim_")?null:e.apiKey}catch{return null}}function T(t){if(!t.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let e=i();l(g(k(e)),{recursive:!0}),h(e,JSON.stringify({version:1,apiKey:t,savedAt:new Date().toISOString()},null,2)+`
|
|
3
3
|
`);try{c(e,384)}catch{}}function K(){p(i(),{force:!0})}var m=["ghs_","ghp_","gho_","ghu_","github_pat_"];function y(t){return!!(t&&t.length>=20&&t.length<=256&&m.some(e=>t.startsWith(e)))}function S(){let t=process.env.SOOT_INSTALLATION_TOKEN?.trim(),e=process.env.GITHUB_TOKEN?.trim(),r=t||e;if(!y(r))return null;let n=(process.env.SOOT_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!n)return null;let u=(process.env.SOOT_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:r,repoId:n,installationId:u||null,source:t?"soot-runner":"github-actions"}}function b(){let t=process.env.SOOTSIM_API_KEY?.trim();if(t&&t.startsWith("sk_sootsim_"))return{kind:"api-key",secret:t,source:"env"};let e=S();if(e)return e;let r=_();if(r)return{kind:"api-key",secret:r,source:"file"};let n=o();return n?.token?{kind:"session",token:n.token,origin:n.origin}:null}function E(t){return t.kind==="api-key"?`Bearer ${t.secret}`:`Bearer ${t.token}`}export{_ as a,T as b,K as c,b as d,E as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
var
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
var o="sootsimConfig";function e(n){return!!n&&Object.keys(n).length>0}function s(n){return n?e(n.modules)||e(n.turboModules)||e(n.nativeModules)||e(n.env)||e(n.settings)||e(n.initialState):!1}function u(n,i){let t=new URL(n);return s(i)?t.searchParams.set(o,JSON.stringify(i)):t.searchParams.delete(o),t.toString()}var g="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function r(n){return/^https?:\/\//i.test(n)}function a(n){return n.endsWith(".bundle")}function l(n){try{let i=r(n),t=new URL(n,"http://soot.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),a(t.pathname)?(t.searchParams.delete("transform.bytecode"),i?t.toString():`${t.pathname}${t.search}${t.hash}`):n}catch{return n}}export{u as a,g as b,l as c};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{l as c}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{l as c}from"./chunk-2GKUXZWK.js";import{chmodSync as m,existsSync as g,mkdirSync as k,readFileSync as A,rmSync as i,writeFileSync as y}from"node:fs";import{dirname as l,join as D,resolve as p}from"node:path";var s=1,S="SOOTSIM_SHARED_AUTH_FILE",u="https://sootbean.com";function v(){let t=process.env[S];return t?.trim()?l(p(t)):c()}function a(){let t=process.env[S];return t?.trim()?p(t):D(v(),"desktop-auth.json")}function f(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.id!="string"||!e.id.trim()?null:{id:e.id.trim(),name:typeof e.name=="string"?e.name:void 0,email:typeof e.email=="string"?e.email:void 0,image:typeof e.image=="string"?e.image:void 0}}function w(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==s||typeof e.token!="string"||!e.token.trim())return null;let r=typeof e.origin=="string"&&e.origin.trim()?e.origin.trim():u,n=e.source==="cli"||e.source==="electron"||e.source==="browser"||e.source==="unknown"?e.source:"unknown",o=typeof e.updatedAt=="string"&&e.updatedAt?e.updatedAt:new Date().toISOString(),h=typeof e.validatedAt=="string"&&e.validatedAt?e.validatedAt:void 0;return{version:s,token:e.token.trim(),user:f(e.user),origin:r,source:n,updatedAt:o,validatedAt:h}}function O(){let t=a();if(!g(t))return null;try{let e=JSON.parse(A(t,"utf8")),r=w(e);return r||(i(t,{force:!0}),null)}catch{return i(t,{force:!0}),null}}function I(t){let e=a();k(l(e),{recursive:!0});let r={version:s,token:t.token.trim(),user:t.user?f(t.user):null,origin:t.origin?.trim()||u,source:t.source,updatedAt:t.updatedAt||new Date().toISOString(),validatedAt:t.validatedAt};y(e,JSON.stringify(r,null,2)+`
|
|
3
3
|
`);try{m(e,384)}catch{}return r}function d(){i(a(),{force:!0})}async function N(t){let e=O();if(!e?.token)return null;let r=t||e.origin||u;try{let n=await fetch(`${r.replace(/\/$/,"")}/api/auth/me`,{headers:{authorization:`Bearer ${e.token}`}});if(n.status===401)return d(),null;if(!n.ok)return e;let o=await n.json();return o.user?.id?I({token:e.token,user:o.user,origin:r,source:e.source,validatedAt:new Date().toISOString()}):(d(),null)}catch{return e}}export{O as a,I as b,d as c,N as d};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as l}from"./chunk-LI5EVOPD.js";import{E as u,F as c,g as p,i as h,z as w}from"./chunk-2GKUXZWK.js";import{closeSync as v,existsSync as f,openSync as P,readSync as S,statSync as g}from"fs";import{homedir as k}from"os";import{resolve as T}from"path";import{WebSocket as D}from"ws";var E=6e4;async function L(){let t=w();if(t&&f(h(t)))return;console.log(" first run \u2014 installing sootsim engine runtime (~6 MB)...");let{runRuntime:e}=await import("./runtime-6MVRXE4J.js");await e(["install"],{})}function I(t,e){return x(t)??e??l()}async function $(t=l(),e=E){if(await m(t,250))return;let n=u();if(n&&c(n)){if(n.bootstrapping===!0&&(await b(e),await m(n.bridgePort,500)))return;throw new Error(`sootsim daemon lockfile is fresh (port ${n.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`)}if(p())throw new Error(`sootsim bridge daemon is not running on port ${t}.
|
|
3
3
|
dev checkouts skip the auto-install of the persistent launchd / systemd
|
|
4
4
|
agent. start the daemon manually in another shell with:
|
|
5
5
|
bun sootsim server
|
|
6
|
-
(set SOOTSIM_FORCE_DAEMON_INSTALL=1 to allow auto-install from this repo.)`);console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-
|
|
6
|
+
(set SOOTSIM_FORCE_DAEMON_INSTALL=1 to allow auto-install from this repo.)`);console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-5O6DIBDJ.js");try{await o({port:t,force:!0})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`${s}
|
|
7
7
|
if this keeps failing, run \`sootsim daemon uninstall\` and retry, or run \`sootsim server\` in a persistent shell as a workaround.`)}console.log(" waiting for runtime to come online...");let i=process.platform==="darwin"?B():null;try{await b(e);let r=Date.now()+5e3;for(;Date.now()<r;){if(await m(t,500))return;await new Promise(s=>setTimeout(s,200))}throw new Error(`daemon registered but the bridge never bound on port ${t} \u2014 see ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}finally{i?.stop()}}async function C(t=l()){await L(),await $(t)}function x(t){for(let e=0;e<t.length;e++){let n=t[e];if((n==="--port"||n==="-p")&&t[e+1]){let o=Number(t[e+1]);return Number.isFinite(o)?o:void 0}if(n.startsWith("--port=")){let o=Number(n.slice(7));return Number.isFinite(o)?o:void 0}}}function m(t,e){return new Promise(n=>{let o=new D(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,r=s=>{if(!i){i=!0;try{o.close()}catch{}n(s)}};o.once("open",()=>r(!0)),o.once("error",()=>r(!1)),setTimeout(()=>r(!1),e)})}async function b(t){let e=Date.now()+t,n;for(;Date.now()<e;){let o=u();if(o&&c(o)){if(o.bootstrapping!==!0)return;o.bootstrapping!==n&&(n=o.bootstrapping)}await new Promise(i=>setTimeout(i,250))}throw new Error(`daemon did not finish bootstrapping within ${Math.round(t/1e3)}s \u2014 check ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}function d(){return T(k(),"Library/Logs/sootsim/server.err.log")}function B(){let t=d(),e=0;try{f(t)&&(e=g(t).size)}catch{}let n=!1,o=()=>{if(!n){try{if(f(t)){let i=g(t).size;if(i>e){let r=Buffer.alloc(i-e),s=P(t,"r");try{S(s,r,0,r.length,e)}finally{v(s)}e=i;for(let y of r.toString("utf8").split(/\r?\n/)){let a=y.trim();a&&(a.startsWith("sootsim:")||a.startsWith("sootsim "))&&console.log(` ${a}`)}}else i<e&&(e=i)}}catch{}setTimeout(o,250)}};return o(),{stop:()=>{n=!0}}}export{L as a,I as b,$ as c,C as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as R,C as w,i as p,r as S,t as O,y as v,z as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as R,C as w,i as p,r as S,t as O,y as v,z as f}from"./chunk-2GKUXZWK.js";import{spawn as I}from"child_process";import C from"crypto";import s from"fs";import l from"path";import{Readable as k}from"stream";import{pipeline as M}from"stream/promises";var N="https://sootbean.com",D="SOOTSIM_CDN_ORIGIN",E="SOOTSIM_RUNTIME_CHANNEL";function $(){try{let e=JSON.parse(s.readFileSync(O(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function d(e){let t=$();return(e||process.env[D]||t.cdnOrigin||N).replace(/\/+$/,"")}function x(e){let t=$();return e||process.env[E]||t.runtimeChannel||"stable"}function T(e){let t=new URL(`${d(e)}/runtimes/manifest.json`);return t.searchParams.set("t",String(Date.now())),t.toString()}function P(e,t){return`${d(t)}/runtimes/sootsim-runtime-${e}.tar.gz`}async function y(e){let t=T(e),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function U(e,t={}){let r=x(t.channel),n=t.version||e.channels[r]?.latest;if(!n)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let i=e.versions[n];if(!i)throw new Error(`version ${n} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:n,channel:r,entry:i}}async function V(e={}){v();let t=d(e.cdnOrigin),r=await y(t),{version:n,channel:i,entry:o}=U(r,e),a=p(n),c=e.setActive!==!1;if(!e.force&&s.existsSync(l.join(a,"index.html")))return c&&R(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!1,activated:c,manifest:r};let g=o.tarball||P(n,t),m=l.join(S(),`sootsim-runtime-${n}.tar.gz`);process.stderr.write(`sootsim: downloading runtime ${n}\u2026
|
|
3
3
|
`),await _(g,m),process.stderr.write(`sootsim: extracting runtime ${n}\u2026
|
|
4
4
|
`);let h=await j(m);if(h!==o.sha256)throw s.rmSync(m,{force:!0}),new Error(`sha256 mismatch for runtime ${n}: expected ${o.sha256}, actual ${h}`);let u=l.join(l.dirname(a),`.installing-${n}-${process.pid}`);s.rmSync(u,{recursive:!0,force:!0}),s.mkdirSync(u,{recursive:!0});try{if(await A(m,u),!s.existsSync(l.join(u,"index.html")))throw new Error(`extracted tarball for runtime ${n} is missing index.html`);s.rmSync(a,{recursive:!0,force:!0}),s.renameSync(u,a)}catch(b){throw s.rmSync(u,{recursive:!0,force:!0}),b}return c&&R(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!0,activated:c,manifest:r}}async function q(e={}){v();let t=d(e.cdnOrigin),r=x(e.channel),n=await y(t),i=n.channels[r]?.latest;if(!i)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:f()};if(!n.versions[i])return{checked:!0,updated:!1,reason:`manifest is missing version ${i}`,activeVersion:f(),latestVersion:i};let a=f(),c=a?p(a):null,g=c?s.existsSync(l.join(c,"index.html")):!1;if(!(!a||!g||w(i,a)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:a,latestVersion:i};let h=await V({version:i,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,activeVersion:i,latestVersion:i,install:h}}async function B(e={}){let t=f();try{let r=await y(d(e.cdnOrigin)),n=x(e.channel),i=r.channels[n]?.latest??null,o=!!(i&&(!t||w(i,t)>0));return{active:t,latest:i,outdated:o}}catch{return{active:t,latest:null,outdated:!1}}}async function _(e,t){let r=await fetch(e);if(!r.ok||!r.body)throw new Error(`download failed: ${r.status} ${r.statusText} (${e})`);s.mkdirSync(l.dirname(t),{recursive:!0});let n=`${t}.partial`;try{await M(k.fromWeb(r.body),s.createWriteStream(n)),s.renameSync(n,t)}catch(i){try{s.unlinkSync(n)}catch{}throw i}}function j(e){return new Promise((t,r)=>{let n=C.createHash("sha256"),i=s.createReadStream(e);i.on("data",o=>n.update(o)),i.on("error",r),i.on("end",()=>t(n.digest("hex")))})}function A(e,t){return new Promise((r,n)=>{let i=I("tar",["-xzf",e,"-C",t],{stdio:["ignore","inherit","inherit"]});i.on("error",n),i.on("exit",o=>{o===0?r():n(new Error(`tar exited with code ${o}`))})})}export{N as a,D as b,E as c,d,x as e,T as f,P as g,y as h,U as i,V as j,q as k,B as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as y,c as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as y,c as C}from"./chunk-Q4U25XDO.js";import{a as x}from"./chunk-BKOFXQX4.js";import{exec as U}from"child_process";import _ from"http";import D from"net";import{promisify as T}from"util";var P=T(U),E=250,A=1500,M=120;function R(e,r=M){return new Promise(s=>{let t=new D.Socket,o=!1,i=a=>{o||(o=!0,t.destroy(),s(a))};t.setTimeout(r),t.once("connect",()=>i(!0)),t.once("timeout",()=>i(!1)),t.once("error",()=>i(!1)),t.connect(e,"localhost")})}function h(e,r,s="GET",t=E,o={}){return new Promise(i=>{let a=_.request({hostname:"localhost",port:e,path:r,method:s,timeout:t,headers:o},n=>{let c="";n.on("data",l=>c+=l.toString());let u=(()=>{let l=n.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();n.on("end",()=>i({statusCode:n.statusCode||0,body:c,contentType:u}))});a.on("error",()=>i(null)),a.setTimeout(t,()=>{a.destroy(),i(null)}),a.end()})}var N=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function v(e,r){return!(e<=0||e>=2e4||r.has(e)||e>=5170&&e<=5200)}async function L(e=[]){let r=new Set(e);try{let{stdout:s}=await P("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(s.trim()){let t=new Map;for(let o of s.trim().split(`
|
|
3
3
|
`)){let i=o.trim().split(/\s+/);if(i.length<9)continue;let a=Number(i[1]),c=i[8].match(/:(\d+)$/);if(!c)continue;let u=Number(c[1]);v(u,r)&&(t.has(u)||t.set(u,a))}if(t.size>0)return[...t.entries()].map(([o,i])=>({port:o,pid:i}))}}catch{}try{let{stdout:s}=await P(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(s.trim()){let t=new Map;for(let o of s.trim().split(`
|
|
4
4
|
`)){let i=o.match(/:(\d+)\s/),a=o.match(/pid=(\d+)/);if(!i)continue;let n=Number(i[1]),c=a?Number(a[1]):0;v(n,r)&&(t.has(n)||t.set(n,c))}if(t.size>0)return[...t.entries()].map(([o,i])=>({port:o,pid:i}))}}catch{}return N.filter(s=>v(s.port,r))}var S=new Map;async function $(e){if(e<=0)return null;let r=S.get(e);if(r)return r;try{let{stdout:s}=await P(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let t of s.split(`
|
|
5
5
|
`))if(t.startsWith("n")&&t.length>1){let o=t.slice(1).trim();if(o)return S.set(e,o),o}}catch{}return null}function I(e,r){return{port:e,framework:r,bundleUrl:m(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function m(e,r){let s=x.find(o=>o.preferredPort===e),t=s?.runtimeConfig?y(r,s.runtimeConfig):r;return C(t)}function O(e){return e.includes("/node_modules/one/metro-entry.bundle")}function j(e){try{let r=JSON.parse(e);return r&&typeof r=="object"?r:null}catch{return null}}function w(e,r,s){if(!r)return e;try{let t=JSON.parse(r.body),o=t?.extra?.expoClient||t?.extra||{};o.name&&(e.projectName=o.name),o.ios?.bundleIdentifier&&(e.bundleId=o.ios.bundleIdentifier),e.framework==="metro"&&o.sdkVersion&&(e.framework="expo");let i=t?.launchAsset?.url;i&&!e.patched&&!O(e.bundleUrl)&&(e.bundleUrl=m(e.port,i));let a=o.iconUrl||o.ios?.iconUrl||o.icon||o.ios?.icon;if(a)if(e.iconPath=a,s)if(a.startsWith("http"))e.iconUrl=s(a);else{let n=a.replace(/^\.\//,"");e.iconUrl=s(`http://localhost:${e.port}/assets/${n}`)}else e.iconUrl=a.startsWith("http")?a:`http://localhost:${e.port}/assets/${a.replace(/^\.\//,"")}`}catch{}return e}var d=new Set,f=new Set,b=new Set;async function H(e,r){if(!await R(e))return null;let s="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[t,o,i,a,n]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),h(e,s,"HEAD"),b.has(e)?Promise.resolve(null):h(e,"/","GET",A,{"expo-platform":"ios"}),f.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);n&&n.statusCode===200?f.delete(e):f.has(e)||f.add(e);let c=a?j(a.body):null,u=typeof c?.launchAsset?.url=="string"?c.launchAsset.url:null,l=c?.extra?.expoClient||c?.extra||{};if(c&&(u||typeof l.name=="string")){d.add(e);let p=u||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,k=p.includes("/one/metro-entry.bundle")?"one":"expo";return w({port:e,framework:k,bundleUrl:m(e,p),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},a,r)}return i&&i.statusCode>0&&i.statusCode<400&&/application\/javascript/i.test(i.contentType||"")?(d.add(e),b.add(e),w({port:e,framework:"one",bundleUrl:m(e,`http://localhost:${e}${s}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},a,r)):o&&o.body.includes("packager-status:running")?(d.add(e),w(I(e,n&&n.statusCode===200?"expo":"metro"),a,r)):t&&t.statusCode===200&&t.body.includes("sootsim-patched")?(d.delete(e),w({port:e,framework:"one",bundleUrl:m(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},a,r)):(d.add(e),null)}function B(e){let r=e.projectName?.trim().toLowerCase();return!!(r==="soot"||r==="sootsim"||e.bundleId?.trim().toLowerCase()?.startsWith("dev.soot"))}var g=new Map,G=3e4,W=1500;function F(e){return!e||e.framework==="metro"||e.framework==="unknown"}function z(e){return e?m(e.port,e.bundleUrl)===e.bundleUrl:!0}function q(e,r,s=Date.now()){if(r===0||e.pid!==r||!z(e.result))return!1;let t=s-e.cachedAt;return!(e.result===null&&t>=G||F(e.result)&&t>=W)}async function ee(e={}){let r=await L(e.excludePorts),s=new Set(r.map(n=>n.port));for(let n of[...g.keys()])s.has(n)||g.delete(n);for(let n of[...d])s.has(n)||d.delete(n);for(let n of[...f])s.has(n)||f.delete(n);for(let n of[...b])s.has(n)||b.delete(n);let t=[],o=[];for(let{port:n,pid:c}of r){let u=g.get(n);if(u&&q(u,c)){u.result&&t.push(u.result);continue}u&&u.pid!==c&&(d.delete(n),f.delete(n),b.delete(n)),o.push({port:n,pid:c})}o.length>0&&(await Promise.all(o.map(c=>H(c.port,e.buildIconProxyUrl)))).forEach((c,u)=>{let{port:l,pid:p}=o[u];p!==0&&g.set(l,{pid:p,result:c,cachedAt:Date.now()}),c&&t.push(c)});let i=new Map;for(let{port:n,pid:c}of r)c>0&&i.set(n,c);await Promise.all(t.map(async n=>{let c=i.get(n.port);if(!c)return;n.pid=c;let u=await $(c);u&&(n.cwd=u)}));let a=new Set(i.values());for(let n of[...S.keys()])a.has(n)||S.delete(n);return t.filter(n=>!B(n))}export{ee as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
async function y(e){let t=await e.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof t=="number"?t:0}}async function p(e,t=5){let n=await e.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${t}))()`});return{depth:t,tree:n}}async function m(e){let t=await e.send({type:"evaluate",code:"window.location.href"});return{url:typeof t=="string"?t:""}}async function g(e,t){let n=`(async () => {
|
|
3
3
|
const t = window.__sootsimTest
|
|
4
4
|
const mainShell = window.SootSim?.bridges?.mainShell
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P,b as v}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P,b as v}from"./chunk-MBYU2XAP.js";import{d as j}from"./chunk-QRZORMLG.js";import{a as b}from"./chunk-H6MLMLDA.js";import{execSync as A}from"child_process";import{existsSync as w,readFileSync as _,writeFileSync as x}from"fs";import{relative as B,resolve as d}from"path";import{existsSync as p,readFileSync as k,readdirSync as O,statSync as R}from"fs";import{basename as L,dirname as T,join as a}from"path";function D(e){let o=e;for(;;){if(p(a(o,"turbo.json"))||p(a(o,"nx.json"))||p(a(o,"lerna.json"))||p(a(o,"pnpm-workspace.yaml")))return o;let i=a(o,"package.json");if(p(i))try{if(JSON.parse(k(i,"utf8")).workspaces)return o}catch{}let r=T(o);if(r===o)break;o=r}return e}function W(e){return p(a(e,"bun.lock"))||p(a(e,"bun.lockb"))?"bun":p(a(e,"pnpm-lock.yaml"))?"pnpm":p(a(e,"yarn.lock"))?"yarn":"npm"}function J(e){if(p(a(e,"turbo.json")))return"turbo";if(p(a(e,"nx.json")))return"nx";if(p(a(e,"pnpm-workspace.yaml")))return"pnpm";let o=a(e,"package.json");if(p(o))try{if(JSON.parse(k(o,"utf8")).workspaces)return"npm-workspaces"}catch{}return"single"}function N(e){return e.one?"one":e.expo?"expo":e["react-native"]?"bare":"unknown"}function y(e){let o=a(e,"package.json");if(!p(o))return null;let i;try{i=JSON.parse(k(o,"utf8"))}catch{return null}let r={...i.dependencies,...i.devDependencies},s=N(r);return s==="unknown"?null:{dir:e,name:i.name||L(e),framework:s,hasViteConfig:p(a(e,"vite.config.ts"))||p(a(e,"vite.config.js")),hasMetroConfig:p(a(e,"metro.config.js"))||p(a(e,"metro.config.ts")),hasSootsimDependency:!!r.sootsim,devCommand:i.scripts?.dev||null}}function V(e){let o=[],i=a(e,"pnpm-workspace.yaml");if(p(i)){let t=k(i,"utf8").match(/packages:\s*\n((?:\s+-\s+.+\n?)+)/);if(t){let c=t[1].split(`
|
|
3
3
|
`).filter(Boolean);for(let n of c){let g=n.replace(/^\s*-\s*['"]?/,"").replace(/['"]?\s*$/,"");g&&o.push(...S(e,g))}}return o}let r=a(e,"package.json");if(p(r))try{let s=JSON.parse(k(r,"utf8")),t=Array.isArray(s.workspaces)?s.workspaces:s.workspaces?.packages||[];for(let c of t)o.push(...S(e,c))}catch{}return o}function S(e,o){let i=o.replace(/\/\*\*?$/,"").replace(/\*$/,""),r=a(e,i);if(!p(r))return[];try{return O(r).map(t=>a(r,t)).filter(t=>{try{return R(t).isDirectory()&&p(a(t,"package.json"))}catch{return!1}})}catch{return[]}}function M(e){let o=J(e),i=W(e);if(o==="single"){let c=y(e);return{root:e,type:o,packageManager:i,apps:c?[c]:[]}}let r=V(e),s=[],t=y(e);t&&s.push(t);for(let c of r){if(c===e)continue;let n=y(c);n&&s.push(n)}return{root:e,type:o,packageManager:i,apps:s}}function $(e){switch(e){case"bun":return"bun add -d sootsim";case"pnpm":return"pnpm add -D sootsim";case"yarn":return"yarn add -D sootsim";case"npm":return"npm install -D sootsim"}}async function ce(e){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
4
4
|
sootsim setup-repo \u2014 set up sootsim in your project
|
|
5
5
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as D,b as q,c as se}from"./chunk-Q4U25XDO.js";import{b as L}from"./chunk-NY4NHSFE.js";import{g as W}from"./chunk-F3CDHMRT.js";import{a as k,b as j}from"./chunk-45N4MXK2.js";import{c as ie}from"./chunk-7X7G5LUX.js";import{d as ne}from"./chunk-NQHG45SY.js";import{a as ee}from"./chunk-EALHLLVY.js";import{b as re,c as x,d as b,e as C}from"./chunk-LI5EVOPD.js";import{c as I,d as g,e as E}from"./chunk-WISEXGFB.js";import{E as te,F as oe}from"./chunk-2GKUXZWK.js";import xe from"node:fs";import Ce from"node:os";import J from"node:path";function he(t){return t.replace(/^\[|\]$/g,"").toLowerCase()}function G(t){let o=he(t);return o==="localhost"||o.endsWith(".localhost")||o==="0.0.0.0"||o==="::1"||/^127(?:\.\d{1,3}){3}$/.test(o)}function ae(t){return new Error(`could not resolve a native bundle for ${t}. pass an explicit bundle URL or open Connect and choose the app there.`)}function we(t,o){return t?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function le(t,o,e){return`${t}//${o}:${e}`}function ye(t){if(typeof window>"u")return!1;try{let o=new URL(t);return G(o.hostname)&&G(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function ce(t,o){let e={...o,cache:o?.cache??"no-store"};return ye(t)?fetch(`/__fetch-proxy?url=${encodeURIComponent(t)}`,e):fetch(t,e)}function be(t){return t==="https:"?443:80}function Se(t){let o=t.pathname||"/";return(o==="/"||o==="")&&!t.search&&!t.hash}async function me(t,o){let e=t.replace(/\/+$/,"");try{let n=await ce(`${e}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),i=r?.extra?.expoClient||r?.extra||{},s=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(s||i.name)return{bundleUrl:se(s||`${e}${q}`),port:o,framework:we(s,i.sdkVersion),projectName:i.name}}}catch{}try{let n=await ce(`${e}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${e}${q}`,port:o,framework:"metro"}}catch{}return null}async function $e(t){return me(le("http:","localhost",t),t)}async function Q(t){let o=t.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await $e(a);if(l)return l;throw ae(`localhost:${a}`)}let e=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(e)}catch{throw new Error(`could not parse "${t}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",i=n.port?parseInt(n.port,10):be(r),s=le(r,n.hostname,i);if(Se(n)){let a=await me(s,i);if(a)return a;throw ae(s)}return{bundleUrl:n.toString(),port:i,framework:"unknown"}}function je(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim install-desktop"),console.error(""),console.error(" or wire sootsim into your own project so your dev server hosts the bridge:"),console.error(" sootsim setup-repo"),console.error("")}function de(t){let o=k();if(console.log(` note: no sootsim bridge detected on port ${t}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim electron");return}console.log(""),console.log(" to get a bridge running, either:"),console.log(" sootsim install-desktop # download the electron app"),console.log(" sootsim setup-repo # wire sootsim into your own project")}function ve(t){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${t}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function We(t,o,e){let n=[];try{n=await t.listSims()}catch{}if(console.error(""),n.length===0){ve(o);return}console.error(` no sim with id "${e}" is connected to the bridge on port ${o}.`),console.error(""),console.error(" connected sims:");for(let r of n){let i=[r.isPrimary?"primary":null,r.readyState].filter(Boolean).join(", ");console.error(` ${r.id} (${i})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var Pe={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function P(t){return new Promise(o=>setTimeout(o,t))}function V(t){return t.trim()}function K(t){try{let o=new URL(t),e=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||e==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||e==="/rn"||/^\/rn\/[^/]+$/i.test(e)||/^\/app\/[^/]+$/i.test(e)||e==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(e)||/^\/__soot\/app\/[^/]+$/i.test(e)}catch{return!1}}async function ct(t){let o=V(t);return(await Q(o)).bundleUrl}function X(t){let o=t.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Ie(t,o){let e=V(t),n=new URL(o),r=X(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(e)?n.pathname=`${r}/rn/${e}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",e)),n.toString()}function ke(t){let o=V(t);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Me(t,o){let e=await Q(t),n=new URL(o),r=X(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.set("bundle",e.bundleUrl),n.toString()}function Te(t){return t.startsWith("~/")?J.join(Ce.homedir(),t.slice(2)):J.isAbsolute(t)?t:J.resolve(process.cwd(),t)}function Ue(t){let o={};for(let e=0;e<t.length;e++){if(t[e]!=="--replace")continue;let n=t[e+1];n||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let r=n.indexOf("=");(r<=0||r===n.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=n.slice(0,r).trim(),s=Te(n.slice(r+1).trim());xe.existsSync(s)||(console.error(` sootsim open: replacement file not found: ${s}`),process.exit(1)),o[i]={file:s},e++}return Object.keys(o).length>0?{modules:o}:void 0}function pe(){let t=te();return oe(t)&&t.runtimePort>0?`http://localhost:${t.runtimePort}/`:ee}async function N(t,o=pe()){if(!t)return new URL(o).toString();if(K(t))return new URL(t).toString();let e=Pe[t.toLowerCase()];if(e){let n=new URL(o),r=X(n.pathname);return n.pathname=`${r}${e}`,n.toString()}return ke(t)?Me(t,o):Ie(t,o)}function ue(t,o){let e=t?.url||t?.origin||o;try{let n=new URL(e);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.toString()}catch{return o}}async function Be(t,o,e){let n=new URL(await N(t,o));return n.searchParams.set("inspectOpen",e),n.toString()}async function Oe(t,o,e,n={}){let r=n.attempts??30,i=n.intervalMs??500,s=n.minNodeCount??10;for(let a=0;a<r;a++){let l=b(t,{commandTimeoutMs:o,simId:e,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>s)return{bridge:l,count:c}}catch{}l.close(),await P(i)}return null}function _e(t){if(!t)return null;try{let o=new URL(t);if(o.searchParams.has("bundle")){let e=o.searchParams.get("bundle")||"";try{let n=new URL(e),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function Re(t,o){if(t.length===0){console.log(" no sims connected");return}console.log(` connected sims (${t.length}):
|
|
3
|
+
`);for(let e of t){let n=e.lockedBy&&e.lockExpiresAt?`locked by ${e.lockedBy} (${Math.max(0,Math.round((e.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[e.isPrimary?"primary":"",e.id===o?"selected":"",e.readyState,e.attachedCliCount&&e.attachedCliCount>0?"in use":"",e.userFocused?"focused":"",n].filter(Boolean);console.log(` ${e.id}${r.length?` [${r.join(", ")}]`:""}`);let i=_e(e.url);if(i&&console.log(` loaded: ${i}`),e.url?console.log(` url: ${e.url}`):e.origin&&console.log(` origin: ${e.origin}`),e.title&&console.log(` title: ${e.title}`),console.log(` connected: ${new Date(e.connectedAt).toISOString()}`),e.lastActiveAt&&e.lastActiveAt>0){let s=Math.round((Date.now()-e.lastActiveAt)/1e3),a=s<60?`${s}s ago`:s<3600?`${Math.round(s/60)}m ago`:`${Math.round(s/3600)}h ago`;console.log(` last active: ${a}`)}}}async function A(t,o,e,n={}){let r=n.attempts??30,i=n.intervalMs??500;for(let s=0;s<r;s++){let a=b(t,{commandTimeoutMs:o});try{let c=(await a.listSims()).find(e);if(c)return c}catch{}finally{a.close()}await P(i)}return null}async function Ee(t,o,e,n={}){let r=n.attempts??20,i=n.intervalMs??250;for(let s=0;s<r;s++){let a=b(t,{commandTimeoutMs:o});try{let c=(await a.listSims()).find(f=>f.id===e);if(!c||c.readyState!=="open")return!0}catch{return!0}finally{a.close()}await P(i)}return!1}function U(t,o){if(o){let r=o.trim(),i=t.find(s=>s.id===r);if(!i)throw new Error(`no sim connected with id ${r}`);return i}let e=t.find(r=>r.isPrimary&&r.readyState==="open");if(e)return e;let n=t.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function M(t,o,e){console.log(` ${e==="current sim"?"loaded":"opened"}: ${t} [${e}]`),console.log(` current sim: ${o.id}`),console.log(JSON.stringify({simId:o.id,url:o.url},null,2))}async function T(t,o,e){if(e.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await Le(t,o,{stableMs:150,maxMs:400});let r=b(t,{commandTimeoutMs:3e3,simId:o,cliLabel:"open --describe",simIdSource:"flag"});try{let s=`(async () => {
|
|
4
|
+
const t = window.__sootsimTest
|
|
5
|
+
const ms = window.SootSim?.bridges?.mainShell
|
|
6
|
+
if (!t) return null
|
|
7
|
+
let shell = null
|
|
8
|
+
try { shell = ms?.getState ? await ms.getState() : null } catch {}
|
|
9
|
+
const tree = await t.dumpTree(12, ${JSON.stringify({describe:!0,verbose:!1,filter:""})})
|
|
10
|
+
return { tree, shell }
|
|
11
|
+
})()`,a=await r.send({type:"evaluate",code:s});if(!a?.tree)return;if(console.log(""),a.shell?.state){let l=[`state=${a.shell.state}`,a.shell.activeApp?`app=${a.shell.activeApp}`:null].filter(Boolean);console.log(` shell: ${l.join(" ")}`)}console.log(a.tree)}finally{r.close()}}catch{}finally{n===void 0?delete process.env.SOOTSIM_QUIET_TARGET_NOTICE:process.env.SOOTSIM_QUIET_TARGET_NOTICE=n}}async function Le(t,o,e){let n=Date.now()+e.maxMs,r="(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()",i=b(t,{commandTimeoutMs:2e3,simId:o,simIdSource:"flag"});try{let s=-1,a=0;for(;Date.now()<n;){let l=-1;try{let c=await i.send({type:"evaluate",code:r});typeof c=="number"&&(l=c)}catch{}if(l>=0&&l===s){if(Date.now()-a>=e.stableMs)return}else s=l,a=Date.now();await P(50)}}finally{i.close()}}async function lt(t,o={}){let e=x(t,{port:o.port,commandTimeoutMs:o.timeoutMs}),n=C(e);try{let r=await n.listSims();Re(r,e.simId)}finally{n.close()}}async function mt(t,o={}){let e=x(t,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--new","--headless","--ephemeral"],stripValueFlags:["--base-url","--replace","--driver","--profile"]}),n=t.find((m,d)=>t[d-1]==="--profile"),r=t.includes("--ephemeral");n&&r&&(console.error(" sootsim open: --profile cannot be combined with --ephemeral"),process.exit(1));let i=n?ie(n).id:void 0,s=!!i||r,a=t.includes("--new")||s,l=Ue(t);a&&e.simIdSource==="flag"&&(console.error(" sootsim open: --new, --profile, and --ephemeral cannot be combined with --sim"),process.exit(1));let c=e.positional[0]||"",f=t.find((m,d)=>t[d-1]==="--driver")||"",h=t.includes("--headless"),S=t.find((m,d)=>t[d-1]==="--base-url")||pe(),B=t.includes("--base-url"),$=I();if(!a&&(e.simIdSource==="flag"||e.simIdSource==="saved"&&!!$)){let m=C(e),d=e.simId?` --sim ${e.simId}`:"",u=!1;try{let p=null;try{let y=await m.listSims();if(e.simIdSource==="saved"?(p=y.find(v=>v.id===$&&v.readyState==="open")??null,p||E()):p=U(y,e.simId),!p)if(e.simIdSource==="saved")u=!0;else throw new Error("no sim connected");if(!u&&p){let v=B||K(c)?S:ue(p,S),R=await N(c,D(v,l));m.send({type:"evaluate",simId:p.id,code:`window.location.href = ${JSON.stringify(R)}`}).catch(()=>{})}}catch(y){console.error(` open failed: ${y instanceof Error?y.message:String(y)}`),await L(m,{errorsCommand:`sootsim get errors 5${d}`,warningsCommand:`sootsim get warnings 5${d}`,requestsCommand:`sootsim get requests 5${d}`}),process.exit(1)}if(!u&&p){await P(1500);let y=await Oe(e.wsPort,e.commandTimeoutMs,p.id);y||(console.error(" timed out waiting for current sim to load target"),process.exit(1)),y.bridge.close(),g(p.id);let v=B||K(c)?S:ue(p,S),R=await N(c,D(v,l));M(R,{...p,url:R},"current sim"),await T(e.wsPort,p.id,t);return}}finally{m.close()}}let Y=D(S,l),ge=await N(c,Y),Z=`cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,w=await Be(c,Y,Z),F={newWindow:!0},O=m=>m.url?.includes(`inspectOpen=${Z}`)??!1;if(f){let m=W(f);m||(console.error(` unknown driver "${f}" \u2014 run \`sootsim list --drivers\``),process.exit(1));let d=await m.launch({url:w,headless:h,newWindow:F.newWindow,profileId:i,ephemeralProfile:r});d.launched||(console.error(` ${m.name} driver: ${d.message}`),process.exit(1));let u=await A(e.wsPort,e.commandTimeoutMs,O,{attempts:60,intervalMs:500});u||(console.error(" timed out waiting for opened sim to connect"),process.exit(1)),g(u.id),M(w,u,`${m.name} driver`),await T(e.wsPort,u.id,t);return}if(s){let m=k();m||(console.error(" profiles require electron or playwright; install the desktop companion or use `--driver playwright`"),process.exit(1));try{(await j(w,m,{profileId:i,ephemeralProfile:r})).launched||(console.error(" desktop companion failed to start"),process.exit(1))}catch(u){console.error(` desktop companion failed: ${u instanceof Error?u.message:String(u)}`),process.exit(1)}let d=await A(e.wsPort,e.commandTimeoutMs,O,{attempts:40,intervalMs:500});d||(console.error(" timed out waiting for profiled sim to connect"),process.exit(1)),g(d.id),M(w,d,"desktop companion"),await T(e.wsPort,d.id,t);return}let H=!1,z=!1;try{let m=b(e.wsPort,{commandTimeoutMs:2e3});try{await m.listSims(),H=!0}finally{m.close()}}catch{}if(H)try{let m=b(e.wsPort,{commandTimeoutMs:3e3});try{await m.openUrl(w,F),z=!0}finally{m.close()}}catch{}if(!z){let m=k();if(m)try{if((await j(w,m)).launched){let u=await A(e.wsPort,e.commandTimeoutMs,O,{attempts:20,intervalMs:500});if(u){g(u.id),M(w,u,"desktop companion"),await T(e.wsPort,u.id,t);return}}}catch{}try{await ne(w,F)}catch(d){console.error(` open failed: ${d instanceof Error?d.message:String(d)}`),W("playwright")?.availability().available?console.error(" no system browser found \u2014 retry with `sootsim open \u2026 --driver playwright` for a headless sim."):console.error(" run `sootsim list --drivers` to see available drivers."),process.exit(1)}if(!H){console.log(` opened: ${ge}`),de(e.wsPort);return}}let _=await A(e.wsPort,e.commandTimeoutMs,O,{attempts:30,intervalMs:500});_||(console.error(" timed out waiting for opened sim to connect"),process.exit(1)),g(_.id),M(w,_,z?"bridge":"direct shell open"),await T(e.wsPort,_.id,t)}async function fe(t,o={}){let e=x(t,{port:o.port,commandTimeoutMs:o.timeoutMs}),n=C(e),r=e.simId?` --sim ${e.simId}`:"";try{try{let i=await n.listSims(),s=U(i,e.positional[0]||e.simId);await n.focusSim(s.id),g(s.id),console.log(` using: ${s.id}`)}catch(i){console.error(` use failed: ${i instanceof Error?i.message:String(i)}`),await L(n,{errorsCommand:`sootsim get errors 5${r}`,warningsCommand:`sootsim get warnings 5${r}`,requestsCommand:`sootsim get requests 5${r}`}),process.exit(1)}}finally{n.close()}}async function dt(t,o={}){await fe(t,o)}async function ut(t,o={}){await fe(t,o)}async function pt(t,o={}){let e=x(t,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--force"]}),n=t.includes("--force"),r=C(e);try{try{let i=await r.listSims(),s=U(i,e.positional[0]||e.simId),a=n&&s.lockedBy&&s.lockedByKind!=="user-active"?s.lockedBy:null,l=await r.claim(s.id,{force:n});g(s.id);let c=Math.max(0,Math.round((l.lockExpiresAt-Date.now())/1e3)),f=l.bootedCount>0?` (booted ${l.bootedCount})`:"";console.log(` claimed: ${l.simId} [${c}s]${f}`),a&&console.log(` took over from: ${a}`)}catch(i){if(i instanceof re){let s=Math.max(0,Math.round(i.lock.expiresInMs/1e3));console.error(` claim failed: locked by ${i.lock.by} for ${s}s more`),console.error(" use --force to take it, or `sootsim open --new` for a fresh sim"),process.exit(1)}console.error(` claim failed: ${i instanceof Error?i.message:String(i)}`),process.exit(1)}}finally{r.close()}}async function De(t,o,e,n){if(n.length===0)return{closed:[],remaining:[]};await Promise.all(n.map(i=>t.closeSim(i).catch(()=>{})));let r=new Set(n);for(let i=0;i<40;i++){let s=[];try{let a=b(o,{commandTimeoutMs:e});try{s=(await a.listSims()).filter(c=>r.has(c.id)&&c.readyState==="open").map(c=>c.id)}finally{a.close()}}catch{s=[]}if(s.length===0)return{closed:[...r],remaining:[]};if(i===39)return{closed:[...r].filter(a=>!s.includes(a)),remaining:s};await P(250)}return{closed:[...r],remaining:[]}}async function ft(t,o={}){let e=x(t,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--all","--others"]}),n=C(e),r=e.simId?` --sim ${e.simId}`:"",i=t.includes("--all"),s=t.includes("--others");if(i||s){try{let a=await n.listSims(),l=a.filter($=>$.readyState==="open"),c=null;if(s)try{c=U(a,e.positional[0]||e.simId||I()||void 0).id}catch{c=null}let f=l.map($=>$.id).filter($=>$!==c);if(f.length===0){console.log(c?` nothing to close \u2014 only the kept sim ${c} is connected`:" nothing to close \u2014 no sims connected");return}let h=await De(n,e.wsPort,e.commandTimeoutMs,f),S=I();S&&h.closed.includes(S)&&(c?g(c):E());let B=` closed ${h.closed.length} sim(s)${c?` (kept ${c})`:""}`;console.log(B),h.remaining.length>0&&console.log(` still connected: ${h.remaining.join(", ")}`)}catch(a){console.error(` close failed: ${a instanceof Error?a.message:String(a)}`),process.exit(1)}finally{n.close()}return}try{try{let a=await n.listSims(),l=U(a,e.positional[0]||e.simId),c=a.find(h=>h.id!==l.id&&h.readyState==="open");if(await n.closeSim(l.id),!await Ee(e.wsPort,e.commandTimeoutMs,l.id)){console.log(` close requested: ${l.id} (still connected)`);return}I()===l.id&&(c?g(c.id):E()),console.log(` closed: ${l.id}`)}catch(a){console.error(` close failed: ${a instanceof Error?a.message:String(a)}`),await L(n,{errorsCommand:`sootsim get errors 5${r}`,warningsCommand:`sootsim get warnings 5${r}`,requestsCommand:`sootsim get requests 5${r}`}),process.exit(1)}}finally{n.close()}}export{je as a,ve as b,We as c,ct as d,pe as e,N as f,Be as g,_e as h,Re as i,A as j,lt as k,mt as l,dt as m,ut as n,pt as o,ft as p};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as l,e as d,h as c}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as l,e as d,h as c}from"./chunk-LI5EVOPD.js";function g(n){let e=n[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function u(n,e,o){let s=l(n,{port:e.port}),a=g(s.positional),r=d({...s,commandTimeoutMs:5e3});try{let i=!!(await c(r,"SootSim.bridges.settings.get"))?.[o.modeKey],t=a==="on"?!0:a==="off"?!1:!i;if(i===t){console.log(` ${o.displayName}: already ${t?"on":"off"}`);return}if(!await r.send({type:"evaluate",acquireLock:!0,code:`(async () => {
|
|
3
3
|
const modeKey = ${JSON.stringify(o.modeKey)}
|
|
4
4
|
const target = ${JSON.stringify(t)}
|
|
5
5
|
window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{i as n}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{i as n}from"./chunk-EB3HUXF3.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
|
|
3
3
|
`)}export{g as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as d}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as d}from"./chunk-LI5EVOPD.js";import{a as p,d as w,h as $,j as y}from"./chunk-SGPKAZCV.js";import{A as g,B as f,i as h,y as m,z as a}from"./chunk-2GKUXZWK.js";import b from"fs";import{WebSocket as D}from"ws";async function P(n,e={}){let[o,...t]=n;if(!o||o==="--help"||o==="-h"){R();return}switch(o){case"install":return O(t,e);case"list":case"ls":return S(t);case"use":return T(t);case"remove":case"rm":return N(t);case"which":case"active":return F();default:console.error(` unknown runtime subcommand: ${o}`),R(),process.exit(1)}}function R(){console.log(`
|
|
3
3
|
sootsim runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -22,4 +22,4 @@ examples:
|
|
|
22
22
|
sootsim runtime install 1.2.3
|
|
23
23
|
sootsim runtime install --channel beta
|
|
24
24
|
sootsim runtime use 1.2.3
|
|
25
|
-
`)}async function O(n,e){let{version:o,flags:t}=_(n),s=t.channel??e.channel??"stable",l=t.force===!0,c=t.setActive!==!1;m(),console.log("sootsim runtime install"),console.log(` cdn: ${w()}`);try{let i=await y({version:o,channel:s,force:l,setActive:c});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),c&&await k(i.version)}catch(i){console.error(` ${I(i)}`),process.exit(1)}}async function k(n){g(n),console.log(` active: ${n}`),await A(n)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${n})`)}async function A(n){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-
|
|
25
|
+
`)}async function O(n,e){let{version:o,flags:t}=_(n),s=t.channel??e.channel??"stable",l=t.force===!0,c=t.setActive!==!1;m(),console.log("sootsim runtime install"),console.log(` cdn: ${w()}`);try{let i=await y({version:o,channel:s,force:l,setActive:c});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),c&&await k(i.version)}catch(i){console.error(` ${I(i)}`),process.exit(1)}}async function k(n){g(n),console.log(` active: ${n}`),await A(n)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${n})`)}async function A(n){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-IBJQU7RM.js"),t=o();if(!e(t))return!1;let s=d();return new Promise(l=>{let c=!1,i=!1,u=x=>{c||(c=!0,l(x))},r=new D(`ws://127.0.0.1:${s}`,{handshakeTimeout:800}),v=setTimeout(()=>{try{r.close()}catch{}u(i)},1500);r.on("open",()=>{try{r.send(JSON.stringify({type:"runtime:use",version:n,id:0})),i=!0}catch{}setTimeout(()=>{try{r.close()}catch{}},100)}),r.on("close",()=>{clearTimeout(v),u(i)}),r.on("error",()=>{clearTimeout(v),u(!1)})})}async function S(n){m();let e=f(),o=a();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let t of e)console.log(` ${t===o?"*":" "} ${t}`);try{let t=await $();console.log("available (latest per channel):");for(let[s,l]of Object.entries(t.channels))console.log(` ${s.padEnd(8)} ${l.latest}`)}catch(t){console.log(`available: (could not fetch manifest: ${I(t)})`)}}async function T(n){let e=n[0];e||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let o=f();o.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${o.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${e}\` first`),process.exit(1)),await k(e)}async function N(n){let e=n[0];e||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),a()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let t=h(e);if(!b.existsSync(t)){console.error(` ${e} is not installed`);return}b.rmSync(t,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function F(){let n=a();if(!n){console.log(" no active runtime");return}console.log(n)}function _(n){let e={},o=[];for(let t=0;t<n.length;t++){let s=n[t];if(s==="--channel"&&t+1<n.length){e.channel=n[t+1],t++;continue}if(s.startsWith("--channel=")){e.channel=s.slice(10);continue}if(s==="--force"){e.force=!0;continue}if(s==="--set-active=false"||s==="--no-set-active"){e.setActive=!1;continue}o.push(s)}return{version:o[0]??null,flags:e}}function I(n){return n instanceof Error?n.message:String(n)}export{P as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{existsSync as C,mkdirSync as D,readFileSync as O,rmSync as s,writeFileSync as g}from"fs";import{tmpdir as P}from"os";import{dirname as R,join as A,resolve as x}from"path";import{execFileSync as a}from"child_process";import{readFileSync as I}from"fs";import{createRequire as S}from"module";var o=null;function u(r){o||(o=_());try{return o(r)}catch{return null}}function _(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return y();if(process.platform==="darwin"){let n=E();return n||T()}return()=>null}function y(){return r=>{try{let n=I(`/proc/${r}/stat`,"utf8"),t=n.lastIndexOf(")");if(t<0)return null;let i=n.slice(t+1).trim().split(/\s+/),e=Number(i[1]);return Number.isFinite(e)&&e>0?e:null}catch{return null}}}var N=3,d=216,b=16;function E(){if(!process.versions?.bun)return null;try{let r=S(import.meta.url),{dlopen:n,FFIType:t}=r("bun:ffi"),i=n("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[t.i32,t.i32,t.u64,t.ptr,t.i32],returns:t.i32}}),e=Buffer.alloc(d);return m=>{if(Number(i.symbols.proc_pidinfo(m,N,0n,e,d))<=0)return null;let p=e.readUInt32LE(b);return p>0?p:null}}catch{return null}}function T(){return r=>{try{let t=a("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
3
|
`)[1];if(!t)return null;let i=t.trim().split(/\s+/),e=Number(i[2]);return Number.isFinite(e)&&e>1?e:null}catch{return null}}}var c=1,f="SOOTSIM_CLI_CURRENT_SIM_PATH",v=["SOOTSIM_CLI_IDENTITY","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"];function F(r,n=20){let t=u(r);if(!t||t<=1)return null;for(let i=0;i<n;i++){let e=u(t);if(!e||e<=1)return t;t=e}return t}function k(){for(let n of v){let t=process.env[n];if(t&&t.trim())return{key:`${n}:${t.trim()}`,source:n,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}}function L(){return k().key}function l(){if(process.env[f])return x(process.env[f]);let r=L();return A(P(),`sootsim-current-sim-${r}.json`)}function h(){let r=l();if(!C(r))return null;try{let n=JSON.parse(O(r,"utf8"));return n.version!==c||typeof n.simId!="string"||!n.simId.trim()||typeof n.updatedAt!="string"?(s(r,{force:!0}),null):{version:c,simId:n.simId.trim(),updatedAt:n.updatedAt}}catch{return s(r,{force:!0}),null}}function J(){return h()?.simId||null}function j(r){let n=r.trim();if(!n)return;let t=l();D(R(t),{recursive:!0}),g(t,JSON.stringify({version:c,simId:n,updatedAt:new Date().toISOString()},null,2)+`
|
|
4
4
|
`)}function K(){s(l(),{force:!0})}export{k as a,L as b,J as c,j as d,K as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t=!0,e="1.0.0",o="public beta",n=`${o} \xB7 free until ${e}`,r="free for everyone until 1.0 \u2014 we send anonymous error and dependency data while you use it";export{t as a,e as b,o as c,n as d,r as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-IKTUA2CO.js";import{existsSync as x,readFileSync as j}from"fs";import{resolve as g}from"path";async function P(s){(s.includes("--help")||s.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim compat \u2014 check package compatibility
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -20,7 +20,7 @@ examples:
|
|
|
20
20
|
sootsim compat react-native-reanimated
|
|
21
21
|
sootsim compat --json
|
|
22
22
|
sootsim compat --brief
|
|
23
|
-
`),process.exit(0));let c=s.includes("--json"),e=s.includes("--brief"),l=s.indexOf("--app"),n=l!==-1&&s[l+1]?g(s[l+1]):process.cwd(),k=s.filter((o,a)=>!o.startsWith("-")&&(l===-1||a!==l+1))[0];if(c||e){let{scanDeps:o}=await import("./web-
|
|
23
|
+
`),process.exit(0));let c=s.includes("--json"),e=s.includes("--brief"),l=s.indexOf("--app"),n=l!==-1&&s[l+1]?g(s[l+1]):process.cwd(),k=s.filter((o,a)=>!o.startsWith("-")&&(l===-1||a!==l+1))[0];if(c||e){let{scanDeps:o}=await import("./web-F42XPZXB.js"),a=g(n,"package.json");x(a)||(console.error(" no package.json found in",n),process.exit(1));let u=JSON.parse(j(a,"utf8")),r=o(u);if(c){console.log(JSON.stringify(r,null,2));return}if(r.packages.length===0){console.log(" no RN ecosystem packages detected");return}let T=Math.round(r.overallScore*100),v=r.packages.filter(i=>i.status==="full").length,$=r.packages.filter(i=>i.status==="partial"||i.status==="auto-stub").length,w=r.packages.filter(i=>i.status==="unsupported").length,p=[];v&&p.push(`${v} fully supported`),$&&p.push(`${$} partial`),w&&p.push(`${w} unsupported`),console.log(` ${p.join(", ")} \u2014 ${T}% compatible`);return}let{POLYFILL_REGISTRY:d}=await import("./web-F42XPZXB.js");if(k){W(k,d);return}let b=g(n,"package.json");x(b)||(console.error(" no package.json found in",n),process.exit(1));let m=JSON.parse(j(b,"utf8")),S={...m.dependencies,...m.devDependencies},t={full:[],partial:[],autoStub:[],unsupported:[],justWorks:[],unknown:[]};for(let o of Object.keys(S)){let a=d[o];if(a){let u=a.stubType==="native"?"full":a.stubType==="works"?"not-relevant":a.stubType;if(a.stubType!=="native"&&a.versions?.length){let r=Math.max(...a.versions.map(y=>y.coverage||0));u=r>=.8?"full":r>=.3?"partial":"auto-stub"}switch(u){case"full":t.full.push(o);break;case"partial":t.partial.push(o);break;case"auto-stub":t.autoStub.push(o);break;case"unsupported":t.unsupported.push(o);break;case"not-relevant":t.justWorks.push(o);break;default:f(o)&&t.unknown.push(o)}}else f(o)&&t.unknown.push(o)}console.log(`
|
|
24
24
|
sootsim compatibility report
|
|
25
25
|
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
26
26
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-IKTUA2CO.js";import{existsSync as i,writeFileSync as n,readFileSync as c}from"fs";import{resolve as t}from"path";async function a(s){let e=s[0];switch((!e||s.includes("--help")||s.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim config \u2014 manage sootsim configuration
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m}from"./chunk-UJ32JSVY.js";import"./chunk-Q4U25XDO.js";import"./chunk-NY4NHSFE.js";import"./chunk-F3CDHMRT.js";import"./chunk-45N4MXK2.js";import"./chunk-7X7G5LUX.js";import"./chunk-FIBNBYEC.js";import"./chunk-NQHG45SY.js";import"./chunk-EALHLLVY.js";import"./chunk-LI5EVOPD.js";import"./chunk-WISEXGFB.js";import"./chunk-SNGLDQLQ.js";import"./chunk-2GKUXZWK.js";import"./chunk-IKTUA2CO.js";export{d as buildOpenUrl,c as buildShellUrl,f as printConnectedSims,a as resolveBundleTarget,b as resolveDefaultShellBaseUrl,l as runClaimCommand,m as runCloseCommand,k as runFocusCommand,h as runListCommand,i as runOpenCommand,j as runUseCommand,e as summarizeSimUrl,g as waitForSimMatch};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as I,e as N,i as S}from"./chunk-LI5EVOPD.js";import"./chunk-WISEXGFB.js";import"./chunk-SNGLDQLQ.js";import"./chunk-2GKUXZWK.js";import"./chunk-IKTUA2CO.js";import{createWriteStream as k,mkdirSync as v,writeFileSync as C}from"fs";import{dirname as T,resolve as w}from"path";import{Readable as F}from"stream";import{pipeline as y}from"stream/promises";import{createGzip as x}from"zlib";async function U(o,m){let n=Number(b(o,"--duration")??"5");if(!Number.isFinite(n)||n<=0)return console.error(" --duration must be a positive number (seconds)"),1;let a=Number(b(o,"--sample-interval")??"10");if(!Number.isFinite(a)||a<=0)return console.error(" --sample-interval must be a positive number (milliseconds)"),1;let t=Number(b(o,"--max-buffer")??"100000");if(!Number.isFinite(t)||t<=0)return console.error(" --max-buffer must be a positive number"),1;let p=b(o,"--output")??b(o,"-o"),l=w(process.cwd(),p??"/tmp/sootsim.cpuprofile"),g=l.endsWith(".gz"),h=I(o,{port:m.port,stripValueFlags:["--duration","--output","-o","--sample-interval","--max-buffer"]}),c=N({...h,commandTimeoutMs:Math.max(3e4,(n+20)*1e3)});try{let u=await S(c,"SootSim.bridges.workerCpuProfileStart",{sampleInterval:a,maxBufferSize:t});if(!u?.started)return u?.error?.includes("cpu-profile-unsupported")?(console.error(" cpu-profile is currently unsupported."),console.error(" the JS Self-Profiler API cannot profile a dedicated worker, and"),console.error(" sootsim runs the guest app in the tenant worker. a CDP-based"),console.error(" profiler is required \u2014 tracked as the F28 follow-up.")):(console.error(" could not start tenant-worker profiler."),console.error(" is sootsim running? (try `sootsim list`)")),1;m.verbose&&console.error(` started: sampleInterval=${u.sampleInterval}ms buffer=${u.maxBufferSize}`),console.log(` recording for ${n}s\u2026`),await new Promise(r=>setTimeout(r,n*1e3));let s=await S(c,"SootSim.bridges.workerCpuProfileStop");if(!s||s.error||!s.trace)return console.error(` profile capture failed: ${s?.error??"no trace returned"}`),1;let P=B(s.trace),e=JSON.stringify(P);v(T(l),{recursive:!0}),g?await y(F.from([e]),x(),k(l)):C(l,e);let i=(Buffer.byteLength(e)/1024/1024).toFixed(2);return console.log(` samples: ${P.samples.length} (${i} MB uncompressed)`),console.log(` saved: ${l}`),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}catch(u){let s=u?.message??String(u);return console.error(` profile failed: ${s}`),/could not connect|ECONNREFUSED/i.test(s)&&console.error(" is sootsim running? (try `sootsim list`)"),1}finally{c.close()}}function B(o){let m=o.frames??[],n=o.resources??[],a=o.stacks??[],t=o.samples??[],p=1,l=[{id:p,callFrame:{functionName:"(root)",scriptId:"0",url:"",lineNumber:-1,columnNumber:-1},hitCount:0,children:[]}];for(let e=0;e<a.length;e++){let i=a[e],r=m[i.frameId]??{name:"(unknown)"},f=r.resource!==void 0?n[r.resource]??"":"";l.push({id:e+2,callFrame:{functionName:r.name||"(anonymous)",scriptId:r.resource!==void 0?String(r.resource):"0",url:f,lineNumber:typeof r.line=="number"?r.line-1:-1,columnNumber:typeof r.column=="number"?r.column-1:-1},hitCount:0,children:[]})}for(let e=0;e<a.length;e++){let i=a[e],r=e+2,f=i.parentId!==void 0?i.parentId+2:p,d=l[f-1];d&&!d.children.includes(r)&&d.children.push(r)}let g=[],h=[],c=t.length>0?t[0].timestamp:0,u=c;for(let e=0;e<t.length;e++){let i=t[e],r=i.stackId!==void 0?i.stackId+2:p;g.push(r);let f=l[r-1];f&&f.hitCount++;let d=e===0?0:i.timestamp-u;h.push(Math.max(0,Math.round(d*1e3))),u=i.timestamp}let s=Math.round(c*1e3),P=t.length>0?Math.round(t[t.length-1].timestamp*1e3):s;return{nodes:l,startTime:s,endTime:P,samples:g,timeDeltas:h}}function b(o,m){let n=o.indexOf(m);if(!(n<0||n===o.length-1))return o[n+1]}export{U as runCpuProfile};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as T,b as _}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as T,b as _}from"./chunk-H6MLMLDA.js";import"./chunk-QFEFKXKP.js";import"./chunk-SNGLDQLQ.js";import{g as I,o as C,p as w,q as B}from"./chunk-2GKUXZWK.js";import{a as W}from"./chunk-IKTUA2CO.js";import{execFileSync as tt,spawnSync as n}from"child_process";import{existsSync as a,mkdirSync as v,readFileSync as et,rmSync as S,writeFileSync as R}from"fs";import{homedir as $}from"os";import{dirname as U,resolve as m}from"path";import{execFileSync as Y}from"child_process";import{chmodSync as H,mkdirSync as D,rmSync as K,writeFileSync as L}from"fs";import{dirname as P}from"path";var X="dev.sootsim.daemon",N="SootSim Daemon",O="0.1.36";function F(t,e,r){let o=w(),s=B(),i=P(P(s)),f=P(s),u=`${i}/Resources`;K(o,{recursive:!0,force:!0}),D(C(),{recursive:!0}),D(f,{recursive:!0}),D(u,{recursive:!0}),L(`${i}/Info.plist`,Q()),L(`${i}/PkgInfo`,"APPL????"),L(s,z(t,e,r)),H(s,493);try{Y("codesign",["--force","--sign","-","--deep",o],{stdio:"pipe"})}catch(c){let g=c instanceof Error?c.message:String(c);console.warn(` warning: ad-hoc codesign of ${o} failed: ${g}
|
|
3
3
|
the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:o,launcherPath:s}}function Q(){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
4
4
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
5
5
|
<plist version="1.0">
|
|
@@ -79,5 +79,5 @@ WantedBy=default.target
|
|
|
79
79
|
the launchd / systemd agent would point at workspace artifacts that change
|
|
80
80
|
between sessions, and would serve stale prod-built engine assets instead of
|
|
81
81
|
the live \`bun dev:sootsim\` output. start the daemon manually in another
|
|
82
|
-
shell with:
|
|
82
|
+
shell with: sootsim server
|
|
83
83
|
(set SOOTSIM_FORCE_DAEMON_INSTALL=1 to override.)`);let r=ot();if(console.log(` binary: ${[r.executable,...r.prefixArgs].join(" ")}`),console.log(` port: ${t}`),process.platform==="darwin"){G()&&console.log(` migrated away from legacy ${E} plist`);let o=b();if(a(o)&&!e){console.log(` already installed at ${o}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}v(U(o),{recursive:!0}),R(o,nt(r,t)),console.log(` wrote ${o}`);let s=`gui/${process.getuid()}`,i=`${s}/${p}`,f=()=>{let l=n("launchctl",["bootstrap",s,o],{stdio:"pipe",encoding:"utf8"}),k=(l.stderr||l.stdout||"").trim();if(l.status!==0)return{ok:!1,reason:`bootstrap exit ${l.status}${k?`: ${k}`:""}`};let A=n("launchctl",["print",i],{encoding:"utf8"});return A.status!==0?{ok:!1,reason:`bootstrap returned 0 but service not registered (print exit ${A.status})`}:{ok:!0}},u=f();if(!u.ok){let l=u.reason;if(n("launchctl",["bootout",i],{stdio:"ignore"}),u=f(),!u.ok)throw new Error(`launchctl bootstrap failed: ${u.reason}`+(l!==u.reason?` (initial: ${l})`:"")+" \u2014 try `sootsim daemon uninstall` then retry, or reboot if launchd state is stuck.")}let c=Date.now()+4e3,g,y;for(;Date.now()<c;){let l=n("launchctl",["print",i],{encoding:"utf8"});if(l.status===0&&(g=l.stdout?.match(/state\s*=\s*(\w+)/)?.[1],y=l.stdout?.match(/pid\s*=\s*(\d+)/)?.[1],g==="running"||y))break;await new Promise(k=>setTimeout(k,150))}if(g!=="running"&&!y)throw new Error(`daemon registered but did not reach running state within 4s (last state: ${g||"unknown"}). check ${m(h,"server.err.log")} \u2014 typically a stale runtime or a port already bound by another process.`);console.log(` registered (state: ${g||"unknown"}${y?`, pid ${y}`:""}, log: ${m(h,"server.err.log")})`);return}if(process.platform==="linux"){let o=x();if(a(o)&&!e){console.log(` already installed at ${o}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}v(U(o),{recursive:!0}),R(o,it(r,t)),console.log(` wrote ${o}`);let s=n("systemctl",["--user","daemon-reload"],{stdio:"pipe",encoding:"utf8"});if(s.status!==0){let c=(s.stderr||s.stdout||"").trim();throw new Error(`systemctl daemon-reload failed${c?`: ${c}`:""}`)}let i=n("systemctl",["--user","enable","--now",d],{stdio:"pipe",encoding:"utf8"});if(i.status!==0){let c=(i.stderr||i.stdout||"").trim();throw new Error(`systemctl enable --now failed${c?`: ${c}`:""} \u2014 try \`sootsim daemon uninstall\` then retry.`)}let u=(n("systemctl",["--user","is-active",d],{encoding:"utf8"}).stdout||"").trim()||"unknown";console.log(` registered (state: ${u}, journalctl --user -u ${d} to tail logs)`);return}console.error(` sootsim daemon install is not supported on ${process.platform}`),console.error(" run 'sootsim server' in a persistent shell instead"),process.exit(1)}async function ut(){if(process.platform==="darwin"){let t=b(),e=G();e&&console.log(` removed legacy ${j()}`);let r=a(t);r&&(n("launchctl",["bootout",`gui/${process.getuid()}/${p}`],{stdio:"ignore"}),S(t,{force:!0}),console.log(` removed ${t}`));let o=w();a(o)&&(S(o,{recursive:!0,force:!0}),console.log(` removed ${o}`)),!r&&!e&&console.log(" not installed");return}if(process.platform==="linux"){let t=x();if(!a(t)){console.log(" not installed");return}n("systemctl",["--user","disable","--now",d],{stdio:"ignore"}),S(t,{force:!0}),n("systemctl",["--user","daemon-reload"],{stdio:"ignore"}),console.log(` removed ${t}`);return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function dt(){if(process.platform==="darwin"){let t=b();if(!a(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let e=ft(t);e&&console.log(` binary: ${e}`);let r=n("launchctl",["print",`gui/${process.getuid()}/${p}`],{encoding:"utf8"});if(r.status===0){let o=r.stdout.match(/state\s*=\s*(\w+)/)?.[1],s=r.stdout.match(/pid\s*=\s*(\d+)/)?.[1];console.log(` state: ${o||"unknown"}${s?` (pid ${s})`:""}`)}else console.log(" state: not running");return}if(process.platform==="linux"){let t=x();if(!a(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let e=n("systemctl",["--user","is-active",d],{encoding:"utf8"});console.log(` state: ${e.stdout.trim()||"unknown"}`);return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function mt(){if(process.platform==="darwin"){let t=b();a(t)||(console.error(" daemon not registered \u2014 run any sootsim command to bootstrap it"),process.exit(1));let e=n("launchctl",["kickstart","-k",`gui/${process.getuid()}/${p}`],{stdio:"pipe",encoding:"utf8"});e.status!==0&&(console.error(` kickstart failed: ${e.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}if(process.platform==="linux"){let t=x();a(t)||(console.error(" daemon not registered \u2014 run any sootsim command to bootstrap it"),process.exit(1));let e=n("systemctl",["--user","restart",d],{stdio:"pipe",encoding:"utf8"});e.status!==0&&(console.error(` restart failed: ${e.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function pt(){if(process.platform==="darwin"){n("launchctl",["kickstart",`gui/${process.getuid()}/${p}`],{stdio:"inherit"});return}if(process.platform==="linux"){n("systemctl",["--user","start",d],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function gt(){if(process.platform==="darwin"){n("launchctl",["bootout",`gui/${process.getuid()}/${p}`],{stdio:"inherit"});return}if(process.platform==="linux"){n("systemctl",["--user","stop",d],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}function ft(t){try{return et(t,"utf8").match(/<array>\s*<string>([^<]+)<\/string>/)?.[1]||null}catch{return null}}export{lt as daemonInstall,At as runDaemon};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{d as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as f}from"./chunk-3PP3IWBX.js";import{A as x,B as T,C as v,y as D,z as O}from"./chunk-U5LVLKCJ.js";import{b as A}from"./chunk-NY4NHSFE.js";import{c as S,e as $,g as N}from"./chunk-LI5EVOPD.js";import"./chunk-WISEXGFB.js";import"./chunk-SNGLDQLQ.js";import"./chunk-2GKUXZWK.js";import"./chunk-IKTUA2CO.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
|
|
3
3
|
sootsim debug \u2014 drive __sootsimDebug from the terminal
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -167,7 +167,7 @@ examples:
|
|
|
167
167
|
} : null,
|
|
168
168
|
samples,
|
|
169
169
|
}
|
|
170
|
-
})()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-
|
|
170
|
+
})()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-BKIZONOF.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=$(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
|
|
171
171
|
known: ${H.join(", ")}`),process.exit(1));let o=await v(t,"enable",e);console.log(a({active:o},n));break}case"disable":{let e=B(r[0]),o=await v(t,"disable",e);console.log(a({active:o},n));break}case"toggle":{let e=r[0];e||(console.error(" usage: sootsim debug toggle <channel>"),process.exit(1));let o=await c(t,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(a({[e]:o},n));break}case"status":{let e=await D(t);console.log(a(e,n));break}case"channels":{let e=await c(t,"window.__sootsimDebug.channels()");console.log(a(e,n));break}case"flags":{let e=await O(t);console.log(a(e,n));break}case"snapshot":{let e=r[0],o=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await c(t,`(() => { const s = ${o}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(a(s,n));break}case"snapshots":{let e=await c(t,"window.__sootsimDebug.snapshots()");console.log(a(e,n));break}case"diff":{let e=r[0],o=r[1];(!e||!o)&&(console.error(" usage: sootsim debug diff <labelA> <labelB>"),process.exit(1));let s=`(() => {
|
|
172
172
|
const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
|
|
173
173
|
if (!d) return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as S}from"./chunk-FKC2YBG4.js";import"./chunk-TX64GCH3.js";import"./chunk-CDA7FZAZ.js";import"./chunk-7KCT4PGT.js";import"./chunk-NH3HVEBX.js";import"./chunk-BK6LB2J2.js";import"./chunk-UJ32JSVY.js";import"./chunk-Q4U25XDO.js";import"./chunk-NY4NHSFE.js";import"./chunk-F3CDHMRT.js";import"./chunk-45N4MXK2.js";import"./chunk-7X7G5LUX.js";import"./chunk-BKOFXQX4.js";import"./chunk-I6QTUUXO.js";import"./chunk-OHEI4R6Z.js";import"./chunk-FIBNBYEC.js";import"./chunk-NQHG45SY.js";import"./chunk-VDO4QIU7.js";import"./chunk-EALHLLVY.js";import"./chunk-JL46FF4H.js";import"./chunk-EB3HUXF3.js";import"./chunk-LI5EVOPD.js";import"./chunk-WISEXGFB.js";import"./chunk-H6MLMLDA.js";import"./chunk-QFEFKXKP.js";import"./chunk-SNGLDQLQ.js";import"./chunk-2GKUXZWK.js";import"./chunk-IKTUA2CO.js";import{spawn as D}from"child_process";import{existsSync as u,mkdirSync as _,writeFileSync as f,unlinkSync as I}from"fs";import{tmpdir as P}from"os";import{dirname as $,resolve as n,join as M}from"path";function E(){try{let e=import.meta.resolve("sootsim/detox");return $(e.startsWith("file://")?e.slice(7):e)}catch{return n(import.meta.dirname,"..","..","detox")}}var F=`
|
|
3
3
|
sootsim detox \u2014 run detox-style tests against a sootsim shell
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -46,4 +46,4 @@ describe('example', () => {
|
|
|
46
46
|
})
|
|
47
47
|
})
|
|
48
48
|
`),console.log(` created ${r}`)),console.log(`
|
|
49
|
-
next:`),console.log("
|
|
49
|
+
next:`),console.log(" sootsim detox # run the sample"),console.log(" sootsim detox --watch"),process.exit(0)}export{B as runDetox};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.49 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-7KCT4PGT.js";import"./chunk-VDO4QIU7.js";import"./chunk-JL46FF4H.js";import{f as c,g as r,h as g}from"./chunk-EB3HUXF3.js";import{c as d,e as l,h as a}from"./chunk-LI5EVOPD.js";import"./chunk-WISEXGFB.js";import"./chunk-SNGLDQLQ.js";import"./chunk-2GKUXZWK.js";import"./chunk-IKTUA2CO.js";function h(){console.log(`
|
|
3
3
|
sootsim device \u2014 inspect or change the live device preset for a sim
|
|
4
4
|
|
|
5
5
|
usage:
|