sootsim 0.0.1

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.
Files changed (62) hide show
  1. package/README.md +197 -0
  2. package/dist-cli/bin.js +29 -0
  3. package/dist-cli/chunks/bridge-host-2EY7Z4AO.js +2 -0
  4. package/dist-cli/chunks/chunk-3C3ZH7PP.js +4 -0
  5. package/dist-cli/chunks/chunk-3R4ZZESY.js +119 -0
  6. package/dist-cli/chunks/chunk-64TOMNZX.js +37 -0
  7. package/dist-cli/chunks/chunk-74XPLOV4.js +2 -0
  8. package/dist-cli/chunks/chunk-7LMDCMSI.js +8 -0
  9. package/dist-cli/chunks/chunk-7X6OPSRD.js +2 -0
  10. package/dist-cli/chunks/chunk-A2CZQIWO.js +1 -0
  11. package/dist-cli/chunks/chunk-CKZ376AY.js +322 -0
  12. package/dist-cli/chunks/chunk-E522F5JW.js +2 -0
  13. package/dist-cli/chunks/chunk-E5UBZEYR.js +2 -0
  14. package/dist-cli/chunks/chunk-G5MR66EB.js +180 -0
  15. package/dist-cli/chunks/chunk-GPVPHE2B.js +3 -0
  16. package/dist-cli/chunks/chunk-HOIHCO7S.js +3 -0
  17. package/dist-cli/chunks/chunk-J2S3OCWA.js +69 -0
  18. package/dist-cli/chunks/chunk-JSF5LPNT.js +176 -0
  19. package/dist-cli/chunks/chunk-KQWZZ56P.js +2 -0
  20. package/dist-cli/chunks/chunk-KSACMDXK.js +3 -0
  21. package/dist-cli/chunks/chunk-KSB6MSZ4.js +34 -0
  22. package/dist-cli/chunks/chunk-KXYKAYYB.js +51 -0
  23. package/dist-cli/chunks/chunk-MBFP2LVH.js +3 -0
  24. package/dist-cli/chunks/chunk-MPSZ5EWF.js +16 -0
  25. package/dist-cli/chunks/chunk-OROM7DZI.js +2 -0
  26. package/dist-cli/chunks/chunk-PWXPA745.js +3 -0
  27. package/dist-cli/chunks/chunk-QOBRRY5X.js +4 -0
  28. package/dist-cli/chunks/chunk-X2U72K7X.js +1 -0
  29. package/dist-cli/chunks/chunk-YCETS3B3.js +2 -0
  30. package/dist-cli/chunks/compat-MRN2ORY5.js +33 -0
  31. package/dist-cli/chunks/config-CO5IYWUY.js +45 -0
  32. package/dist-cli/chunks/control-Y7TKKB6D.js +2 -0
  33. package/dist-cli/chunks/daemon-G4XVRFHM.js +49 -0
  34. package/dist-cli/chunks/debug-ZNSZTWT6.js +182 -0
  35. package/dist-cli/chunks/detox-JEGYNTYV.js +49 -0
  36. package/dist-cli/chunks/dev-ZUKCZQEX.js +25 -0
  37. package/dist-cli/chunks/dev-checkout-IEZVVTCN.js +2 -0
  38. package/dist-cli/chunks/device-BS34FAFM.js +16 -0
  39. package/dist-cli/chunks/drivers-46PFFIDF.js +2 -0
  40. package/dist-cli/chunks/electron-P2KOPX2S.js +15 -0
  41. package/dist-cli/chunks/flow-VVOF6UNC.js +2 -0
  42. package/dist-cli/chunks/hints-7Z656W4H.js +2 -0
  43. package/dist-cli/chunks/inspect-NAHXP2M5.js +1042 -0
  44. package/dist-cli/chunks/install-EPUJX4AT.js +67 -0
  45. package/dist-cli/chunks/install-desktop-PYIZIH67.js +19 -0
  46. package/dist-cli/chunks/login-Z5Z54HUJ.js +26 -0
  47. package/dist-cli/chunks/logout-T2QDYGCB.js +2 -0
  48. package/dist-cli/chunks/maestro-4AXTS7OE.js +75 -0
  49. package/dist-cli/chunks/preview-NMGWHWMX.js +17 -0
  50. package/dist-cli/chunks/profile-6RGJA4FR.js +22 -0
  51. package/dist-cli/chunks/record-IE27Z2GA.js +37 -0
  52. package/dist-cli/chunks/screenshot-R3GCCSCI.js +26 -0
  53. package/dist-cli/chunks/screenshot-mode-SZQDNGYE.js +17 -0
  54. package/dist-cli/chunks/screenshots-4UQJE4NC.js +70 -0
  55. package/dist-cli/chunks/server-AN2G5KO4.js +21 -0
  56. package/dist-cli/chunks/skills-2PPKPL4B.js +10 -0
  57. package/dist-cli/chunks/store-PU5ES4YQ.js +2 -0
  58. package/dist-cli/chunks/test-5LFKOQ4M.js +31 -0
  59. package/dist-cli/chunks/upload-BYNPC54C.js +2 -0
  60. package/dist-cli/chunks/vite-plugin-5AEUUBKP.js +9 -0
  61. package/dist-cli/chunks/whoami-H6FW34JS.js +2 -0
  62. package/package.json +56 -0
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
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
+ ${r}
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};
@@ -0,0 +1 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ var t={width:3,lock:{top:253,height:103},ringToggle:{top:152,height:32},volumeUp:{top:214,height:61},volumeDown:{top:290,height:61}},h={width:2.5,lock:{top:130,height:78},ringToggle:{top:94,height:22},volumeUp:{top:126,height:48},volumeDown:{top:188,height:48}},a={"iphone-se":{name:"iPhone SE",width:375,height:667,scale:2,statusBarHeight:20,homeIndicatorHeight:0,cornerRadius:0,dynamicIsland:null,safeAreaInsets:{top:20,bottom:0,left:0,right:0},iosVersion:"15.8",physicalPPI:326,hardwareButtons:h},"iphone-14":{name:"iPhone 14",width:390,height:844,scale:3,statusBarHeight:47,homeIndicatorHeight:34,cornerRadius:55,dynamicIsland:null,safeAreaInsets:{top:47,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:t},"iphone-15":{name:"iPhone 15",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:t},"iphone-15-plus":{name:"iPhone 15 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:t},"iphone-15-pro":{name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:54,homeIndicatorHeight:17,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:t},"iphone-15-pro-max":{name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:54,homeIndicatorHeight:17,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:t},"iphone-16":{name:"iPhone 16",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:t},"iphone-16-plus":{name:"iPhone 16 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:t},"iphone-16-pro":{name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:54,homeIndicatorHeight:17,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:t},"iphone-16-pro-max":{name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:54,homeIndicatorHeight:17,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:t},"iphone-17":{name:"iPhone 17",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:t},"iphone-17-air":{name:"iPhone 17 Air",width:430,height:932,scale:3,statusBarHeight:54,homeIndicatorHeight:17,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:t},"iphone-17-pro":{name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:54,homeIndicatorHeight:17,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:t},"iphone-17-pro-max":{name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:54,homeIndicatorHeight:17,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:t},"ipad-pro-13":{name:'iPad Pro 13"',width:1032,height:1376,scale:2,statusBarHeight:24,homeIndicatorHeight:20,cornerRadius:18,dynamicIsland:null,safeAreaInsets:{top:24,bottom:20,left:0,right:0},iosVersion:"18.2",physicalPPI:264,hardwareButtons:t}},n="iphone-17-pro";function d(e){return a[e]}function s(){return Object.keys(a)}var i={"iphone-6-9":{name:"iphone-6-9",label:'iPhone 6.9"',width:1290,height:2796,store:"apple"},"iphone-6-1":{name:"iphone-6-1",label:'iPhone 6.1"',width:1170,height:2532,store:"apple"},"ipad-13":{name:"ipad-13",label:'iPad 13"',width:2064,height:2752,store:"apple"}},r={dark:{type:"gradient",direction:180,glow:"#4caeff",stops:[{offset:0,color:"#111827"},{offset:40,color:"#101725"},{offset:100,color:"#06080d"}]},cyan:{type:"gradient",direction:180,glow:"#25c3ec",stops:[{offset:0,color:"#1b465c"},{offset:32,color:"#122336"},{offset:100,color:"#05070b"}]},gold:{type:"gradient",direction:180,glow:"#ffc25a",stops:[{offset:0,color:"#3b2f1a"},{offset:34,color:"#18140d"},{offset:100,color:"#050505"}]},red:{type:"gradient",direction:180,glow:"#ff6178",stops:[{offset:0,color:"#3e1018"},{offset:35,color:"#17080c"},{offset:100,color:"#050405"}]}},g={color:"#25c3ec",blur:120,spread:52,opacity:.34},m="iphone-17-pro";function f(e){return Object.prototype.hasOwnProperty.call(i,e)?i[e]:null}function l(e){return{type:e.type,color:e.color,direction:e.direction,glow:e.glow,stops:e.stops?.map(o=>({...o}))}}function y(e){return Object.prototype.hasOwnProperty.call(r,e)?l(r[e]):null}var c={deviceModel:{type:"enum",default:n,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:s(),group:"device"},orientation:{type:"enum",default:"portrait",description:"screen orientation",cliFlag:"orientation",options:["portrait","landscape"],group:"device"},colorScheme:{type:"enum",default:"dark",description:"color scheme (auto follows system preference)",cliFlag:"theme",cliFlagShort:"t",options:["light","dark","auto"],group:"appearance"},reduceMotion:{type:"boolean",default:!1,description:"reduce motion",group:"appearance"},boldText:{type:"boolean",default:!1,description:"bold text",group:"appearance"},fontSize:{type:"number",default:1,description:"font size multiplier (1.0 = default)",group:"appearance",validate:e=>e>=.5&&e<=2},networkCondition:{type:"enum",default:"wifi",description:"simulated network condition",cliFlag:"network",options:["wifi","lte","fast-3g","slow-3g","offline"],group:"network"},language:{type:"string",default:"en",description:"language code (ISO 639-1)",cliFlag:"language",group:"locale"},region:{type:"string",default:"US",description:"region code (ISO 3166-1)",cliFlag:"region",group:"locale"},showTouches:{type:"boolean",default:!1,description:"show touch indicators",group:"simulator"},showFrame:{type:"boolean",default:!0,description:"show device frame",cliFlag:"frame",group:"simulator"},showTopBar:{type:"boolean",default:!0,description:"show simulator top bar",group:"simulator"},screenshotMode:{type:"boolean",default:!1,description:"show screenshot composition mode in the browser shell",group:"simulator"},screenshotCanvas:{type:"enum",default:"iphone-6-9",description:"target app-store canvas preset for screenshot mode",options:Object.keys(i),group:"simulator"},screenshotBackground:{type:"enum",default:"dark",description:"background preset rendered inside the screenshot canvas",options:Object.keys(r),group:"simulator"},screenshotText:{type:"enum",default:"bold-top",description:"text layout preset for the screenshot canvas",options:["bold-top","editorial-left","minimal-bottom","none"],group:"simulator"},screenshotPose:{type:"enum",default:"straight",description:"device pose preset inside the screenshot canvas",options:["straight","tilted-left","tilted-right","cut-bottom","cut-top"],group:"simulator"},screenshotDynamicSize:{type:"boolean",default:!1,description:"let the screenshot canvas rect fit available space (off = pin to exact preset pixels)",group:"simulator"},showStatusBar:{type:"boolean",default:!0,description:"show status bar",group:"simulator"},showHomeIndicator:{type:"boolean",default:!0,description:"show home indicator",group:"simulator"},a11yMode:{type:"enum",default:"delayed",description:"accessibility tree sync mode (off, delayed=100ms, active=30ms)",options:["off","delayed","active"],group:"simulator"},a11yDepth:{type:"enum",default:"deep",description:"accessibility tree structure depth (shallow or deep)",options:["shallow","deep"],group:"simulator"},inspectMode:{type:"boolean",default:!1,description:"inspect mode",group:"simulator"},errorReporting:{type:"boolean",default:!1,description:"send anonymous crash reports",group:"privacy"}};function S(){let e={};for(let[o,p]of Object.entries(c))e[o]=p.default;if(typeof window<"u")try{let o=new URLSearchParams(window.location.search).get("device");o&&c.deviceModel.options?.includes(o)&&(e.deviceModel=o)}catch{}return e}export{g as a,m as b,f as c,l as d,y as e,a as f,d as g,s as h,c as i,S as j};
@@ -0,0 +1,33 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-E522F5JW.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
+ sootsim compat \u2014 check package compatibility
4
+
5
+ usage:
6
+ sootsim compat [package-name]
7
+ sootsim compat --json
8
+ sootsim compat --brief
9
+
10
+ with no args: scan the current project's dependencies
11
+ with a package name: check that specific package
12
+
13
+ flags:
14
+ --json machine-readable JSON output (uses scanDeps from @soot/compat)
15
+ --brief one-line summary
16
+ --app <dir> target directory (default: cwd)
17
+
18
+ examples:
19
+ sootsim compat
20
+ sootsim compat react-native-reanimated
21
+ sootsim compat --json
22
+ sootsim compat --brief
23
+ `),process.exit(0));let u=s.includes("--json"),e=s.includes("--brief"),l=s.indexOf("--app"),a=l!==-1&&s[l+1]?g(s[l+1]):process.cwd(),k=s.filter((o,n)=>!o.startsWith("-")&&(l===-1||n!==l+1))[0];if(u||e){let{scanDeps:o}=await import("@soot/compat"),n=g(a,"package.json");x(n)||(console.error(" no package.json found in",a),process.exit(1));let r=JSON.parse(j(n,"utf8")),c=o(r);if(u){console.log(JSON.stringify(c,null,2));return}if(c.packages.length===0){console.log(" no RN ecosystem packages detected");return}let T=Math.round(c.overallScore*100),$=c.packages.filter(i=>i.status==="full").length,v=c.packages.filter(i=>i.status==="partial"||i.status==="auto-stub").length,w=c.packages.filter(i=>i.status==="unsupported").length,p=[];$&&p.push(`${$} fully supported`),v&&p.push(`${v} partial`),w&&p.push(`${w} unsupported`),console.log(` ${p.join(", ")} \u2014 ${T}% compatible`);return}let{POLYFILL_REGISTRY:d}=await import("@soot/compat/web");if(k){W(k,d);return}let b=g(a,"package.json");x(b)||(console.error(" no package.json found in",a),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 n=d[o];if(n){let r=n.status;if(!r&&n.stubType&&(r=n.stubType==="native"?"full":n.stubType==="just-works"?"not-relevant":n.stubType),!r&&n.versions?.length){let c=Math.max(...n.versions.map(y=>y.coverage||0));r=c>=.8?"full":c>=.3?"partial":"auto-stub"}switch(r){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
+ sootsim compatibility report
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
+
27
+ full support (${t.full.length}):`);for(let o of t.full)console.log(` + ${o}`);if(t.partial.length){console.log(`
28
+ partial support (${t.partial.length}):`);for(let o of t.partial)console.log(` ~ ${o}`)}if(t.autoStub.length){console.log(`
29
+ auto-stubbed (${t.autoStub.length}):`);for(let o of t.autoStub)console.log(` . ${o}`)}if(t.unsupported.length){console.log(`
30
+ unsupported (${t.unsupported.length}):`);for(let o of t.unsupported)console.log(` x ${o}`)}if(t.unknown.length){console.log(`
31
+ unknown native packages (${t.unknown.length}):`);for(let o of t.unknown)console.log(` ? ${o}`)}console.log(`
32
+ total: ${t.full.length} full, ${t.partial.length} partial, ${t.autoStub.length} auto-stub, ${t.unsupported.length} unsupported, ${t.unknown.length} unknown
33
+ `)}function W(s,u){let e=u[s];if(!e){f(s)?console.log(` ${s}: unknown native package (may be auto-stubbed)`):console.log(` ${s}: not a native package (should work as-is)`);return}let l=e.status;if(!l&&e.stubType&&(l=e.stubType==="native"?"full":e.stubType),!l&&e.versions?.length){let a=Math.max(...e.versions.map(h=>h.coverage||0));l=a>=.8?"full":a>=.3?"partial":"auto-stub"}if(console.log(` ${s}:`),console.log(` status: ${l||"unknown"}`),e.stubType&&console.log(` stub type: ${e.stubType}`),e.category&&console.log(` category: ${e.category}`),e.versions?.length)for(let a of e.versions)console.log(` ${a.range}: ${Math.round((a.coverage||0)*100)}% coverage${a.note?` \u2014 ${a.note}`:""}`)}function f(s){return s.startsWith("expo-")||s.startsWith("react-native-")||s.startsWith("@react-native/")||s.startsWith("@react-native-community/")||s.startsWith("@expo/")||s==="expo"}export{P as runCompat};
@@ -0,0 +1,45 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-E522F5JW.js";import{existsSync as s,writeFileSync as n}from"fs";import{resolve as t}from"path";async function r(e){let i=e[0];switch((!i||e.includes("--help")||e.includes("-h"))&&(console.log(`
3
+ sootsim config \u2014 manage sootsim configuration
4
+
5
+ usage:
6
+ sootsim config <subcommand>
7
+
8
+ subcommands:
9
+ init create a sootsim.config.ts in the current directory
10
+ validate check the current config for errors
11
+ show display the resolved configuration
12
+
13
+ examples:
14
+ sootsim config init
15
+ sootsim config validate
16
+ sootsim config show
17
+ `),process.exit(0)),i){case"init":{let o=t(process.cwd(),"sootsim.config.ts");s(o)&&(console.log(" sootsim.config.ts already exists"),process.exit(1)),n(o,`import { defineConfig } from 'sootsim-engine/config'
18
+
19
+ export default defineConfig({
20
+ // module resolution overrides
21
+ modules: {
22
+ // 'my-native-lib': 'noop', // stub as empty
23
+ // 'react-native-gesture-handler': false, // use builtin
24
+ // 'my-shim': { file: './shims/my-shim.ts' }, // custom file
25
+ },
26
+
27
+ // environment variables
28
+ env: {
29
+ // API_URL: 'http://localhost:3000',
30
+ },
31
+
32
+ // simulator settings
33
+ settings: {
34
+ // deviceModel: 'iphone-16-pro',
35
+ // colorScheme: 'dark',
36
+ },
37
+
38
+ // initial app state
39
+ initialState: {
40
+ // authenticated: false,
41
+ // locale: 'en',
42
+ // colorScheme: 'light',
43
+ },
44
+ })
45
+ `),console.log(" created sootsim.config.ts");break}case"validate":{let o=t(process.cwd(),"sootsim.config.ts");s(o)||(console.log(" no sootsim.config.ts found"),console.log(" run 'sootsim config init' to create one"),process.exit(1)),console.log(` config exists at: ${o}`),console.log(" (full validation not yet implemented)");break}case"show":{let{settingsStore:o}=await import("./store-PU5ES4YQ.js");console.log(JSON.stringify(o.getAll(),null,2));break}default:console.error(` unknown subcommand: ${i}`),process.exit(1)}}export{r as runConfig};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l}from"./chunk-HOIHCO7S.js";import"./chunk-KSB6MSZ4.js";import"./chunk-OROM7DZI.js";import"./chunk-MPSZ5EWF.js";import"./chunk-3C3ZH7PP.js";import"./chunk-E5UBZEYR.js";import"./chunk-X2U72K7X.js";import"./chunk-74XPLOV4.js";import"./chunk-MBFP2LVH.js";import"./chunk-E522F5JW.js";export{c as buildOpenUrl,b as buildShellUrl,e as printConnectedBrowsers,a as resolveBundleTarget,k as runClaimCommand,l as runCloseCommand,j as runFocusCommand,g as runListCommand,h as runOpenCommand,i as runUseCommand,d as summarizeBrowserUrl,f as waitForBrowserMatch};
@@ -0,0 +1,49 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-X2U72K7X.js";import"./chunk-E522F5JW.js";import{execFileSync as k,spawnSync as o}from"child_process";import{existsSync as i,mkdirSync as d,readFileSync as v,rmSync as f,writeFileSync as y}from"fs";import{homedir as p}from"os";import{dirname as $,resolve as c}from"path";var l="dev.sootsim.server",a="sootsim-server",u=c(p(),"Library/Logs/sootsim"),b=c(p(),".local/state/sootsim");async function F(t,s={}){let[r,...e]=t,n=s.port??7668;if(!r||r==="--help"||r==="-h"){h();return}switch(r){case"install":return P({port:n,force:e.includes("--force")});case"uninstall":return D();case"status":return E();case"restart":return I();case"start":return A();case"stop":return R();default:console.error(` unknown daemon subcommand: ${r}`),h(),process.exit(1)}}function h(){console.log(`
3
+ sootsim daemon \u2014 manage the sootsim bridge as a login agent
4
+
5
+ usage:
6
+ sootsim daemon install [--force] register the login agent and start it
7
+ sootsim daemon uninstall stop and remove the login agent
8
+ sootsim daemon status show whether the agent is installed + running
9
+ sootsim daemon restart restart the agent (use after 'npm update -g sootsim')
10
+ sootsim daemon start start the installed agent
11
+ sootsim daemon stop stop the running agent
12
+
13
+ examples:
14
+ sootsim daemon install
15
+ sootsim daemon status
16
+ sootsim daemon restart
17
+ `)}function x(){try{let s=k("which",["sootsim"],{encoding:"utf8"}).trim();if(s&&i(s))return s}catch{}let t=process.argv[1];if(t&&i(t))return t;throw new Error("could not locate the sootsim binary")}function S(t,s){d(u,{recursive:!0});let r=c(u,"server.out.log"),e=c(u,"server.err.log");return`<?xml version="1.0" encoding="UTF-8"?>
18
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
19
+ <plist version="1.0">
20
+ <dict>
21
+ <key>Label</key><string>${l}</string>
22
+ <key>ProgramArguments</key>
23
+ <array>
24
+ <string>${t}</string>
25
+ <string>server</string>
26
+ <string>--quiet</string>
27
+ <string>--port</string>
28
+ <string>${s}</string>
29
+ </array>
30
+ <key>RunAtLoad</key><true/>
31
+ <key>KeepAlive</key><true/>
32
+ <key>ProcessType</key><string>Background</string>
33
+ <key>StandardOutPath</key><string>${r}</string>
34
+ <key>StandardErrorPath</key><string>${e}</string>
35
+ </dict>
36
+ </plist>
37
+ `}function L(t,s){return d(b,{recursive:!0}),`[Unit]
38
+ Description=sootsim bridge daemon
39
+ After=default.target
40
+
41
+ [Service]
42
+ Type=simple
43
+ ExecStart=${t} server --quiet --port ${s}
44
+ Restart=always
45
+ RestartSec=3
46
+
47
+ [Install]
48
+ WantedBy=default.target
49
+ `}function m(){return c(p(),"Library/LaunchAgents",`${l}.plist`)}function g(){return c(p(),".config/systemd/user",`${a}.service`)}async function P({port:t,force:s}){let r=x();if(console.log(` binary: ${r}`),console.log(` port: ${t}`),process.platform==="darwin"){let e=m();if(i(e)&&!s){console.log(` already installed at ${e}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}d($(e),{recursive:!0}),y(e,S(r,t)),console.log(` wrote ${e}`),o("launchctl",["bootstrap",`gui/${process.getuid()}`,e],{stdio:"ignore"});let n=o("launchctl",["kickstart","-k",`gui/${process.getuid()}/${l}`],{stdio:"pipe",encoding:"utf8"});n.status!==0&&console.warn(` warning: kickstart returned ${n.status}: ${n.stderr?.trim()}`),console.log(` started (log: ${c(u,"server.err.log")})`);return}if(process.platform==="linux"){let e=g();if(i(e)&&!s){console.log(` already installed at ${e}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}d($(e),{recursive:!0}),y(e,L(r,t)),console.log(` wrote ${e}`),o("systemctl",["--user","daemon-reload"],{stdio:"ignore"});let n=o("systemctl",["--user","enable","--now",a],{stdio:"pipe",encoding:"utf8"});n.status!==0&&(console.warn(` warning: systemctl enable --now exited ${n.status}`),n.stderr&&console.warn(` ${n.stderr.trim()}`)),console.log(` started (journalctl --user -u ${a} 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 D(){if(process.platform==="darwin"){let t=m();if(!i(t)){console.log(" not installed");return}o("launchctl",["bootout",`gui/${process.getuid()}/${l}`],{stdio:"ignore"}),f(t,{force:!0}),console.log(` removed ${t}`);return}if(process.platform==="linux"){let t=g();if(!i(t)){console.log(" not installed");return}o("systemctl",["--user","disable","--now",a],{stdio:"ignore"}),f(t,{force:!0}),o("systemctl",["--user","daemon-reload"],{stdio:"ignore"}),console.log(` removed ${t}`);return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function E(){if(process.platform==="darwin"){let t=m();if(!i(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let s=T(t);s&&console.log(` binary: ${s}`);let r=o("launchctl",["print",`gui/${process.getuid()}/${l}`],{encoding:"utf8"});if(r.status===0){let e=r.stdout.match(/state\s*=\s*(\w+)/)?.[1],n=r.stdout.match(/pid\s*=\s*(\d+)/)?.[1];console.log(` state: ${e||"unknown"}${n?` (pid ${n})`:""}`)}else console.log(" state: not running");return}if(process.platform==="linux"){let t=g();if(!i(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let s=o("systemctl",["--user","is-active",a],{encoding:"utf8"});console.log(` state: ${s.stdout.trim()||"unknown"}`);return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function I(){if(process.platform==="darwin"){let t=m();i(t)||(console.error(" not installed \u2014 run `sootsim daemon install` first"),process.exit(1));let s=o("launchctl",["kickstart","-k",`gui/${process.getuid()}/${l}`],{stdio:"pipe",encoding:"utf8"});s.status!==0&&(console.error(` kickstart failed: ${s.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}if(process.platform==="linux"){let t=g();i(t)||(console.error(" not installed \u2014 run `sootsim daemon install` first"),process.exit(1));let s=o("systemctl",["--user","restart",a],{stdio:"pipe",encoding:"utf8"});s.status!==0&&(console.error(` restart failed: ${s.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function A(){if(process.platform==="darwin"){o("launchctl",["kickstart",`gui/${process.getuid()}/${l}`],{stdio:"inherit"});return}if(process.platform==="linux"){o("systemctl",["--user","start",a],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function R(){if(process.platform==="darwin"){o("launchctl",["bootout",`gui/${process.getuid()}/${l}`],{stdio:"inherit"});return}if(process.platform==="linux"){o("systemctl",["--user","stop",a],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}function T(t){try{return v(t,"utf8").match(/<array>\s*<string>([^<]+)<\/string>/)?.[1]||null}catch{return null}}export{F as runDaemon};
@@ -0,0 +1,182 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as f}from"./chunk-64TOMNZX.js";import{b as v}from"./chunk-KSB6MSZ4.js";import{b as $,d as S,f as N}from"./chunk-MPSZ5EWF.js";import"./chunk-3C3ZH7PP.js";import"./chunk-X2U72K7X.js";import"./chunk-E522F5JW.js";var A=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],x="__sootsimShellAnimationTrace",R="__sootsimDebugAnimation";function D(){console.log(`
3
+ sootsim debug \u2014 drive __sootsimDebug from the terminal
4
+
5
+ usage:
6
+ sootsim debug <subcommand> [args]
7
+
8
+ subcommands:
9
+ enable <channels> turn on one or more debug channels
10
+ channels: ${A.slice(0,-1).join(", ")}
11
+ or 'all' for every channel
12
+ disable <channels> turn off one or more debug channels (or 'all')
13
+ toggle <channel> flip a single channel
14
+ status list currently-enabled channels
15
+ channels list every known channel name
16
+ flags print the full DEBUG flag object
17
+
18
+ state <kind> ... dump raw runtime state (diagnostic \u2014 not a getter)
19
+ kinds: shell, worker, keyboard, node <id>,
20
+ scroll <id>, scroll-hit <x> <y>,
21
+ hit <x> <y>, gesture <x> <y>
22
+
23
+ js <code> execute javascript in the running app. SootSim
24
+ is the canonical state object \u2014 reach into its
25
+ bridges / state / chrome / debug slots directly.
26
+ e.g. SootSim.bridges.test.findByText("Sign in")
27
+ eval <code> alias for js
28
+ perf <sub> profiling: stats, start, stop, frames [n],
29
+ worst [n], transition
30
+ sample-color <...> sample averaged color from canvas (same flags as
31
+ screenshot)
32
+
33
+ snapshot [label] capture a tree snapshot (layout + transform + opacity)
34
+ snapshots list taken snapshot labels
35
+ diff <a> <b> compare two snapshots by label
36
+ clear-snapshots [label] drop a snapshot (or all if no label given)
37
+
38
+ find sheets dump Sheet.Frame-shaped nodes currently in the tree
39
+ find portals dump portal-host / portal-view nodes
40
+
41
+ trace shell [cmd] opt-in shell animation trace
42
+ cmds: on [limit], off, status, clear, [recentLimit]
43
+ trace anim <sub> opt-in per-tick animation value trace
44
+ subs: on <id|all> [limit], off [id|all],
45
+ status, clear, <id> [limit]
46
+ record [on|off] toggle event ring buffer recording
47
+ recent [channel] [n] last N events (default 50), optionally filtered
48
+ clear-events clear the event ring buffer
49
+
50
+ options:
51
+ --port <port> WS bridge port (default: ${7668})
52
+ --session <session-id> target a specific connected browser tab
53
+ --pretty format JSON output for humans (default)
54
+ --json compact JSON output for pipelines
55
+
56
+ examples:
57
+ sootsim debug enable sheets,portals
58
+ sootsim debug snapshot before
59
+ sootsim debug snapshot after
60
+ sootsim debug diff before after
61
+ sootsim debug find sheets | jq '.[] | select(.translateY != null)'
62
+ sootsim debug trace shell on 240
63
+ sootsim debug trace shell 120
64
+ sootsim debug trace anim on 3 240
65
+ sootsim debug trace anim 3 60
66
+ `)}function O(i){return i?i.split(",").map(c=>c.trim()).filter(Boolean):[]}function r(i,c){return i===void 0?"":JSON.stringify(i,null,c?2:0)}function w(i,c=240){let g=Number.isFinite(c)&&c>0?Math.max(1,Math.round(c)):240,m=JSON.stringify(x),p=JSON.stringify(R);return i==="on"?`(() => {
67
+ const root = window
68
+ const store = root[${m}] || (root[${m}] = {
69
+ enabled: false,
70
+ limit: ${g},
71
+ seq: 0,
72
+ samples: [],
73
+ prevHook: undefined,
74
+ hook: undefined,
75
+ })
76
+ store.limit = ${g}
77
+ store.enabled = true
78
+ const currentHook = root[${p}]
79
+ if (store.hook !== currentHook) {
80
+ store.prevHook = typeof currentHook === 'function' ? currentHook : undefined
81
+ }
82
+ if (typeof store.hook !== 'function') {
83
+ store.hook = (sample) => {
84
+ const target = root[${m}]
85
+ if (!target || target.enabled !== true) return
86
+ const samples = Array.isArray(target.samples) ? target.samples : (target.samples = [])
87
+ target.seq = typeof target.seq === 'number' ? target.seq + 1 : 1
88
+ samples.push({ seq: target.seq, ...sample })
89
+ if (samples.length > target.limit) {
90
+ samples.splice(0, samples.length - target.limit)
91
+ }
92
+ if (typeof target.prevHook === 'function') {
93
+ try {
94
+ target.prevHook(sample)
95
+ } catch {}
96
+ }
97
+ }
98
+ }
99
+ root[${p}] = store.hook
100
+ return {
101
+ enabled: true,
102
+ limit: store.limit,
103
+ count: Array.isArray(store.samples) ? store.samples.length : 0,
104
+ }
105
+ })()`:i==="off"?`(() => {
106
+ const root = window
107
+ const store = root[${m}]
108
+ if (!store) return { enabled: false, limit: 0, count: 0 }
109
+ store.enabled = false
110
+ if (root[${p}] === store.hook) {
111
+ root[${p}] = typeof store.prevHook === 'function' ? store.prevHook : undefined
112
+ }
113
+ return {
114
+ enabled: false,
115
+ limit: typeof store.limit === 'number' ? store.limit : 0,
116
+ count: Array.isArray(store.samples) ? store.samples.length : 0,
117
+ }
118
+ })()`:i==="clear"?`(() => {
119
+ const store = window[${m}]
120
+ if (!store) return { cleared: true, count: 0 }
121
+ store.samples = []
122
+ store.seq = 0
123
+ return {
124
+ cleared: true,
125
+ enabled: store.enabled === true,
126
+ limit: typeof store.limit === 'number' ? store.limit : 0,
127
+ count: 0,
128
+ }
129
+ })()`:`(() => {
130
+ const store = window[${m}]
131
+ return {
132
+ enabled: !!store?.enabled,
133
+ limit: typeof store?.limit === 'number' ? store.limit : 0,
134
+ count: Array.isArray(store?.samples) ? store.samples.length : 0,
135
+ }
136
+ })()`}function j(i=50){let c=Number.isFinite(i)&&i>0?Math.max(1,Math.round(i)):50;return`(() => {
137
+ const store = window[${JSON.stringify(x)}]
138
+ const all = Array.isArray(store?.samples) ? store.samples : []
139
+ const samples = all.slice(-${c})
140
+ const first = samples[0] ?? null
141
+ const last = samples[samples.length - 1] ?? null
142
+ const uniquePhases = [...new Set(samples.map((sample) => sample?.phase).filter(Boolean))]
143
+ const metricRange = (key) => {
144
+ const values = samples
145
+ .map((sample) => (typeof sample?.[key] === 'number' ? sample[key] : null))
146
+ .filter((value) => value != null)
147
+ if (values.length === 0) return null
148
+ return {
149
+ min: Math.min(...values),
150
+ max: Math.max(...values),
151
+ }
152
+ }
153
+ return {
154
+ enabled: !!store?.enabled,
155
+ limit: typeof store?.limit === 'number' ? store.limit : 0,
156
+ count: samples.length,
157
+ total: all.length,
158
+ summary: first && last ? {
159
+ durationMs: last.ts - first.ts,
160
+ phases: uniquePhases,
161
+ start: first,
162
+ end: last,
163
+ zoomLevel: metricRange('zoomLevel'),
164
+ horizontalZoom: metricRange('horizontalZoom'),
165
+ launchProgress: metricRange('launchProgress'),
166
+ dismissOffsetY: metricRange('dismissOffsetY'),
167
+ } : null,
168
+ samples,
169
+ }
170
+ })()`}async function l(i,c){return N(i,c)}async function z(i,c){let g=$(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-NAHXP2M5.js");await e(["debug",...i],{port:c.port,verbose:c.verbose});return}let o=S(g);try{switch(_){case"enable":{let e=O(a[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
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
+ const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(t)});
173
+ if (!d) return null;
174
+ return {
175
+ a: d.a,
176
+ b: d.b,
177
+ counts: { added: d.added.length, removed: d.removed.length, changed: d.changed.length },
178
+ added: d.added,
179
+ removed: d.removed,
180
+ changed: d.changed,
181
+ };
182
+ })()`,u=await l(o,s);console.log(r(u,n));break}case"clear-snapshots":{let e=a[0],t=e?`window.__sootsimDebug.clearSnapshots(${JSON.stringify(e)})`:"window.__sootsimDebug.clearSnapshots()";await l(o,t),console.log(r({cleared:e||"all"},n));break}case"find":{let e=a[0];if(e==="sheets"){let t=await l(o,"window.__sootsimDebug.findSheets()");console.log(r(t,n))}else if(e==="portals"){let t=await l(o,"window.__sootsimDebug.findPortals()");console.log(r(t,n))}else console.error(" usage: sootsim debug find <sheets|portals>"),process.exit(1);break}case"trace":{let e=a[0],t=a[1];if(e==="anim"){let s=a[1];if((!s||s==="--help"||s==="-h")&&(console.error(" usage: sootsim debug trace anim <on|off|status|clear|<id>> [id|limit]"),process.exit(1)),s==="on"){let d=a[2]??"all",b=a[3]?Number(a[3]):void 0,h=d==="all"?"all":Number(d);h!=="all"&&!Number.isFinite(h)&&(console.error(` invalid target: ${d}`),process.exit(1)),await f(o,"enableAnimationTrace",h,b);let B=await f(o,"listAnimationTraces");console.log(r({enabled:h,traces:B},n));break}if(s==="off"){let d=a[2]??"all",b=d==="all"?"all":Number(d);b!=="all"&&!Number.isFinite(b)&&(console.error(` invalid target: ${d}`),process.exit(1)),await f(o,"disableAnimationTrace",b),console.log(r({disabled:b},n));break}if(s==="status"||s==="clear"){s==="clear"&&await f(o,"disableAnimationTrace","all");let d=await f(o,"listAnimationTraces");console.log(r({traces:d},n));break}let u=Number(s);Number.isFinite(u)||(console.error(` invalid id: ${s}`),process.exit(1));let T=a[2]?Number(a[2]):void 0,L=await f(o,"getAnimationTrace",u,T);console.log(r({id:u,samples:L},n));break}if(e!=="shell"&&(console.error(" usage: sootsim debug trace <shell|anim> [args]"),process.exit(1)),!t||/^[0-9]+$/.test(t)){let s=t?Number(t):50,u=await l(o,j(s));console.log(r(u,n));break}if(t==="on"){let s=a[2]?Number(a[2]):240,u=await l(o,w("on",s));console.log(r(u,n));break}if(t==="off"){let s=await l(o,w("off"));console.log(r(s,n));break}if(t==="clear"){let s=await l(o,w("clear"));console.log(r(s,n));break}if(t==="status"){let s=await l(o,w("status"));console.log(r(s,n));break}console.error(" usage: sootsim debug trace shell [on [limit]|off|status|clear|recentLimit]"),process.exit(1)}case"record":{let e=a[0],s=await l(o,`window.__sootsimDebug.record(${e==="on"?"true":e==="off"?"false":"undefined"})`);console.log(r({recording:s},n));break}case"recent":{let e=a[0],t=a[1]?Number(a[1]):50,s=e&&e!=="all"?`window.__sootsimDebug.recent(${JSON.stringify(e)}, ${t})`:`window.__sootsimDebug.recent(undefined, ${t})`,u=await l(o,s);console.log(r(u,n));break}case"clear-events":{await l(o,"window.__sootsimDebug.clearEvents()"),console.log(r({cleared:!0},n));break}default:console.error(` unknown subcommand: ${_}`),D(),process.exit(1)}}catch(e){console.error(` debug failed: ${e.message}`),await v(o,{errorsCommand:`sootsim get errors 5${y}`,warningsCommand:`sootsim get warnings 5${y}`,requestsCommand:`sootsim get requests 5${y}`}),process.exit(1)}finally{o.close()}}export{z as runDebug};
@@ -0,0 +1,49 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as S}from"./chunk-CKZ376AY.js";import"./chunk-G5MR66EB.js";import"./chunk-A2CZQIWO.js";import"./chunk-KXYKAYYB.js";import"./chunk-PWXPA745.js";import"./chunk-KSACMDXK.js";import"./chunk-KQWZZ56P.js";import"./chunk-YCETS3B3.js";import"./chunk-JSF5LPNT.js";import"./chunk-HOIHCO7S.js";import"./chunk-KSB6MSZ4.js";import"./chunk-OROM7DZI.js";import"./chunk-MPSZ5EWF.js";import"./chunk-3C3ZH7PP.js";import"./chunk-E5UBZEYR.js";import"./chunk-X2U72K7X.js";import"./chunk-74XPLOV4.js";import"./chunk-MBFP2LVH.js";import"./chunk-E522F5JW.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
+ sootsim detox \u2014 run detox-style tests against a sootsim shell
4
+
5
+ usage:
6
+ sootsim detox [testFiles...] run all tests under e2e/, test/e2e/, or detox/
7
+ sootsim detox --config <path> use a specific jest config
8
+ sootsim detox init scaffold sootsim-detox.config.cjs + sample test
9
+ sootsim detox --watch jest watch mode
10
+ sootsim detox --headed keep the sootsim shell window visible
11
+ sootsim detox -t <pattern> pass a jest --testNamePattern
12
+ sootsim detox --no-launch skip auto-launching a sootsim shell
13
+
14
+ sootsim detox auto-launches a sootsim shell if none is running on the
15
+ expected port. disable with --no-launch if you're managing the shell yourself.
16
+ `;async function C(e,s={}){if((e.includes("--help")||e.includes("-h"))&&(console.log(E),process.exit(0)),e[0]==="init")return U();let c=t=>{let o=e.indexOf(t);return o>=0?e[o+1]:void 0},n=t=>e.includes(t),w=n("--watch"),h=n("--headed"),O=n("--no-launch"),y=c("--config"),d=s.port||Number(process.env.SOOTSIM_PORT)||5173,j=e.filter((t,o)=>{if(t.startsWith("--")||t==="-t"||t==="-h")return!1;let m=e[o-1];return!(m==="--config"||m==="-t"||m==="--testNamePattern"||m==="--grep")}),x=["e2e","test/e2e","detox"],l=process.env.SOOTSIM_TEST_DIR?i(process.cwd(),process.env.SOOTSIM_TEST_DIR):null;if(!l)for(let t of x){let o=i(process.cwd(),t);if(u(o)){l=o;break}}l||(console.error(` error: no detox tests found. expected one of: ${x.join(", ")}
17
+ run 'sootsim detox init' to scaffold a starter suite.`),process.exit(1)),O||await R(d);let r=["jest"],p=y||F(["sootsim-detox.config.cjs","jest.config.cjs","jest.config.js"]),a=null;if(p)r.push("--config",i(process.cwd(),p));else{let t=i(M(),"jest-preset.cjs");a=$(I(),`sootsim-detox-${process.pid}.config.cjs`);let o={rootDir:l,roots:["<rootDir>"],testMatch:["<rootDir>/**/*.test.ts","<rootDir>/**/*.test.js"]};f(a,`module.exports = { ...require(${JSON.stringify(t)}), ...${JSON.stringify(o)} }
18
+ `),r.push("--config",a)}w&&r.push("--watch");let g=c("-t")||c("--testNamePattern")||c("--grep");g&&r.push("-t",g),process.env.SOOTSIM_JEST_JSON==="1"&&r.push("--json"),process.env.SOOTSIM_JEST_OUTPUT_FILE&&r.push("--outputFile",process.env.SOOTSIM_JEST_OUTPUT_FILE),r.push(...j),console.log(" sootsim detox"),console.log(` test dir: ${l}`),console.log(` port: ${d}${h?" (headed)":""}`),p&&console.log(` config: ${p}`);let T=b("npx",r,{cwd:process.cwd(),stdio:"inherit",env:{...process.env,SOOTSIM_TEST_DIR:l,SOOTSIM_PORT:String(d),SOOTSIM_HEADED:h?"1":"",SOOTSIM_URL:process.env.SOOTSIM_URL||`http://localhost:${d}`}}),v=await new Promise(t=>T.on("exit",o=>t(o||0)));if(a)try{_(a)}catch{}process.exit(v)}function F(e){for(let s of e)if(u(i(process.cwd(),s)))return s;return null}async function R(e){await S()||console.warn(` warn: no sootsim shell reachable on :${e}. start one with \`bun run dev:sootsim:shell\`
19
+ or pass --no-launch if you're managing the shell yourself.`)}function U(){let e=process.cwd(),s=i(e,"sootsim-detox.config.cjs");u(s)?console.log(` skip: ${s} already exists`):(f(s,`// sootsim detox jest config.
20
+ // extends the sootsim preset, which rewrites \`import ... from 'detox'\`
21
+ // to the sootsim driver and keeps your jest transforms intact.
22
+
23
+ /** @type {import('@jest/types').Config.InitialOptions} */
24
+ module.exports = {
25
+ preset: 'sootsim/detox/jest-preset',
26
+ rootDir: __dirname,
27
+ testMatch: ['<rootDir>/e2e/**/*.test.ts', '<rootDir>/e2e/**/*.test.js'],
28
+ }
29
+ `),console.log(` created ${s}`));let c=i(e,"e2e"),n=i(c,"example.test.ts");u(n)?console.log(` skip: ${n} already exists`):(D(c,{recursive:!0}),f(n,`// sample sootsim detox test. resolve \`detox\` via the jest preset in
30
+ // sootsim-detox.config.cjs \u2014 no extra imports required.
31
+
32
+ import { by, device, element, expect, waitFor } from 'detox'
33
+
34
+ describe('example', () => {
35
+ beforeAll(async () => {
36
+ await device.launchApp()
37
+ })
38
+
39
+ it('shows the welcome text', async () => {
40
+ await waitFor(element(by.text('Welcome'))).toBeVisible().withTimeout(5000)
41
+ })
42
+
43
+ it('taps a button by id', async () => {
44
+ await element(by.id('start-button')).tap()
45
+ await expect(element(by.id('home-screen'))).toBeVisible()
46
+ })
47
+ })
48
+ `),console.log(` created ${n}`)),console.log(`
49
+ next:`),console.log(" bun sootsim detox # run the sample"),console.log(" bun sootsim detox --watch"),process.exit(0)}export{C as runDetox};
@@ -0,0 +1,25 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as k,h as S}from"./chunk-7X6OPSRD.js";import"./chunk-MBFP2LVH.js";import"./chunk-E522F5JW.js";import{spawn as D}from"child_process";import{existsSync as w,readFileSync as P}from"fs";import R from"http";import{resolve as c,dirname as _}from"path";import{fileURLToPath as E}from"url";var u=_(E(import.meta.resolve("sootsim-engine/package.json"))),j=new Set(["turbo","nx","lerna","pnpm","npm","yarn","bun","npx","bunx"]);function A(o){let s=o[0]?.replace(/^.*[\\/]/,"");return!!(j.has(s)||s==="pnpm"||s==="npm"||s==="yarn"||s==="bun")}async function J(o){o.command.length===0&&(console.log(`
3
+ sootsim dev \u2014 iOS simulator proxy
4
+
5
+ wraps any bundler. proxies everything through sootsim.
6
+
7
+ usage:
8
+ sootsim pnpm dev
9
+ sootsim npx expo start
10
+ sootsim --port 3000 npm start
11
+ sootsim dev -- one dev
12
+
13
+ add to package.json:
14
+ "dev:soot": "sootsim dev -- bun metro:dev"
15
+ `),process.exit(1));let s=o.port||I(),e=s+100,t=[...o.command],m=A(t);if(!m){let n=t.findIndex(b=>b==="--port"||b==="-p");n>=0&&t[n+1]?t[n+1]=String(e):t.push("--port",String(e))}console.log(`
16
+ \u250C\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\u2500\u2500\u2500\u2500\u2500\u2510
17
+ \u2502 sootsim \u2502
18
+ \u2514\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\u2500\u2500\u2500\u2500\u2500\u2518
19
+
20
+ port: ${s} \u2192 ${e} (internal)
21
+ command: ${t.join(" ")}
22
+ mode: ${m?"env (task runner detected)":"flag (direct bundler)"}
23
+ `);let r=process.cwd(),p=[...[c(r,"node_modules/.bin"),c(r,"../../node_modules/.bin")].filter(n=>w(n)),process.env.PATH].join(":"),i=D(t[0],t.slice(1),{cwd:r,stdio:"inherit",env:{...process.env,PATH:p,PORT:String(e),RCT_METRO_PORT:String(e),ONE_PORT:String(e),EXPO_METRO_PORT:String(e)}});i.on("error",n=>{console.error(` failed to start: ${n.message}`),process.exit(1)}),console.log(" waiting for bundler..."),await H(e)||(console.error(` bundler didn't start on port ${e} within 120s`),i.kill(),process.exit(1));let a=W(),l=a[0];for(let n of a)try{if((await fetch(`http://localhost:${e}${n}`,{method:"HEAD",signal:AbortSignal.timeout(5e3)})).ok){l=n;break}}catch{}console.log(" bundler ready"),console.log(` bundle: ${l.split("?")[0]}`);let{createServer:$}=await import("vite"),{sootsim:T}=await import("./vite-plugin-5AEUUBKP.js"),O=`http://localhost:${s}${l}`,f=`http://localhost:${s}/?bundle=${encodeURIComponent(O)}`,g=await $({root:u,configFile:!1,plugins:[{name:"sootsim-proxy",configureServer(n){n.middlewares.use(C(e,f))}},T()],server:{port:s,strictPort:!0,fs:{allow:[u,c(u,".."),c(u,"../../node_modules")]}},optimizeDeps:{include:["react-reconciler","react-reconciler/constants","canvaskit-wasm","yoga-layout"]},resolve:{alias:[{find:"@tamagui/config/v5-css",replacement:c(u,"../../node_modules/@tamagui/config/dist/esm/v5-css.mjs")}]}});await g.listen(),console.log(`
24
+ sootsim: ${f}
25
+ `);let y=o.driver?k(o.driver):null;o.driver&&!y&&console.error(` unknown driver "${o.driver}" \u2014 try \`sootsim list --drivers\``);let v=y??S(null,["electron","system","chromium"])??null;if(v){let n=await v.launch({url:f,headless:o.headless});n.launched?console.log(` ${n.message}`):console.log(` ${v.id}: ${n.message}`)}let x=()=>{i.kill(),g.close()};process.on("SIGINT",()=>{x(),process.exit(0)}),process.on("SIGTERM",x),i.on("exit",n=>{g.close(),process.exit(n||0)})}function I(){let o=c(process.cwd(),"package.json");if(w(o))try{let s=JSON.parse(P(o,"utf8")),e={...s.dependencies,...s.devDependencies};if(e.one||e.expo||e["react-native"])return 8081}catch{}return 8081}function W(){let o=c(process.cwd(),"package.json");if(w(o))try{let s=JSON.parse(P(o,"utf8"));if({...s.dependencies,...s.devDependencies}.one)return["/node_modules/one/metro-entry.bundle?platform=ios&dev=true&minify=false","/index.bundle?platform=ios&dev=true&hot=true&minify=false"]}catch{}return["/index.bundle?platform=ios&dev=true&hot=true&minify=false"]}async function H(o,s=12e4){let e=Date.now();for(;Date.now()-e<s;){try{let t=await fetch(`http://localhost:${o}/status`,{method:"GET",signal:AbortSignal.timeout(2e3)});if(t.ok||t.status<500)return!0}catch{}try{let t=await fetch(`http://localhost:${o}/`,{method:"HEAD",signal:AbortSignal.timeout(2e3)});if(t.ok||t.status<500)return!0}catch{}await new Promise(t=>setTimeout(t,2e3))}return!1}function C(o,s){return(e,t,m)=>{let r=e.url||"/",h=r.split("?")[0];if(h==="/"&&s&&!r.includes("bundle=")){let i=s.replace(/^https?:\/\/[^/]+/,"");t.writeHead(302,{Location:i}),t.end();return}if(h==="/"||r.startsWith("/src/")||r.startsWith("/@vite/")||r.startsWith("/@id/")||r.startsWith("/@fs/")||r.startsWith("/node_modules/.vite/")||r.startsWith("/canvaskit.wasm")||r.startsWith("/fonts/")||r.startsWith("/icons/")||r.startsWith("/sounds/"))return m();let p=R.request({hostname:"localhost",port:o,path:r,method:e.method||"GET",headers:{...e.headers,host:`localhost:${o}`}},i=>{let d={...i.headers},a=i.headers["set-cookie"];if(a){d["x-sootsim-set-cookie"]=Array.isArray(a)?a.join(", "):a;let l=String(d["access-control-expose-headers"]||"");d["access-control-expose-headers"]=(l?l+", ":"")+"x-sootsim-set-cookie"}t.writeHead(i.statusCode||502,d),i.pipe(t)});p.on("error",i=>{t.writeHead(502,{"Content-Type":"text/plain"}),t.end(`sootsim proxy error: ${i.message}`)}),e.pipe(p)}}export{J as runDev};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-E522F5JW.js";import{spawn as d,execSync as m}from"child_process";import{openSync as f,closeSync as v}from"fs";import{resolve as i}from"path";function p(e){try{return m(`lsof -ti:${e}`,{encoding:"utf8",timeout:3e3}).trim().length>0}catch{return!1}}async function h(e,t=3e4){let o=Date.now();for(;Date.now()-o<t;){if(p(e))return!0;await new Promise(n=>setTimeout(n,500))}return!1}function b(){try{return m('pgrep -f "electron.*packages/sootsim"',{encoding:"utf8",timeout:3e3}).trim().length>0}catch{return!1}}async function P(e,t){let{port:o,verbose:n,device:l}=t,r=i(process.env.TMPDIR||"/tmp","sootsim-dev-vite.log"),a=i(process.env.TMPDIR||"/tmp","sootsim-dev-electron.log"),u=i(e,"..","sootsim-engine");if(await p(o))console.log(` vite already on :${o}`);else{console.log(` starting vite on :${o}`);let c=f(r,"a");d("bun",["run","dev"],{cwd:u,stdio:["ignore",c,c],detached:!0}).unref(),v(c),await h(o)||(console.error(` vite failed to start on :${o}`),console.error(` log: ${r}`),process.exit(1)),n&&console.log(" vite ready")}if(b()){console.log(" sootsim electron already running");return}console.log(" starting electron");let s=f(a,"a"),g={...process.env};l&&(g.SOOTSIM_INITIAL_DEVICE=l),d("bun",["run","dev:electron"],{cwd:u,stdio:["ignore",s,s],detached:!0,env:g}).unref(),v(s),console.log(` vite log: ${r}`),console.log(` electron log: ${a}`)}export{P as runDevCheckout};
@@ -0,0 +1,16 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-A2CZQIWO.js";import"./chunk-KSACMDXK.js";import"./chunk-KQWZZ56P.js";import{f as c,g as r,h as g}from"./chunk-YCETS3B3.js";import{b as d,d as l,g as a}from"./chunk-MPSZ5EWF.js";import"./chunk-3C3ZH7PP.js";import"./chunk-X2U72K7X.js";import"./chunk-E522F5JW.js";function h(){console.log(`
3
+ sootsim device \u2014 inspect or change the live device preset for a session
4
+
5
+ usage:
6
+ sootsim device
7
+ sootsim device get
8
+ sootsim device set <model> [--session <id>]
9
+ sootsim device list
10
+
11
+ examples:
12
+ sootsim device
13
+ sootsim device set iphone-14
14
+ sootsim device set ipad-pro-13 --session tab-7
15
+ `)}function v(t){let i=r(t);console.log(` ${t.padEnd(14)} ${String(i.width).padStart(4)}x${String(i.height).padEnd(4)} pt ${String(i.width*i.scale).padStart(4)}x${String(i.height*i.scale).padEnd(4)} px ${i.name}`)}async function u(t){let i=l(t);try{let s=await a(i,"SootSim.bridges.settings.get")??{deviceModel:null},o=typeof s.deviceModel=="string"?s.deviceModel:null;if(!o||!(o in c))return null;let e=r(o);return{model:o,width:e.width,height:e.height,scale:e.scale,name:e.name}}finally{i.close()}}async function x(t,i){(t.includes("--help")||t.includes("-h"))&&(h(),process.exit(0));let s=t[0];if(!s||s==="get"){let o=d(t,{port:i.port}),e=await u(o);e||(console.error(" error: could not read current device from the target session"),process.exit(1)),console.log(` ${e.model} ${e.width}x${e.height} pt ${e.width*e.scale}x${e.height*e.scale} px ${e.name}`);return}if(s==="list"){console.log(` available devices:
16
+ `);for(let o of g())v(o);return}if(s==="set"){let o=t[1];o||(console.error(" error: device set expects a model"),process.exit(1)),o in c||(console.error(` error: unknown device "${o}"`),console.error(" run `sootsim device list` to see valid models"),process.exit(1));let e=d(t,{port:i.port}),p=l(e);try{let m=await a(p,"SootSim.bridges.settings.set","deviceModel",o),n=r(o);console.log(` ${m?"set":"kept"} device: ${o} (${n.width}x${n.height} pt, ${n.width*n.scale}x${n.height*n.scale} px)${m?" \u2014 reloading session":""}`)}finally{p.close()}return}h(),console.error(` unknown subcommand: ${s}`),process.exit(1)}export{x as runDeviceCommand};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-7X6OPSRD.js";import"./chunk-MBFP2LVH.js";import"./chunk-E522F5JW.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};
@@ -0,0 +1,15 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as l,g as p}from"./chunk-7X6OPSRD.js";import{a as d}from"./chunk-QOBRRY5X.js";import{a}from"./chunk-74XPLOV4.js";import{a as s}from"./chunk-MBFP2LVH.js";import"./chunk-E522F5JW.js";async function I(o,r){(o.includes("--help")||o.includes("-h"))&&(console.log(`
3
+ sootsim electron \u2014 launch the desktop companion
4
+
5
+ usage:
6
+ sootsim electron [options]
7
+
8
+ options:
9
+ --port <number> connect to running dev server on this port
10
+ --driver <id> override the launch driver (default: electron)
11
+
12
+ examples:
13
+ sootsim electron
14
+ sootsim electron --port 5173
15
+ `),process.exit(0));let c=o.indexOf("--driver"),n=(c>=0?o[c+1]:void 0)||r.driver,i=l;if(n){let e=p(n);e||(console.error(` unknown driver "${n}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),i=e}if(i.id==="electron"){let e=s();if(!e){if(a(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await d("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:v}=await import("./install-desktop-PYIZIH67.js");await v(["--yes"]),e=s()}e||process.exit(1)}console.log(` launching ${e.path}`)}let m=r.port?`http://localhost:${r.port}`:void 0,t=await i.launch({url:m,device:r.device});t.launched||(console.error(` ${t.message}`),process.exit(1)),console.log(` ${t.message}`)}export{I as runElectron};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d}from"./chunk-CKZ376AY.js";import"./chunk-G5MR66EB.js";import"./chunk-A2CZQIWO.js";import"./chunk-KXYKAYYB.js";import"./chunk-PWXPA745.js";import"./chunk-KSACMDXK.js";import"./chunk-KQWZZ56P.js";import"./chunk-YCETS3B3.js";import"./chunk-JSF5LPNT.js";import"./chunk-HOIHCO7S.js";import"./chunk-KSB6MSZ4.js";import"./chunk-OROM7DZI.js";import"./chunk-MPSZ5EWF.js";import"./chunk-3C3ZH7PP.js";import"./chunk-E5UBZEYR.js";import"./chunk-X2U72K7X.js";import"./chunk-74XPLOV4.js";import"./chunk-MBFP2LVH.js";import"./chunk-E522F5JW.js";export{b as discoverSootsimUrl,a as parseFlowFile,d as runFlow,c as runFlowPlayback};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as t,c as r,d as l}from"./chunk-GPVPHE2B.js";import"./chunk-3C3ZH7PP.js";import"./chunk-E522F5JW.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};