sootsim 0.0.4 → 0.1.36
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/LICENSE +21 -0
- package/README.md +4 -4
- package/dist-cli/bin.js +12 -12
- package/dist-cli/chunks/{agent-PJAOF4JS.js → agent-YZB6D3DR.js} +4 -4
- package/dist-cli/chunks/agent-wrapper-VHCVS22I.js +15 -0
- package/dist-cli/chunks/{assert-P47NW4AF.js → assert-AIVCKKLG.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-MLNTX23H.js +2 -0
- package/dist-cli/chunks/chunk-27P763IZ.js +61 -0
- package/dist-cli/chunks/chunk-3UIWOHC2.js +62 -0
- package/dist-cli/chunks/chunk-5KGFHWVR.js +1 -0
- package/dist-cli/chunks/chunk-5QIUJNT3.js +5 -0
- package/dist-cli/chunks/{chunk-W7CYWXRZ.js → chunk-6GGMKFWJ.js} +1 -1
- package/dist-cli/chunks/{chunk-EHMSE3Q3.js → chunk-6Z275LCY.js} +2 -2
- package/dist-cli/chunks/chunk-75LBYBKW.js +11 -0
- package/dist-cli/chunks/chunk-A5BRCXYE.js +2 -0
- package/dist-cli/chunks/{chunk-UQ3N6FZF.js → chunk-CYCXOAVZ.js} +2 -2
- package/dist-cli/chunks/{chunk-QIP7LYQI.js → chunk-DFN3GGH7.js} +2 -2
- package/dist-cli/chunks/chunk-EBEHZJRG.js +117 -0
- package/dist-cli/chunks/{chunk-UKYK63H6.js → chunk-EJLNUMMP.js} +1 -1
- package/dist-cli/chunks/{chunk-DQKQYPIG.js → chunk-EWSQSALM.js} +2 -2
- package/dist-cli/chunks/{chunk-BQRM4E66.js → chunk-FE7UI3MT.js} +4 -4
- package/dist-cli/chunks/chunk-G663654J.js +1 -0
- package/dist-cli/chunks/chunk-G7XQD4KC.js +4 -0
- package/dist-cli/chunks/chunk-GW7XY5KC.js +2 -0
- package/dist-cli/chunks/{chunk-QQOBLF7O.js → chunk-H2QO4TDV.js} +2 -2
- package/dist-cli/chunks/{chunk-I6XGFZPA.js → chunk-HWCKZXNJ.js} +2 -2
- package/dist-cli/chunks/{chunk-UNFERMZ3.js → chunk-HWFHBMAQ.js} +2 -2
- package/dist-cli/chunks/chunk-IJMYFYDZ.js +2 -0
- package/dist-cli/chunks/chunk-J7CTD37P.js +1 -0
- package/dist-cli/chunks/{chunk-432TMHBG.js → chunk-KAXZHEKM.js} +1 -1
- package/dist-cli/chunks/{chunk-WWDJCKMI.js → chunk-LHDWH7VS.js} +1 -1
- package/dist-cli/chunks/{chunk-VGXARPIH.js → chunk-N32NCVL2.js} +2 -2
- package/dist-cli/chunks/{chunk-XJF46GU2.js → chunk-NIZBR7EK.js} +2 -2
- package/dist-cli/chunks/{chunk-MQDPKSCK.js → chunk-NYY36OKU.js} +12 -12
- package/dist-cli/chunks/{chunk-5TTQKPGH.js → chunk-OXN2PEB7.js} +1 -1
- package/dist-cli/chunks/{chunk-SY74J6F4.js → chunk-PJL25JQV.js} +1 -1
- package/dist-cli/chunks/{chunk-4XBPZQLW.js → chunk-RMW5BO3S.js} +2 -2
- package/dist-cli/chunks/chunk-SHO54NET.js +2 -0
- package/dist-cli/chunks/chunk-SMVJOWSV.js +16 -0
- package/dist-cli/chunks/chunk-TC6V7YFC.js +3 -0
- package/dist-cli/chunks/{chunk-6SZMLFCR.js → chunk-VFDRZNPN.js} +1 -1
- package/dist-cli/chunks/{chunk-AFQBSK2J.js → chunk-YIO6S3R5.js} +1 -1
- package/dist-cli/chunks/{chunk-AUR2LTNX.js → chunk-YLIIVTTQ.js} +2 -2
- package/dist-cli/chunks/chunk-YR7BGGYE.js +2 -0
- package/dist-cli/chunks/chunk-ZEW3RF5Q.js +1 -0
- package/dist-cli/chunks/{compat-ILLJ7VDL.js → compat-Y2O2U7FL.js} +2 -2
- package/dist-cli/chunks/{config-CDIAJIIT.js → config-SRBOFUCI.js} +2 -2
- package/dist-cli/chunks/control-PL2V2O6S.js +2 -0
- package/dist-cli/chunks/daemon-IZC32PZW.js +50 -0
- package/dist-cli/chunks/{debug-6SMCTPMC.js → debug-BIDMW2PE.js} +3 -3
- package/dist-cli/chunks/demo-app-registry-5JFOUU3D.js +2 -0
- package/dist-cli/chunks/{detox-R4G5INNB.js → detox-B3FDOIS3.js} +2 -2
- package/dist-cli/chunks/{device-YSLCWS4E.js → device-ZZSI363W.js} +2 -2
- package/dist-cli/chunks/drivers-S4NGK4DB.js +2 -0
- package/dist-cli/chunks/{electron-JZOFO37G.js → electron-5YFHXEOI.js} +3 -3
- package/dist-cli/chunks/flow-JJBO6TFY.js +2 -0
- package/dist-cli/chunks/{hints-O4QR6UGI.js → hints-G5HBBV2O.js} +2 -2
- package/dist-cli/chunks/home-paths-VWC3FWA3.js +2 -0
- package/dist-cli/chunks/{inspect-DRFAUJUH.js → inspect-POOPWUQI.js} +56 -52
- package/dist-cli/chunks/install-MP6FHXNZ.js +2 -0
- package/dist-cli/chunks/install-desktop-2MYEI4FM.js +23 -0
- package/dist-cli/chunks/{install-dev-desktop-CAJHPRNP.js → install-dev-desktop-SKH3KEHY.js} +2 -2
- package/dist-cli/chunks/{keys-OWQ7SOTM.js → keys-7PNASIQR.js} +2 -2
- package/dist-cli/chunks/{launch-WUEDHSO5.js → launch-JNS47LAQ.js} +3 -3
- package/dist-cli/chunks/login-YWZWUHBS.js +26 -0
- package/dist-cli/chunks/logout-O6SXMSBP.js +2 -0
- package/dist-cli/chunks/{maestro-PMHK6EHI.js → maestro-CW6XVUKV.js} +3 -3
- package/dist-cli/chunks/{preview-4RVHA2PP.js → preview-WGKJO5FS.js} +2 -2
- package/dist-cli/chunks/{profile-3IVNHUS6.js → profile-SUOBRPIC.js} +2 -2
- package/dist-cli/chunks/{record-KEWLM5JR.js → record-QPWLYH5R.js} +2 -2
- package/dist-cli/chunks/runtime-KEMO2MSB.js +25 -0
- package/dist-cli/chunks/{screenshot-BXRAQERZ.js → screenshot-JTY46V7G.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-5IXEDIUS.js → screenshot-mode-7OYBBX6D.js} +2 -2
- package/dist-cli/chunks/{screenshots-T4MQF3TB.js → screenshots-QISKC4GD.js} +2 -2
- package/dist-cli/chunks/server-YSFJAKAV.js +34 -0
- package/dist-cli/chunks/setup-repo-LFB3HBEO.js +2 -0
- package/dist-cli/chunks/{skills-DJA6QEVR.js → skills-MO7BFNVM.js} +2 -2
- package/dist-cli/chunks/store-6MFL53I4.js +2 -0
- package/dist-cli/chunks/telemetry-CN42GMVC.js +2 -0
- package/dist-cli/chunks/{test-IWUHNFXV.js → test-XUI3KNNQ.js} +3 -3
- package/dist-cli/chunks/upload-6FUT7AX5.js +2 -0
- package/dist-cli/chunks/{whoami-MCXFWKIH.js → whoami-TQFHY42N.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +3 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +2 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +3 -1
- package/dist-lib/home-paths.cjs +29 -3
- package/dist-lib/host/bridge-host.cjs +499 -59
- package/dist-lib/index.cjs +2 -2
- package/dist-lib/metro.cjs +2 -2
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/vite-base.cjs +800 -102
- package/dist-lib/vite.cjs +1 -1
- package/package.json +5 -3
- package/dist-cli/chunks/agent-wrapper-STO7PLQD.js +0 -15
- package/dist-cli/chunks/auto-bootstrap-SC2LMI2H.js +0 -2
- package/dist-cli/chunks/chunk-47S5DXXX.js +0 -11
- package/dist-cli/chunks/chunk-4VXB2DBA.js +0 -119
- package/dist-cli/chunks/chunk-C3QLIYCS.js +0 -16
- package/dist-cli/chunks/chunk-F4ARVCRR.js +0 -1
- package/dist-cli/chunks/chunk-HAKR72LJ.js +0 -2
- package/dist-cli/chunks/chunk-HGFIS26A.js +0 -2
- package/dist-cli/chunks/chunk-MZPAJ5PQ.js +0 -1
- package/dist-cli/chunks/chunk-OAHMYSMD.js +0 -2
- package/dist-cli/chunks/chunk-W3TYN64D.js +0 -62
- package/dist-cli/chunks/chunk-WRF43M33.js +0 -4
- package/dist-cli/chunks/chunk-WVBPATRA.js +0 -2
- package/dist-cli/chunks/chunk-ZF5FCFLD.js +0 -2
- package/dist-cli/chunks/chunk-ZKNI5MRD.js +0 -1
- package/dist-cli/chunks/control-7QGKUCAX.js +0 -2
- package/dist-cli/chunks/daemon-4BLYGM5N.js +0 -49
- package/dist-cli/chunks/demo-app-registry-HLI5UGGI.js +0 -2
- package/dist-cli/chunks/drivers-YIXRFFBQ.js +0 -2
- package/dist-cli/chunks/flow-L7X5FGIN.js +0 -2
- package/dist-cli/chunks/home-paths-4YJJYGR6.js +0 -2
- package/dist-cli/chunks/install-BATRTWRI.js +0 -65
- package/dist-cli/chunks/install-desktop-6X474IQ3.js +0 -23
- package/dist-cli/chunks/login-54YJ2KH6.js +0 -26
- package/dist-cli/chunks/logout-XECXLEXW.js +0 -2
- package/dist-cli/chunks/runtime-PJKHEB36.js +0 -25
- package/dist-cli/chunks/server-CIP3LH45.js +0 -29
- package/dist-cli/chunks/store-SPC247DB.js +0 -2
- package/dist-cli/chunks/upload-UPD2RSYF.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
2
|
-
import{a as
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as ge}from"./chunk-DFN3GGH7.js";import{a as ye}from"./chunk-HWFHBMAQ.js";import{a as be}from"./chunk-EWSQSALM.js";import{a as B,b as A,c as ue,d as q,f as fe,g as pe}from"./chunk-HWCKZXNJ.js";import{a as ve}from"./chunk-3UIWOHC2.js";import{f as ne}from"./chunk-6Z275LCY.js";import{a as ie,b as z}from"./chunk-IJMYFYDZ.js";import{e as me,k as he}from"./chunk-75LBYBKW.js";import{b as de}from"./chunk-OXN2PEB7.js";import{a as we}from"./chunk-PJL25JQV.js";import{c as H,d as le,e as ce}from"./chunk-SMVJOWSV.js";import{d as ae}from"./chunk-6GGMKFWJ.js";import*as $ from"fs";import{tmpdir as Te}from"os";import*as g from"path";import*as m from"fs";import*as w from"path";var V=1e4,U=393,E=852,Se="__sootsimCliPerf",Ce="maestroCopiedText",X=new Map;function f(s){return new Promise(e=>setTimeout(e,s))}function Oe(s){return s?w.basename(s)===".maestro"?w.dirname(s):s:process.cwd()}function De(s,e,t){let r=e.endsWith(".png")?e:`${e}.png`;if(w.isAbsolute(r))return r;if(t.mode==="flow"&&/[\\/]/.test(r)){let o=r.startsWith("./")||r.startsWith("../")?t.flowDir??process.cwd():Oe(t.flowDir);return w.resolve(o,r)}return w.join(s,r)}function Ne(s){if(typeof s=="string")return{path:s,withFrame:!1};let e=s.path?.trim()||s.name?.trim();if(!e)throw new Error("takeScreenshot object form requires path or name");return{path:e,withFrame:s.withFrame===!0}}function Y(s){let[e,t]=s.split(",").map(o=>o.trim()),r=(o,i)=>o.endsWith("%")?Number.parseFloat(o)/100*i:Number.parseFloat(o);return{x:r(e,U),y:r(t,E)}}function G(s){return typeof s=="string"?s.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(e,t)=>{if(X.has(t))return X.get(t);let r=process.env[t];if(r===void 0)throw new Error(`missing environment variable for flow placeholder: ${t}`);return r}):Array.isArray(s)?s.map(e=>G(e)):s&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([e,t])=>[e,G(t)])):s}function Re(s){let e=s.split(/^---$/m),t=e.length>1?e[e.length-1]:s,r=G(A.parse(t));return Array.isArray(r)?r:[]}var W=class{constructor(e,t){this.bridge=e;this.opts=t}stepDelay=0;firstLaunchDone=!1;profilingEnabled=!1;recordingEnabled=!1;recordingAccessChecked=!1;recordingStartedAtMs=null;lastRecordingDurationMs=null;browserRouteHint=null;lastFailedStep=null;get browserId(){return this.opts.browserId}setBrowserRouteHint(e){this.browserRouteHint=this.normalizeBrowserRoute(e)}normalizeBrowserRoute(e){if(!e)return null;try{let t=new URL(e);t.searchParams.delete("inspectOpen");let r=t.searchParams.toString();return`${t.origin}${t.pathname}${r?`?${r}`:""}`}catch{return e}}async refreshBrowserId(){if(this.opts.browserId)try{let e=await this.bridge.listBrowsers(),t=e.find(a=>a.id===this.opts.browserId);if(t&&(this.browserRouteHint=this.normalizeBrowserRoute(t.url||t.origin)),e.find(a=>a.id===this.opts.browserId&&a.readyState==="open")||!this.browserRouteHint)return;let o=this.browserRouteHint&&e.find(a=>a.readyState==="open"&&this.normalizeBrowserRoute(a.url||a.origin)===this.browserRouteHint);if(!o)return;let i=e.find(a=>a.isPrimary&&a.readyState==="open"),n=e.find(a=>a.readyState==="open"),l=o??i??n;l&&(this.opts.browserId=l.id,console.log(` [flow] session rotated to ${l.id}`))}catch{}}async evaluate(e){return this.bridge.send({type:"evaluate",browserId:this.opts.browserId,code:e})}async callTest(e,...t){return this.bridge.send({type:"call",browserId:this.opts.browserId,path:`__sootsimTest.${e}`,args:t})}async waitForTree(e=V){let t=Date.now()+e,r=null;for(;Date.now()<t;){try{let o=await this.evaluate(`(async () => {
|
|
3
3
|
const test = window.__sootsimTest
|
|
4
4
|
if (!test) return { count: 0, loading: true }
|
|
5
5
|
const count = (await test.getNodeCount?.()) || 0
|
|
@@ -19,7 +19,7 @@ import{a as he}from"./chunk-QIP7LYQI.js";import{a as be}from"./chunk-UNFERMZ3.js
|
|
|
19
19
|
const openingAppNode = await test.findByText?.('opening app')
|
|
20
20
|
const isLoading = !!loadingNode || !!capturingNode || !!openingAppNode || count < 5
|
|
21
21
|
return { count, loading: isLoading, error: null }
|
|
22
|
-
})()`);if(o?.error)throw new Error(`app failed to load: ${o.error}`);if(o&&o.count>10&&!o.loading)return}catch(o){r=o instanceof Error?o:new Error(String(o)),await this.refreshBrowserId()}await f(500)}throw r?.message.startsWith("app failed to load:")?r:new Error(`app not ready after ${e}ms`)}async ensureRecordingStarted(){if(!this.opts.recordingOutputDir)throw new Error("recording output directory not configured");this.recordingAccessChecked||(await
|
|
22
|
+
})()`);if(o?.error)throw new Error(`app failed to load: ${o.error}`);if(o&&o.count>10&&!o.loading)return}catch(o){r=o instanceof Error?o:new Error(String(o)),await this.refreshBrowserId()}await f(500)}throw r?.message.startsWith("app failed to load:")?r:new Error(`app not ready after ${e}ms`)}async ensureRecordingStarted(){if(!this.opts.recordingOutputDir)throw new Error("recording output directory not configured");this.recordingAccessChecked||(await ye("flow --video",{originOverride:this.opts.billingOriginOverride}),this.recordingAccessChecked=!0);let e=Date.now(),t=await this.evaluate(`(() => {
|
|
23
23
|
const rec = window.__sootsimRecorder
|
|
24
24
|
if (!rec) return { ok: false, error: 'recorder unavailable on this page' }
|
|
25
25
|
if (rec.state() === 'recording') return { ok: true, format: 'webm' }
|
|
@@ -76,7 +76,7 @@ import{a as he}from"./chunk-QIP7LYQI.js";import{a as be}from"./chunk-UNFERMZ3.js
|
|
|
76
76
|
visible: !!keyboard?.isVisible?.(),
|
|
77
77
|
focused: !!test?.isTextInputFocused?.(),
|
|
78
78
|
}
|
|
79
|
-
})()`);if(!t?.visible&&!t?.focused){await f(80);return}await f(80)}}async eraseText(e){for(let t=0;t<e;t++)await this.pressKey("Backspace");await f(100)}async waitFor(e){let t=Date.now()+(e.timeout||V);for(;Date.now()<t;){if(await this.findElement(e))return;await f(200)}throw new Error(`waitFor: ${JSON.stringify(e)} not found after ${e.timeout||V}ms`)}async takeScreenshot(e){await f(250);let t=Ne(e),r=De(this.opts.screenshotDir,t.path,{mode:this.opts.screenshotPathMode??"dir",flowDir:this.opts.flowDir});m.mkdirSync(w.dirname(r),{recursive:!0});let i=(await this.bridge.send({type:"screenshot",browserId:this.opts.browserId})).replace(/^data:image\/png;base64,/,""),n=Buffer.from(i,"base64");if(t.withFrame){let l=await this.readCurrentDeviceModel();if(!l)throw new Error("could not read current device model for framed screenshot");let a=await
|
|
79
|
+
})()`);if(!t?.visible&&!t?.focused){await f(80);return}await f(80)}}async eraseText(e){for(let t=0;t<e;t++)await this.pressKey("Backspace");await f(100)}async waitFor(e){let t=Date.now()+(e.timeout||V);for(;Date.now()<t;){if(await this.findElement(e))return;await f(200)}throw new Error(`waitFor: ${JSON.stringify(e)} not found after ${e.timeout||V}ms`)}async takeScreenshot(e){await f(250);let t=Ne(e),r=De(this.opts.screenshotDir,t.path,{mode:this.opts.screenshotPathMode??"dir",flowDir:this.opts.flowDir});m.mkdirSync(w.dirname(r),{recursive:!0});let i=(await this.bridge.send({type:"screenshot",browserId:this.opts.browserId})).replace(/^data:image\/png;base64,/,""),n=Buffer.from(i,"base64");if(t.withFrame){let l=await this.readCurrentDeviceModel();if(!l)throw new Error("could not read current device model for framed screenshot");let a=await be(n,l);m.writeFileSync(r,a),console.log(`[flow] screenshot: ${r} (frame: ${l})`);return}m.writeFileSync(r,n),console.log(`[flow] screenshot: ${r}`)}async readCurrentDeviceModel(){let e=await this.bridge.send({type:"call",browserId:this.opts.browserId,path:"SootSim.bridges.settings.get",args:[]}),t=e&&typeof e.deviceModel=="string"?e.deviceModel:null;return!t||!(t in ne)?null:t}async captureFailureScreenshot(e){m.mkdirSync(w.dirname(e),{recursive:!0});let r=(await this.bridge.send({type:"screenshot",browserId:this.opts.browserId})).replace(/^data:image\/png;base64,/,"");m.writeFileSync(e,Buffer.from(r,"base64"))}async captureFailureBundle(e,t){m.mkdirSync(e,{recursive:!0});let r=(p,h)=>{try{m.writeFileSync(w.join(e,p),h)}catch{}},o=async p=>{try{return await this.bridge.send({type:"evaluate",browserId:this.opts.browserId,code:p})}catch{return null}};r("error.json",JSON.stringify({message:t.error.message,stack:t.error.stack,stepIndex:t.stepIndex,stepKind:t.stepKind,stepTarget:t.stepTarget,capturedAt:new Date().toISOString()},null,2));try{let h=(await this.bridge.send({type:"screenshot",browserId:this.opts.browserId})).replace(/^data:image\/png;base64,/,"");r("screenshot.png",Buffer.from(h,"base64"))}catch{}let i=await o(`(async () => {
|
|
80
80
|
const t = window.__sootsimTest
|
|
81
81
|
const mainShell = window.SootSim?.bridges?.mainShell
|
|
82
82
|
if (!t) return { error: 'no test bridge' }
|
|
@@ -224,7 +224,7 @@ import{a as he}from"./chunk-QIP7LYQI.js";import{a as be}from"./chunk-UNFERMZ3.js
|
|
|
224
224
|
} catch (err) {
|
|
225
225
|
return { ok: false, error: err && err.message ? err.message : String(err) }
|
|
226
226
|
}
|
|
227
|
-
})()`);if(!r.ok)throw new Error(`evalScript failed: ${r.error}`);r.value!==void 0&&console.log("[flow] evalScript ->",r.value)}async openLink(e){let t=typeof e=="string"?e:e.link;if(!t)throw new Error("openLink: missing link");await this.evaluate(`window.location.href = ${JSON.stringify(t)}`),await f(300),await this.refreshBrowserId(),await this.waitForTree(3e4)}async evaluateWhen(e){if(e.visible!==void 0){let t=typeof e.visible=="string"?{text:e.visible}:e.visible;return!!await this.findElement(t)}if(e.notVisible!==void 0){let t=typeof e.notVisible=="string"?{text:e.notVisible}:e.notVisible;return!await this.findElement(t)}return e.platform!==void 0?e.platform.toLowerCase()==="ios":e.true!==void 0?e.true.toLowerCase()!=="false":!0}isOptional(e){if(e.optional===!0)return!0;let r=Object.entries(e).find(([i])=>i!=="when"&&i!=="optional"),o=r?r[1]:void 0;return!!(o&&typeof o=="object"&&"optional"in o&&o.optional)}async runStep(e,t){let r=Object.keys(e).find(o=>o!=="when")||Object.keys(e)[0];if(console.log(`[flow] step ${t+1}: ${r}`),e.when&&!await this.evaluateWhen(e.when)){console.log("[flow] (when: predicate false, skipped)");return}try{let o=!!(e.extendedWaitUntil||e.waitFor||e.launchApp||e.runFlow),i=1e4,n=this.runStepInner(e);if(o)await n;else{let a=null,p=new Promise((h,b)=>{a=setTimeout(()=>{b(new Error(`step watchdog: ${r} made no progress in ${i}ms \u2014 bridge or bundle probably hung`))},i)});try{await Promise.race([n,p])}finally{a&&clearTimeout(a)}}let l=!!(e.assertVisible||e.assertNotVisible||e.extendedWaitUntil||e.waitFor);this.stepDelay>0&&!l&&await f(this.stepDelay)}catch(o){if(this.isOptional(e)){console.log(`[flow] (optional, skipped: ${o.message.slice(0,80)})`);return}throw this.lastFailedStep={index:t,kind:r,target:e[r]},o}}async runStepInner(e){if(e.tapOn)await this.tapOn(e.tapOn);else if(e.scrollUntilVisible)await this.scrollUntilVisible(e.scrollUntilVisible);else if(e.extendedWaitUntil)await this.extendedWaitUntil(e.extendedWaitUntil);else if(e.assertVisible)await this.assertVisible(e.assertVisible);else if(e.assertNotVisible)await this.assertNotVisible(e.assertNotVisible);else if(e.inputText)await this.inputText(e.inputText);else if(e.pressKey)await this.pressKey(e.pressKey);else if(e.dispatchKey)await this.dispatchKey(e.dispatchKey);else if(e.waitFor)await this.waitFor(e.waitFor);else if(e.takeScreenshot)await this.takeScreenshot(e.takeScreenshot);else if(e.swipe)e.swipe.start&&e.swipe.end?await this.swipeCoords(e.swipe.start,e.swipe.end,e.swipe.duration):e.swipe.from?await this.swipeFrom(e.swipe.from,e.swipe.direction,e.swipe.duration):await this.swipe(e.swipe.direction,e.swipe.duration);else if(e.scroll)await this.swipe(e.scroll.direction==="DOWN"?"UP":"DOWN");else if(e.scrollTo)await this.scrollTo(e.scrollTo.id,e.scrollTo.x,e.scrollTo.y);else if(e.pinch)await this.pinch(e.pinch);else if(e.waitForAnimationToEnd)await this.waitForAnimationToEnd(typeof e.waitForAnimationToEnd=="number"?e.waitForAnimationToEnd:2e3);else if(e.back)await this.back();else if(e.hideKeyboard)await this.hideKeyboard();else if(e.launchApp)await this.launchApp(e.launchApp);else if(typeof e.wait=="number")await f(e.wait);else if(e.dumpTree)await this.dumpTree(e.dumpTree);else if(e.tapAtCoords)await this.tapAtCoords(e.tapAtCoords.x,e.tapAtCoords.y);else if(e.doubleTapAtCoords)await this.doubleTapAtCoords(e.doubleTapAtCoords.x,e.doubleTapAtCoords.y,e.doubleTapAtCoords.gapMs);else if(e.assertTreeContains)await this.assertTreeContains(e.assertTreeContains);else if(typeof e.eraseText=="number")await this.eraseText(e.eraseText);else if(e.repeat)for(let t=0;t<e.repeat.times;t++)for(let r=0;r<e.repeat.commands.length;r++)await this.runStep(e.repeat.commands[r],r);else if(e.stopApp!==void 0)await this.stopApp();else if(e.clearState!==void 0)await this.clearState();else if(e.clearKeychain!==void 0)this.clearKeychain();else if(e.copyTextFrom!==void 0)await this.copyTextFrom(e.copyTextFrom);else if(typeof e.evalScript=="string")await this.evalScript(e.evalScript);else if(e.openLink!==void 0)await this.openLink(e.openLink);else if(e.runFlow){let t=e.runFlow,r=typeof t=="string"?t:t.file,o=typeof t=="string"?void 0:t.when;if(o&&!await this.evaluateWhen(o)){console.log(`[flow] runFlow skipped (when predicate false): ${r}`);return}let i=w.resolve(this.opts.flowDir,r),n=m.readFileSync(i,"utf8"),l=this.opts.flowDir;this.opts.flowDir=w.dirname(i),await this.runFlow(Re(n)),this.opts.flowDir=l}else throw new Error(`unsupported flow step: ${JSON.stringify(e)}`)}async runFlow(e){let t=[],r=[],o=[];for(let n of e){let l=Object.keys(n);if(l.length===1&&l[0]==="onFlowStart"&&Array.isArray(n.onFlowStart)){t.push(...n.onFlowStart);continue}if(l.length===1&&l[0]==="onFlowComplete"&&Array.isArray(n.onFlowComplete)){r.push(...n.onFlowComplete);continue}o.push(n)}if(t.length>0){console.log(`[flow] onFlowStart (${t.length} steps)`);for(let n=0;n<t.length;n++)await this.runStep(t[n],n)}let i=null;try{await this.runFlowBody(o)}catch(n){i=n instanceof Error?n:new Error(String(n))}if(r.length>0){console.log(`[flow] onFlowComplete (${r.length} steps)`);for(let n=0;n<r.length;n++)try{await this.runStep(r[n],n)}catch(l){console.warn(`[flow] onFlowComplete step ${n+1} failed: ${l instanceof Error?l.message:l}`)}}if(i)throw i}async runFlowBody(e){for(let t=0;t<e.length;t++){let r=e[t],o=typeof r.wait=="number"?r.wait:0,i=typeof r.waitFor?.timeout=="number"?r.waitFor.timeout:0,n=Math.max(6e4,o+15e3,i+15e3);if(r.runFlow){await this.runStep(r,t);continue}await Promise.race([this.runStep(r,t),new Promise((l,a)=>setTimeout(()=>a(new Error(`step ${t+1} (${Object.keys(r)[0]}) exceeded ${n}ms deadline`)),n))])}}};function $e(s){let e={},t=s,r=s.match(/^---\n([\s\S]*?)\n---\n?/);if(r){try{e=A.parse(r[1])??{}}catch(n){console.warn(` warn: could not parse frontmatter: ${n.message}`)}t=s.slice(r[0].length);let i=A.parse(t);return{frontmatter:e,steps:Array.isArray(i)?i:[]}}if(/\n---\s*\n/.test(s))try{let i=A.parseAllDocuments(s);if(i.length>=2){let n=i[0].toJS(),l=i[i.length-1].toJS();return{frontmatter:n&&typeof n=="object"?n:{},steps:Array.isArray(l)?l:[]}}}catch(i){console.warn(` warn: could not parse multi-doc flow: ${i.message}`)}let o=A.parse(t);return{frontmatter:e,steps:Array.isArray(o)?o:[]}}async function Be(){let s=await
|
|
227
|
+
})()`);if(!r.ok)throw new Error(`evalScript failed: ${r.error}`);r.value!==void 0&&console.log("[flow] evalScript ->",r.value)}async openLink(e){let t=typeof e=="string"?e:e.link;if(!t)throw new Error("openLink: missing link");await this.evaluate(`window.location.href = ${JSON.stringify(t)}`),await f(300),await this.refreshBrowserId(),await this.waitForTree(3e4)}async evaluateWhen(e){if(e.visible!==void 0){let t=typeof e.visible=="string"?{text:e.visible}:e.visible;return!!await this.findElement(t)}if(e.notVisible!==void 0){let t=typeof e.notVisible=="string"?{text:e.notVisible}:e.notVisible;return!await this.findElement(t)}return e.platform!==void 0?e.platform.toLowerCase()==="ios":e.true!==void 0?e.true.toLowerCase()!=="false":!0}isOptional(e){if(e.optional===!0)return!0;let r=Object.entries(e).find(([i])=>i!=="when"&&i!=="optional"),o=r?r[1]:void 0;return!!(o&&typeof o=="object"&&"optional"in o&&o.optional)}async runStep(e,t){let r=Object.keys(e).find(o=>o!=="when")||Object.keys(e)[0];if(console.log(`[flow] step ${t+1}: ${r}`),e.when&&!await this.evaluateWhen(e.when)){console.log("[flow] (when: predicate false, skipped)");return}try{let o=!!(e.extendedWaitUntil||e.waitFor||e.launchApp||e.runFlow),i=1e4,n=this.runStepInner(e);if(o)await n;else{let a=null,p=new Promise((h,b)=>{a=setTimeout(()=>{b(new Error(`step watchdog: ${r} made no progress in ${i}ms \u2014 bridge or bundle probably hung`))},i)});try{await Promise.race([n,p])}finally{a&&clearTimeout(a)}}let l=!!(e.assertVisible||e.assertNotVisible||e.extendedWaitUntil||e.waitFor);this.stepDelay>0&&!l&&await f(this.stepDelay)}catch(o){if(this.isOptional(e)){console.log(`[flow] (optional, skipped: ${o.message.slice(0,80)})`);return}throw this.lastFailedStep={index:t,kind:r,target:e[r]},o}}async runStepInner(e){if(e.tapOn)await this.tapOn(e.tapOn);else if(e.scrollUntilVisible)await this.scrollUntilVisible(e.scrollUntilVisible);else if(e.extendedWaitUntil)await this.extendedWaitUntil(e.extendedWaitUntil);else if(e.assertVisible)await this.assertVisible(e.assertVisible);else if(e.assertNotVisible)await this.assertNotVisible(e.assertNotVisible);else if(e.inputText)await this.inputText(e.inputText);else if(e.pressKey)await this.pressKey(e.pressKey);else if(e.dispatchKey)await this.dispatchKey(e.dispatchKey);else if(e.waitFor)await this.waitFor(e.waitFor);else if(e.takeScreenshot)await this.takeScreenshot(e.takeScreenshot);else if(e.swipe)e.swipe.start&&e.swipe.end?await this.swipeCoords(e.swipe.start,e.swipe.end,e.swipe.duration):e.swipe.from?await this.swipeFrom(e.swipe.from,e.swipe.direction,e.swipe.duration):await this.swipe(e.swipe.direction,e.swipe.duration);else if(e.scroll)await this.swipe(e.scroll.direction==="DOWN"?"UP":"DOWN");else if(e.scrollTo)await this.scrollTo(e.scrollTo.id,e.scrollTo.x,e.scrollTo.y);else if(e.pinch)await this.pinch(e.pinch);else if(e.waitForAnimationToEnd)await this.waitForAnimationToEnd(typeof e.waitForAnimationToEnd=="number"?e.waitForAnimationToEnd:2e3);else if(e.back)await this.back();else if(e.hideKeyboard)await this.hideKeyboard();else if(e.launchApp)await this.launchApp(e.launchApp);else if(typeof e.wait=="number")await f(e.wait);else if(e.dumpTree)await this.dumpTree(e.dumpTree);else if(e.tapAtCoords)await this.tapAtCoords(e.tapAtCoords.x,e.tapAtCoords.y);else if(e.doubleTapAtCoords)await this.doubleTapAtCoords(e.doubleTapAtCoords.x,e.doubleTapAtCoords.y,e.doubleTapAtCoords.gapMs);else if(e.assertTreeContains)await this.assertTreeContains(e.assertTreeContains);else if(typeof e.eraseText=="number")await this.eraseText(e.eraseText);else if(e.repeat)for(let t=0;t<e.repeat.times;t++)for(let r=0;r<e.repeat.commands.length;r++)await this.runStep(e.repeat.commands[r],r);else if(e.stopApp!==void 0)await this.stopApp();else if(e.clearState!==void 0)await this.clearState();else if(e.clearKeychain!==void 0)this.clearKeychain();else if(e.copyTextFrom!==void 0)await this.copyTextFrom(e.copyTextFrom);else if(typeof e.evalScript=="string")await this.evalScript(e.evalScript);else if(e.openLink!==void 0)await this.openLink(e.openLink);else if(e.runFlow){let t=e.runFlow,r=typeof t=="string"?t:t.file,o=typeof t=="string"?void 0:t.when;if(o&&!await this.evaluateWhen(o)){console.log(`[flow] runFlow skipped (when predicate false): ${r}`);return}let i=w.resolve(this.opts.flowDir,r),n=m.readFileSync(i,"utf8"),l=this.opts.flowDir;this.opts.flowDir=w.dirname(i),await this.runFlow(Re(n)),this.opts.flowDir=l}else throw new Error(`unsupported flow step: ${JSON.stringify(e)}`)}async runFlow(e){let t=[],r=[],o=[];for(let n of e){let l=Object.keys(n);if(l.length===1&&l[0]==="onFlowStart"&&Array.isArray(n.onFlowStart)){t.push(...n.onFlowStart);continue}if(l.length===1&&l[0]==="onFlowComplete"&&Array.isArray(n.onFlowComplete)){r.push(...n.onFlowComplete);continue}o.push(n)}if(t.length>0){console.log(`[flow] onFlowStart (${t.length} steps)`);for(let n=0;n<t.length;n++)await this.runStep(t[n],n)}let i=null;try{await this.runFlowBody(o)}catch(n){i=n instanceof Error?n:new Error(String(n))}if(r.length>0){console.log(`[flow] onFlowComplete (${r.length} steps)`);for(let n=0;n<r.length;n++)try{await this.runStep(r[n],n)}catch(l){console.warn(`[flow] onFlowComplete step ${n+1} failed: ${l instanceof Error?l.message:l}`)}}if(i)throw i}async runFlowBody(e){for(let t=0;t<e.length;t++){let r=e[t],o=typeof r.wait=="number"?r.wait:0,i=typeof r.waitFor?.timeout=="number"?r.waitFor.timeout:0,n=Math.max(6e4,o+15e3,i+15e3);if(r.runFlow){await this.runStep(r,t);continue}await Promise.race([this.runStep(r,t),new Promise((l,a)=>setTimeout(()=>a(new Error(`step ${t+1} (${Object.keys(r)[0]}) exceeded ${n}ms deadline`)),n))])}}};function $e(s){let e={},t=s,r=s.match(/^---\n([\s\S]*?)\n---\n?/);if(r){try{e=A.parse(r[1])??{}}catch(n){console.warn(` warn: could not parse frontmatter: ${n.message}`)}t=s.slice(r[0].length);let i=A.parse(t);return{frontmatter:e,steps:Array.isArray(i)?i:[]}}if(/\n---\s*\n/.test(s))try{let i=A.parseAllDocuments(s);if(i.length>=2){let n=i[0].toJS(),l=i[i.length-1].toJS();return{frontmatter:n&&typeof n=="object"?n:{},steps:Array.isArray(l)?l:[]}}}catch(i){console.warn(` warn: could not parse multi-doc flow: ${i.message}`)}let o=A.parse(t);return{frontmatter:e,steps:Array.isArray(o)?o:[]}}async function Be(){let s=await ge(),e=s.find(r=>r.patched);if(e)return`http://localhost:${e.port}/__soot/`;let t=s[0];return t?`http://localhost:${t.port}/__soot/`:null}async function ke(s){(s.length===0||s.includes("--help")||s.includes("-h"))&&(console.log(`
|
|
228
228
|
sootsim flow \u2014 run flows or manage a draft session
|
|
229
229
|
|
|
230
230
|
usage:
|
|
@@ -247,7 +247,7 @@ options:
|
|
|
247
247
|
--screenshot-paths <mode>
|
|
248
248
|
screenshot path mode: dir (default) or flow
|
|
249
249
|
--replace <m>=<f> replace a Metro module with a local file for this run
|
|
250
|
-
--new open a fresh
|
|
250
|
+
--new open a fresh browser window before running the flow
|
|
251
251
|
--driver <id> when paired with --new, launch through a specific
|
|
252
252
|
driver from the registry (e.g. playwright for
|
|
253
253
|
hermetic CI runs); see 'sootsim list --drivers'
|
|
@@ -284,10 +284,10 @@ flow extension:
|
|
|
284
284
|
takeScreenshot:
|
|
285
285
|
path: marketing/hero
|
|
286
286
|
withFrame: true
|
|
287
|
-
`),process.exit(0));let e=s[0];$.existsSync(e)||(console.error(` error: ${e} not found`),process.exit(1));let t=d=>s.find((c,v)=>s[v-1]===d),r=s.includes("--profile"),o=s.includes("--new"),i=t("--out")||"/tmp/sootsim-recordings",n=t("--screenshots")||"/tmp/sootsim-flow",l=t("--screenshot-paths")==="flow"?"flow":"dir",a=t("--device")?.trim()||"",p=s.includes("--slow")?+(t("--slow")||"500"):0,h=s.includes("--electron"),b=s.includes("--preview"),j=await ve(t("--preview-origin")),Me=s.includes("--preview-open"),Ae=s.flatMap((d,c)=>s[c-1]==="--replace"?["--replace",d]:[]),F=s.includes("--record")||b,Z=s.includes("--tail-wait")?Math.max(0,+(t("--tail-wait")||"2000")):F?2e3:0,Pe=$.readFileSync(e,"utf8"),{frontmatter:k,steps:P}=$e(Pe);P.length===0&&(console.error(" error: flow file must contain a YAML array of steps"),process.exit(1));let I=a||k.device||"",O=h||k.electron===!0,L=k.app===void 0||k.app===null?"":typeof k.app=="number"?String(k.app):k.app,Q={stripBooleanFlags:["--record","--profile","--electron","--new","--preview","--preview-open","--headless"],stripValueFlags:["--out","--device","--slow","--tail-wait","--url","--replace","--screenshots","--screenshot-paths","--preview-origin","--driver"]},S=
|
|
287
|
+
`),process.exit(0));let e=s[0];$.existsSync(e)||(console.error(` error: ${e} not found`),process.exit(1));let t=d=>s.find((c,v)=>s[v-1]===d),r=s.includes("--profile"),o=s.includes("--new"),i=t("--out")||"/tmp/sootsim-recordings",n=t("--screenshots")||"/tmp/sootsim-flow",l=t("--screenshot-paths")==="flow"?"flow":"dir",a=t("--device")?.trim()||"",p=s.includes("--slow")?+(t("--slow")||"500"):0,h=s.includes("--electron"),b=s.includes("--preview"),j=await ve(t("--preview-origin")),Me=s.includes("--preview-open"),Ae=s.flatMap((d,c)=>s[c-1]==="--replace"?["--replace",d]:[]),F=s.includes("--record")||b,Z=s.includes("--tail-wait")?Math.max(0,+(t("--tail-wait")||"2000")):F?2e3:0,Pe=$.readFileSync(e,"utf8"),{frontmatter:k,steps:P}=$e(Pe);P.length===0&&(console.error(" error: flow file must contain a YAML array of steps"),process.exit(1));let I=a||k.device||"",O=h||k.electron===!0,L=k.app===void 0||k.app===null?"":typeof k.app=="number"?String(k.app):k.app,Q={stripBooleanFlags:["--record","--profile","--electron","--new","--preview","--preview-open","--headless"],stripValueFlags:["--out","--device","--slow","--tail-wait","--url","--replace","--screenshots","--screenshot-paths","--preview-origin","--driver"]},S=H(s,Q),Ee=t("--url")||"";O&&!we()&&(console.error(" error: desktop companion not found. install or build it first with `bun run build:electron`"),process.exit(1));let ee=O?"desktop companion":"bridge",Ie=L?` | target: ${L}`:"";console.log(`
|
|
288
288
|
sootsim flow \u2014 ${g.basename(e)}
|
|
289
289
|
${P.length} steps | ${ee}${Ie}${F?" | recording":""}${r?" | profiling":""}${p?` | ${p}ms delay`:""}
|
|
290
|
-
`),b&&
|
|
290
|
+
`),b&&ie({event:"preview_flow_started",properties:{flowName:g.basename(e),stepCount:P.length,mode:ee,electron:O,record:F,profile:r,previewOrigin:j}});let x=Ee||L||"",K=o||O&&S.browserIdSource!=="flag",te=!1;if(!x&&!K&&S.browserIdSource==="none"){let d=ce(S);try{let c=await d.listBrowsers(),v=c.find(R=>R.isPrimary&&R.readyState==="open"),N=c.find(R=>R.readyState==="open"),se=v??N;se&&(te=!0,console.log(` reusing active session: ${se.id}`))}catch{}finally{d.close()}}if(!x&&!te&&(K||S.browserIdSource==="none")){let d=await Be();d||(console.error(" error: no current session and no sootsim target found"),await z(),process.exit(1)),x=d}if(x&&I){let d=new URL(await me(x));d.searchParams.set("device",I),x=d.toString()}if(x){let d=[x];d.push(...Ae),K&&d.push("--new"),S.browserIdSource==="flag"&&S.browserId&&d.push("--session",S.browserId);let c=t("--driver");c&&d.push("--driver",c),s.includes("--headless")&&d.push("--headless"),await he(d,{port:S.wsPort,timeoutMs:S.commandTimeoutMs})}let _=H(s,Q),re=_.browserIdSource==="flag"?_.browserId:ae()||_.browserId,T=le(_.wsPort,{commandTimeoutMs:_.commandTimeoutMs,browserId:re,fallbackOnMissingBrowserId:!1}),u,oe=async()=>{if(!I)return!1;let d=await T.send({type:"evaluate",browserId:u.browserId,code:"window.location.href"});if(typeof d=="string"&&d.length>0){let c=new URL(d);c.searchParams.set("device",I),u.setBrowserRouteHint(c.toString())}return!!await T.send({type:"call",browserId:u.browserId,path:"SootSim.bridges.settings.set",args:["deviceModel",I]})};u=new W(T,{screenshotDir:n,flowDir:g.dirname(g.resolve(e)),screenshotPathMode:l,browserId:re,recordingOutputDir:F?i:void 0,billingOriginOverride:b?j:void 0,onAfterLaunch:async()=>{await oe()&&await u.waitForTree(12e4),b&&await T.send({type:"evaluate",browserId:u.browserId,code:`(() => {
|
|
291
291
|
const r = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder
|
|
292
292
|
return r?.start?.() ?? false
|
|
293
293
|
})()`})}}),p&&(u.stepDelay=p);let M=null,y=null,C=null,J=null,D=0,_e=!!P[0]?.launchApp;try{await u.waitForTree(12e4),await oe()&&await u.waitForTree(12e4),F&&(_e?u.prepareRecording():await u.startRecording()),r&&await u.startProfile(),b&&(await T.send({type:"evaluate",browserId:u.browserId,code:`(() => {
|
|
@@ -299,10 +299,10 @@ flow extension:
|
|
|
299
299
|
})()`}),console.log(` captured ${J.length} replay events`)),console.log(`
|
|
300
300
|
+ completed (${P.length} steps)`),M&&xe(M),y&&console.log(` video: ${y}`),console.log()}catch(d){if(r&&!M)try{M=await u.stopProfile()}catch{}if(F&&!y)try{y=await u.stopRecording(),C=u.getLastRecordingDurationMs()}catch(c){console.warn(` recording stop failed: ${c?.message||String(c)}`)}console.error(`
|
|
301
301
|
x failed: ${d.message}
|
|
302
|
-
`),M&&(console.log(" partial profile:"),xe(M)),y&&console.log(` partial video: ${y}`);try{let c=u.lastFailedStep,v=c?`step-${String(c.index+1).padStart(2,"0")}-${c.kind}`:"unstaged",N=g.join(n,v);await u.captureFailureBundle(N,{error:d,stepIndex:c?.index,stepKind:c?.kind,stepTarget:c?.target}),console.log(` failure bundle: ${N}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(c){try{let v=g.join(n,"error.png");await u.captureFailureScreenshot(v),console.log(` error screenshot: ${v}`)}catch{}console.log(` (failure bundle capture failed: ${c instanceof Error?c.message:String(c)})`)}await
|
|
303
|
-
preparing preview upload\u2026`);let{runUpload:v}=await import("./upload-
|
|
302
|
+
`),M&&(console.log(" partial profile:"),xe(M)),y&&console.log(` partial video: ${y}`);try{let c=u.lastFailedStep,v=c?`step-${String(c.index+1).padStart(2,"0")}-${c.kind}`:"unstaged",N=g.join(n,v);await u.captureFailureBundle(N,{error:d,stepIndex:c?.index,stepKind:c?.kind,stepTarget:c?.target}),console.log(` failure bundle: ${N}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(c){try{let v=g.join(n,"error.png");await u.captureFailureScreenshot(v),console.log(` error screenshot: ${v}`)}catch{}console.log(` (failure bundle capture failed: ${c instanceof Error?c.message:String(c)})`)}await de(T,{errorsCommand:`sootsim get errors 5${u.browserId?` --session ${u.browserId}`:""}`,warningsCommand:`sootsim get warnings 5${u.browserId?` --session ${u.browserId}`:""}`,requestsCommand:`sootsim get requests 5${u.browserId?` --session ${u.browserId}`:""}`}),D=1}finally{T.close()}if(D===0&&b)try{let d=await Ve(J??[]),c=["--origin",j,"--events",d];y&&c.push("--video",y),y&&C&&Number.isFinite(C)&&c.push("--video-duration-ms",String(Math.round(C))),u.browserId&&c.push("--session",u.browserId),Me&&c.push("--open"),console.log(`
|
|
303
|
+
preparing preview upload\u2026`);let{runUpload:v}=await import("./upload-6FUT7AX5.js");await v(c,{})}catch(d){console.error(` preview upload failed: ${d?.message||d}`),D=1}return await z(),D}async function Ve(s){let{gzipSync:e}=await import("zlib"),t=s.map(i=>JSON.stringify(i)).join(`
|
|
304
304
|
`)+(s.length?`
|
|
305
|
-
`:""),r=e(Buffer.from(t,"utf8")),o=g.join(Te(),`sootsim-events-${Date.now()}.jsonl.gz`);return $.writeFileSync(o,r),console.log(` events: ${s.length} written to ${o} (${r.length} bytes gz)`),o}async function Ue(s){let e=s[0],t=r=>s.find((o,i)=>s[i-1]===r);switch(e){case"start":{let{path:r,state:o}=
|
|
306
|
-
validation failed \u2014 draft preserved so you can keep iterating`),process.exitCode=a;return}
|
|
305
|
+
`:""),r=e(Buffer.from(t,"utf8")),o=g.join(Te(),`sootsim-events-${Date.now()}.jsonl.gz`);return $.writeFileSync(o,r),console.log(` events: ${s.length} written to ${o} (${r.length} bytes gz)`),o}async function Ue(s){let e=s[0],t=r=>s.find((o,i)=>s[i-1]===r);switch(e){case"start":{let{path:r,state:o}=ue();console.log(" flow draft started"),console.log(` session: ${r}`),console.log(` steps: ${o.steps.length}`);return}case"keep":case"good":{let r=fe();if(r.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!r.kept){console.log(" no pending action to keep");return}console.log(` kept: ${r.candidate.summary}`),console.log(` steps: ${r.stepCount}`);return}case"end":{let r=t("--output")||(s[1]&&!s[1].startsWith("-")?s[1]:void 0),o=s.includes("--validate")||s.includes("--video"),i=s.includes("--video"),n=pe(r||(o?je():void 0));if(n.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),o){let l=Le(s,n.outputPath),a=await ke(l);if(a!==0){console.error(`
|
|
306
|
+
validation failed \u2014 draft preserved so you can keep iterating`),process.exitCode=a;return}q(),console.log(` flow draft validated (${n.stepCount} step${n.stepCount===1?"":"s"})`),n.outputPath&&console.log(` saved: ${n.outputPath}`),i&&console.log(" video: recorded during validation run");return}if(q(),console.log(` flow draft ended (${n.stepCount} step${n.stepCount===1?"":"s"})`),n.outputPath){console.log(` saved: ${n.outputPath}`),console.log(` next: sootsim flow ${n.outputPath} --record`);return}console.log(""),process.stdout.write(n.yaml);return}case"validate":{let r=s[1];(!r||r.startsWith("-"))&&(console.error(" usage: sootsim flow validate <path>"),process.exit(1));let o=We(r);if(o.length>0){console.error(` x ${r} failed validation:`);for(let i of o)console.error(` - ${i}`);process.exit(1)}console.log(` + ${r} looks valid`);return}}}var Fe=new Set(["tapOn","inputText","pressKey","dispatchKey","hideKeyboard","swipe","pinch","scroll","scrollUntilVisible"]);function We(s){let e=[];if(!$.existsSync(s))return[`file not found: ${s}`];let t;try{t=$.readFileSync(s,"utf8")}catch(i){return[`cannot read file: ${i.message}`]}if(t.trim().length===0)return["file is empty"];let r;try{r=$e(t)}catch(i){return[`yaml parse error: ${i.message}`]}if(!Array.isArray(r.steps)||r.steps.length===0)return e.push("flow body must be a non-empty YAML array of steps"),e;let o=0;for(let i=0;i<r.steps.length;i++){let n=r.steps[i];n&&typeof n=="object"?Object.keys(n).some(a=>Fe.has(a))&&(o+=1):typeof n=="string"&&Fe.has(n)&&(o+=1)}return o===0&&e.push("no interaction steps found (expected at least one tapOn / inputText / pressKey / swipe / scroll)"),e}async function lt(s){let e=s[0];if(e==="start"||e==="keep"||e==="good"||e==="end"||e==="validate")return await Ue(s),0;let t=await ke(s);return t!==0&&(process.exitCode=t),t}function xe(s){let e=s.avgMs>0?(1e3/s.avgMs).toFixed(1):"?",t=s.sampleCount>0?(s.jankFrames/s.sampleCount*100).toFixed(1):"0";console.log(`
|
|
307
307
|
profile:`),console.log(` frames: ${s.frames}`),console.log(` total: ${s.totalMs.toFixed(1)}ms`),console.log(` avg: ${s.avgMs.toFixed(2)}ms (${e} fps)`),console.log(` max: ${s.maxMs.toFixed(2)}ms`),s.layoutAvgMs!==void 0&&console.log(` breakdown: layout ${s.layoutAvgMs.toFixed(2)}ms | render ${s.renderAvgMs?.toFixed(2)||"0.00"}ms | copy ${s.copyAvgMs?.toFixed(2)||"0.00"}ms`),console.log(` p95: ${s.p95.toFixed(2)}ms`),console.log(` p99: ${s.p99.toFixed(2)}ms`),console.log(` jank: ${s.jankFrames}/${s.sampleCount} (${t}%) >16.67ms`);let r=Array.isArray(s.worstFrames)?s.worstFrames:[];if(r.length!==0){if(console.log(`
|
|
308
308
|
worst frames:`),s.mode==="render-worker"){console.log(" total layout render copy t+");for(let o of r){let[i,n,l,a,p]=o;console.log(` ${n.toFixed(2).padStart(7)} ${l.toFixed(2).padStart(7)} ${a.toFixed(2).padStart(7)} ${p.toFixed(2).padStart(7)} ${String(i).padStart(5)}`)}return}console.log(` ${r.map(o=>o.toFixed(2)).join(", ")}`)}}function je(){return g.join(Te(),`sootsim-flow-draft-${Date.now()}.yaml`)}function Le(s,e){if(!e)throw new Error("validated flow draft requires an output path");let t=[e];for(let r=1;r<s.length;r++){let o=s[r];if(!(o==="--validate"||o==="--video")){if(o==="--output"){r+=1;continue}r===1&&!o.startsWith("-")||t.push(o)}}return!t.includes("--record")&&s.includes("--video")&&t.push("--record"),t}export{$e as a,Be as b,ke as c,lt as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function d(t){let e=t.displayUrl||t.url;return t.status!=null?`${t.method} ${e} -> ${t.status}${t.statusText?` ${t.statusText}`:""}`:t.error?`${t.method} ${e} -> ${t.error}`:`${t.method} ${e}`}async function u(t,e,...o){return t.send({type:"call",path:`__sootsimTest.${e}`,args:o})}async function g(t,e={}){let o=await t.send({type:"evaluate",code:"window.__sootsimConsole?.count?.() || { errors: 0, warnings: 0, total: 0 }"});if(!o||typeof o!="object")return;let n=Math.max(0,Number(o.errors)||0),s=Math.max(0,Number(o.warnings)||0);if(n===0&&s===0)return;let r=[];if(n>0&&r.push(`${n} console error${n===1?"":"s"}`),s>0&&r.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
3
3
|
console: ${r.join(", ")}`),e.errorsCommand&&console.log(` inspect: ${e.errorsCommand}`),s>0&&e.warningsCommand&&console.log(` inspect: ${e.warningsCommand}`),!e.includeTail||n===0)return;let i=await t.send({type:"evaluate",code:"window.__sootsimConsole?.getErrors?.(5) || []"});if(!(!Array.isArray(i)||i.length===0)){console.log(`
|
|
4
4
|
recent console errors:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{execFileSync as g,spawn as h}from"child_process";import{existsSync as s,readdirSync as k}from"fs";import{dirname as f,join as u,resolve as a}from"path";import{fileURLToPath as v}from"url";var c;function p(){if(c!==void 0)return c;try{c=f(v(import.meta.resolve("sootsim-engine/package.json")))}catch{c=null}return c}var x="dev.sootsim.simulator";function D(){let n=p();if(!n)return null;let e=u(n,"dist-electron/main.cjs");if(!s(e))return null;let t=b(n);return t?{path:t,platform:process.platform,kind:"dev-electron",engineDir:n}:null}function I(){let n=p();return n?s(u(n,"src-electron/main.ts")):!1}function b(n){let e=n;for(let t=0;t<6;t++){let i=u(e,"node_modules/.bin/electron");if(s(i))return i;let o=f(e);if(o===e)break;e=o}return null}function C(){let n=p(),t=["/Applications/sootsim.app",a(process.env.HOME||"","Applications/sootsim.app"),...n?[a(n,"app/sootsim.app")]:[]].find(i=>s(i));if(t)return{path:t,platform:"darwin",kind:"mac-app"};try{let i=g("mdfind",[`kMDItemCFBundleIdentifier == "${x}"`],{encoding:"utf8",timeout:3e3}).trim();if(i)return{path:i.split(`
|
|
3
3
|
`)[0],platform:"darwin",kind:"mac-app"}}catch{}return null}function m(n){if(!s(n))return null;let e=k(n).filter(t=>t.startsWith("sootsim")&&t.endsWith(".AppImage")).sort().reverse()[0];return e?u(n,e):null}function w(){let n=p(),t=[a(process.env.HOME||"","Applications/sootsim.AppImage"),a(process.env.HOME||"",".local/bin/sootsim.AppImage"),"/opt/sootsim/sootsim.AppImage","/opt/sootsim/sootsim",...n?[a(n,"app/sootsim.AppImage"),a(n,"release/linux-unpacked/sootsim")]:[]].find(o=>s(o));if(t)return{path:t,platform:"linux",kind:t.endsWith(".AppImage")?"linux-appimage":"linux-binary"};let i=n?m(a(n,"app"))||m(a(n,"release")):null;return i?{path:i,platform:"linux",kind:"linux-appimage"}:null}function A(){let n=D();if(n)return n;if(I()){let e=p(),t=u(e,"dist-electron/main.cjs");return s(t)?console.error(` no node_modules/.bin/electron found near ${e}. run \`bun install\`.`):console.error(` dist-electron/main.cjs missing in ${e}.
|
|
4
4
|
run: bun run --cwd packages/sootsim-engine build:electron-main
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
2
|
-
import{i as n}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{i as n}from"./chunk-6Z275LCY.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
|
|
3
3
|
`)}export{g as a};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as S,b as P,d as T,f as v}from"./chunk-6GGMKFWJ.js";import{w as h,x as k}from"./chunk-5QIUJNT3.js";import{WebSocket as A}from"ws";function x(){let e=h();return e&&k(e)?e.bridgePort:7668}P();var y=class extends Error{lock;constructor(o,t){super(o),this.name="BridgeTabLockedError",this.lock=t}};function O(e){return e==="flag"?"via --tab":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no session pinned"}function F(e,o={}){let t=new Set,c=o.port??x(),l=o.commandTimeoutMs??15e3,a,g="none",b=new Set(o.stripBooleanFlags??[]),m=new Set(o.stripValueFlags??[]);for(let r=0;r<e.length;r++){let d=e[r];if(d==="--port"||d==="-p"){t.add(r),r+1<e.length&&(t.add(r+1),c=Number(e[r+1])),r++;continue}if(d.startsWith("--port=")){t.add(r),c=Number(d.slice(7));continue}if(d==="--timeout"){t.add(r),r+1<e.length&&(t.add(r+1),l=Number(e[r+1])),r++;continue}if(d==="--session"||d==="--id"||d==="--tab"){t.add(r),r+1<e.length&&(t.add(r+1),a=e[r+1],g="flag"),r++;continue}if(b.has(d)){t.add(r);continue}m.has(d)&&(t.add(r),r+1<e.length&&t.add(r+1),r++)}if(!a){let r=T();r&&(a=r,g="saved")}return{positional:e.filter((r,d)=>!t.has(d)),wsPort:c,browserId:a,browserIdSource:g,commandTimeoutMs:l}}function W(e,o={}){let t=1,c=o.commandTimeoutMs??15e3,l=new Map,a=new A(`ws://localhost:${e}`),g=o.browserId?{key:`browser:${o.browserId}`,source:"explicit-browser-id",stable:!0}:S(),b=new Promise((s,n)=>{a.on("open",()=>{try{a.send(JSON.stringify({type:"bridge:hello",id:0,cliSessionKey:g.key,cliSessionSource:g.source,cliLabel:o.cliLabel}))}catch{}s()}),a.on("error",i=>n(new Error(`could not connect to ws://localhost:${e}: ${i.message}`)))}),m=!1,r=!1;function d(s,n){if(r||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;r=!0;let i=n??"primary",u=O(n?o.browserIdSource:"none");process.stderr.write(` \u2192 ${i} (${u})
|
|
3
|
+
`)}return a.on("message",s=>{let n;try{n=JSON.parse(s.toString())}catch{return}if(n.id===0)return;let i=l.get(n.id);i&&(l.delete(n.id),n.i>0&&!m&&(m=!0,process.stderr.write(`
|
|
4
|
+
\u26A0 ${n.i} other CLI client(s) are also connected to this tab
|
|
5
|
+
commands from multiple agents may interfere with each other.
|
|
6
|
+
use sootsim open --new to get a dedicated session.
|
|
7
|
+
|
|
8
|
+
`)),n.error?n.o?i.reject(new y(n.error,n.o)):i.reject(new Error(n.error)):i.resolve(n.result))}),a.on("close",(s,n)=>{let i=n?.toString()||"connection closed";for(let[u,w]of l)l.delete(u),w.reject(new Error(`session disconnected: ${i} (code ${s})`))}),{async send(s){let n=async i=>{await b;let u=t++;return new Promise((w,B)=>{let I=setTimeout(()=>{l.delete(u),B(new Error(`command timed out after ${Math.round(c/1e3)}s`))},c);l.set(u,{resolve:p=>{clearTimeout(I),w(p)},reject:p=>{clearTimeout(I),B(p)}});let f={...s,id:u};f.browserId===void 0&&i&&(f.browserId=i),d(s.type??"",f.browserId),a.send(JSON.stringify(f))})};try{return await n(o.browserId)}catch(i){let u=i instanceof Error?i.message:String(i);if(o.fallbackOnMissingBrowserId&&o.browserId&&s.browserId===void 0&&u===`no browser connected with id ${o.browserId}`)return v(),process.stderr.write(` \u26A0 saved session ${o.browserId} is gone \u2014 falling back to primary
|
|
9
|
+
pin a tab with: sootsim use <tab-id>
|
|
10
|
+
`),r=!1,n(void 0);throw i}},async listBrowsers(){let s=await this.send({type:"bridge:list-browsers"});return Array.isArray(s)?s:[]},async openUrl(s,n={}){return this.send({type:"bridge:open",url:s,newWindow:n.newWindow===!0})},async focusBrowser(s){return this.send({type:"focus",browserId:s})},async closeBrowser(s){return this.send({type:"close",browserId:s})},async claim(s,n={}){return await this.send({type:"bridge:claim",browserId:s,force:n.force===!0})},close(){try{a.readyState===A.OPEN&&a.send(JSON.stringify({type:"bridge:bye",id:0}))}catch{}a.close()}}}function N(e){return W(e.wsPort,{commandTimeoutMs:e.commandTimeoutMs,browserId:e.browserId,fallbackOnMissingBrowserId:e.browserIdSource==="saved",browserIdSource:e.browserIdSource})}async function R(e){try{return await e.send({type:"evaluate",code:"document.hidden"})===!0?(process.stderr.write(`
|
|
11
|
+
\u26A0 target tab is hidden (document.hidden = true)
|
|
12
|
+
animations and rAF callbacks are throttled \u2014 coordinates may be wrong
|
|
13
|
+
and launch/transition animations will not complete.
|
|
14
|
+
bring the tab to the foreground or use: sootsim debug eval "window.focus()"
|
|
15
|
+
|
|
16
|
+
`),{hidden:!0,warned:!0}):{hidden:!1,warned:!1}}catch{return{hidden:!1,warned:!1}}}async function _(e,o,t={}){let c={type:"evaluate",code:o};return t.acquireLock&&(c.acquireLock=!0),e.send(c)}async function D(e,o,...t){return e.send({type:"call",path:o,args:t})}async function j(e,o,...t){return e.send({type:"call",path:o,args:t,acquireLock:!0})}export{x as a,y as b,F as c,W as d,N as e,R as f,_ as g,D as h,j as i};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as l}from"./chunk-SMVJOWSV.js";import{h as p,r as g,w as u,x as c}from"./chunk-5QIUJNT3.js";import{closeSync as y,existsSync as f,openSync as v,readSync as P,statSync as w}from"fs";import{homedir as T}from"os";import{resolve as k}from"path";import{WebSocket as S}from"ws";var D=6e4;async function x(){let t=g();if(t&&f(p(t)))return;console.log(" first run \u2014 installing sootsim engine runtime (~6 MB)...");let{runRuntime:e}=await import("./runtime-KEMO2MSB.js");await e(["install"],{})}function z(t,e){return B(t)??e??l()}async function $(t=l(),e=D){if(await m(t,250))return;let n=u();if(n&&c(n)){if(n.bootstrapping===!0&&(await h(e),await m(n.bridgePort,500)))return;throw new Error(`sootsim daemon lockfile is fresh (port ${n.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`)}console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-IZC32PZW.js");try{await o({port:t,force:!0})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`${s}
|
|
3
|
+
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"?L():null;try{await h(e);let r=Date.now()+5e3;for(;Date.now()<r;){if(await m(t,500))return;await new Promise(s=>setTimeout(s,200))}throw new Error(`daemon registered but the bridge never bound on port ${t} \u2014 see ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}finally{i?.stop()}}async function A(t=l()){await x(),await $(t)}function B(t){for(let e=0;e<t.length;e++){let n=t[e];if((n==="--port"||n==="-p")&&t[e+1]){let o=Number(t[e+1]);return Number.isFinite(o)?o:void 0}if(n.startsWith("--port=")){let o=Number(n.slice(7));return Number.isFinite(o)?o:void 0}}}function m(t,e){return new Promise(n=>{let o=new S(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,r=s=>{if(!i){i=!0;try{o.close()}catch{}n(s)}};o.once("open",()=>r(!0)),o.once("error",()=>r(!1)),setTimeout(()=>r(!1),e)})}async function h(t){let e=Date.now()+t,n;for(;Date.now()<e;){let o=u();if(o&&c(o)){if(o.bootstrapping!==!0)return;o.bootstrapping!==n&&(n=o.bootstrapping)}await new Promise(i=>setTimeout(i,250))}throw new Error(`daemon did not finish bootstrapping within ${Math.round(t/1e3)}s \u2014 check ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}function d(){return k(T(),"Library/Logs/sootsim/server.err.log")}function L(){let t=d(),e=0;try{f(t)&&(e=w(t).size)}catch{}let n=!1,o=()=>{if(!n){try{if(f(t)){let i=w(t).size;if(i>e){let r=Buffer.alloc(i-e),s=v(t,"r");try{P(s,r,0,r.length,e)}finally{y(s)}e=i;for(let b of r.toString("utf8").split(/\r?\n/)){let a=b.trim();a&&(a.startsWith("sootsim:")||a.startsWith("sootsim "))&&console.log(` ${a}`)}}else i<e&&(e=i)}}catch{}setTimeout(o,250)}};return o(),{stop:()=>{n=!0}}}export{x as a,z as b,$ as c,A as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(r){return new Promise(n=>{let e=c();e.question(r,t=>{e.close(),n(t.trim())})})}async function a(r,n=!0){let t=await s(` ${r} ${n?"[Y/n]":"[y/N]"} `);return t===""?n:t.toLowerCase().startsWith("y")}async function l(r,n){console.log(`
|
|
3
3
|
${r}
|
|
4
4
|
`);for(let o=0;o<n.length;o++)console.log(` ${o+1}. ${n[o]}`);console.log();let e=await s(` choose [1-${n.length}]: `),t=parseInt(e,10);return t>=1&&t<=n.length?t-1:0}export{a,l as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function t(_){return`(async () => {
|
|
3
3
|
const __t = window.__sootsimTest
|
|
4
4
|
if (!__t) throw new Error('__sootsimTest not available')
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
2
|
-
import{a as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as s}from"./chunk-EJLNUMMP.js";import{chmodSync as a,existsSync as l,mkdirSync as p,readFileSync as d,rmSync as h,writeFileSync as m}from"node:fs";import{homedir as f,platform as u}from"node:os";import{dirname as g,join as r,resolve as _}from"node:path";function o(){let t=f();if(!t)throw new Error("could not determine home directory");let e=u()==="darwin"?r(t,"Library","Application Support","sootsim"):u()==="win32"?r(process.env.APPDATA||r(t,"AppData","Roaming"),"sootsim"):r(process.env.XDG_CONFIG_HOME||r(t,".config"),"sootsim");return r(e,"credentials.json")}function k(){let t=o();if(!l(t))return null;try{let e=JSON.parse(d(t,"utf8"));return e.version!==1||typeof e.apiKey!="string"||!e.apiKey.startsWith("sk_sootsim_")?null:e.apiKey}catch{return null}}function K(t){if(!t.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let e=o();p(g(_(e)),{recursive:!0}),m(e,JSON.stringify({version:1,apiKey:t,savedAt:new Date().toISOString()},null,2)+`
|
|
3
3
|
`);try{a(e,384)}catch{}}function b(){h(o(),{force:!0})}var y=["ghs_","ghp_","gho_","ghu_","github_pat_"];function A(t){return!!(t&&t.length>=20&&t.length<=256&&y.some(e=>t.startsWith(e)))}function S(){let t=process.env.SOOT_INSTALLATION_TOKEN?.trim(),e=process.env.GITHUB_TOKEN?.trim(),i=t||e;if(!A(i))return null;let n=(process.env.SOOT_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!n)return null;let c=(process.env.SOOT_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:i,repoId:n,installationId:c||null,source:t?"soot-runner":"github-actions"}}function E(){let t=process.env.SOOTSIM_API_KEY?.trim();if(t&&t.startsWith("sk_sootsim_"))return{kind:"api-key",secret:t,source:"env"};let e=S();if(e)return e;let i=k();if(i)return{kind:"api-key",secret:i,source:"file"};let n=s();return n?.token?{kind:"session",token:n.token,origin:n.origin}:null}function w(t){return t.kind==="api-key"?`Bearer ${t.secret}`:`Bearer ${t.token}`}export{k as a,K as b,b as c,E as d,w as e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as n,b as o}from"./chunk-PJL25JQV.js";import{a as l,b as u,c}from"./chunk-A5BRCXYE.js";function f(){let r=l();return r?{available:!0,reason:null,detail:r}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function g(r){let e=l();if(!e)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!r.url)return{launched:!1,message:"chromium driver requires a target url"};try{let i=await c(r.url,{headless:r.headless,detached:r.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${r.url}`,pid:i.pid,target:i.target??e,attachUrl:r.url}}catch(i){return{launched:!1,message:`chromium spawn failed: ${i instanceof Error?i.message:String(i)}`}}}var m={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 supports --headless",kind:"browser",availability:f,launch:g};function y(){let r=n();return r?{available:!0,reason:null,detail:`${r.kind} @ ${r.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim install-desktop`)"}}async function D(r){let e=n();if(!e)return{launched:!1,message:"sootsim desktop app not installed"};try{let i=await o(r.url,e,{device:r.device});return i.launched?{launched:!0,message:r.url?`electron launched via ${i.via} \u2192 ${r.url}`:`electron launched via ${i.via}`,target:i.target,attachUrl:r.url}:{launched:!1,message:"desktop companion failed to start"}}catch(i){return{launched:!1,message:`electron launch failed: ${i instanceof Error?i.message:String(i)}`}}}var d={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:y,launch:D};import{createRequire as w}from"module";function h(){try{let r=w(process.cwd()+"/");for(let e of["playwright","playwright-chromium","playwright-core"])try{return r.resolve(e),e}catch{}}catch{}return null}function b(){let r=h();return r?{available:!0,reason:null,detail:`resolved via ${r}`}:{available:!1,reason:"playwright not installed in the current workspace"}}async function L(r){let e=h();if(!e)return{launched:!1,message:"playwright not installed \u2014 run `bun add -D playwright` first"};if(!r.url)return{launched:!1,message:"playwright driver requires a target url"};try{return await(await(await(await(await import(e)).chromium.launch({headless:r.headless??!0})).newContext()).newPage()).goto(r.url),{launched:!0,message:`playwright chromium launched \u2192 ${r.url}`,target:e,attachUrl:r.url}}catch(i){return{launched:!1,message:`playwright launch failed: ${i instanceof Error?i.message:String(i)}`}}}var p={id:"playwright",name:"playwright",description:"programmatic chromium via the playwright package \u2014 headless default",kind:"automation",availability:b,launch:L};function k(){return process.platform!=="darwin"&&process.platform!=="linux"&&process.platform!=="win32"?{available:!1,reason:`unsupported platform: ${process.platform}`}:{available:!0,reason:null,detail:process.platform==="darwin"?"open(1)":process.platform==="win32"?"cmd /c start":"xdg-open(1)"}}async function x(r){if(r.headless)return{launched:!1,message:"system driver does not support --headless; use chromium or playwright"};if(!r.url)return{launched:!1,message:"system driver requires a target url"};try{let e=await u(r.url,{detached:r.detached??!0,newWindow:r.newWindow});return{launched:!0,message:`${e.via} launch \u2192 ${r.url}`,pid:e.pid,target:e.target,attachUrl:r.url}}catch(e){return{launched:!1,message:`system launch failed: ${e instanceof Error?e.message:String(e)}`}}}var v={id:"system",name:"system",description:"shared browser launcher \u2014 system default or chromium window",kind:"delegate",availability:k,launch:x};var t=[m,d,p,v];function V(){return t}function _(r){return t.find(e=>e.id===r)??null}function j(r,e){if(r)return t.find(a=>a.id===r)??null;for(let i of e){let a=t.find(s=>s.id===i);if(a&&a.availability().available)return a}return null}function z(){return t.map(r=>{let e=r.availability();return{id:r.id,name:r.name,kind:r.kind,description:r.description,available:e.available,reason:e.reason,detail:e.detail??null}})}export{m as a,d as b,p as c,v as d,t as e,V as f,_ as g,j as h,z as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-LHDWH7VS.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:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-LHDWH7VS.js";import{existsSync as i,writeFileSync as n,readFileSync as c}from"fs";import{resolve as t}from"path";async function a(s){let e=s[0];switch((!e||s.includes("--help")||s.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim config \u2014 manage sootsim configuration
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m}from"./chunk-75LBYBKW.js";import"./chunk-GW7XY5KC.js";import"./chunk-OXN2PEB7.js";import"./chunk-YR7BGGYE.js";import"./chunk-PJL25JQV.js";import"./chunk-G663654J.js";import"./chunk-A5BRCXYE.js";import"./chunk-SHO54NET.js";import"./chunk-SMVJOWSV.js";import"./chunk-6GGMKFWJ.js";import"./chunk-ZEW3RF5Q.js";import"./chunk-5QIUJNT3.js";import"./chunk-LHDWH7VS.js";export{d as buildOpenUrl,c as buildShellUrl,f as printConnectedBrowsers,a as resolveBundleTarget,b as resolveDefaultShellBaseUrl,l as runClaimCommand,m as runCloseCommand,k as runFocusCommand,h as runListCommand,i as runOpenCommand,j as runUseCommand,e as summarizeBrowserUrl,g as waitForBrowserMatch};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as S,b as E}from"./chunk-IJMYFYDZ.js";import"./chunk-EJLNUMMP.js";import"./chunk-ZEW3RF5Q.js";import"./chunk-5QIUJNT3.js";import{a as O}from"./chunk-LHDWH7VS.js";import{execFileSync as N,spawnSync as s}from"child_process";import{existsSync as c,mkdirSync as $,readFileSync as R,rmSync as A,writeFileSync as I}from"fs";import{homedir as w}from"os";import{dirname as P,resolve as d}from"path";var T=60,p="dev.sootsim.server",l="sootsim-server",y=d(w(),"Library/Logs/sootsim"),C=d(w(),".local/state/sootsim");async function rt(t,e={}){let[r,...o]=t,n=e.port??7668;if(!r||r==="--help"||r==="-h"){D();return}new Set(["install","uninstall","restart","start","stop"]).has(r)&&S({event:`daemon_${r}`,properties:{platform:process.platform,subsource:"daemon"}});try{switch(r){case"install":return await W({port:n,force:o.includes("--force")});case"uninstall":return await G();case"status":return await K();case"restart":return await X();case"start":return await H();case"stop":return await V();default:console.error(` unknown daemon subcommand: ${r}`),D(),process.exit(1)}}finally{await E()}}function D(){console.log(`
|
|
3
|
+
sootsim daemon \u2014 manage the sootsim bridge daemon
|
|
4
|
+
|
|
5
|
+
the daemon is registered automatically on first CLI use, so you usually
|
|
6
|
+
don't need to run any of these subcommands. use them to inspect or remove
|
|
7
|
+
the launchd/systemd agent.
|
|
8
|
+
|
|
9
|
+
usage:
|
|
10
|
+
sootsim daemon uninstall stop and remove the login agent
|
|
11
|
+
sootsim daemon status show whether the agent is installed + running
|
|
12
|
+
sootsim daemon restart restart the agent (use after 'npm update -g sootsim')
|
|
13
|
+
sootsim daemon start start the installed agent
|
|
14
|
+
sootsim daemon stop stop the running agent
|
|
15
|
+
|
|
16
|
+
examples:
|
|
17
|
+
sootsim daemon status
|
|
18
|
+
sootsim daemon restart
|
|
19
|
+
sootsim daemon uninstall
|
|
20
|
+
`)}function U(){let t=B();return{executable:process.execPath,prefixArgs:[t]}}function B(){try{let e=N("which",["sootsim"],{encoding:"utf8"}).trim();if(e&&c(e))return L(e)}catch{}let t=process.argv[1];if(t&&c(t))return L(t);throw new Error("could not locate the sootsim binary")}function L(t){try{return O("fs").realpathSync(t)}catch{return t}}function M(t,e){$(y,{recursive:!0});let r=d(y,"server.out.log"),o=d(y,"server.err.log"),n=[t.executable,...t.prefixArgs,"server","--quiet","--port",String(e)].map(a=>` <string>${j(a)}</string>`).join(`
|
|
21
|
+
`);return`<?xml version="1.0" encoding="UTF-8"?>
|
|
22
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
23
|
+
<plist version="1.0">
|
|
24
|
+
<dict>
|
|
25
|
+
<key>Label</key><string>${p}</string>
|
|
26
|
+
<key>ProgramArguments</key>
|
|
27
|
+
<array>
|
|
28
|
+
${n}
|
|
29
|
+
</array>
|
|
30
|
+
<key>RunAtLoad</key><true/>
|
|
31
|
+
<key>KeepAlive</key><true/>
|
|
32
|
+
<key>ThrottleInterval</key><integer>${T}</integer>
|
|
33
|
+
<key>ProcessType</key><string>Background</string>
|
|
34
|
+
<key>StandardOutPath</key><string>${r}</string>
|
|
35
|
+
<key>StandardErrorPath</key><string>${o}</string>
|
|
36
|
+
</dict>
|
|
37
|
+
</plist>
|
|
38
|
+
`}function F(t,e){return $(C,{recursive:!0}),`[Unit]
|
|
39
|
+
Description=sootsim bridge daemon
|
|
40
|
+
After=default.target
|
|
41
|
+
|
|
42
|
+
[Service]
|
|
43
|
+
Type=simple
|
|
44
|
+
ExecStart=${[t.executable,...t.prefixArgs].map(q).join(" ")} server --quiet --port ${e}
|
|
45
|
+
Restart=always
|
|
46
|
+
RestartSec=${T}
|
|
47
|
+
|
|
48
|
+
[Install]
|
|
49
|
+
WantedBy=default.target
|
|
50
|
+
`}function j(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function q(t){return/[^\w@%+=:,./-]/.test(t)?`'${t.replace(/'/g,"'\\''")}'`:t}function b(){return d(w(),"Library/LaunchAgents",`${p}.plist`)}function k(){return d(w(),".config/systemd/user",`${l}.service`)}async function W({port:t,force:e}){let r=U();if(console.log(` binary: ${[r.executable,...r.prefixArgs].join(" ")}`),console.log(` port: ${t}`),process.platform==="darwin"){let o=b();if(c(o)&&!e){console.log(` already installed at ${o}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}$(P(o),{recursive:!0}),I(o,M(r,t)),console.log(` wrote ${o}`);let n=`gui/${process.getuid()}`,a=`${n}/${p}`,v=()=>{let i=s("launchctl",["bootstrap",n,o],{stdio:"pipe",encoding:"utf8"}),h=(i.stderr||i.stdout||"").trim();if(i.status!==0)return{ok:!1,reason:`bootstrap exit ${i.status}${h?`: ${h}`:""}`};let x=s("launchctl",["print",a],{encoding:"utf8"});return x.status!==0?{ok:!1,reason:`bootstrap returned 0 but service not registered (print exit ${x.status})`}:{ok:!0}},u=v();if(!u.ok){let i=u.reason;if(s("launchctl",["bootout",a],{stdio:"ignore"}),u=v(),!u.ok)throw new Error(`launchctl bootstrap failed: ${u.reason}`+(i!==u.reason?` (initial: ${i})`:"")+" \u2014 try `sootsim daemon uninstall` then retry, or reboot if launchd state is stuck.")}let m=Date.now()+4e3,g,f;for(;Date.now()<m;){let i=s("launchctl",["print",a],{encoding:"utf8"});if(i.status===0&&(g=i.stdout?.match(/state\s*=\s*(\w+)/)?.[1],f=i.stdout?.match(/pid\s*=\s*(\d+)/)?.[1],g==="running"||f))break;await new Promise(h=>setTimeout(h,150))}if(g!=="running"&&!f)throw new Error(`daemon registered but did not reach running state within 4s (last state: ${g||"unknown"}). check ${d(y,"server.err.log")} \u2014 typically a stale runtime or a port already bound by another process.`);console.log(` registered (state: ${g||"unknown"}${f?`, pid ${f}`:""}, log: ${d(y,"server.err.log")})`);return}if(process.platform==="linux"){let o=k();if(c(o)&&!e){console.log(` already installed at ${o}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}$(P(o),{recursive:!0}),I(o,F(r,t)),console.log(` wrote ${o}`);let n=s("systemctl",["--user","daemon-reload"],{stdio:"pipe",encoding:"utf8"});if(n.status!==0){let m=(n.stderr||n.stdout||"").trim();throw new Error(`systemctl daemon-reload failed${m?`: ${m}`:""}`)}let a=s("systemctl",["--user","enable","--now",l],{stdio:"pipe",encoding:"utf8"});if(a.status!==0){let m=(a.stderr||a.stdout||"").trim();throw new Error(`systemctl enable --now failed${m?`: ${m}`:""} \u2014 try \`sootsim daemon uninstall\` then retry.`)}let u=(s("systemctl",["--user","is-active",l],{encoding:"utf8"}).stdout||"").trim()||"unknown";console.log(` registered (state: ${u}, journalctl --user -u ${l} to tail logs)`);return}console.error(` sootsim daemon install is not supported on ${process.platform}`),console.error(" run 'sootsim server' in a persistent shell instead"),process.exit(1)}async function G(){if(process.platform==="darwin"){let t=b();if(!c(t)){console.log(" not installed");return}s("launchctl",["bootout",`gui/${process.getuid()}/${p}`],{stdio:"ignore"}),A(t,{force:!0}),console.log(` removed ${t}`);return}if(process.platform==="linux"){let t=k();if(!c(t)){console.log(" not installed");return}s("systemctl",["--user","disable","--now",l],{stdio:"ignore"}),A(t,{force:!0}),s("systemctl",["--user","daemon-reload"],{stdio:"ignore"}),console.log(` removed ${t}`);return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function K(){if(process.platform==="darwin"){let t=b();if(!c(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let e=Q(t);e&&console.log(` binary: ${e}`);let r=s("launchctl",["print",`gui/${process.getuid()}/${p}`],{encoding:"utf8"});if(r.status===0){let o=r.stdout.match(/state\s*=\s*(\w+)/)?.[1],n=r.stdout.match(/pid\s*=\s*(\d+)/)?.[1];console.log(` state: ${o||"unknown"}${n?` (pid ${n})`:""}`)}else console.log(" state: not running");return}if(process.platform==="linux"){let t=k();if(!c(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let e=s("systemctl",["--user","is-active",l],{encoding:"utf8"});console.log(` state: ${e.stdout.trim()||"unknown"}`);return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function X(){if(process.platform==="darwin"){let t=b();c(t)||(console.error(" daemon not registered \u2014 run any sootsim command to bootstrap it"),process.exit(1));let e=s("launchctl",["kickstart","-k",`gui/${process.getuid()}/${p}`],{stdio:"pipe",encoding:"utf8"});e.status!==0&&(console.error(` kickstart failed: ${e.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}if(process.platform==="linux"){let t=k();c(t)||(console.error(" daemon not registered \u2014 run any sootsim command to bootstrap it"),process.exit(1));let e=s("systemctl",["--user","restart",l],{stdio:"pipe",encoding:"utf8"});e.status!==0&&(console.error(` restart failed: ${e.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function H(){if(process.platform==="darwin"){s("launchctl",["kickstart",`gui/${process.getuid()}/${p}`],{stdio:"inherit"});return}if(process.platform==="linux"){s("systemctl",["--user","start",l],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function V(){if(process.platform==="darwin"){s("launchctl",["bootout",`gui/${process.getuid()}/${p}`],{stdio:"inherit"});return}if(process.platform==="linux"){s("systemctl",["--user","stop",l],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}function Q(t){try{return R(t,"utf8").match(/<array>\s*<string>([^<]+)<\/string>/)?.[1]||null}catch{return null}}export{W as daemonInstall,rt as runDaemon};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
2
|
-
import{d as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as f}from"./chunk-CYCXOAVZ.js";import{b as N}from"./chunk-OXN2PEB7.js";import{c as v,e as $,g as S}from"./chunk-SMVJOWSV.js";import"./chunk-6GGMKFWJ.js";import"./chunk-ZEW3RF5Q.js";import"./chunk-5QIUJNT3.js";import"./chunk-LHDWH7VS.js";var A=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],x="__sootsimShellAnimationTrace",R="__sootsimDebugAnimation";function D(){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 l(i,c){return S(i,c)}async function z(i,c){let g=v(i,{port:c.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),m=g.positional;(!m[0]||i.includes("--help")||i.includes("-h"))&&(D(),process.exit(0));let C=g.wsPort,k=g.browserId,n=!i.includes("--json"),y=k?` --session ${k}`:"",_=m[0],a=m.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(_)){let{runInspect:e}=await import("./inspect-
|
|
170
|
+
})()`}async function l(i,c){return S(i,c)}async function z(i,c){let g=v(i,{port:c.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),m=g.positional;(!m[0]||i.includes("--help")||i.includes("-h"))&&(D(),process.exit(0));let C=g.wsPort,k=g.browserId,n=!i.includes("--json"),y=k?` --session ${k}`:"",_=m[0],a=m.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(_)){let{runInspect:e}=await import("./inspect-POOPWUQI.js");await e(["debug",...i],{port:c.port,verbose:c.verbose});return}let o=$(g);try{switch(_){case"enable":{let e=O(a[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
|
|
171
171
|
known: ${A.join(", ")}`),process.exit(1));let t=e.map(u=>JSON.stringify(u)).join(", "),s=await l(o,`window.__sootsimDebug.enable(${t})`);console.log(r({active:s},n));break}case"disable":{let e=O(a[0]),t=e.length>0?e.map(u=>JSON.stringify(u)).join(", "):"'all'",s=await l(o,`window.__sootsimDebug.disable(${t})`);console.log(r({active:s},n));break}case"toggle":{let e=a[0];e||(console.error(" usage: sootsim debug toggle <channel>"),process.exit(1));let t=await l(o,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(r({[e]:t},n));break}case"status":{let e=await l(o,"window.__sootsimDebug.status()");console.log(r(e,n));break}case"channels":{let e=await l(o,"window.__sootsimDebug.channels()");console.log(r(e,n));break}case"flags":{let e=await l(o,"window.__sootsimDebug.flags()");console.log(r(e,n));break}case"snapshot":{let e=a[0],t=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await l(o,`(() => { const s = ${t}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(r(s,n));break}case"snapshots":{let e=await l(o,"window.__sootsimDebug.snapshots()");console.log(r(e,n));break}case"diff":{let e=a[0],t=a[1];(!e||!t)&&(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(t)});
|
|
173
173
|
if (!d) return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
2
|
-
import{b as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as S}from"./chunk-NYY36OKU.js";import"./chunk-DFN3GGH7.js";import"./chunk-HWFHBMAQ.js";import"./chunk-EWSQSALM.js";import"./chunk-5KGFHWVR.js";import"./chunk-HWCKZXNJ.js";import"./chunk-H2QO4TDV.js";import"./chunk-3UIWOHC2.js";import"./chunk-YLIIVTTQ.js";import"./chunk-RMW5BO3S.js";import"./chunk-NIZBR7EK.js";import"./chunk-6Z275LCY.js";import"./chunk-IJMYFYDZ.js";import"./chunk-EJLNUMMP.js";import"./chunk-75LBYBKW.js";import"./chunk-GW7XY5KC.js";import"./chunk-OXN2PEB7.js";import"./chunk-YR7BGGYE.js";import"./chunk-PJL25JQV.js";import"./chunk-G663654J.js";import"./chunk-A5BRCXYE.js";import"./chunk-SHO54NET.js";import"./chunk-SMVJOWSV.js";import"./chunk-6GGMKFWJ.js";import"./chunk-ZEW3RF5Q.js";import"./chunk-5QIUJNT3.js";import"./chunk-LHDWH7VS.js";import{spawn as b}from"child_process";import{existsSync as u,mkdirSync as D,writeFileSync as f,unlinkSync as _}from"fs";import{tmpdir as I}from"os";import{dirname as P,resolve as i,join as $}from"path";function M(){try{let e=import.meta.resolve("sootsim/detox");return P(e.startsWith("file://")?e.slice(7):e)}catch{return i(import.meta.dirname,"..","..","detox")}}var E=`
|
|
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.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-5KGFHWVR.js";import"./chunk-RMW5BO3S.js";import"./chunk-NIZBR7EK.js";import{f as c,g as r,h as g}from"./chunk-6Z275LCY.js";import{c as d,e as l,h as a}from"./chunk-SMVJOWSV.js";import"./chunk-6GGMKFWJ.js";import"./chunk-ZEW3RF5Q.js";import"./chunk-5QIUJNT3.js";import"./chunk-LHDWH7VS.js";function h(){console.log(`
|
|
3
3
|
sootsim device \u2014 inspect or change the live device preset for a session
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-J7CTD37P.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-YR7BGGYE.js";import"./chunk-PJL25JQV.js";import"./chunk-G663654J.js";import"./chunk-A5BRCXYE.js";import"./chunk-LHDWH7VS.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.
|
|
2
|
-
import{a as m}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as m}from"./chunk-VFDRZNPN.js";import"./chunk-J7CTD37P.js";import{a as u,e as a}from"./chunk-75LBYBKW.js";import"./chunk-GW7XY5KC.js";import"./chunk-OXN2PEB7.js";import{b as d,g as p}from"./chunk-YR7BGGYE.js";import{a as l}from"./chunk-PJL25JQV.js";import"./chunk-G663654J.js";import"./chunk-A5BRCXYE.js";import"./chunk-SHO54NET.js";import"./chunk-SMVJOWSV.js";import"./chunk-6GGMKFWJ.js";import"./chunk-ZEW3RF5Q.js";import"./chunk-5QIUJNT3.js";import"./chunk-LHDWH7VS.js";function g(e){let n=e.indexOf("--port");if(n<0)return;let r=e[n+1],i=r?Number(r):Number.NaN;return(!Number.isInteger(i)||i<=0)&&(console.error(` invalid --port value: ${r||"(missing)"}`),process.exit(1)),i}async function h(e,n){let r=g(e)??n.port;return r?a(String(r)):void 0}async function P(e,n){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim electron \u2014 launch the desktop companion
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -12,4 +12,4 @@ options:
|
|
|
12
12
|
examples:
|
|
13
13
|
sootsim electron
|
|
14
14
|
sootsim electron --port 5173
|
|
15
|
-
`),process.exit(0));let r=e.indexOf("--driver"),t=(r>=0?e[r+1]:void 0)||n.driver,s=d;if(t){let o=p(t);o||(console.error(` unknown driver "${t}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),s=o}if(s.id==="electron"){let o=l();if(!o){if(u(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await m("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:v}=await import("./install-desktop-
|
|
15
|
+
`),process.exit(0));let r=e.indexOf("--driver"),t=(r>=0?e[r+1]:void 0)||n.driver,s=d;if(t){let o=p(t);o||(console.error(` unknown driver "${t}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),s=o}if(s.id==="electron"){let o=l();if(!o){if(u(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await m("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:v}=await import("./install-desktop-2MYEI4FM.js");await v(["--yes"]),o=l()}o||process.exit(1)}console.log(` launching ${o.path}`)}let f=await h(e,n),c=await s.launch({url:f,device:n.device});c.launched||(console.error(` ${c.message}`),process.exit(1)),console.log(` ${c.message}`)}export{h as resolveElectronLaunchUrl,P as runElectron};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d}from"./chunk-NYY36OKU.js";import"./chunk-DFN3GGH7.js";import"./chunk-HWFHBMAQ.js";import"./chunk-EWSQSALM.js";import"./chunk-5KGFHWVR.js";import"./chunk-HWCKZXNJ.js";import"./chunk-H2QO4TDV.js";import"./chunk-3UIWOHC2.js";import"./chunk-YLIIVTTQ.js";import"./chunk-RMW5BO3S.js";import"./chunk-NIZBR7EK.js";import"./chunk-6Z275LCY.js";import"./chunk-IJMYFYDZ.js";import"./chunk-EJLNUMMP.js";import"./chunk-75LBYBKW.js";import"./chunk-GW7XY5KC.js";import"./chunk-OXN2PEB7.js";import"./chunk-YR7BGGYE.js";import"./chunk-PJL25JQV.js";import"./chunk-G663654J.js";import"./chunk-A5BRCXYE.js";import"./chunk-SHO54NET.js";import"./chunk-SMVJOWSV.js";import"./chunk-6GGMKFWJ.js";import"./chunk-ZEW3RF5Q.js";import"./chunk-5QIUJNT3.js";import"./chunk-LHDWH7VS.js";export{b as discoverSootsimUrl,a as parseFlowFile,d as runFlow,c as runFlowPlayback};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.
|
|
2
|
-
import{b as t,c as r,d as l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as t,c as r,d as l}from"./chunk-N32NCVL2.js";import"./chunk-6GGMKFWJ.js";import"./chunk-LHDWH7VS.js";function a(n){let s=n[0]??"list";if(s==="reset"){n[1]==="global"?(r(),console.log(" cleared global hint state")):(t(),console.log(" cleared hint state for this session"));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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.36 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A,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-5QIUJNT3.js";import"./chunk-LHDWH7VS.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,v as activeRuntimeDir,i as activeRuntimeFile,l as cacheDir,z as claimDaemonLockfile,u as compareSemver,n as configFilePath,m as daemonLockfilePath,j as electronDir,k as electronVersionDir,q as ensureSootsimHome,x as isDaemonLockfileFresh,t as listInstalledRuntimes,r as readActiveRuntime,w as readDaemonLockfile,o as readTelemetryEnabled,A as removeDaemonLockfile,h as runtimeDir,g as runtimesDir,f as sootsimHomeDir,s as writeActiveRuntime,y as writeDaemonLockfile,p as writeTelemetryEnabled};
|