sootsim 0.1.66 → 0.1.67

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 (147) hide show
  1. package/dist-cli/bin.js +3 -3
  2. package/dist-cli/chunks/{agent-IW7CCSSI.js → agent-Z45KTLTP.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-5DJBERZP.js → agent-wrapper-EEKVEJOC.js} +2 -2
  4. package/dist-cli/chunks/{assert-RHILK3WR.js → assert-MDYZKXZ6.js} +2 -2
  5. package/dist-cli/chunks/auto-bootstrap-YZ6C6VYO.js +2 -0
  6. package/dist-cli/chunks/beta-WXH75XUE.js +2 -0
  7. package/dist-cli/chunks/chunk-2HKCZLY7.js +372 -0
  8. package/dist-cli/chunks/{chunk-UMXVWFST.js → chunk-2I535GZU.js} +1 -1
  9. package/dist-cli/chunks/{chunk-TJEP4DBA.js → chunk-3KVVIZ6M.js} +2 -2
  10. package/dist-cli/chunks/chunk-42NMKOVE.js +3 -0
  11. package/dist-cli/chunks/{chunk-WAOLC7WV.js → chunk-4H6LBA4A.js} +1 -1
  12. package/dist-cli/chunks/{chunk-LVFWALS4.js → chunk-4QSGVTBE.js} +2 -2
  13. package/dist-cli/chunks/{chunk-T4YLDM5C.js → chunk-52RZ6TSZ.js} +3 -3
  14. package/dist-cli/chunks/{chunk-AYBGSHQK.js → chunk-5WRBVYML.js} +2 -2
  15. package/dist-cli/chunks/{chunk-BD76YSRN.js → chunk-67566AJS.js} +2 -2
  16. package/dist-cli/chunks/chunk-6O64VUC6.js +2 -0
  17. package/dist-cli/chunks/chunk-7PQHQOCI.js +186 -0
  18. package/dist-cli/chunks/{chunk-V4SZERWD.js → chunk-AQ7YR4MO.js} +14 -14
  19. package/dist-cli/chunks/{chunk-6AP6LXVV.js → chunk-ATRGAFJD.js} +1 -1
  20. package/dist-cli/chunks/{chunk-LRBMW2WC.js → chunk-BCVVANS5.js} +2 -2
  21. package/dist-cli/chunks/chunk-CUNQTNH4.js +35 -0
  22. package/dist-cli/chunks/{chunk-DEQ7RED3.js → chunk-DOWYG3HG.js} +2 -2
  23. package/dist-cli/chunks/{chunk-XZ5SQJM2.js → chunk-EJTXYZEF.js} +128 -36
  24. package/dist-cli/chunks/{chunk-4NT6VRUU.js → chunk-F23Y4HMT.js} +1 -1
  25. package/dist-cli/chunks/{chunk-M2Q4FXRE.js → chunk-F4RC4AOY.js} +1 -1
  26. package/dist-cli/chunks/chunk-GFVC6EEB.js +1 -0
  27. package/dist-cli/chunks/{chunk-BEQD2DSK.js → chunk-HW5YHSIE.js} +1 -1
  28. package/dist-cli/chunks/{chunk-VRV2X4X2.js → chunk-IB4BRND4.js} +1 -1
  29. package/dist-cli/chunks/{chunk-22CO2ZE3.js → chunk-IBWN764Q.js} +2 -2
  30. package/dist-cli/chunks/chunk-JE4JBSNJ.js +119 -0
  31. package/dist-cli/chunks/{chunk-HWCZYW6M.js → chunk-K4PKR2EO.js} +2 -2
  32. package/dist-cli/chunks/chunk-KBJ2WHII.js +73 -0
  33. package/dist-cli/chunks/chunk-KR36VJSN.js +1 -0
  34. package/dist-cli/chunks/{chunk-EEMGSSWY.js → chunk-LQ5BA5JU.js} +2 -2
  35. package/dist-cli/chunks/chunk-MIAAZSSE.js +12 -0
  36. package/dist-cli/chunks/{chunk-BTHB3PMG.js → chunk-N4JRDJMN.js} +3 -3
  37. package/dist-cli/chunks/{chunk-FXF2FHPI.js → chunk-NYR3Z44O.js} +2 -2
  38. package/dist-cli/chunks/{chunk-EIQLQDKX.js → chunk-O624O5MO.js} +2 -2
  39. package/dist-cli/chunks/{chunk-4LYNJPUM.js → chunk-SH6HMUCY.js} +2 -2
  40. package/dist-cli/chunks/chunk-SVFSMAZN.js +2 -0
  41. package/dist-cli/chunks/chunk-TEMZK6Q2.js +1 -0
  42. package/dist-cli/chunks/{chunk-D4VEI6MI.js → chunk-TLTS533S.js} +1 -1
  43. package/dist-cli/chunks/chunk-U47AHSGE.js +23 -0
  44. package/dist-cli/chunks/{chunk-LCKLQSZX.js → chunk-XCRUPKWB.js} +2 -2
  45. package/dist-cli/chunks/{chunk-NCSGLZRV.js → chunk-YGQV3CUV.js} +2 -2
  46. package/dist-cli/chunks/{chunk-UNSLXX7V.js → chunk-ZJJKYJMH.js} +2 -2
  47. package/dist-cli/chunks/{chunk-GDCMTHEU.js → chunk-ZO7SGE65.js} +1 -1
  48. package/dist-cli/chunks/{chunk-HIN5TAAL.js → chunk-ZP2HMCKS.js} +1 -1
  49. package/dist-cli/chunks/cli-version-5LGQQE5P.js +2 -0
  50. package/dist-cli/chunks/{compat-I7JXYUJN.js → compat-5MMZ4R3Q.js} +3 -3
  51. package/dist-cli/chunks/{config-3HR5RKVH.js → config-YWN44WJQ.js} +2 -2
  52. package/dist-cli/chunks/control-LUCFDAZI.js +2 -0
  53. package/dist-cli/chunks/{cpu-profile-ZVHMTVAU.js → cpu-profile-VFGUVXU5.js} +2 -2
  54. package/dist-cli/chunks/{daemon-VYRTYH55.js → daemon-ONX5ZBXF.js} +2 -2
  55. package/dist-cli/chunks/{debug-CQ6Y7GJ2.js → debug-CPOG32OT.js} +5 -5
  56. package/dist-cli/chunks/demo-app-registry-LWT6JLU6.js +2 -0
  57. package/dist-cli/chunks/{detox-7ZKTGLDR.js → detox-J6NGSZR5.js} +2 -2
  58. package/dist-cli/chunks/{device-4M6Z7E2N.js → device-QYOQXI2P.js} +2 -2
  59. package/dist-cli/chunks/{diagnose-SMQLYGNX.js → diagnose-MMW4LJLA.js} +2 -2
  60. package/dist-cli/chunks/drivers-NRWUJJCD.js +2 -0
  61. package/dist-cli/chunks/{electron-6N2MIN5W.js → electron-IK3HIZY4.js} +3 -3
  62. package/dist-cli/chunks/flow-2MB7HINM.js +2 -0
  63. package/dist-cli/chunks/{hints-RJCZS2E3.js → hints-KZOD56U5.js} +2 -2
  64. package/dist-cli/chunks/{home-paths-DCUNA3CD.js → home-paths-R2YZZTUM.js} +2 -2
  65. package/dist-cli/chunks/inspect-ZARO3HQ4.js +970 -0
  66. package/dist-cli/chunks/install-O67RTYCX.js +2 -0
  67. package/dist-cli/chunks/{install-desktop-C7424OSW.js → install-desktop-4GH5I7SC.js} +3 -3
  68. package/dist-cli/chunks/{keys-TXUQOAZ3.js → keys-AXEFZUUI.js} +2 -2
  69. package/dist-cli/chunks/{launch-MVA44QTC.js → launch-QLE56ON7.js} +3 -3
  70. package/dist-cli/chunks/{login-NHO2WTHC.js → login-J45NQQM6.js} +4 -4
  71. package/dist-cli/chunks/{logout-SRRWADCE.js → logout-ZE5OUBB7.js} +2 -2
  72. package/dist-cli/chunks/{maestro-UHNXEZAN.js → maestro-FS6CAKDD.js} +2 -2
  73. package/dist-cli/chunks/{preview-ETIUP7KC.js → preview-TSU5IXVR.js} +2 -2
  74. package/dist-cli/chunks/{profile-MY5JFVIF.js → profile-ZBJ4TYWA.js} +2 -2
  75. package/dist-cli/chunks/{react-KCMC4GL3.js → react-TGZLTTYN.js} +2 -2
  76. package/dist-cli/chunks/record-JSBFUNOD.js +54 -0
  77. package/dist-cli/chunks/runtime-DGDQ7NVY.js +2 -0
  78. package/dist-cli/chunks/{runtime-delivery-LQZIWQU6.js → runtime-delivery-36UMAXOV.js} +2 -2
  79. package/dist-cli/chunks/screenshot-3CHMALUJ.js +33 -0
  80. package/dist-cli/chunks/{screenshot-mode-USPWASI3.js → screenshot-mode-C547UT5H.js} +2 -2
  81. package/dist-cli/chunks/{screenshots-EPEDNA6H.js → screenshots-XCNGSNYG.js} +2 -2
  82. package/dist-cli/chunks/{server-222QT33M.js → server-W37X3IW7.js} +6 -6
  83. package/dist-cli/chunks/setup-repo-DETS5ZJT.js +2 -0
  84. package/dist-cli/chunks/{skills-6XRREE2M.js → skills-OXZLDNDW.js} +2 -2
  85. package/dist-cli/chunks/{start-YCAZBZEX.js → start-N6ZQYUBP.js} +4 -4
  86. package/dist-cli/chunks/store-QOXJKJUZ.js +2 -0
  87. package/dist-cli/chunks/telemetry-74LX7WG4.js +2 -0
  88. package/dist-cli/chunks/{test-6TNRHSWC.js → test-DWZ7PRSW.js} +3 -3
  89. package/dist-cli/chunks/{three-mode-MDOLHGXW.js → three-mode-P2R7KA62.js} +2 -2
  90. package/dist-cli/chunks/{timeline-72MWE44G.js → timeline-VPES3YCN.js} +3 -3
  91. package/dist-cli/chunks/{upgrade-IHZ4DFAE.js → upgrade-NYQLA4UJ.js} +2 -2
  92. package/dist-cli/chunks/upload-YOMMYESV.js +2 -0
  93. package/dist-cli/chunks/{web-JLJSJUS2.js → web-OTALJKK5.js} +2 -2
  94. package/dist-cli/chunks/what-happened-GZ73H6KF.js +22 -0
  95. package/dist-cli/chunks/{whoami-2EYGCRDQ.js → whoami-UDLQK7IY.js} +2 -2
  96. package/dist-lib/agent-daemon-client.cjs +1 -1
  97. package/dist-lib/agent-events.cjs +1 -1
  98. package/dist-lib/agent-sessions.cjs +1 -1
  99. package/dist-lib/attached-projects.cjs +1 -1
  100. package/dist-lib/auth/shared-session.cjs +1 -1
  101. package/dist-lib/backend-origin.cjs +1 -1
  102. package/dist-lib/bridge-constants.cjs +1 -1
  103. package/dist-lib/cli-constants.cjs +1 -1
  104. package/dist-lib/config.cjs +1 -1
  105. package/dist-lib/dev-bundle-resolution.cjs +9 -2
  106. package/dist-lib/home-paths.cjs +1 -1
  107. package/dist-lib/host/bridge-host.cjs +23 -7
  108. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  109. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  110. package/dist-lib/index.cjs +1 -1
  111. package/dist-lib/metro.cjs +1 -1
  112. package/dist-lib/profiles.cjs +1 -1
  113. package/dist-lib/render-mode.cjs +1 -1
  114. package/dist-lib/vite-base.cjs +23 -7
  115. package/dist-lib/vite.cjs +1 -1
  116. package/package.json +1 -1
  117. package/dist-cli/chunks/auto-bootstrap-PS2UDBP7.js +0 -2
  118. package/dist-cli/chunks/beta-XLYWSKEA.js +0 -2
  119. package/dist-cli/chunks/chunk-5MVFADNH.js +0 -3
  120. package/dist-cli/chunks/chunk-7NYW73Q6.js +0 -2
  121. package/dist-cli/chunks/chunk-EMMX6RF7.js +0 -73
  122. package/dist-cli/chunks/chunk-FIIBCY5I.js +0 -3
  123. package/dist-cli/chunks/chunk-G4VWDOWB.js +0 -17
  124. package/dist-cli/chunks/chunk-GMKGJHVG.js +0 -1
  125. package/dist-cli/chunks/chunk-M3ZEZHOB.js +0 -34
  126. package/dist-cli/chunks/chunk-MWTMLNGM.js +0 -348
  127. package/dist-cli/chunks/chunk-NQKBIKUZ.js +0 -1
  128. package/dist-cli/chunks/chunk-QMRXLBPN.js +0 -11
  129. package/dist-cli/chunks/chunk-X4HQLK4V.js +0 -119
  130. package/dist-cli/chunks/chunk-XOTJSR4T.js +0 -2
  131. package/dist-cli/chunks/chunk-YSQV4D7P.js +0 -1
  132. package/dist-cli/chunks/chunk-Z6HSVZIO.js +0 -100
  133. package/dist-cli/chunks/cli-version-ESQ2S6N5.js +0 -2
  134. package/dist-cli/chunks/control-TDZXFNVT.js +0 -2
  135. package/dist-cli/chunks/demo-app-registry-JAYU7BBM.js +0 -2
  136. package/dist-cli/chunks/drivers-SIY6JBEM.js +0 -2
  137. package/dist-cli/chunks/flow-BZEWL7UQ.js +0 -2
  138. package/dist-cli/chunks/inspect-T5NC7HHB.js +0 -1025
  139. package/dist-cli/chunks/install-YTJI5RS7.js +0 -2
  140. package/dist-cli/chunks/record-DHDSXC2Y.js +0 -51
  141. package/dist-cli/chunks/runtime-AJP6V5LM.js +0 -2
  142. package/dist-cli/chunks/screenshot-4KPEEI6I.js +0 -28
  143. package/dist-cli/chunks/setup-repo-D56L3CEB.js +0 -2
  144. package/dist-cli/chunks/store-Z32KZ34K.js +0 -2
  145. package/dist-cli/chunks/telemetry-RFTX2BZK.js +0 -2
  146. package/dist-cli/chunks/upload-G5C7LJWG.js +0 -2
  147. package/dist-cli/chunks/what-happened-BUXSJ3QS.js +0 -15
