sootsim 0.1.134 → 0.1.135
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-VMB2RUAT.js → agent-EV3LMTI2.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-Z3ROMZQZ.js → agent-wrapper-GOUAYJWS.js} +2 -2
- package/dist-cli/chunks/{app-fonts-NMKBEO3H.js → app-fonts-7ZGCVBWL.js} +2 -2
- package/dist-cli/chunks/{assert-6TFSLJZZ.js → assert-CZPAVBXB.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-PRFJ44RD.js +2 -0
- package/dist-cli/chunks/beta-HNHNY7GJ.js +2 -0
- package/dist-cli/chunks/chunk-2RQ5M6MJ.js +13 -0
- package/dist-cli/chunks/{chunk-6BSDH5L3.js → chunk-2VUPH4SQ.js} +1 -1
- package/dist-cli/chunks/{chunk-UKGEBJO7.js → chunk-45Z6VTEC.js} +1 -1
- package/dist-cli/chunks/{chunk-WFKQBUVT.js → chunk-4PJFJ77U.js} +1 -1
- package/dist-cli/chunks/{chunk-7AW6PBDV.js → chunk-56LSJ5RZ.js} +2 -2
- package/dist-cli/chunks/{chunk-M7Y6N4P6.js → chunk-5HFMOWG3.js} +1 -1
- package/dist-cli/chunks/{chunk-Y4KIVYC7.js → chunk-5JSVHUKF.js} +3 -3
- package/dist-cli/chunks/{chunk-QAQTDA4L.js → chunk-5PB5X45Q.js} +2 -2
- package/dist-cli/chunks/{chunk-T3FWQAUS.js → chunk-7TWZYT4A.js} +1 -1
- package/dist-cli/chunks/{chunk-33MZ6O5D.js → chunk-7WF23EDW.js} +2 -2
- package/dist-cli/chunks/{chunk-I2VRBQ5H.js → chunk-AQ6QT2DY.js} +2 -2
- package/dist-cli/chunks/{chunk-M63L7MMI.js → chunk-ASXKBNRL.js} +2 -2
- package/dist-cli/chunks/{chunk-YHX465ER.js → chunk-CLO4G4ZK.js} +1 -1
- package/dist-cli/chunks/{chunk-ORHN5FYU.js → chunk-CYELNMX7.js} +2 -2
- package/dist-cli/chunks/{chunk-T2OFKNEP.js → chunk-DNF7AILW.js} +2 -2
- package/dist-cli/chunks/{chunk-SFXCDLYK.js → chunk-EKZJFBGU.js} +2 -2
- package/dist-cli/chunks/{chunk-A4XRRJER.js → chunk-G7W4URXX.js} +2 -2
- package/dist-cli/chunks/{chunk-ZLITT2QF.js → chunk-GBBGAIOO.js} +1 -1
- package/dist-cli/chunks/chunk-GGLJLJ7P.js +1 -0
- package/dist-cli/chunks/{chunk-ELJTZV3R.js → chunk-IJU5JVF2.js} +1 -1
- package/dist-cli/chunks/{chunk-IGMJFER4.js → chunk-MLNENEA4.js} +1 -1
- package/dist-cli/chunks/{chunk-DUWCLIV5.js → chunk-MLVYS3AE.js} +2 -2
- package/dist-cli/chunks/{chunk-SOK4CAR5.js → chunk-OC5UQFLJ.js} +1 -1
- package/dist-cli/chunks/{chunk-KFH6ED7B.js → chunk-OODLGJLZ.js} +2 -2
- package/dist-cli/chunks/{chunk-OXEBJWSX.js → chunk-PVWYEMAR.js} +1 -1
- package/dist-cli/chunks/{chunk-DWLMWYVM.js → chunk-PWRO2WPW.js} +1 -1
- package/dist-cli/chunks/{chunk-M6PYEFZ2.js → chunk-QDGNAEBR.js} +2 -2
- package/dist-cli/chunks/{chunk-IVDZ3W6A.js → chunk-QDRAULAC.js} +2 -2
- package/dist-cli/chunks/{chunk-646XDTEN.js → chunk-QLXTTGJD.js} +2 -2
- package/dist-cli/chunks/{chunk-R33YPSKP.js → chunk-QMUNA6VQ.js} +3 -3
- package/dist-cli/chunks/{chunk-CFZAP564.js → chunk-S5ZKCSJZ.js} +1 -1
- package/dist-cli/chunks/chunk-TVCTN2EF.js +2 -0
- package/dist-cli/chunks/{chunk-T3LSXEVR.js → chunk-TXDUBB6W.js} +2 -2
- package/dist-cli/chunks/{chunk-SUQFTSA4.js → chunk-U6TZCGUB.js} +1 -1
- package/dist-cli/chunks/{chunk-GKW7BY7I.js → chunk-UM7EEN26.js} +1 -1
- package/dist-cli/chunks/{chunk-BXVFVTB7.js → chunk-UNM45I7B.js} +2 -2
- package/dist-cli/chunks/{chunk-L35AUO7S.js → chunk-UOBTAOWL.js} +2 -2
- package/dist-cli/chunks/chunk-VH4VPAMR.js +1 -0
- package/dist-cli/chunks/{chunk-VT26XQSW.js → chunk-XAVQLMY7.js} +2 -2
- package/dist-cli/chunks/{chunk-45XY4F6P.js → chunk-XMZJQZFB.js} +2 -2
- package/dist-cli/chunks/{chunk-535S34EI.js → chunk-XOK53FNY.js} +1 -1
- package/dist-cli/chunks/{chunk-HXR6XU6C.js → chunk-YQM3RWNV.js} +2 -2
- package/dist-cli/chunks/{chunk-5YFJRLU5.js → chunk-Z5WZKI7J.js} +2 -2
- package/dist-cli/chunks/chunk-ZANDDBFJ.js +1 -0
- package/dist-cli/chunks/{chunk-YY7XLGEP.js → chunk-ZFDBEITH.js} +3 -3
- package/dist-cli/chunks/cli-version-EOI7UVCS.js +2 -0
- package/dist-cli/chunks/{compat-RQSP3A4K.js → compat-DZRWNMC2.js} +3 -3
- package/dist-cli/chunks/{config-GPQXM7XD.js → config-JNO26BKX.js} +2 -2
- package/dist-cli/chunks/{control-OPM5UT5V.js → control-GWQ44GVR.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-SSK4NTBF.js → cpu-profile-2VSK3E45.js} +2 -2
- package/dist-cli/chunks/{daemon-5SXKDVTQ.js → daemon-QMFDDXFF.js} +2 -2
- package/dist-cli/chunks/{debug-VRDAVGN6.js → debug-Q3K4TXLC.js} +3 -3
- package/dist-cli/chunks/demo-app-registry-LDTURANL.js +2 -0
- package/dist-cli/chunks/{detox-IER2FXXY.js → detox-TX4AUV2W.js} +2 -2
- package/dist-cli/chunks/{device-XH546AFN.js → device-E5RRT67Y.js} +2 -2
- package/dist-cli/chunks/{diagnose-IQVAFQGI.js → diagnose-CGHRCXKF.js} +2 -2
- package/dist-cli/chunks/drivers-WF5OT6EA.js +2 -0
- package/dist-cli/chunks/{electron-DGAACAIN.js → electron-YSY7HZBI.js} +3 -3
- package/dist-cli/chunks/flow-PV4WV3DZ.js +2 -0
- package/dist-cli/chunks/help-RZ2M7P7U.js +2 -0
- package/dist-cli/chunks/{hints-27ZUR5TJ.js → hints-V7M7GKXL.js} +2 -2
- package/dist-cli/chunks/{home-paths-6O3WRSPE.js → home-paths-KYTBCLPQ.js} +2 -2
- package/dist-cli/chunks/{inspect-ADZLCQTO.js → inspect-ZUYLUCRJ.js} +3 -3
- package/dist-cli/chunks/install-XLJ4CJUN.js +2 -0
- package/dist-cli/chunks/{install-desktop-MZ47Z4X5.js → install-desktop-HKLVDL7Q.js} +3 -3
- package/dist-cli/chunks/{keys-AU777KZN.js → keys-QJDWORM5.js} +2 -2
- package/dist-cli/chunks/{launch-E34RMXXP.js → launch-CBIYGOV7.js} +3 -3
- package/dist-cli/chunks/{login-J7W3QNG5.js → login-II2EWFHY.js} +4 -4
- package/dist-cli/chunks/{logout-J2YBTA5E.js → logout-E52753SB.js} +2 -2
- package/dist-cli/chunks/{maestro-EZ62M2VG.js → maestro-DUIODHYF.js} +2 -2
- package/dist-cli/chunks/{preview-KRDPFRKF.js → preview-LSVZXF7S.js} +2 -2
- package/dist-cli/chunks/{profile-75A7BSOQ.js → profile-2LUO56EX.js} +2 -2
- package/dist-cli/chunks/{react-UCAXWTQU.js → react-KPNHGOQ3.js} +2 -2
- package/dist-cli/chunks/{record-JIDVPW3G.js → record-LLNZNJSY.js} +2 -2
- package/dist-cli/chunks/runtime-B3RQF5NL.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-J7XQ4ZFI.js → runtime-delivery-A2PZCEPU.js} +2 -2
- package/dist-cli/chunks/{screenshot-IASSDVSN.js → screenshot-OEIH2ETO.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-N5QGF5RE.js → screenshot-mode-3TDLGZPT.js} +2 -2
- package/dist-cli/chunks/{screenshots-T5YPBSYI.js → screenshots-GCJW22B5.js} +2 -2
- package/dist-cli/chunks/{server-OUOF3SW4.js → server-CBH2UYLT.js} +3 -3
- package/dist-cli/chunks/setup-repo-U7XMVCQA.js +2 -0
- package/dist-cli/chunks/{skills-3XZ5EHZS.js → skills-DVPCRUUO.js} +2 -2
- package/dist-cli/chunks/{start-NLEY3RB2.js → start-2T5QRVL2.js} +4 -4
- package/dist-cli/chunks/store-WIQ4ZE4Z.js +2 -0
- package/dist-cli/chunks/telemetry-2XPV6PVU.js +2 -0
- package/dist-cli/chunks/{test-MHLSSGM7.js → test-ZGUHV3XE.js} +3 -3
- package/dist-cli/chunks/{three-mode-E6FNRWW2.js → three-mode-3BUTKBTR.js} +2 -2
- package/dist-cli/chunks/{timeline-2TORZFTW.js → timeline-WS2FXPG2.js} +2 -2
- package/dist-cli/chunks/{upgrade-FT3QFFOF.js → upgrade-FFTCNLCI.js} +2 -2
- package/dist-cli/chunks/upload-JQMTDQMQ.js +2 -0
- package/dist-cli/chunks/{version-WYYMIGAV.js → version-OQOFXNMZ.js} +2 -2
- package/dist-cli/chunks/web-Y2ZMUXP4.js +2 -0
- package/dist-cli/chunks/{what-happened-UVBUSMG3.js → what-happened-5A2RUC6V.js} +2 -2
- package/dist-cli/chunks/{whoami-2Y422P77.js → whoami-ZVM5A34Z.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +30 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.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/scripts/demo-app-registry.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +5 -5
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/dev-bundle-resolution.ts +64 -0
- package/dist-cli/chunks/auto-bootstrap-JD7JT5JS.js +0 -2
- package/dist-cli/chunks/beta-OJZBBTGE.js +0 -2
- package/dist-cli/chunks/chunk-6EO76DWY.js +0 -1
- package/dist-cli/chunks/chunk-IZN3MCHO.js +0 -1
- package/dist-cli/chunks/chunk-KE3EJA7O.js +0 -1
- package/dist-cli/chunks/chunk-LAJCBUZT.js +0 -13
- package/dist-cli/chunks/chunk-WYDL2H2W.js +0 -2
- package/dist-cli/chunks/cli-version-D3EINJYQ.js +0 -2
- package/dist-cli/chunks/demo-app-registry-JJVMXHLB.js +0 -2
- package/dist-cli/chunks/drivers-2HTFK23W.js +0 -2
- package/dist-cli/chunks/flow-3ZYT4CYB.js +0 -2
- package/dist-cli/chunks/help-AS4Z2FND.js +0 -2
- package/dist-cli/chunks/install-P6K5SUCS.js +0 -2
- package/dist-cli/chunks/runtime-ACX43ZIT.js +0 -2
- package/dist-cli/chunks/setup-repo-LJIDHL6S.js +0 -2
- package/dist-cli/chunks/store-GTC6V2PO.js +0 -2
- package/dist-cli/chunks/telemetry-6BJJFDDX.js +0 -2
- package/dist-cli/chunks/upload-ZAAQ5XTC.js +0 -2
- package/dist-cli/chunks/web-NUISI4HO.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as R}from"./chunk-SUQFTSA4.js";import{n as D}from"./chunk-GKW7BY7I.js";import{a as T}from"./chunk-UKGEBJO7.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-JJVMXHLB.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.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R}from"./chunk-U6TZCGUB.js";import{n as D}from"./chunk-UM7EEN26.js";import{a as T}from"./chunk-45Z6VTEC.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-LDTURANL.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{F as P,m as v,n as A,o as h,s as I,u as N}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{F as P,m as v,n as A,o as h,s as I,u as N}from"./chunk-PVWYEMAR.js";import{d as y,h as B,i as E}from"./chunk-EKZJFBGU.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
3
3
|
`)}function V(e){process.stderr.write(`${e}
|
|
4
4
|
`)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function D(e,t,...r){return B(e,`__sootsimTest.${t}`,...r)}async function k(e,t,...r){return E(e,`SootSim.bridges.mainShell.${t}`,...r)}async function z(e,t={}){try{let r=await D(e,"waitForScreenTransitions",q);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function K(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await k(e,t,...n)}catch(o){if(!P(o)||Date.now()>=s)throw o;await w(50)}}async function Q(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let a=0;a<s;a++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function X(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let a=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await a.send({type:"evaluate",code:"1"}),a}catch{a.close()}await w(o)}return null}async function Z(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,a=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let i=await e.send({type:"evaluate",code:v}),g=Date.now()-o,f=Number(i?.nodes)||0,$=Number(i?.targets)||0,x=Number(i?.errors)||0,C=i?.flag===!0,p=i?.externalReady,T=typeof i?.loadingText=="string"?i.loadingText.trim():"",W=typeof i?.externalStatus=="string"?i.externalStatus.trim():"",M=typeof i?.externalError=="string"?i.externalError.trim():"",R=typeof i?.externalError=="string"&&M.length>0;if(c=p,d=R,f!==a&&(a=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,flag:i?.flag,loadingText:T,externalReady:typeof p=="boolean"?p:null,externalStatus:W,externalError:M,errors:x},C&&p!==!1&&!R&&!T&&h({nodes:f,targets:$})&&g-u>=A)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!C)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&h(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function O(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function F(e,t={}){let r=await e.send({type:"evaluate",code:N});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
5
5
|
console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await I(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as R,B as g,C as v,E as w,k as p,t as b,v as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as R,B as g,C as v,E as w,k as p,t as b,v as S}from"./chunk-UM7EEN26.js";import{spawn as I}from"child_process";import P from"crypto";import s from"fs";import l from"path";import{Readable as k}from"stream";import{pipeline as E}from"stream/promises";var M="https://sootbean.com",C="SOOTSIM_CDN_ORIGIN",N="SOOTSIM_RUNTIME_CHANNEL";function $(){try{let e=JSON.parse(s.readFileSync(S(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function m(e){let t=$();return(e||process.env[C]||t.cdnOrigin||M).replace(/\/+$/,"")}function x(e){let t=$();return e||process.env[N]||t.runtimeChannel||"stable"}function T(e){let t=new URL(`${m(e)}/runtimes/manifest.json`);return t.searchParams.set("t",String(Date.now())),t.toString()}function D(e,t){return`${m(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=new URL(`${m(t)}/api/changelog/sootsim`);return r.searchParams.set("page",String(e)),r.searchParams.set("t",String(Date.now())),r.toString()}async function V(e,t){let r=U(e,t),n=await fetch(r,{headers:{Accept:"application/json"}});if(n.status===404)return{product:"sootsim",updatedThrough:null,page:e,pageSize:0,total:0,totalPages:0,hasMore:!1,entries:[]};if(!n.ok)throw new Error(`releases fetch failed: ${n.status} ${n.statusText} (${r})`);return await n.json()}async function K(e){let t=[],r=1;for(let n=0;n<1e3;n++){let i=await V(r,e);if(Array.isArray(i.entries)&&t.push(...i.entries),!i.hasMore||i.entries.length===0)break;r++}return t}function A(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 j(e={}){R();let t=m(e.cdnOrigin),r=await y(t),{version:n,channel:i,entry:o}=A(r,e),a=p(n),c=e.setActive!==!1;if(!e.force&&s.existsSync(l.join(a,"index.html")))return c&&v(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!1,activated:c,manifest:r};let d=o.tarball||D(n,t),f=l.join(b(),`sootsim-runtime-${n}.tar.gz`);process.stderr.write(`sootsim: downloading runtime ${n}\u2026
|
|
3
3
|
`),await _(d,f),process.stderr.write(`sootsim: extracting runtime ${n}\u2026
|
|
4
4
|
`);let h=await z(f);if(h!==o.sha256)throw s.rmSync(f,{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 L(f,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(O){throw s.rmSync(u,{recursive:!0,force:!0}),O}return c&&v(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!0,activated:c,manifest:r}}async function Q(e={}){R();let t=m(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:g()};if(!n.versions[i])return{checked:!0,updated:!1,reason:`manifest is missing version ${i}`,activeVersion:g(),latestVersion:i};let a=g(),c=a?p(a):null,d=c?s.existsSync(l.join(c,"index.html")):!1;if(!(!a||!d||w(i,a)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:a,latestVersion:i};let h=await j({version:i,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,activeVersion:i,latestVersion:i,install:h}}async function X(e={}){let t=g();try{let r=await y(m(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 E(k.fromWeb(r.body),s.createWriteStream(n)),s.renameSync(n,t)}catch(i){try{s.unlinkSync(n)}catch{}throw i}}function z(e){return new Promise((t,r)=>{let n=P.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 L(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{M as a,C as b,N as c,m as d,x as e,T as f,D as g,y as h,U as i,K as j,A as k,j as l,Q as m,X as n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t=4001,n="sootsim close";export{t as a,n as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as d,b as v}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as d,b as v}from"./chunk-S5ZKCSJZ.js";import{a as f,c as w}from"./chunk-Z5WZKI7J.js";import{a as u,b as h,c as m}from"./chunk-CLO4G4ZK.js";import{c as p}from"./chunk-7TWZYT4A.js";function _(){let e=u();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function M(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=u();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await m(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var g={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:_,launch:M};function I(){let e=d();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim install-desktop`)"}}async function x(e){let r=d();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await v(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var y={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:I,launch:x};import{spawn as C}from"child_process";import{closeSync as E,mkdtempSync as A,openSync as L,readFileSync as W}from"fs";import{createRequire as R}from"module";import{tmpdir as b}from"os";import{join as P}from"path";var N=`
|
|
3
3
|
const modulePath = process.env.SOOTSIM_PW_MODULE;
|
|
4
4
|
const url = process.env.SOOTSIM_PW_URL;
|
|
5
5
|
const headless = process.env.SOOTSIM_PW_HEADLESS === '1';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as m,n as P,p as a}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as m,n as P,p as a}from"./chunk-UM7EEN26.js";import l from"fs";import c from"path";var s="default",S="profiles.json",i=1;function o(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function d(){return c.join(a(),S)}function I(e){return`sootsim-profile-${o(e)}`}function h(e){return c.join(P(),"Partitions",I(e))}function A(e){return c.join(a(),"playwright",o(e))}function u(){try{let e=JSON.parse(l.readFileSync(d(),"utf8"));if(!e||e.version!==i)return{version:i,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:o(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:i,profiles:r}}catch{return{version:i,profiles:[]}}}function x(e){return[...e].sort((r,t)=>r.id===s?-1:t.id===s?1:r.id.localeCompare(t.id))}function p(e){if(e.profiles.some(t=>t.id===s))return{...e,profiles:x(e.profiles)};let r=new Date().toISOString();return{version:i,profiles:x([{id:s,createdAt:r,updatedAt:r},...e.profiles])}}function g(e){m();let r=p(e),t=`${d()}.tmp`;return l.writeFileSync(t,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`,"utf8"),l.renameSync(t,d()),r}function y(){return g(u()).profiles}function E(e){let r=o(e);return y().find(t=>t.id===r)??null}function _(e=s){let r=o(e),t=E(r);return t||D(r)}function D(e){let r=o(e),t=p(u());if(t.profiles.some(w=>w.id===r))throw new Error(`profile already exists: ${r}`);let f=new Date().toISOString(),n={id:r,createdAt:f,updatedAt:f};return g({version:i,profiles:[...t.profiles,n]}),n}function F(e){let r=o(e);if(r===s)throw new Error("the default profile cannot be deleted; clear it instead");let t=p(u()),f=t.profiles.find(n=>n.id===r);if(!f)throw new Error(`profile not found: ${r}`);return g({version:i,profiles:t.profiles.filter(n=>n.id!==r)}),v(r),f}function v(e){let r=o(e);for(let t of[h(r),A(r)])try{l.rmSync(t,{recursive:!0,force:!0})}catch{}}export{A as a,y as b,_ as c,D as d,F as e,v as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as u}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as u}from"./chunk-EKZJFBGU.js";import{B as g,G as l,H as m,h as p,i as h,k as w}from"./chunk-UM7EEN26.js";import{closeSync as k,existsSync as f,openSync as P,readSync as S,statSync as b}from"fs";import{homedir as T}from"os";import{resolve as D}from"path";import{WebSocket as $}from"ws";var L=6e4;async function E(){let e=g();if(e&&f(w(e)))return;console.log(" first run \u2014 installing sootsim engine runtime (~6 MB)...");let{runRuntime:t}=await import("./runtime-B3RQF5NL.js");await t(["install"],{})}function W(e,t){return B(e)??t??u()}async function x(e=u(),t=L){if(await c(e,250)||await c(e,1500))return;let n=l();if(n&&m(n)){if(n.bootstrapping===!0&&(await v(t),await c(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(h()){let r=p()?"dev workstations":"dev checkouts";throw new Error(`sootsim bridge daemon is not running on port ${e}.
|
|
3
3
|
${r} don't run a standalone daemon \u2014 the live \`bun dev\` stack hosts the
|
|
4
4
|
bridge in-process on :${e}. start the dev stack (\`bun dev\`) so the CLI can
|
|
5
5
|
reach it, or set SOOTSIM_FORCE_DAEMON_INSTALL=1 to run \`bun sootsim server\`
|
|
6
|
-
standalone here on purpose.`)}console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-
|
|
6
|
+
standalone here on purpose.`)}console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-QMFDDXFF.js");try{await o({port:e,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"?O():null;try{await v(t);let r=Date.now()+5e3;for(;Date.now()<r;){if(await c(e,500))return;await new Promise(s=>setTimeout(s,200))}throw new Error(`daemon registered but the bridge never bound on port ${e} \u2014 see ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}finally{i?.stop()}}async function C(e=u()){await E(),await x(e)}function B(e){for(let t=0;t<e.length;t++){let n=e[t];if((n==="--port"||n==="-p")&&e[t+1]){let o=Number(e[t+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 c(e,t){return new Promise(n=>{let o=new $(`ws://127.0.0.1:${e}`,{handshakeTimeout:t}),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),t)})}async function v(e){let t=Date.now()+e,n;for(;Date.now()<t;){let o=l();if(o&&m(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(e/1e3)}s \u2014 check ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}function d(){return D(T(),"Library/Logs/sootsim/server.err.log")}function O(){let e=d(),t=0;try{f(e)&&(t=b(e).size)}catch{}let n=!1,o=()=>{if(!n){try{if(f(e)){let i=b(e).size;if(i>t){let r=Buffer.alloc(i-t),s=P(e,"r");try{S(s,r,0,r.length,t)}finally{k(s)}t=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<t&&(t=i)}}catch{}setTimeout(o,250)}};return o(),{stop:()=>{n=!0}}}export{E as a,W as b,x as c,C as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-45Z6VTEC.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-Y2ZMUXP4.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-Y2ZMUXP4.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.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-45Z6VTEC.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:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
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,q as n,r as o,s as p,t as q,u as r,v as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (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,q as n,r as o,s as p,t as q,u as r,v as s}from"./chunk-2RQ5M6MJ.js";import"./chunk-QLXTTGJD.js";import"./chunk-XAVQLMY7.js";import"./chunk-PVWYEMAR.js";import"./chunk-OC5UQFLJ.js";import"./chunk-EKZJFBGU.js";import"./chunk-G7W4URXX.js";import"./chunk-YQM3RWNV.js";import"./chunk-S5ZKCSJZ.js";import"./chunk-Z5WZKI7J.js";import"./chunk-VH4VPAMR.js";import"./chunk-CLO4G4ZK.js";import"./chunk-7TWZYT4A.js";import"./chunk-TVCTN2EF.js";import"./chunk-XOK53FNY.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";export{e as buildOpenUrl,d as buildShellUrl,q as closeSimsBulk,r as planBulkCloseTargets,i as playwrightHostPidForSim,g as printConnectedSims,b as resolveBundleTarget,c as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,p as runClaimCommand,s as runCloseCommand,o as runFocusCommand,l as runListCommand,m as runOpenCommand,n as runUseCommand,j as signalDriverLaunchConnected,f as summarizeSimUrl,k as terminatePlaywrightHostsForSims,h as waitForSimMatch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-45Z6VTEC.js";import{mkdirSync as $,writeFileSync as P}from"fs";import{dirname as S,resolve as O}from"path";import{WebSocket as C}from"ws";var v=e=>new Promise(i=>setTimeout(i,e)),w=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(i){this.ws=new C(i,{maxPayload:1<<28}),this.ready=new Promise((t,r)=>{this.ws.once("open",()=>t()),this.ws.once("error",r)}),this.ws.on("message",t=>{let r=JSON.parse(t.toString());if(r.id&&this.pending.has(r.id)){let{res:o,rej:s}=this.pending.get(r.id);this.pending.delete(r.id),r.error?s(new Error(JSON.stringify(r.error))):o(r.result)}else if(r.method)for(let o of this.listeners)o(r.method,r.params)})}waitOpen(){return this.ready}on(i){this.listeners.add(i)}send(i,t={},r){let o=this.nextId++;return new Promise((s,p)=>{this.pending.set(o,{res:s,rej:p}),this.ws.send(JSON.stringify({id:o,method:i,params:t,...r?{sessionId:r}:{}}))})}close(){try{this.ws.close()}catch{}}};async function D(e,i){let t=Number(d(e,"--duration")??"5");if(!Number.isFinite(t)||t<=0)return console.error(" --duration must be a positive number (seconds)"),1;let r=Number(d(e,"--sample-interval")??"0.1"),o=Number(d(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=d(e,"--match")??"/rn/",p=d(e,"--output")??d(e,"-o"),u=O(process.cwd(),p??"/tmp/sootsim.cpuprofile"),g=[];try{g=await(await fetch(`http://localhost:${o}/json/list`)).json()}catch{return T(o),1}let y=g.find(a=>a.type==="page"&&a.url.includes(s));if(!y)return console.error(` no page target matching "${s}" on CDP :${o}`),console.error(` open targets: ${g.map(a=>a.url).join(", ")||"(none)"}`),1;let c=new w(y.webSocketDebuggerUrl);await c.waitOpen();try{let a=new Map;if(c.on((n,l)=>{n==="Target.attachedToTarget"&&l.targetInfo?.type==="worker"&&a.set(l.sessionId,l.targetInfo.url),n==="Target.detachedFromTarget"&&a.delete(l.sessionId)}),await c.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await v(500),a.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let n of a.keys())await c.send("Profiler.enable",{},n),await c.send("Profiler.setSamplingInterval",{interval:r*1e3},n),await c.send("Profiler.start",{},n);console.log(` recording ${t}s across ${a.size} worker(s) \u2014 interact now\u2026`),await v(t*1e3);let m=[];for(let[n,l]of a){let{profile:f}=await c.send("Profiler.stop",{},n);m.push({url:l,profile:f})}return m.sort((n,l)=>l.profile.samples.length-n.profile.samples.length),$(S(u),{recursive:!0}),m.forEach((n,l)=>{let f=l===0?u:u.replace(/(\.[^.]+)?$/,`.worker${l}$1`);if(P(f,JSON.stringify(n.profile)),console.log(` ${b(n.url)}: ${n.profile.samples.length} samples \u2192 ${f}`),i.verbose&&n.profile.samples.length>0)for(let h of k(n.profile,12))console.log(` ${h.pct.toFixed(1).padStart(5)}% ${h.name} ${h.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{c.close()}}function T(e){console.error(` cpu-profile needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` sootsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` sootsim cpu-profile --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox --in-process-gpu \\"),console.error(" --use-gl=angle --use-angle=swiftshader --enable-unsafe-swiftshader \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function b(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function k(e,i){let t=e.samples.length||1,r=new Map;for(let o of e.nodes){let s=o.callFrame,p=`${s.functionName||"(anonymous)"}@${b(s.url)}:${s.lineNumber}`,u=r.get(p)??{self:0,name:s.functionName||"(anonymous)",url:`${b(s.url)}:${s.lineNumber}`};u.self+=o.hitCount??0,r.set(p,u)}return[...r.values()].map(o=>({...o,pct:o.self/t*100})).sort((o,s)=>s.self-o.self).slice(0,i)}function d(e,i){let t=e.indexOf(i);if(!(t<0||t===e.length-1))return e[t+1]}export{D as runCpuProfile};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as _,b as N}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as _,b as N}from"./chunk-DNF7AILW.js";import"./chunk-5PB5X45Q.js";import{c as O}from"./chunk-ASXKBNRL.js";import"./chunk-CYELNMX7.js";import"./chunk-PWRO2WPW.js";import"./chunk-TVCTN2EF.js";import"./chunk-XOK53FNY.js";import"./chunk-GBBGAIOO.js";import"./chunk-IJU5JVF2.js";import"./chunk-4PJFJ77U.js";import{h as I,i as C,q as T,r as w,s as B}from"./chunk-UM7EEN26.js";import{a as Y}from"./chunk-45Z6VTEC.js";import{execFileSync as rt,spawnSync as s}from"child_process";import{existsSync as c,mkdirSync as S,readFileSync as ot,rmSync as v,writeFileSync as M}from"fs";import{homedir as $}from"os";import{dirname as V,resolve as m}from"path";import{execFileSync as K}from"child_process";import{chmodSync as X,mkdirSync as D,rmSync as Q,writeFileSync as E}from"fs";import{dirname as L}from"path";var z="dev.sootsim.daemon",R="SootSim Daemon",F="0.1.36";function U(t,e,o){let r=w(),n=B(),a=L(L(n)),y=L(n),u=`${a}/Resources`;Q(r,{recursive:!0,force:!0}),D(T(),{recursive:!0}),D(y,{recursive:!0}),D(u,{recursive:!0}),E(`${a}/Info.plist`,J()),E(`${a}/PkgInfo`,"APPL????"),E(n,Z(t,e,o)),X(n,493);try{K("codesign",["--force","--sign","-","--deep",r],{stdio:"pipe"})}catch(i){let d=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${r} failed: ${d}
|
|
3
3
|
the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:r,launcherPath:n}}function J(){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">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{f,m as T}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{f,m as T}from"./chunk-XAVQLMY7.js";import{I as A,J as D,K as O,L as x,M as v}from"./chunk-PVWYEMAR.js";import{c as S,e as $,g as N}from"./chunk-EKZJFBGU.js";import"./chunk-7TWZYT4A.js";import"./chunk-XOK53FNY.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.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-ZUYLUCRJ.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 A(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 D(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{a as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as S}from"./chunk-5JSVHUKF.js";import"./chunk-OODLGJLZ.js";import"./chunk-GGLJLJ7P.js";import"./chunk-AQ6QT2DY.js";import"./chunk-UNM45I7B.js";import"./chunk-7WF23EDW.js";import"./chunk-QDRAULAC.js";import"./chunk-2RQ5M6MJ.js";import"./chunk-QLXTTGJD.js";import"./chunk-XAVQLMY7.js";import"./chunk-PVWYEMAR.js";import"./chunk-OC5UQFLJ.js";import"./chunk-EKZJFBGU.js";import"./chunk-G7W4URXX.js";import"./chunk-YQM3RWNV.js";import"./chunk-S5ZKCSJZ.js";import"./chunk-Z5WZKI7J.js";import"./chunk-VH4VPAMR.js";import"./chunk-CLO4G4ZK.js";import"./chunk-7TWZYT4A.js";import"./chunk-DNF7AILW.js";import"./chunk-5PB5X45Q.js";import"./chunk-CYELNMX7.js";import"./chunk-TVCTN2EF.js";import"./chunk-XOK53FNY.js";import"./chunk-MLVYS3AE.js";import"./chunk-4PJFJ77U.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.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:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-GGLJLJ7P.js";import{c as d,e as l,h as a}from"./chunk-EKZJFBGU.js";import"./chunk-7TWZYT4A.js";import"./chunk-CYELNMX7.js";import"./chunk-XOK53FNY.js";import"./chunk-MLVYS3AE.js";import{f as c,g as r,h as g}from"./chunk-4PJFJ77U.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.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:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as E,e as R,h as b}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as E,e as R,h as b}from"./chunk-EKZJFBGU.js";import{b as v}from"./chunk-7TWZYT4A.js";import"./chunk-XOK53FNY.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
|
|
3
3
|
sootsim diagnose \u2014 compact "what just went wrong?" report
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-ZANDDBFJ.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-YQM3RWNV.js";import"./chunk-S5ZKCSJZ.js";import"./chunk-Z5WZKI7J.js";import"./chunk-VH4VPAMR.js";import"./chunk-CLO4G4ZK.js";import"./chunk-7TWZYT4A.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";export{e as ALL_DRIVERS,i as buildDriverListRows,a as chromiumDriver,b as electronDriver,f as getAllDrivers,g as getDriver,c as playwrightDriver,h as resolveDriver,d as systemDriver};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as g}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as g}from"./chunk-MLNENEA4.js";import"./chunk-ZANDDBFJ.js";import{a as v,g as h}from"./chunk-2RQ5M6MJ.js";import"./chunk-QLXTTGJD.js";import"./chunk-XAVQLMY7.js";import"./chunk-PVWYEMAR.js";import"./chunk-OC5UQFLJ.js";import"./chunk-EKZJFBGU.js";import"./chunk-G7W4URXX.js";import{b as f,g as u}from"./chunk-YQM3RWNV.js";import{a as p}from"./chunk-S5ZKCSJZ.js";import{c as m}from"./chunk-Z5WZKI7J.js";import"./chunk-VH4VPAMR.js";import"./chunk-CLO4G4ZK.js";import"./chunk-7TWZYT4A.js";import"./chunk-TVCTN2EF.js";import"./chunk-XOK53FNY.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";function b(e){let r=e.indexOf("--port");if(r<0)return;let o=e[r+1],i=o?Number(o):Number.NaN;return(!Number.isInteger(i)||i<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),i}async function O(e,r){let o=b(e)??r.port;return o?h(String(o)):void 0}async function $(e,r){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim electron \u2014 launch the desktop companion
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -15,4 +15,4 @@ examples:
|
|
|
15
15
|
sootsim electron
|
|
16
16
|
sootsim electron --port 5173
|
|
17
17
|
sootsim electron --profile qa
|
|
18
|
-
`),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-
|
|
18
|
+
`),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-HKLVDL7Q.js");await I(["--yes"]),n=p()}n||process.exit(1)}console.log(` launching ${n.path}`)}let w=await O(e,r),c=await l.launch({url:w,device:r.device,profileId:x,ephemeralProfile:d});c.launched||(console.error(` ${c.message}`),process.exit(1)),console.log(` ${c.message}`)}export{O as resolveElectronLaunchUrl,$ as runElectron};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as c,b as d,c as e,d as f}from"./chunk-5JSVHUKF.js";import"./chunk-OODLGJLZ.js";import"./chunk-GGLJLJ7P.js";import"./chunk-AQ6QT2DY.js";import"./chunk-UNM45I7B.js";import"./chunk-7WF23EDW.js";import{d as a,e as b}from"./chunk-QDRAULAC.js";import"./chunk-2RQ5M6MJ.js";import"./chunk-QLXTTGJD.js";import"./chunk-XAVQLMY7.js";import"./chunk-PVWYEMAR.js";import"./chunk-OC5UQFLJ.js";import"./chunk-EKZJFBGU.js";import"./chunk-G7W4URXX.js";import"./chunk-YQM3RWNV.js";import"./chunk-S5ZKCSJZ.js";import"./chunk-Z5WZKI7J.js";import"./chunk-VH4VPAMR.js";import"./chunk-CLO4G4ZK.js";import"./chunk-7TWZYT4A.js";import"./chunk-DNF7AILW.js";import"./chunk-5PB5X45Q.js";import"./chunk-CYELNMX7.js";import"./chunk-TVCTN2EF.js";import"./chunk-XOK53FNY.js";import"./chunk-MLVYS3AE.js";import"./chunk-4PJFJ77U.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";export{c as discoverSootsimUrl,e as hoistLeadingSimFlag,a as parseFlowFile,f as runFlow,d as runFlowPlayback,b as validateFlowFile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c}from"./chunk-ASXKBNRL.js";import"./chunk-CYELNMX7.js";import"./chunk-PWRO2WPW.js";import"./chunk-TVCTN2EF.js";import"./chunk-XOK53FNY.js";import"./chunk-GBBGAIOO.js";import"./chunk-IJU5JVF2.js";import"./chunk-4PJFJ77U.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as n,c as r,d as l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as n,c as r,d as l}from"./chunk-56LSJ5RZ.js";import"./chunk-7TWZYT4A.js";import"./chunk-45Z6VTEC.js";function a(t){let s=t[0]??"list";if(s==="reset"){t[1]==="global"?(r(),console.log(" cleared global hint state")):(n(),console.log(" cleared hint state for this CLI identity"));return}if(s==="list"){let e=l();if(!e.length){console.log(" no hints registered");return}let i=Math.max(...e.map(o=>o.id.length));console.log(" registered hints:");for(let o of e){let c=typeof o.frequency=="string"?o.frequency:`cooldown ${o.frequency.cooldownMs}ms`;console.log(` ${o.id.padEnd(i)} ${c}`)}console.log(""),console.log(" env overrides:"),console.log(" SOOTSIM_HINTS=off suppress all hints"),console.log(" SOOTSIM_HINTS=always show every hint every time");return}console.error(` unknown subcommand: ${s}`),console.error(" usage:"),console.error(" sootsim hints list show registered hints"),console.error(" sootsim hints reset [global] clear shown-state"),process.exit(1)}export{a as runHints};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A,B,C,D,E,F,G,H,I,J,K,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A,B,C,D,E,F,G,H,I,J,K,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,F as activeRuntimeDir,l as activeRuntimeFile,t as cacheDir,J as claimDaemonLockfile,E as compareSemver,v as configFilePath,r as daemonAppBundlePath,q as daemonAppDir,s as daemonAppLauncherPath,u as daemonLockfilePath,m as electronDir,n as electronUserDataDir,o as electronVersionDir,A as ensureSootsimHome,H as isDaemonLockfileFresh,h as isDevWorkstation,g as isSootsimDevCheckout,D as listInstalledRuntimes,p as profilesDir,B as readActiveRuntime,G as readDaemonLockfile,w as readSharedConfig,y as readTelemetryEnabled,K as removeDaemonLockfile,k as runtimeDir,j as runtimesDir,i as shouldSkipPersistentDaemon,f as sootsimHomeDir,C as writeActiveRuntime,I as writeDaemonLockfile,x as writeSharedConfig,z as writeTelemetryEnabled};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as G}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as G}from"./chunk-56LSJ5RZ.js";import{a as wt,b as xt}from"./chunk-2VUPH4SQ.js";import{a as Ye,h as $e,k as ee}from"./chunk-QDRAULAC.js";import{b as $t,c as St,j as vt}from"./chunk-2RQ5M6MJ.js";import"./chunk-QLXTTGJD.js";import{a as Z,b as A,c as P,d as Pe,e as re,f as Y,g as ce,h as pe,i as yt,j as ht,k as Re,l as bt}from"./chunk-XAVQLMY7.js";import{A as mt,E as pt,G as le,H as ft,N as gt,a as be,b as Ge,c as Xe,d as Ve,e as Qe,f as Ze,g as et,h as tt,i as ot,j as st,k as _e,l as Oe,p as Ae,q as nt,r as rt,s as we,t as it,u as xe,v as at,w as lt,x as ct,y as dt,z as ut}from"./chunk-PVWYEMAR.js";import"./chunk-OC5UQFLJ.js";import{c as He,e as Ue,f as Ke,g as ze,h as Fe}from"./chunk-EKZJFBGU.js";import"./chunk-G7W4URXX.js";import"./chunk-YQM3RWNV.js";import"./chunk-S5ZKCSJZ.js";import"./chunk-Z5WZKI7J.js";import"./chunk-VH4VPAMR.js";import"./chunk-CLO4G4ZK.js";import{b as qe}from"./chunk-7TWZYT4A.js";import{a as Je}from"./chunk-5HFMOWG3.js";import{a as Ie,c as Ne}from"./chunk-PWRO2WPW.js";import{a as We}from"./chunk-TVCTN2EF.js";import"./chunk-XOK53FNY.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";import{existsSync as co,mkdirSync as uo,readFileSync as mo,rmSync as kt,writeFileSync as po}from"fs";import{tmpdir as fo}from"os";import{dirname as go,join as yo,resolve as ho}from"path";var fe=1,bo="SOOTSIM_INSPECT_NOTICE_PATH",wo=300*1e3,xo=15e3;function Tt(){return ho(process.env[bo]||yo(fo(),"sootsim-inspect-notice-state.json"))}function $o(e,c){return Object.fromEntries(Object.entries(e).filter(([,n])=>typeof n?.signature=="string"&&Number.isFinite(n?.updatedAt)&&c-n.updatedAt<=wo))}function So(e){let c=Tt();if(!co(c))return{version:fe,entries:{}};try{let n=JSON.parse(mo(c,"utf8"));return n.version!==fe||!n.entries||typeof n.entries!="object"?(kt(c,{force:!0}),{version:fe,entries:{}}):{version:fe,entries:$o(n.entries,e)}}catch{return kt(c,{force:!0}),{version:fe,entries:{}}}}function vo(e){let c=Tt();uo(go(c),{recursive:!0}),po(c,JSON.stringify(e,null,2)+`
|
|
3
3
|
`)}function ko(e,c){let n=c.trim()||"default";return`${e}:${n}`}function Ee(e,c,n,l={}){let m=l.nowMs??Date.now(),r=l.cooldownMs??xo,g=So(m),y=ko(e,c),T=g.entries[y];return T&&T.signature===n&&m-T.updatedAt<r?!1:(g.entries[y]={signature:n,updatedAt:m},vo(g),!0)}var To={initialWaitMs:3e3,deadlineMs:5e3,retryWaitMs:700},Mo={initialWaitMs:1200,deadlineMs:2500,retryWaitMs:700};function Io(e,c={}){return{...e?To:Mo,...c}}function de(e){return!(!e||e.hit===!1||e.ok===!1||e.pointerTapHandled===!1&&!e.keyboardOpened&&!e.isTextInput)}function No(e,c){return{id:e.target?.id??e.match?.id??e.node?.id??null,testID:e.target?.testID??e.match?.testID??e.node?.testID??null,text:e.target?.text??e.target?.accessibilityLabel??e.match?.text??e.match?.accessibilityLabel??e.node?.text??c??null,type:e.target?.type??e.match?.type??e.node?.type??null}}async function ge(e,c){let n=Io(!!c.agent,c.timing),l=0,m=null,r=null;try{await ee({bridge:e,maxMs:n.initialWaitMs,pollMs:32,stablePolls:2})}catch{}let g=Date.now()+n.deadlineMs;for(;Date.now()<=g||l===0;){l++;let y=await c.resolve();if(m=y,y?.error==="bridge-not-ready"||y?.ambiguous||y?.nthOutOfRange)return{payload:y,result:null,attempts:l,failure:"special"};if(y&&typeof y.cx=="number"&&typeof y.cy=="number"){let M=await e.send({type:"tap",x:y.cx,y:y.cy,target:No(y,c.textFallback)});if(r=M,de(M))return{payload:y,result:M,attempts:l}}let T=g-Date.now();if(T<=0)break;try{await ee({bridge:e,maxMs:Math.min(T,n.retryWaitMs),pollMs:32,stablePolls:2})}catch{await new Promise(M=>setTimeout(M,Math.min(120,T)))}}return{payload:m,result:r,attempts:l,failure:m&&typeof m.cx=="number"?"missed":"not-found"}}async function Mt(e,c,n,l){return e.send({type:"tap",x:c,y:n,...l?{target:l}:{}})}async function It(e,c,n={}){let l=JSON.stringify(c);return ge(e,{agent:n.agent,timing:n.timing,resolve:()=>e.send({type:"evaluate",code:`(async () => {
|
|
4
4
|
const t = window.__sootsimTest
|
|
5
5
|
if (!t) return null
|
|
@@ -315,7 +315,7 @@ import{a as G}from"./chunk-7AW6PBDV.js";import{a as wt,b as xt}from"./chunk-6BSD
|
|
|
315
315
|
`);console.log(`${t??""}
|
|
316
316
|
|
|
317
317
|
${s}
|
|
318
|
-
`),process.exit(0)}let _=m.wsPort,I=m.simId,R=m.simIdSource,j=m.commandTimeoutMs;if(g==="list"&&l.some(o=>o==="--drivers"||o==="-D")){let{buildDriverListRows:o}=await import("./drivers-
|
|
318
|
+
`),process.exit(0)}let _=m.wsPort,I=m.simId,R=m.simIdSource,j=m.commandTimeoutMs;if(g==="list"&&l.some(o=>o==="--drivers"||o==="-D")){let{buildDriverListRows:o}=await import("./drivers-WF5OT6EA.js"),t=o();console.log(` available drivers (${t.length}):
|
|
319
319
|
`);let s=Math.max(...t.map(a=>a.id.length),6),i=Math.max(...t.map(a=>a.kind.length),4);for(let a of t){let u=a.available?"\u2713":"\u2717",p=a.id.padEnd(s),b=a.kind.padEnd(i);console.log(` ${u} ${p} ${b} ${a.description}`),a.available&&a.detail?console.log(` ${a.detail}`):!a.available&&a.reason&&console.log(` unavailable: ${a.reason}`)}return}let d=Ue(m),z=I||"default",B=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","list","wait","sleep"]),D=200;function V(o){let t=o.replace(/\s+/g," ").trim();if(!t)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(t)){let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o)?.[1]?.trim(),a=/<body[^>]*>([\s\S]*?)<\//i.exec(o)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),u=i||a||"html error page";return`<html ${o.length}B> "${u}" (body elided \u2014 add --json for the full payload)`}return t.length<=D?t:`${t.slice(0,D)}\u2026 (+${t.length-D} more bytes)`}function te(o){let t=o.displayUrl||o.url;return o.status!=null?`${o.method} ${t} -> ${o.status}${o.statusText?` ${o.statusText}`:""}`:o.error?`${o.method} ${t} -> ${o.error}`:`${o.method} ${t}`}async function S(o){let t=ue()?5e3:1500;try{let{settled:s,elapsed:i}=await ee({bridge:o,maxMs:t,pollMs:32,stablePolls:2});s||process.stderr.write(` \u26A0 auto-wait timed out after ${i??t}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
|
|
320
320
|
`)}catch{}}function N(o,t){console.error(` tap failed: ${o} stayed visible but did not receive a hittable press after ${t.attempts} attempt${t.attempts===1?"":"s"}`),t.result&&console.error(` last result: ${JSON.stringify(t.result)}`)}async function J(){try{return await d.send({type:"evaluate",code:`(() => ({
|
|
321
321
|
console: ${xe},
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as o}from"./chunk-QDGNAEBR.js";import"./chunk-MLNENEA4.js";import"./chunk-ZFDBEITH.js";import"./chunk-EKZJFBGU.js";import"./chunk-7TWZYT4A.js";import"./chunk-DNF7AILW.js";import"./chunk-5PB5X45Q.js";import"./chunk-XOK53FNY.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";async function t(n){console.error(" note: `sootsim install` is now `sootsim setup-repo`. forwarding\u2026\n"),await o(n)}export{t as runInstall};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as b}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as b}from"./chunk-MLNENEA4.js";import{a as x}from"./chunk-S5ZKCSJZ.js";import"./chunk-45Z6VTEC.js";import{spawn as v,spawnSync as u}from"child_process";import{chmodSync as S,copyFileSync as T,createWriteStream as E,existsSync as w,mkdirSync as y,rmSync as g,statSync as P,unlinkSync as D}from"fs";import{tmpdir as M}from"os";import{dirname as A,join as f,resolve as k}from"path";var h="https://sootbean.com/api/electron-release";function O(){let n=process.arch;if(process.platform==="darwin"){let o=n==="arm64"?"mac-arm64":"mac-x64",e=`sootsim-latest-${o}.dmg`;return{platform:o,filename:e,url:`${h}/${e}`,install:L}}if(process.platform==="linux"){let o=n==="arm64"?"linux-arm64":"linux-x64",e=`sootsim-latest-${o}.AppImage`;return{platform:o,filename:e,url:`${h}/${e}`,install:C}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:B}}return null}async function _({url:n,dest:o,onProgress:e}){let s=await fetch(n,{redirect:"follow"});if(!s.ok)throw new Error(`download failed: ${s.status} ${s.statusText} (${n})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error("download failed: empty response body");y(A(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,e?.(c,a)}}finally{await new Promise((l,p)=>{i.end(r=>r?p(r):l())})}}function I(n,o){let e=(n/1048576).toFixed(1);if(!o)return` ${e} MB`;let s=Math.min(100,Math.round(n/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${e} / ${t} MB`}async function L(n){let o=u("hdiutil",["attach","-nobrowse","-readonly",n],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let e=o.stdout.trim().split(`
|
|
3
3
|
`),t=e[e.length-1].split(" ").pop()?.trim();if(!t||!w(t))throw new Error(`could not determine dmg mount point (output: ${o.stdout})`);let a=f(t,"sootsim.app");if(!w(a))throw u("hdiutil",["detach","-force",t]),new Error(`sootsim.app not found inside ${t}`);let i="/Applications",d=k(process.env.HOME||"","Applications"),c=i;try{let m=f(i,`.sootsim-write-probe-${process.pid}`);u("touch",[m]),w(m)?g(m,{force:!0}):c=d}catch{c=d}c===d&&y(c,{recursive:!0});let l=f(c,"sootsim.app");w(l)&&g(l,{recursive:!0,force:!0});let p=u("cp",["-R",a,l]),r=u("hdiutil",["detach","-force",t]);if(p.status!==0)throw new Error(`copy to ${l} failed: ${p.stderr?.toString()||""}`.trim());return r.status!==0&&console.warn(` warning: failed to unmount ${t} (${r.stderr?.toString().trim()||"unknown error"})`),u("xattr",["-dr","com.apple.quarantine",l]),l}async function C(n){let o=k(process.env.HOME||"","Applications");y(o,{recursive:!0});let e=f(o,"sootsim.AppImage");return w(e)&&g(e,{force:!0}),T(n,e),D(n),S(e,493),e}async function B(n){return await new Promise((o,e)=>{let s=v("cmd",["/c","start",'""',"/wait",n],{stdio:"inherit"});s.once("error",e),s.once("exit",t=>{t===0?o():e(new Error(`installer exited with code ${t}`))})}),n}async function G(n){(n.includes("--help")||n.includes("-h"))&&(console.log(`
|
|
4
4
|
sootsim install-desktop \u2014 download and install the optional desktop GUI
|
|
5
5
|
|
|
@@ -20,4 +20,4 @@ examples:
|
|
|
20
20
|
`),process.exit(0));let o=n.includes("--yes")||n.includes("-y")||process.env.SOOTSIM_NO_PROMPT==="1"||process.env.CI==="1"||!process.stdin.isTTY,e=n.includes("--force"),s=x();if(s&&!e){console.log(` sootsim desktop already installed at: ${s.path}`),console.log(" pass --force to reinstall.");return}let t=O();if(t||(console.error(` no desktop build available for ${process.platform}/${process.arch}.`),console.error(" supported: darwin-arm64, darwin-x64, linux-x64, win32-x64"),process.exit(1)),console.log(` platform: ${t.platform}`),console.log(` download: ${t.url}`),console.log(),!o){if(!await b("download and install now?",!0)){console.log(" cancelled.");return}console.log()}let a=f(M(),`sootsim-install-${Date.now()}`),i=f(a,t.filename),d=0;process.stdout.write(` downloading ${t.filename}...
|
|
21
21
|
`);try{await _({url:t.url,dest:i,onProgress:(r,m)=>{let $=Date.now();$-d<100&&r<(m??1/0)||(d=$,process.stdout.isTTY&&process.stdout.write(`\r\x1B[2K${I(r,m)}`))}})}catch(r){g(a,{recursive:!0,force:!0}),console.error(`
|
|
22
22
|
download failed: ${r instanceof Error?r.message:String(r)}`),process.exit(1)}process.stdout.isTTY&&process.stdout.write(`
|
|
23
|
-
`);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-
|
|
23
|
+
`);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-2XPV6PVU.js");try{let r=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${r}`)}catch(r){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:r instanceof Error?r.message:String(r)}}),await p(),console.error(` install failed: ${r instanceof Error?r.message:String(r)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim electron launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{G as runInstallDesktop};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as l,b as d,c as k,d as y,e as g}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as l,b as d,c as k,d as y,e as g}from"./chunk-7WF23EDW.js";import{d as c}from"./chunk-5PB5X45Q.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";async function a(){let s=await c();return s?.token||(process.stderr.write(" sootsim keys ... needs you to be signed in.\n run `sootsim login` first.\n"),process.exit(1)),{origin:s.origin,token:s.token}}function f(s){if(!s)return"never";try{return new Date(s).toLocaleString()}catch{return s}}async function h(s){let i=s[0];if(!i||i==="--help"||i==="-h"){u();return}if(i==="list"){let{origin:o,token:e}=await a(),n=await fetch(`${o.replace(/\/$/,"")}/api/sootsim/billing/keys`,{headers:{authorization:`Bearer ${e}`}});n.ok||(console.error(` keys list failed (${n.status})`),process.exit(1));let{keys:r}=await n.json();if(r.length===0){console.log(" no keys. create one with `sootsim keys create <label>`.");return}for(let t of r)console.log(` ${t.keyPrefix}\u2026 ${t.label.padEnd(24)} scopes=${t.scopes.join(",")} last=${f(t.lastUsedAt)} id=${t.id}`);return}if(i==="create"){let o=s[1]?.trim();o||(console.error(" usage: sootsim keys create <label>"),process.exit(1));let{origin:e,token:n}=await a(),r=await fetch(`${e.replace(/\/$/,"")}/api/sootsim/billing/keys`,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},body:JSON.stringify({label:o})});r.ok||(console.error(` keys create failed (${r.status}): ${await r.text()}`),process.exit(1));let t=await r.json();console.log(`
|
|
3
3
|
created: ${t.record.label} (${t.record.keyPrefix}\u2026)`),console.log(` scopes: ${t.record.scopes.join(",")}`),console.log(`
|
|
4
4
|
secret: ${t.secret}
|
|
5
5
|
`),console.log(` copy this now \u2014 we can't show it again.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-ZANDDBFJ.js";import{b as h}from"./chunk-YQM3RWNV.js";import{a as d}from"./chunk-S5ZKCSJZ.js";import"./chunk-Z5WZKI7J.js";import"./chunk-VH4VPAMR.js";import"./chunk-CLO4G4ZK.js";import"./chunk-7TWZYT4A.js";import{A as t,B as u,F as m,G as r,H as a,h as l,i as c}from"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";import{spawn as v}from"child_process";import{existsSync as w}from"fs";async function O(n){if(n.includes("--help")||n.includes("-h")){console.log(`
|
|
3
3
|
sootsim launch \u2014 one-shot: install runtime if needed, start daemon, open app
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -13,4 +13,4 @@ options:
|
|
|
13
13
|
examples:
|
|
14
14
|
sootsim launch
|
|
15
15
|
sootsim launch --version 1.2.3
|
|
16
|
-
`);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),s=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;t(),await x({skipAutoInstall:e,channel:s,explicitVersion:f}),await p(),await k()}async function x(n){let e=u(),i=m();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:s}=await import("./runtime-
|
|
16
|
+
`);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),s=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;t(),await x({skipAutoInstall:e,channel:s,explicitVersion:f}),await p(),await k()}async function x(n){let e=u(),i=m();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:s}=await import("./runtime-B3RQF5NL.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await s(["install",...o],{channel:n.channel})}async function p(){let n=r();if(a(n))return;if(c()){let o=l()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";console.error(` not spawning a standalone sootsim daemon \u2014 ${o}.`),console.error(" the live `bun dev` stack hosts the bridge in-process (run it, or its electron);"),console.error(" set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose."),process.exit(1)}console.log("sootsim: starting daemon");let e=g();v(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let s=Date.now()+8e3;for(;Date.now()<s;){let o=r();if(a(o))return;await D(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function k(){d()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await h.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function g(){let n=process.argv[1];return n&&w(n)?n:"sootsim"}function D(n){return new Promise(e=>setTimeout(e,n))}async function R(){t(),await p()}export{R as ensureDaemonRunning,O as runLaunch};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as g,d as m}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.135 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as g,d as m}from"./chunk-5PB5X45Q.js";import"./chunk-UM7EEN26.js";import"./chunk-45Z6VTEC.js";import{exec as S}from"node:child_process";import{randomBytes as $}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${h}/api/auth/me`)).ok)return h}catch{}return I}function L(){console.log(`
|
|
3
3
|
sootsim login \u2014 sign in so desktop uploads can attach to your account
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -21,6 +21,6 @@ options:
|
|
|
21
21
|
<p style="color:#ccc">${r}</p>
|
|
22
22
|
</div>
|
|
23
23
|
</body>
|
|
24
|
-
</html>`}async function P(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!e.ok){let c=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${c}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function A(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe")}catch{return!1}}async function G(r){(r.includes("--help")||r.includes("-h"))&&(L(),process.exit(0));let e=[...r],t=await x(R(e,"--origin"));if(A(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await P(t);if(o.ok){g({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let s=await m(t),l=s?.user?.email||o.email||s?.user?.id||o.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-
|
|
24
|
+
</html>`}async function P(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!e.ok){let c=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${c}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function A(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe")}catch{return!1}}async function G(r){(r.includes("--help")||r.includes("-h"))&&(L(),process.exit(0));let e=[...r],t=await x(R(e,"--origin"));if(A(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await P(t);if(o.ok){g({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let s=await m(t),l=s?.user?.email||o.email||s?.user?.id||o.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-2XPV6PVU.js");n({event:"cli_login_succeeded",identity:{userId:o.userId??s?.user?.id??null},properties:{origin:t,mode:"dev"}}),await a(),console.log(` signed in${l?` as ${l}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let c=$(16).toString("hex"),i=await new Promise(o=>{let s=_.createServer((l,n)=>{try{let a=new URL(l.url||"/","http://127.0.0.1"),w=a.searchParams.get("state"),k=a.searchParams.get("token"),b=a.searchParams.get("email")||void 0,O=a.searchParams.get("userId")||void 0,f=a.searchParams.get("error");if(n.setHeader("content-type","text/html; charset=utf-8"),f){n.end(u(`sign-in failed: ${f}`)),o({ok:!1,error:f}),s.close();return}if(w!==c){n.end(u("state mismatch. close this tab and retry `sootsim login`.")),o({ok:!1,error:"state mismatch"}),s.close();return}if(!k){n.end(u("missing token. close this tab and retry `sootsim login`.")),o({ok:!1,error:"missing token"}),s.close();return}n.end(u("sign-in complete. you can return to the terminal.")),o({ok:!0,token:k,email:b,userId:O}),s.close()}catch(a){n.statusCode=500,n.end(u("sign-in callback failed. retry `sootsim login`.")),o({ok:!1,error:a instanceof Error?a.message:"callback failed"}),s.close()}});s.listen(0,"127.0.0.1",()=>{let l=s.address();if(!l||typeof l=="string"){o({ok:!1,error:"failed to bind callback server"}),s.close();return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",c),n.searchParams.set("port",String(l.port)),n.searchParams.set("sootbean",t),console.log(" opening browser for sootsim login..."),console.log(` waiting for callback on 127.0.0.1:${l.port}`),console.log(` if nothing opens, visit:
|
|
25
25
|
${n.toString()}
|
|
26
|
-
`),T(n.toString())})});if(!i.ok){let{trackCliEvent:o,flushCliTelemetry:s}=await import("./telemetry-
|
|
26
|
+
`),T(n.toString())})});if(!i.ok){let{trackCliEvent:o,flushCliTelemetry:s}=await import("./telemetry-2XPV6PVU.js");o({event:"cli_login_failed",properties:{origin:t,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}g({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:t,source:"cli"});let d=await m(t),p=d?.user?.email||i.email||d?.user?.id||i.userId,{trackCliEvent:y,flushCliTelemetry:v}=await import("./telemetry-2XPV6PVU.js");y({event:"cli_login_succeeded",identity:{userId:i.userId??d?.user?.id??null},properties:{origin:t}}),await v(),console.log(` signed in${p?` as ${p}`:""}`)}export{G as runLogin};
|