@@ -0,0 +1,22 @@
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A as y,L as x,y as F,z as T}from"./chunk-AQ7YR4MO.js";import{c as S,e as N}from"./chunk-U47AHSGE.js";import{b as k}from"./chunk-IB4BRND4.js";import"./chunk-6O64VUC6.js";import"./chunk-HW5YHSIE.js";import"./chunk-TLTS533S.js";function _(n){let e=[];for(let t=0;t<n.length;t++)if(n[t]==="--since"&&t+1<n.length){e.push(t,t+1);let s=n[t+1].trim(),l=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(s);if(l){let a=Number(l[1]),m=l[2]??"ms",$=m==="s"?a*1e3:m==="m"?a*6e4:a;return{since:Date.now()-$,consumed:e}}let o=Number(s);if(Number.isFinite(o)&&o>1e12)return{since:o,consumed:e}}return{consumed:e}}function K(n){let e=[];for(let t=0;t<n.length;t++)if(n[t]==="--kinds"&&t+1<n.length)return e.push(t,t+1),{kinds:n[t+1].split(",").map(s=>s.trim()).filter(Boolean),consumed:e};return{consumed:e}}function O(n){let e=[];for(let t=0;t<n.length;t++)if(n[t]==="--limit"&&t+1<n.length){e.push(t,t+1);let s=Number(n[t+1]);if(Number.isFinite(s)&&s>0)return{limit:s,consumed:e}}return{consumed:e}}function j(n,e){if(e===null)return new Date(n).toLocaleTimeString();let t=(n-e)/1e3;return`${t>=0?"+":""}${t.toFixed(2)}s`}function B(n,e){switch(n){case"app-launch":return e.phase==="launch"?`launch ${e.appName??e.toAppId??""}`:`dismiss ${e.appName??e.fromAppId??""} \u2192 ${e.toAppId??""}`;case"toast":return`"${e.text??""}"${e.durationMs?` (${e.durationMs}ms)`:""}`;case"keyboard":return`${e.phase??"?"}${e.heightPx?` h=${e.heightPx}`:""}${e.mode?` ${e.mode}`:""}`;case"screen":return`${e.phase??"?"} ${e.name??e.activeName??""}`;case"route":return`${e.phase??"?"} ${e.path??e.pathname??""}`;case"alert":case"actionsheet":case"picker":return`${e.phase??"?"} ${e.title??e.message??""}`;case"notification":return`${e.title??""}${e.body?` \u2014 ${e.body}`:""}`;case"fetch":return`${e.method??"GET"} ${e.url??""}${e.status?` -> ${e.status}`:""}`;case"console":return`${e.level??"log"}: ${(e.message??"").toString().slice(0,120)}`;case"shell":return`${e.event??e.type??e.phase??""}`;case"scroll":return`${e.phase??"?"} ${e.target??""}`;case"gesture":return`${e.phase??"?"} ${e.type??""}`;case"text-input":return`${e.phase??"?"}${e.value!==void 0?` "${String(e.value).slice(0,40)}"`:""}`;case"layout":return`${e.kind??"?"} ${e.testID??e.type??""}${e.skipped?` skipped:${e.reason??"unknown"}`:""}`;case"react-commit":{let t=e.slowest;return`${e.fiberCount??"?"} fibers ${e.durationMs??"?"}ms${t?.displayName?` \xB7 ${t.displayName} ${t.durationMs??"?"}ms`:""}`}case"reanimated":case"animation":return`${e.kind??""} ${e.target??""}${e.durationMs?` ${e.durationMs}ms`:""}`}}function A(n,e){let t=j(n.t,e).padStart(8),s=n.context.padEnd(6),l=`[${n.kind}]`.padEnd(15),o="",a=n.data;return a&&typeof a=="object"&&(o=B(n.kind,a)),` ${t} ${s} ${l} ${o}`}function M(n){let e=[],t={label:"initial state",events:[],startedAt:n[0]?.t??null};e.push(t);for(let s of n)if(t.events.push(s),s.kind==="screen"||s.kind==="route"){let l=s.data,o=l?.phase;if(!o||o==="enter"||o==="appear"||o==="active"){let a=l?.name||l?.activeName||l?.path||l?.pathname||s.kind;e.length===1&&t.events.length===1?t.label=`${s.kind}: ${a}`:(t={label:`${s.kind}: ${a}`,events:[],startedAt:s.t},e.push(t))}}return e}async function J(n,e){let t=S(n,{port:e.port,stripBooleanFlags:["--summary","--all","--json","--no-advance","--help","-h","--flow","--noisy"],stripValueFlags:["--since","--kinds","--limit"]});(n.includes("--help")||n.includes("-h"))&&(console.log(`
3
+ sootsim what-happened \u2014 show recent events from the semantic timeline
4
+
5
+ usage:
6
+ sootsim what-happened # since last CLI call
7
+ sootsim what-happened --summary # one-line counts
8
+ sootsim what-happened --all # full ring (ignore cursor)
9
+ sootsim what-happened --since 5s # absolute window
10
+ sootsim what-happened --kinds toast,fetch
11
+ sootsim what-happened --noisy # include react-commit/layout/scroll
12
+ sootsim what-happened --limit 50
13
+ sootsim what-happened --json
14
+ sootsim what-happened --no-advance # don't advance cursor after read
15
+
16
+ note: by default react-commit, layout, and scroll events are hidden as
17
+ noise \u2014 pass --noisy or include them in --kinds to see them.
18
+ `),process.exit(0));let s=n.includes("--summary"),l=n.includes("--flow"),o=n.includes("--all"),a=n.includes("--json"),m=n.includes("--no-advance"),$=n.includes("--noisy"),{since:c}=_(n),{kinds:p}=K(n),{limit:E}=O(n),g=k(),w={limit:E??200,...p&&p.length?{kinds:p}:{},...c!==void 0?{since:c}:o?{}:{sinceCursor:g}},d=N(t);try{if(s){let r=await F(d,w);if(a)console.log(JSON.stringify(r));else{let u=o?"all time":c!==void 0?`last ${((Date.now()-c)/1e3).toFixed(1)}s`:"since last call";console.log(` ${u}: ${x(r)}`)}!m&&!o&&r.lastAt&&await y(d,g,r.lastAt);return}let i=await T(d,w),b=new Set(["react-commit","layout","scroll"]),I=Array.isArray(p)&&p.some(r=>b.has(r)),C=!$&&!I,h=0;if(C){let r=i.events.filter(u=>b.has(u.kind)?(h+=1,!1):!0);i.events=r}if(a)console.log(JSON.stringify(l?M(i.events):i,null,2));else{if(i.events.length===0)h>0?console.log(` no non-noise events (${h} react-commit/layout/scroll hidden)`):console.log(o?" no events recorded":c!==void 0?" no events in window":" no new events since last call");else if(l){let r=i.events[0]?.t??null,u=M(i.events),v=o?`\u2500\u2500\u2500 ${i.events.length} event(s) total \u2014 flow view \u2500\u2500\u2500`:c!==void 0?`\u2500\u2500\u2500 ${i.events.length} event(s) in last ${((Date.now()-c)/1e3).toFixed(1)}s \u2014 flow view \u2500\u2500\u2500`:`\u2500\u2500\u2500 ${i.events.length} event(s) since last call \u2014 flow view \u2500\u2500\u2500`;console.log(` ${v}`);for(let f of u){console.log(`
19
+ \u2500\u2500 ${f.label} (${f.events.length} event${f.events.length===1?"":"s"}) \u2500\u2500`);for(let D of f.events)console.log(A(D,r))}}else{let r=i.events[0]?.t??null,u=o?`\u2500\u2500\u2500 ${i.events.length} event(s) total \u2500\u2500\u2500`:c!==void 0?`\u2500\u2500\u2500 ${i.events.length} event(s) in last ${((Date.now()-c)/1e3).toFixed(1)}s \u2500\u2500\u2500`:`\u2500\u2500\u2500 ${i.events.length} event(s) since last call \u2500\u2500\u2500`;console.log(` ${u}`);for(let v of i.events)console.log(A(v,r))}h>0&&i.events.length>0&&process.stderr.write(`
20
+ ${h} high-frequency event(s) hidden (react-commit/layout/scroll)
21
+ rerun with --noisy or --kinds react-commit,layout,scroll to include them
22
+ `)}!m&&!o&&i.watermark>0&&await y(d,g,i.watermark)}finally{d.close()}}export{J as runWhatHappened};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as i}from"./chunk-EEMGSSWY.js";import{d as n}from"./chunk-EIQLQDKX.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";async function u(){let o=i();if(o||(console.log(" not signed in"),console.log(" set SOOTSIM_API_KEY=sk_sootsim_\u2026 or run `sootsim login`"),process.exit(1)),o.kind==="api-key"){let r=`${o.secret.slice(0,14)}\u2026`,t=o.source==="env"?"SOOTSIM_API_KEY env var":"saved key (~/.config/sootsim/credentials.json)";console.log(` api key ${r}`),console.log(` source: ${t}`);return}if(o.kind==="github"){console.log(` github token (${o.source})`),console.log(` repo: ${o.repoId}`);return}let e=await n(),s=e?.user;console.log(` ${s?.email||s?.name||s?.id||"signed in"}`),console.log(` origin: ${e?.origin??o.origin}`),e?.updatedAt&&console.log(` updated: ${e.updatedAt}`)}export{u as runWhoami};
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as i}from"./chunk-LQ5BA5JU.js";import{d as n}from"./chunk-O624O5MO.js";import"./chunk-HW5YHSIE.js";import"./chunk-TLTS533S.js";async function u(){let o=i();if(o||(console.log(" not signed in"),console.log(" set SOOTSIM_API_KEY=sk_sootsim_\u2026 or run `sootsim login`"),process.exit(1)),o.kind==="api-key"){let r=`${o.secret.slice(0,14)}\u2026`,t=o.source==="env"?"SOOTSIM_API_KEY env var":"saved key (~/.config/sootsim/credentials.json)";console.log(` api key ${r}`),console.log(` source: ${t}`);return}if(o.kind==="github"){console.log(` github token (${o.source})`),console.log(` repo: ${o.repoId}`);return}let e=await n(),s=e?.user;console.log(` ${s?.email||s?.name||s?.id||"signed in"}`),console.log(` origin: ${e?.origin??o.origin}`),e?.updatedAt&&console.log(` updated: ${e.updatedAt}`)}export{u as runWhoami};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -156,7 +156,14 @@ async function resolveConnectionInput(input) {
156
156
  const port2 = parseInt(trimmed, 10);
157
157
  const resolved = await probePortBundle(port2);
158
158
  if (resolved) return resolved;
159
- throw buildUnresolvedTargetError(`localhost:${port2}`);
159
+ const SHIFT_WINDOW = 3;
160
+ for (let offset = 1; offset <= SHIFT_WINDOW; offset++) {
161
+ const shifted = await probePortBundle(port2 + offset);
162
+ if (shifted) return shifted;
163
+ }
164
+ throw buildUnresolvedTargetError(
165
+ `localhost:${port2} (also scanned +1..+${SHIFT_WINDOW})`
166
+ );
160
167
  }
161
168
  const bundleUrl = trimmed.startsWith("http") ? trimmed : `http://${trimmed}`;
162
169
  let parsed;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -3572,7 +3572,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
3572
3572
  }
3573
3573
  if (msg.type === "bridge:user-focus-state" && sim) {
3574
3574
  const focusState = msg;
3575
- this.updateUserFocusLease(sim, focusState.focused === true);
3575
+ this.updateUserFocusLease(sim, focusState);
3576
3576
  return;
3577
3577
  }
3578
3578
  if (msg.type === "bridge:user-interact" && sim) {
@@ -4188,6 +4188,8 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
4188
4188
  let rel = url.pathname;
4189
4189
  if (rel === "/runtime" || rel === "/runtime/") rel = "/";
4190
4190
  else if (rel.startsWith("/runtime/")) rel = rel.slice("/runtime".length);
4191
+ else if (rel === "/sootsim" || rel === "/sootsim/") rel = "/";
4192
+ else if (rel.startsWith("/sootsim/")) rel = rel.slice("/sootsim".length);
4191
4193
  if (rel === "" || rel === "/") rel = "/index.html";
4192
4194
  if (rel.includes("\0")) {
4193
4195
  res.writeHead(400);
@@ -4557,6 +4559,9 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
4557
4559
  lockedByKind: lease ? lease.kind : void 0,
4558
4560
  lockExpiresAt: lease ? lease.expiresAt : void 0,
4559
4561
  userFocused: sim.userFocused || void 0,
4562
+ userVisible: sim.userVisible,
4563
+ visibilityState: sim.visibilityState,
4564
+ documentFocused: sim.documentFocused,
4560
4565
  kind: sim.kind,
4561
4566
  meta: sim.meta
4562
4567
  };
@@ -4621,10 +4626,18 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
4621
4626
  // locked out agent inspect calls for 15s — the opposite of what you want
4622
4627
  // when debugging something the user is actively looking at. use
4623
4628
  // updateUserActivity() to lock on real interaction instead.
4624
- updateUserFocusLease(sim, focused) {
4625
- const next = focused;
4626
- if (sim.userFocused === next) return;
4627
- sim.userFocused = next;
4629
+ updateUserFocusLease(sim, focusState) {
4630
+ const nextFocused = focusState.focused === true;
4631
+ const nextVisible = typeof focusState.visible === "boolean" ? focusState.visible : void 0;
4632
+ const nextVisibilityState = typeof focusState.visibilityState === "string" ? focusState.visibilityState : void 0;
4633
+ const nextDocumentFocused = typeof focusState.documentFocused === "boolean" ? focusState.documentFocused : void 0;
4634
+ if (sim.userFocused === nextFocused && sim.userVisible === nextVisible && sim.visibilityState === nextVisibilityState && sim.documentFocused === nextDocumentFocused) {
4635
+ return;
4636
+ }
4637
+ sim.userFocused = nextFocused;
4638
+ sim.userVisible = nextVisible;
4639
+ sim.visibilityState = nextVisibilityState;
4640
+ sim.documentFocused = nextDocumentFocused;
4628
4641
  this.broadcastSimClientStates();
4629
4642
  }
4630
4643
  // called when the sim reports a real user interaction (pointerdown,
@@ -4714,7 +4727,10 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
4714
4727
  lockedBy: lease ? lease.cliLabel || lease.cliIdentityKey : void 0,
4715
4728
  lockedByKind: lease ? lease.kind : void 0,
4716
4729
  lockExpiresAt: lease ? lease.expiresAt : void 0,
4717
- userFocused: sim.userFocused || void 0
4730
+ userFocused: sim.userFocused || void 0,
4731
+ userVisible: sim.userVisible,
4732
+ visibilityState: sim.visibilityState,
4733
+ documentFocused: sim.documentFocused
4718
4734
  };
4719
4735
  sim.ws.send(JSON.stringify(message));
4720
4736
  }
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -3682,7 +3682,7 @@ var init_bridge_host = __esm({
3682
3682
  }
3683
3683
  if (msg.type === "bridge:user-focus-state" && sim) {
3684
3684
  const focusState = msg;
3685
- this.updateUserFocusLease(sim, focusState.focused === true);
3685
+ this.updateUserFocusLease(sim, focusState);
3686
3686
  return;
3687
3687
  }
3688
3688
  if (msg.type === "bridge:user-interact" && sim) {
@@ -4298,6 +4298,8 @@ var init_bridge_host = __esm({
4298
4298
  let rel = url.pathname;
4299
4299
  if (rel === "/runtime" || rel === "/runtime/") rel = "/";
4300
4300
  else if (rel.startsWith("/runtime/")) rel = rel.slice("/runtime".length);
4301
+ else if (rel === "/sootsim" || rel === "/sootsim/") rel = "/";
4302
+ else if (rel.startsWith("/sootsim/")) rel = rel.slice("/sootsim".length);
4301
4303
  if (rel === "" || rel === "/") rel = "/index.html";
4302
4304
  if (rel.includes("\0")) {
4303
4305
  res.writeHead(400);
@@ -4667,6 +4669,9 @@ var init_bridge_host = __esm({
4667
4669
  lockedByKind: lease ? lease.kind : void 0,
4668
4670
  lockExpiresAt: lease ? lease.expiresAt : void 0,
4669
4671
  userFocused: sim.userFocused || void 0,
4672
+ userVisible: sim.userVisible,
4673
+ visibilityState: sim.visibilityState,
4674
+ documentFocused: sim.documentFocused,
4670
4675
  kind: sim.kind,
4671
4676
  meta: sim.meta
4672
4677
  };
@@ -4731,10 +4736,18 @@ var init_bridge_host = __esm({
4731
4736
  // locked out agent inspect calls for 15s — the opposite of what you want
4732
4737
  // when debugging something the user is actively looking at. use
4733
4738
  // updateUserActivity() to lock on real interaction instead.
4734
- updateUserFocusLease(sim, focused) {
4735
- const next = focused;
4736
- if (sim.userFocused === next) return;
4737
- sim.userFocused = next;
4739
+ updateUserFocusLease(sim, focusState) {
4740
+ const nextFocused = focusState.focused === true;
4741
+ const nextVisible = typeof focusState.visible === "boolean" ? focusState.visible : void 0;
4742
+ const nextVisibilityState = typeof focusState.visibilityState === "string" ? focusState.visibilityState : void 0;
4743
+ const nextDocumentFocused = typeof focusState.documentFocused === "boolean" ? focusState.documentFocused : void 0;
4744
+ if (sim.userFocused === nextFocused && sim.userVisible === nextVisible && sim.visibilityState === nextVisibilityState && sim.documentFocused === nextDocumentFocused) {
4745
+ return;
4746
+ }
4747
+ sim.userFocused = nextFocused;
4748
+ sim.userVisible = nextVisible;
4749
+ sim.visibilityState = nextVisibilityState;
4750
+ sim.documentFocused = nextDocumentFocused;
4738
4751
  this.broadcastSimClientStates();
4739
4752
  }
4740
4753
  // called when the sim reports a real user interaction (pointerdown,
@@ -4824,7 +4837,10 @@ var init_bridge_host = __esm({
4824
4837
  lockedBy: lease ? lease.cliLabel || lease.cliIdentityKey : void 0,
4825
4838
  lockedByKind: lease ? lease.kind : void 0,
4826
4839
  lockExpiresAt: lease ? lease.expiresAt : void 0,
4827
- userFocused: sim.userFocused || void 0
4840
+ userFocused: sim.userFocused || void 0,
4841
+ userVisible: sim.userVisible,
4842
+ visibilityState: sim.visibilityState,
4843
+ documentFocused: sim.documentFocused
4828
4844
  };
4829
4845
  sim.ws.send(JSON.stringify(message));
4830
4846
  }
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.67 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sootsim",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
4
4
  "description": "sootsim CLI + vite/metro plugins + skills registry. bridge client for driving the proprietary sootsim-engine over WebSocket.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a,b,c,d}from"./chunk-BTHB3PMG.js";import"./chunk-G4VWDOWB.js";import"./chunk-VRV2X4X2.js";import"./chunk-7NYW73Q6.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a,b,c,d,e}from"./chunk-UMXVWFST.js";import"./chunk-D4VEI6MI.js";export{e as BETA_ASK_HEADLINE,c as BETA_LABEL,d as BETA_TAGLINE,b as BETA_VERSION_TARGET,a as IS_BETA};
@@ -1,3 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{B as E,j as B,k as b,l as I,m as S}from"./chunk-V4SZERWD.js";import{d as y,h as T,i as v}from"./chunk-G4VWDOWB.js";var C={timeoutMs:1800,settleMs:48,startWindowMs:64};function p(e){return new Promise(t=>setTimeout(t,e))}function A(e){return e.includes("--json")}function k(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
3
- `)}async function P(e,t,...r){return T(e,`__sootsimTest.${t}`,...r)}async function W(e,t,...r){return v(e,`SootSim.bridges.mainShell.${t}`,...r)}async function F(e,t={}){try{let r=await P(e,"waitForScreenTransitions",C);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function O(e,t,r,...n){let a=Date.now()+Math.max(0,r);for(;;)try{return await W(e,t,...n)}catch(o){if(!E(o)||Date.now()>=a)throw o;await p(50)}}async function $(e,t,r,n={}){let a=n.attempts??30,o=n.intervalMs??500,m=n.minNodeCount??10;for(let s=0;s<a;s++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>m)return{bridge:u,count:c}}catch{}u.close(),await p(o)}return null}async function G(e,t,r,n={}){let a=n.timeoutMs??8e3,o=n.intervalMs??250,m=Date.now()+a;for(;Date.now()<m;){let s=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await s.send({type:"evaluate",code:"1"}),s}catch{s.close()}await p(o)}return null}async function H(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,a=t.pollIntervalMs??200,o=Date.now(),m=o+r,s=-1,u=o,c=null,M=!1,w={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,errors:0};for(;Date.now()<m;){try{let i=await e.send({type:"evaluate",code:B}),d=Date.now()-o,l=Number(i?.nodes)||0,g=Number(i?.targets)||0,f=Number(i?.errors)||0,R=i?.flag===!0,h=i?.externalReady,x=typeof i?.externalError=="string"&&i.externalError.trim().length>0;if(c=h,M=x,l!==s&&(s=l,u=d),w={ready:!1,source:"timeout",elapsedMs:d,nodes:l,targets:g,errors:f},R&&h!==!1&&!x&&l>=b&&S({nodes:l,targets:g})&&d-u>=I)return{ready:!0,source:"flag",elapsedMs:d,nodes:l,targets:g,errors:f};if(d>=n&&f>0&&!R)return{ready:!1,source:"error-bail",elapsedMs:d,nodes:l,targets:g,errors:f}}catch{}await p(a)}return c!==!1&&!M&&w.nodes>=b&&S(w)?{...w,ready:!0,source:"nodes-fallback"}:{...w,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}export{p as a,A as b,k as c,P as d,F as e,O as f,$ as g,G as h,H as i};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- var O="sootsim close";export{O as a};
@@ -1,73 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as te,e as ne}from"./chunk-EEMGSSWY.js";import{d as X}from"./chunk-HIN5TAAL.js";import{a as Q,b as v}from"./chunk-DEQ7RED3.js";import{a as Y}from"./chunk-EIQLQDKX.js";import{c as Z,e as ee,g as T}from"./chunk-G4VWDOWB.js";import{createHash as Re}from"crypto";import{readFileSync as oe}from"fs";import{gzipSync as ie}from"zlib";function re(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}function N(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function Be(e){let t=N(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${r.status}: ${s.slice(0,200)}`)}}async function Ie(e,t=8,r){let s=0,o=0,a=e.length;await Promise.all(Array.from({length:Math.min(t,a)},async()=>{for(;s<a;){let u=e[s++];await Be(u),o++,r?.(o,a)}}))}function Ue(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let a of e.files){let u=r.get(a.urlhash);u&&o.push({url:a.putUrl,contentType:a.contentType,bytes:u})}return e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),o}function Pe(e){return e.replace(/\/+$/,"")}var E=class extends Error{constructor(r,s,o,a=""){super(r);this.status=s;this.phase=o;this.responseText=a;this.name="PresignedUploadError"}};async function se(e){let t=Pe(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let s=N(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let y=await o.text().catch(()=>"");throw new E(`init failed: ${o.status} ${y.slice(0,200)}`,o.status,"init",y)}let a=await o.json(),u=Ue(a,e.bundleBytes,e.filesByHash,e.extras);await Ie(u,e.concurrency??8,e.onPutProgress);let B=N(3e4,"finalize"),g;try{g=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:B.signal})}finally{B.cancel()}if(!g.ok){let y=await g.text().catch(()=>"");throw new E(`finalize failed: ${g.status} ${y.slice(0,200)}`,g.status,"finalize",y)}let S=await g.json();return{init:a,finalize:S}}function xe(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}var ce=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",de=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",D="http://localhost:3000";async function Se(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${D}/api/preview/upload/init`,{method:"OPTIONS"});if(t.ok||t.status===204||t.status===405)return D}catch{}return ce}function U(e){return e.replace(/\/$/,"")}function Oe(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function _e(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function $e(e,t){return t?U(t):process.env.SOOTSIM_PREVIEW_ORIGIN?U(process.env.SOOTSIM_PREVIEW_ORIGIN):Oe(e)?U(e):_e(e)?U(de):U(e)}function ke(){console.log(`
3
- sootsim upload \u2014 publish the current bundle as a /preview/<id> link
4
-
5
- usage:
6
- sootsim upload [--origin <url>] [--public-origin <url>] [--events <path>] [--sim <sim>] [--open] [--assets-only]
7
-
8
- options:
9
- --origin <url> upload target (default: auto)
10
- prefers ${D} when available, otherwise
11
- falls back to ${ce}
12
- override with SOOTSIM_UPLOAD_ORIGIN env var
13
- --public-origin <url>
14
- public /preview link origin (default: ${de}
15
- for prod uploads, upload origin for localhost/custom origins).
16
- override with SOOTSIM_PREVIEW_ORIGIN env var
17
- --events <path> path to a gzipped events .jsonl.gz file to attach
18
- --video <path> path to a webm/mp4/gif flow recording. embedded inline
19
- in the pr sticky comment served at
20
- /api/preview/flow-video?id=<share-id>
21
- --video-duration-ms <ms>
22
- duration hint for attached flow video
23
- --sim <sim> target a specific sim (see: sootsim list)
24
- --open open the resulting /preview/<id> url in the browser
25
- --assets-only drop API/JSON/HTML records before upload; keep images,
26
- fonts, css, js, and binary blobs. live-data demos hit
27
- the real network at replay time instead of serving
28
- recorded API snapshots
29
- -h, --help
30
-
31
- examples:
32
- sootsim upload
33
- sootsim upload --origin http://localhost:3000 --open
34
- sootsim upload --events ./my-session.jsonl.gz
35
- sootsim upload --video /tmp/soot-flow.webm
36
- `)}function x(e,t){let r=e.findIndex(o=>o===t);if(r<0)return;let s=e[r+1];return e.splice(r,2),s}function ae(e,t){let r=e.findIndex(s=>s===t);return r<0?!1:(e.splice(r,1),!0)}function le(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!!(t.startsWith("image/")||t.startsWith("font/")||t.startsWith("video/")||t.startsWith("audio/")||t.startsWith("model/")||t==="text/css"||t==="application/javascript"||t==="text/javascript"||t==="application/wasm"||t==="application/font-woff"||t==="application/font-woff2"||t==="application/octet-stream"):!1}async function ue(e){let t=await fetch(e);if(!t.ok)throw new Error(`fetch ${e} -> ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())}function Ee(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function ze(e){try{let t=new URL(e);return t.searchParams.get("lazy")==="true"?(t.searchParams.set("lazy","false"),t.toString()):e}catch{return e}}async function Ae(e,t){let s=[];for(let o=0;o<t;o+=15e5){let a=Math.min(o+15e5,t),u=await T(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${o}, ${a})`);if(typeof u!="string")return null;s.push(u)}return s.join("")}function W(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function qe(e,t){(e.includes("--help")||e.includes("-h"))&&(ke(),process.exit(0));let r=[...e],s=await Se(x(r,"--origin")),o=$e(s,x(r,"--public-origin")),a=x(r,"--events"),u=x(r,"--video"),B=x(r,"--video-duration-ms"),g=ae(r,"--open"),S=ae(r,"--assets-only"),y=Z(r,{stripBooleanFlags:[],stripValueFlags:[]}),m=ee(y),l,j=[],f=[],z=null;try{if(l=await T(m,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),l?.bundleUrl){let n=new URL(l.bundleUrl).origin,[i,H]=await Promise.all([T(m,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(n)}) || [])`),T(m,`(async () => {
37
- const list = window.__sootsimListWorkerFetchRecorder
38
- return typeof list === 'function'
39
- ? await list(${JSON.stringify(n)})
40
- : []
41
- })()`)]);j=W([...i,...H]).filter(d=>{try{return!new URL(d.url).pathname.startsWith("/api/")}catch{return!0}});let P=await T(m,`(async () => {
42
- const rec = window.__sootsimPreviewRecorder
43
- const workerList = window.__sootsimListWorkerFetchRecorder
44
- return {
45
- main: rec?.list ? rec.list() : [],
46
- worker: typeof workerList === 'function' ? await workerList() : [],
47
- }
48
- })()`),I=(P?W([...P.main,...P.worker]):[]).filter(d=>{try{return new URL(d.url).origin!==n}catch{return!1}}),w=I.length>0?{count:I.length,totalBytes:I.reduce((d,R)=>d+(R.size||0),0)}:null;if(w&&w.count>0){console.log(` ${w.count} recorded cross-origin responses (${(w.totalBytes/1024).toFixed(1)} KiB)`);let d=await T(m,`(async () => {
49
- const rec = window.__sootsimPreviewRecorder
50
- const workerDump = window.__sootsimDumpWorkerFetchRecorder
51
- const bundleUrl = ${JSON.stringify(l.bundleUrl)}
52
- const keep = (r) => {
53
- try {
54
- const u = new URL(r.url)
55
- if (u.origin !== ${JSON.stringify(n)}) return true
56
- // bundle-origin api responses came from the rewritten
57
- // /__app-api proxy at record time (re-keyed by the
58
- // recorder's unwrap step). they need bodies attached the
59
- // same way as cross-origin records \u2014 direct re-fetch from
60
- // the dev server lacks the bundle's session cookies.
61
- if (r.url !== bundleUrl && u.pathname.startsWith('/api/')) return true
62
- return false
63
- } catch { return false }
64
- }
65
- return {
66
- main: rec?.dump ? rec.dump().filter(keep) : [],
67
- worker: typeof workerDump === 'function'
68
- ? (await workerDump()).filter(keep)
69
- : [],
70
- }
71
- })()`);if(f=W([...d.main,...d.worker]),S){let R=f.length;f=f.filter(C=>le(C.contentType));let ve=w.totalBytes-f.reduce((C,Te)=>C+(Te.size||0),0);console.log(` --assets-only: kept ${f.length}/${R} records (dropped ${(ve/1024).toFixed(1)} KiB of API responses)`)}}}l?.transformedBundle&&(z=await Ae(m,l.transformedBundle.byteLength))}finally{m.close()}l||(console.error(" could not read bundle snapshot \u2014 is sootsim running and is the bundle loaded?"),process.exit(2)),l.bundleUrl||(console.error(` no ?bundle= URL on the current sootsim tab.
72
- open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let p,A=!1;if(z!==null)p=new TextEncoder().encode(z),A=!0,console.log(` using post-transform bundle: ${(p.byteLength/1024).toFixed(1)} KiB`);else{let n=ze(l.bundleUrl);n!==l.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),p=await ue(n),console.log(` main bundle: ${(p.byteLength/1024).toFixed(1)} KiB`)}let O=j.filter(n=>n.url!==l.bundleUrl);S&&(O=O.filter(n=>le(n.contentType))),console.log(` fetching ${O.length} extra files\u2026`);let _=(await Promise.all(O.map(async n=>{try{let i=await ue(n.url);return{...n,bytes:i}}catch(i){return console.error(` warning: failed to re-fetch ${n.url}: ${i instanceof Error?i.message:i}`),null}}))).filter(n=>!!n),pe=_.reduce((n,i)=>n+i.bytes.byteLength,0);console.log(` ${_.length} extra files: ${(pe/1024).toFixed(1)} KiB`);let b;a&&(b=oe(a));let h,$,G;if(u){if(h=oe(u),$=u.endsWith(".mp4")?"video/mp4":u.endsWith(".gif")?"image/gif":"video/webm",B){let n=Number(B);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${B}`),await v(),process.exit(1)),G=Math.round(n)}console.log(` attaching flow video: ${(h.byteLength/1024).toFixed(1)} KiB (${$})`)}let c=te(),ge=Y();Q({event:"preview_upload_started",identity:{userId:c?.kind==="session"?ge?.user?.id??null:null,repoId:c?.kind==="github"?c.repoId:null,installationId:c?.kind==="github"?c.installationId??null:null},properties:{origin:s,hasAuth:!!c,authMode:c?.kind??"none",bundleBytes:p.byteLength,isTransformed:A,extraFiles:_.length,recordedFetches:f.length,hasEvents:!!b,hasVideo:!!h}}),c||(console.error(" preview uploads need auth."),console.error(" set SOOTSIM_API_KEY=sk_sootsim_..., run `sootsim login`, or use the soot github runner."),await v(),process.exit(1));let fe=ne(c),he=(()=>{try{return new URL(l.bundleUrl).origin}catch{return null}})(),V=(n,i,H,P,q,I,w)=>{let d=re(I),R=d?ie(n):n;return{url:i,urlhash:H,method:P,bodyHash:q,contentType:I,responseHeaders:w,bytes:R,encoding:d?"gzip":void 0}},L=[..._.map(n=>V(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders)),...f.map(n=>V(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders))],F=ie(p),ye=Re("sha256").update(p).digest("hex");console.log(` bundle raw=${(p.byteLength/1024).toFixed(1)} KiB gz=${(F.byteLength/1024).toFixed(1)} KiB`);let me={contentHash:ye,bundleSizeBytes:p.byteLength,bundleContentType:Ee(l.bundleUrl),bundleEncoding:"gzip",bundleOrigin:he,entry:l.entry,isTransformed:A,deviceSpec:l.deviceSpec,installationId:c.kind==="github"?c.installationId??void 0:void 0,repoId:c.kind==="github"?c.repoId:void 0,files:L.map(n=>({url:n.url,urlhash:n.urlhash,method:n.method,bodyHash:n.bodyHash,contentType:n.contentType,responseHeaders:n.responseHeaders,encoding:n.encoding,sizeBytes:n.bytes.byteLength})),events:b?{sizeBytes:b.byteLength}:void 0,flowVideo:h&&$?{sizeBytes:h.byteLength,contentType:$,durationMs:G}:void 0},J=new Map;for(let n of L)J.set(n.urlhash,n.bytes);let be=Date.now(),k=F.byteLength;for(let n of L)k+=n.bytes.byteLength;b&&(k+=b.byteLength),h&&(k+=h.byteLength);let we=`${U(s)}/api/preview/upload/init`;console.log(` init: ${we}`);let M;try{let n=await se({originBase:s,initBody:me,bundleBytes:F,filesByHash:J,extras:{eventsBytes:b,videoBytes:h},authHeader:fe,concurrency:16});M=n.finalize;let i=1+n.init.files.length+(n.init.events?1:0)+(n.init.flowVideo?1:0);console.log(` PUT ${i} objects in ${Date.now()-be}ms (${(k/1024).toFixed(1)} KiB)`)}catch(n){let i=n;i.phase==="init"&&i.status===401&&(console.error(" preview upload requires a valid login."),console.error(" run `sootsim login` and retry."),await v(),process.exit(1)),i.status===402&&(console.error(` ${xe(i.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await v(),process.exit(1)),console.error(` ${i.message??`${i.phase??"upload"} failed: ${String(n)}`}`),await v(),process.exit(1)}let K=`${o}${M.url}`;console.log(`
73
- stored ${M.filesStored??0} extra files`),console.log(` preview: ${K}`),g&&await X(K),await v()}export{Se as a,$e as b,qe as c};
@@ -1,3 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as d}from"./chunk-VRV2X4X2.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as m}from"fs";import{tmpdir as w}from"os";import{dirname as v,join as p}from"path";var y=new Map;function i(e,r){y.set(e,r)}var a=1;function s(){return p(w(),`sootsim-cli-hints-${d()}.json`)}function l(){return p(w(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:a,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==a||!r?.shown?{version:a,shown:{}}:r}catch{return{version:a,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
3
- `)}catch{}}function F(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function x(e,r){let o=F();if(o==="off")return!1;if(o==="always"||r==="always")return!0;let n=Date.now();if(r==="once-per-identity"){let t=u(s());return t.shown[e]?!1:(t.shown[e]=n,f(s(),t),!0)}if(r==="once-ever"){let t=u(l());return t.shown[e]?!1:(t.shown[e]=n,f(l(),t),!0)}if(typeof r=="object"&&"cooldownMs"in r){let t=u(s()),c=t.shown[e]??0;return n-c<r.cooldownMs?!1:(t.shown[e]=n,f(s(),t),!0)}return!0}function M(e,...r){let o=y.get(e);if(!o)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!x(e,o.frequency))return!1;let n=o.render(...r);if(n==null)return!1;let t=Array.isArray(n)?n:[n],c=o.stream==="error"?console.error:console.log;for(let g of t)c(` hint: ${g}`);return!0}function O(){m(s(),{force:!0})}function k(){m(l(),{force:!0})}function T(){return Array.from(y.entries()).map(([e,r])=>({id:e,frequency:r.frequency}))}i("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});i("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`,stream:"error"});i("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(r=>` ${r}`)]:null,stream:"error"});i("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});i("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`,stream:"error"});export{M as a,O as b,k as c,T as d};
@@ -1,17 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as P,c as v,e as A}from"./chunk-VRV2X4X2.js";import{E as k,F as T}from"./chunk-BEQD2DSK.js";import{WebSocket as w}from"ws";function M(){let e=k();return e&&T(e)?e.bridgePort:7668}var h=class extends Error{lock;constructor(t,s){super(t),this.name="BridgeSimLockedError",this.lock=s}};function O(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function N(e,t={}){let s=new Set,l=t.port??M(),c=t.commandTimeoutMs??15e3,o,g="none",b=new Set(t.stripBooleanFlags??[]),p=new Set(t.stripValueFlags??[]);for(let i=0;i<e.length;i++){let a=e[i];if(a==="--port"||a==="-p"){s.add(i),i+1<e.length&&(s.add(i+1),l=Number(e[i+1])),i++;continue}if(a.startsWith("--port=")){s.add(i),l=Number(a.slice(7));continue}if(a==="--timeout"){s.add(i),i+1<e.length&&(s.add(i+1),c=Number(e[i+1])),i++;continue}if(a==="--sim"){s.add(i),i+1<e.length&&(s.add(i+1),o=e[i+1]?.trim()||void 0,g="flag"),i++;continue}if(b.has(a)){s.add(i);continue}p.has(a)&&(s.add(i),i+1<e.length&&s.add(i+1),i++)}if(!o){let i=v();i&&(o=i.trim()||void 0,g="saved")}return{positional:e.filter((i,a)=>!s.has(a)),wsPort:l,simId:o,simIdSource:g,commandTimeoutMs:c}}function W(e,t={}){let s=1,l=t.commandTimeoutMs??15e3,c=new Map,o=new w(`ws://localhost:${e}`),g=t.simId?{key:`sim:${t.simId}`,source:"explicit-sim-id",stable:!0}:P(),b=new Promise((n,r)=>{o.on("open",()=>{try{o.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:g.key,cliIdentitySource:g.source,cliLabel:t.cliLabel}))}catch{}n()}),o.on("error",d=>{let u=d.message?`: ${d.message}`:"";r(new Error(`could not connect to ws://localhost:${e}${u}`))})}),p=!1,i=!1;function a(n,r){if(i||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||n.startsWith("bridge:")||n==="focus"||n==="close")return;i=!0;let d=r??"primary",u=O(r?t.simIdSource:"none");process.stderr.write(` \u2192 ${d} (${u})
3
- `)}return o.on("message",n=>{let r;try{r=JSON.parse(n.toString())}catch{return}if(r.id===0)return;let d=c.get(r.id);d&&(c.delete(r.id),r.i>0&&!p&&(p=!0,process.stderr.write(`
4
- \u26A0 ${r.i} other CLI identity/identities are driving this sim
5
- taps, scrolls, and keyboard input from multiple agents will collide on
6
- the same screen state (this is not a bridge throughput limit).
7
- use \`sootsim open --new\` for an isolated sim per agent.
8
-
9
- `)),r.error?r.o?d.reject(new h(r.error,r.o)):d.reject(new Error(r.error)):d.resolve(r.result))}),o.on("close",(n,r)=>{let d=r?.toString()||"connection closed";for(let[u,m]of c)c.delete(u),m.reject(new Error(`sim disconnected: ${d} (code ${n})`))}),{async send(n,r){let d=r?.timeoutMs??l,u=async m=>{await b;let f=s++;return new Promise((C,S)=>{let B=setTimeout(()=>{c.delete(f),S(new Error(`command timed out after ${Math.round(d/1e3)}s`))},d);c.set(f,{resolve:I=>{clearTimeout(B),C(I)},reject:I=>{clearTimeout(B),S(I)}});let y={...n,id:f};y.simId===void 0&&m&&(y.simId=m),a(n.type??"",y.simId),o.send(JSON.stringify(y))})};try{return await u(t.simId)}catch(m){let f=m instanceof Error?m.message:String(m);if(t.fallbackOnMissingSimId&&t.simId&&n.simId===void 0&&f===`no sim connected with id ${t.simId}`)return A(),process.stderr.write(` \u26A0 saved sim ${t.simId} is gone \u2014 falling back to primary
10
- pin a sim with: sootsim use <sim>
11
- `),i=!1,u(void 0);throw m}},async listSims(){let n=await this.send({type:"bridge:list-sims"});return Array.isArray(n)?n:[]},async openUrl(n,r={}){return this.send({type:"bridge:open",url:n,newWindow:r.newWindow===!0})},async focusSim(n){return this.send({type:"focus",simId:n})},async closeSim(n){return this.send({type:"close",simId:n})},async claim(n,r={}){return await this.send({type:"bridge:claim",simId:n,force:r.force===!0})},close(){try{o.readyState===w.OPEN&&o.send(JSON.stringify({type:"bridge:bye",id:0}))}catch{}o.close();let n=setTimeout(()=>{o.readyState!==w.CLOSED&&o.terminate()},250)}}}function R(e){return W(e.wsPort,{commandTimeoutMs:e.commandTimeoutMs,simId:e.simId,fallbackOnMissingSimId:e.simIdSource==="saved",simIdSource:e.simIdSource})}async function _(e){try{return await e.send({type:"evaluate",code:"document.hidden"})===!0?(process.stderr.write(`
12
- \u26A0 target sim is hidden (document.hidden = true)
13
- animations and rAF callbacks are throttled \u2014 coordinates may be wrong
14
- and launch/transition animations will not complete.
15
- bring the sim to the foreground or use: sootsim debug eval "window.focus()"
16
-
17
- `),{hidden:!0,warned:!0}):{hidden:!1,warned:!1}}catch{return{hidden:!1,warned:!1}}}async function D(e,t,s={}){let l={type:"evaluate",code:t};return s.acquireLock&&(l.acquireLock=!0),e.send(l)}async function j(e,t,...s){return e.send({type:"call",path:t,args:s})}async function q(e,t,...s){return e.send({type:"call",path:t,args:s,acquireLock:!0})}export{M as a,h as b,N as c,W as d,R as e,_ as f,D as g,j as h,q as i};
@@ -1 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -1,34 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
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
- 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
- recent console errors:
5
- `);for(let a of i){let c=new Date(a.timestamp).toLocaleTimeString(),m=Array.isArray(a.args)?a.args.map(l=>typeof l=="object"?JSON.stringify(l):String(l)).join(" "):String(a);console.log(` [${c}] ${m}`)}}}async function f(t,e={}){let o=await u(t,"getRequestCounts");if(!o||typeof o!="object")return;let n=Math.max(0,Number(o.failed)||0);if(n===0||(console.log(`
6
- network: ${n} failed request${n===1?"":"s"}`),e.requestsCommand&&console.log(` inspect: ${e.requestsCommand}`),!e.includeTail))return;let s=await u(t,"getFailedRequests",5);if(!(!Array.isArray(s)||s.length===0)){console.log(`
7
- recent failed requests:
8
- `);for(let r of s){let i=new Date(r.timestamp).toLocaleTimeString();console.log(` [${i}] ${d(r)}`),r.responseBody?console.log(` ${r.responseBody}`):r.error&&console.log(` ${r.error}`)}}}async function w(t){let e=await t.send({type:"evaluate",code:`(async () => {
9
- const test = window.__sootsimTest
10
- const mainShell = window.SootSim?.bridges?.mainShell
11
- let shell = null
12
- try {
13
- shell = typeof mainShell?.getState === 'function' ? await mainShell.getState() : null
14
- } catch {}
15
- let nodeCount = 0
16
- try {
17
- nodeCount = typeof test?.getNodeCount === 'function' ? await test.getNodeCount() : 0
18
- } catch {}
19
- return {
20
- url: window.location.href,
21
- simId: window.__sootsimSimId || null,
22
- nodeCount,
23
- mode: window.__sootsimRenderHost ? 'render-worker' : 'main-thread',
24
- shell: shell
25
- ? {
26
- state: shell.state || null,
27
- activeApp: shell.activeApp || null,
28
- showSwitcher: !!shell.showSwitcher,
29
- switcherPhase: shell.switcherPhase || null,
30
- }
31
- : null,
32
- }
33
- })()`});if(!e||typeof e!="object")return;console.log(`
34
- state:`),e.simId&&console.log(` sim: ${e.simId}`),e.url&&console.log(` url: ${e.url}`),e.mode&&console.log(` mode: ${e.mode}`);let o=Number(e.nodeCount)||0;console.log(` nodes: ${o}${o>10?" (ready)":" (not ready)"}`);let n=e.shell;if(n&&typeof n=="object"){let s=[n.state?`state=${n.state}`:null,n.activeApp?`app=${n.activeApp}`:null,n.showSwitcher?"switcher=open":null,n.switcherPhase?`phase=${n.switcherPhase}`:null].filter(Boolean);s.length>0&&console.log(` shell: ${s.join(" ")}`)}}async function h(t,e={}){try{await w(t)}catch{}try{await g(t,{includeTail:!0,errorsCommand:e.errorsCommand,warningsCommand:e.warningsCommand})}catch{}try{await f(t,{includeTail:!0,requestsCommand:e.requestsCommand})}catch{}}export{w as a,h as b};