sootsim 0.1.128 → 0.1.130

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 (149) hide show
  1. package/dist-cli/bin.js +3 -3
  2. package/dist-cli/chunks/{agent-KVBASG57.js → agent-KNT2MNHS.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-CSUCCH35.js → agent-wrapper-OQ6MXYSM.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-LK57Q63V.js → app-fonts-5YH5C37X.js} +2 -2
  5. package/dist-cli/chunks/{assert-LMMXHK7P.js → assert-7GTOVITS.js} +2 -2
  6. package/dist-cli/chunks/auto-bootstrap-7QUYTCK3.js +2 -0
  7. package/dist-cli/chunks/beta-TKYV2VUL.js +2 -0
  8. package/dist-cli/chunks/{chunk-TT5RWL45.js → chunk-3QB2RIJ3.js} +2 -2
  9. package/dist-cli/chunks/{chunk-7SSQQWXI.js → chunk-4A5BPDNH.js} +2 -2
  10. package/dist-cli/chunks/{chunk-KABJPUT4.js → chunk-4KQKAI4R.js} +1 -1
  11. package/dist-cli/chunks/chunk-4TWK4GWQ.js +2 -0
  12. package/dist-cli/chunks/chunk-544KNXXS.js +1 -0
  13. package/dist-cli/chunks/{chunk-PINZJVS6.js → chunk-5IYZIY67.js} +1 -1
  14. package/dist-cli/chunks/{chunk-KBW2VI34.js → chunk-5QO3N7MG.js} +1 -1
  15. package/dist-cli/chunks/{chunk-X33P2PIG.js → chunk-6YFOOGMX.js} +1 -1
  16. package/dist-cli/chunks/{chunk-TGMTCNZ2.js → chunk-6YKC2PAW.js} +2 -2
  17. package/dist-cli/chunks/{chunk-PSL42AVT.js → chunk-77BLGF7T.js} +2 -2
  18. package/dist-cli/chunks/{chunk-P4W42H4A.js → chunk-7NG5U6NK.js} +3 -3
  19. package/dist-cli/chunks/{chunk-JBVHVSVC.js → chunk-7YASUTHS.js} +2 -2
  20. package/dist-cli/chunks/{chunk-ZTHTQNVD.js → chunk-BIWTU6Y6.js} +6 -6
  21. package/dist-cli/chunks/{chunk-XF5W3CGA.js → chunk-DLYAXBRT.js} +2 -2
  22. package/dist-cli/chunks/{chunk-DTHD7QGU.js → chunk-DRHDI7V4.js} +2 -2
  23. package/dist-cli/chunks/{chunk-HTFFTIEU.js → chunk-FGMOSDCQ.js} +1 -1
  24. package/dist-cli/chunks/{chunk-YKUW3QNP.js → chunk-H6WPFY4K.js} +2 -2
  25. package/dist-cli/chunks/{chunk-MQFUXG7V.js → chunk-HCGT7RFQ.js} +1 -1
  26. package/dist-cli/chunks/chunk-HKKCAEKK.js +1 -0
  27. package/dist-cli/chunks/{chunk-AJ34QMR4.js → chunk-IGQ54SMC.js} +2 -2
  28. package/dist-cli/chunks/{chunk-KG3XVCAL.js → chunk-JALLIXYA.js} +2 -2
  29. package/dist-cli/chunks/{chunk-SKW6NBUP.js → chunk-K5N6S6MK.js} +2 -2
  30. package/dist-cli/chunks/{chunk-B3HLOZ3N.js → chunk-KYJJSQWY.js} +2 -2
  31. package/dist-cli/chunks/{chunk-E3NRRI4M.js → chunk-LBRLBJAS.js} +1 -1
  32. package/dist-cli/chunks/{chunk-J7TYQVOU.js → chunk-MOO23TCK.js} +1 -1
  33. package/dist-cli/chunks/{chunk-374XJJVQ.js → chunk-MWZ2K75V.js} +1 -1
  34. package/dist-cli/chunks/{chunk-OAZYZXMH.js → chunk-NEXDOXJ3.js} +1 -1
  35. package/dist-cli/chunks/{chunk-CYKPWI35.js → chunk-OHPV4WP2.js} +1 -1
  36. package/dist-cli/chunks/{chunk-DKK3CC3D.js → chunk-OOTZNIHU.js} +2 -2
  37. package/dist-cli/chunks/{chunk-H7O2EPCU.js → chunk-OP5XM4ED.js} +2 -2
  38. package/dist-cli/chunks/{chunk-ASKSZHOR.js → chunk-PBYFOCRO.js} +3 -3
  39. package/dist-cli/chunks/{chunk-HMBYOS66.js → chunk-QDMM6U4X.js} +2 -2
  40. package/dist-cli/chunks/{chunk-OULIZJPC.js → chunk-R35KFNWH.js} +2 -2
  41. package/dist-cli/chunks/{chunk-QNKKUBAX.js → chunk-RSJKAVWL.js} +2 -2
  42. package/dist-cli/chunks/{chunk-HDW4B3FW.js → chunk-SK4G3KBR.js} +2 -2
  43. package/dist-cli/chunks/{chunk-3AAJ272V.js → chunk-SPJXGCEP.js} +1 -1
  44. package/dist-cli/chunks/{chunk-OLXRO2UE.js → chunk-T77EKSH4.js} +1 -1
  45. package/dist-cli/chunks/{chunk-HNRZM6GI.js → chunk-TCYVPNQO.js} +3 -3
  46. package/dist-cli/chunks/chunk-TOPGPGVZ.js +1 -0
  47. package/dist-cli/chunks/{chunk-ZB2LBNNH.js → chunk-VGCTSDGM.js} +54 -14
  48. package/dist-cli/chunks/{chunk-WCJMLITZ.js → chunk-XPYODDHV.js} +1 -1
  49. package/dist-cli/chunks/{chunk-WBVNZ7R3.js → chunk-XRIPNBCE.js} +2 -2
  50. package/dist-cli/chunks/{chunk-SQRVXVCM.js → chunk-YRRFLKL4.js} +1 -1
  51. package/dist-cli/chunks/{chunk-WEGRCMET.js → chunk-YYCJASBO.js} +2 -2
  52. package/dist-cli/chunks/cli-version-SHSHHYXU.js +2 -0
  53. package/dist-cli/chunks/{compat-WT4WILUH.js → compat-NXBN3X4Z.js} +3 -3
  54. package/dist-cli/chunks/{config-GKCHSOOI.js → config-TBUMHWAL.js} +2 -2
  55. package/dist-cli/chunks/control-CAPNUH2B.js +2 -0
  56. package/dist-cli/chunks/{cpu-profile-HAHWXEDN.js → cpu-profile-UFGS2RPI.js} +2 -2
  57. package/dist-cli/chunks/{daemon-Z2O7JY3O.js → daemon-BUW7GFTP.js} +2 -2
  58. package/dist-cli/chunks/{debug-C7NG2DAG.js → debug-7TLF5GM5.js} +3 -3
  59. package/dist-cli/chunks/{detox-Q45XNNH3.js → detox-MPVMCPWZ.js} +2 -2
  60. package/dist-cli/chunks/{device-55XBOVDK.js → device-APKKBXMJ.js} +2 -2
  61. package/dist-cli/chunks/{diagnose-I44BNF4T.js → diagnose-FVLVFNDW.js} +2 -2
  62. package/dist-cli/chunks/drivers-QQJOT5IF.js +2 -0
  63. package/dist-cli/chunks/{electron-XR7UGDZD.js → electron-X2DEUVXA.js} +3 -3
  64. package/dist-cli/chunks/flow-SOFJ7QI3.js +2 -0
  65. package/dist-cli/chunks/help-ZFJBFDNU.js +2 -0
  66. package/dist-cli/chunks/{hints-GTUK7PES.js → hints-D47SYWGV.js} +2 -2
  67. package/dist-cli/chunks/{home-paths-N6TCKIQQ.js → home-paths-23FGUKN4.js} +2 -2
  68. package/dist-cli/chunks/{inspect-7WV43JZ3.js → inspect-HEJB6NB6.js} +4 -4
  69. package/dist-cli/chunks/install-5XBIUQGH.js +2 -0
  70. package/dist-cli/chunks/{install-desktop-GFQYXJVD.js → install-desktop-5ZBMF444.js} +3 -3
  71. package/dist-cli/chunks/{keys-KHRGMVKB.js → keys-CI2XOBPT.js} +2 -2
  72. package/dist-cli/chunks/{launch-EXL7RKQ7.js → launch-6R6RY6R5.js} +3 -3
  73. package/dist-cli/chunks/{login-VCD33FX6.js → login-VLLUNVK7.js} +4 -4
  74. package/dist-cli/chunks/{logout-E2T66AOL.js → logout-D4YKYIDG.js} +2 -2
  75. package/dist-cli/chunks/{maestro-ZANP2BL4.js → maestro-KLROSFMP.js} +2 -2
  76. package/dist-cli/chunks/{preview-UBXWRORY.js → preview-O4365QYC.js} +2 -2
  77. package/dist-cli/chunks/{profile-XMGEEZ5K.js → profile-VAEKDLEX.js} +2 -2
  78. package/dist-cli/chunks/{react-D6L6HQOQ.js → react-MMA3LE34.js} +2 -2
  79. package/dist-cli/chunks/{record-JOHCXOWR.js → record-GVWF4BNF.js} +2 -2
  80. package/dist-cli/chunks/runtime-ZE6YLTHF.js +2 -0
  81. package/dist-cli/chunks/{runtime-delivery-HERSJG4G.js → runtime-delivery-4SSWMW25.js} +2 -2
  82. package/dist-cli/chunks/{screenshot-B7OWAB6E.js → screenshot-C72QGUMV.js} +2 -2
  83. package/dist-cli/chunks/{screenshot-mode-Z5BJFBTW.js → screenshot-mode-OCTJDADF.js} +2 -2
  84. package/dist-cli/chunks/{screenshots-XV6WVUPL.js → screenshots-AWDE4NDZ.js} +2 -2
  85. package/dist-cli/chunks/{server-GKB36CKN.js → server-K6KOFHSQ.js} +12 -12
  86. package/dist-cli/chunks/setup-repo-KZDLN5I2.js +2 -0
  87. package/dist-cli/chunks/{skills-KZMAEPI7.js → skills-DIETG7L3.js} +2 -2
  88. package/dist-cli/chunks/{start-U476YCIN.js → start-R54AVUYP.js} +4 -4
  89. package/dist-cli/chunks/store-3I5TVDYR.js +2 -0
  90. package/dist-cli/chunks/telemetry-MZWJNMXL.js +2 -0
  91. package/dist-cli/chunks/{test-KZKN34BL.js → test-6EZ2YHEN.js} +3 -3
  92. package/dist-cli/chunks/{three-mode-HCUMT2OW.js → three-mode-FWE57WZP.js} +2 -2
  93. package/dist-cli/chunks/{timeline-EVARJJIQ.js → timeline-4FFLAGNO.js} +2 -2
  94. package/dist-cli/chunks/{upgrade-NJMIIBUR.js → upgrade-RI62D65F.js} +2 -2
  95. package/dist-cli/chunks/upload-2OQWKQOR.js +2 -0
  96. package/dist-cli/chunks/{version-VENV6XNR.js → version-RHWBKIPW.js} +2 -2
  97. package/dist-cli/chunks/web-U4RROYGL.js +2 -0
  98. package/dist-cli/chunks/{what-happened-P6T4UG2I.js → what-happened-QYK3MLTS.js} +2 -2
  99. package/dist-cli/chunks/{whoami-MVMHRDM6.js → whoami-XO5L3YTX.js} +2 -2
  100. package/dist-lib/agent-daemon-client.cjs +1 -1
  101. package/dist-lib/agent-events.cjs +1 -1
  102. package/dist-lib/agent-sessions.cjs +1 -1
  103. package/dist-lib/attached-projects.cjs +1 -1
  104. package/dist-lib/auth/shared-session.cjs +1 -1
  105. package/dist-lib/backend-origin.cjs +1 -1
  106. package/dist-lib/beta.cjs +1 -1
  107. package/dist-lib/beta.mjs +1 -1
  108. package/dist-lib/bridge-constants.cjs +1 -1
  109. package/dist-lib/cli-constants.cjs +1 -1
  110. package/dist-lib/config.cjs +1 -1
  111. package/dist-lib/detox/index.cjs +1 -1
  112. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  113. package/dist-lib/home-paths.cjs +1 -1
  114. package/dist-lib/host/bridge-host.cjs +20 -7
  115. package/dist-lib/host/fetch-proxy-handler.cjs +20 -7
  116. package/dist-lib/host/fetch-proxy-overrides.cjs +10 -6
  117. package/dist-lib/host/fetch-proxy-overrides.mjs +10 -6
  118. package/dist-lib/host/websocket-proxy.cjs +1 -1
  119. package/dist-lib/index.cjs +1 -1
  120. package/dist-lib/metro.cjs +1 -1
  121. package/dist-lib/profiles.cjs +1 -1
  122. package/dist-lib/render-mode.cjs +1 -1
  123. package/dist-lib/scripts/demo-app-registry.cjs +1 -1
  124. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  125. package/dist-lib/sdk.cjs +51 -2
  126. package/dist-lib/sdk.mjs +51 -2
  127. package/dist-lib/skills.cjs +27 -13
  128. package/dist-lib/vite.cjs +1 -1
  129. package/package.json +1 -1
  130. package/src/host/fetch-proxy-handler.ts +23 -2
  131. package/src/host/fetch-proxy-overrides.ts +17 -5
  132. package/dist-cli/chunks/auto-bootstrap-CTWKEM4V.js +0 -2
  133. package/dist-cli/chunks/beta-KGUBAGXH.js +0 -2
  134. package/dist-cli/chunks/chunk-3TDPLIKL.js +0 -2
  135. package/dist-cli/chunks/chunk-N2VJC564.js +0 -1
  136. package/dist-cli/chunks/chunk-UNV6BGOP.js +0 -1
  137. package/dist-cli/chunks/chunk-ZE7W2MTD.js +0 -1
  138. package/dist-cli/chunks/cli-version-INZLODFN.js +0 -2
  139. package/dist-cli/chunks/control-MSK5L3VF.js +0 -2
  140. package/dist-cli/chunks/drivers-SYUDXJZK.js +0 -2
  141. package/dist-cli/chunks/flow-66GRPHHA.js +0 -2
  142. package/dist-cli/chunks/help-4VBCUZAR.js +0 -2
  143. package/dist-cli/chunks/install-55EDLMPA.js +0 -2
  144. package/dist-cli/chunks/runtime-SX4NL3N4.js +0 -2
  145. package/dist-cli/chunks/setup-repo-UKVZZ52B.js +0 -2
  146. package/dist-cli/chunks/store-JUR4T52G.js +0 -2
  147. package/dist-cli/chunks/telemetry-BZJQZXB2.js +0 -2
  148. package/dist-cli/chunks/upload-INJR46LD.js +0 -2
  149. package/dist-cli/chunks/web-2ZJXPNQQ.js +0 -2
package/dist-cli/bin.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
- import{a as u,b as d,c as g}from"./chunks/chunk-374XJJVQ.js";import"./chunks/chunk-KABJPUT4.js";function f(a){let e=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("no sim connected with id ")||e.startsWith("could not connect to ws://")||e.startsWith("sootsim bridge daemon is not running")||e.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${e}
2
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
+ import{a as u,b as d,c as g}from"./chunks/chunk-MWZ2K75V.js";import"./chunks/chunk-4KQKAI4R.js";function f(a){let e=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("no sim connected with id ")||e.startsWith("could not connect to ws://")||e.startsWith("sootsim bridge daemon is not running")||e.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${e}
4
4
  `),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
5
5
  `):process.stderr.write(`${e}
6
6
  `),process.exit(1)}process.on("unhandledRejection",f);process.on("uncaughtException",f);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["preview","electron","install-desktop"]);function v(a){!A||!k.has(a)||(process.stderr.write(` sootsim ${a} isn't available in the standalone binary \u2014
7
7
  it needs vite / electron / playwright from a project's node_modules.
8
8
  install the npm package and run via bun or node instead:
9
9
  npm i -g sootsim && sootsim ${a}
10
- `),process.exit(1))}var t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-BZJQZXB2.js");a({event:"cli_command_invoked",properties:{command:t.command||(t.version?"version":t.help?"help":"none"),arg_count:t.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:e}=await import("./chunks/telemetry-BZJQZXB2.js");await e(),process.exit(a)}if(t.version){let{getCliVersion:a}=await import("./chunks/cli-version-INZLODFN.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-KGUBAGXH.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-N6TCKIQQ.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(t.help&&!t.command){let{printHelp:a}=await import("./chunks/help-4VBCUZAR.js");a(),await c(0)}var o=t.globalFlags.port,n=t.verbose,p=t.globalFlags.device,l=t.globalFlags.theme,S=t.globalFlags.driver,E=t.globalFlags.headless===!0,b=t.globalFlags.sim??t.globalFlags.session??t.globalFlags.tab,s=b?["--sim",b,...t.commandArgs]:t.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-JUR4T52G.js"),e={};p&&(e.deviceModel=p),l&&(e.colorScheme=l),a.apply(e)}if(!t.command&&t.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-U476YCIN.js");await a([],{port:o}),await c(0)}var r=t.command??"";if(!r){if(t.commandArgs.length>0){let e=t.commandArgs.find(i=>!i.startsWith("-"))??t.commandArgs[0];console.error(` unknown command: ${e}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-4VBCUZAR.js");a(),await c(0)}if(r in d){let a=d[r],e=t.commandArgs.length>0?` ${t.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),e&&console.error(` \u2192 ${a}${e}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(t.help||t.commandArgs.includes("--help")||t.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",e=t.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!e){let{printGroupHelp:i}=await import("./chunks/help-4VBCUZAR.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-4VBCUZAR.js");i(a&&e?e:r,{prefer:a&&e?"verb":"command",group:a&&e?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-CTWKEM4V.js"),i=e(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-7WV43JZ3.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-LMMXHK7P.js");await a(t.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-66GRPHHA.js"),e=await a(s);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:a}=await import("./chunks/test-KZKN34BL.js");await a(t.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-Q45XNNH3.js");await a(t.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-ZANP2BL4.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-UBXWRORY.js");await a(t.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-JOHCXOWR.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-XMGEEZ5K.js"),e=await a(t.commandArgs,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-HAHWXEDN.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"react":{let{runReact:a}=await import("./chunks/react-D6L6HQOQ.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-B7OWAB6E.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-XV6WVUPL.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-Z5BJFBTW.js");await a(t.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-HCUMT2OW.js");await a(t.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-7WV43JZ3.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-C7NG2DAG.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-EVARJJIQ.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-P6T4UG2I.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-I44BNF4T.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-CTWKEM4V.js"),i=e(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-MSK5L3VF.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-MSK5L3VF.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-MSK5L3VF.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-MSK5L3VF.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-GKCHSOOI.js");await a(t.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-55XBOVDK.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-WT4WILUH.js");await a(t.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-XR7UGDZD.js");await a(t.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-VCD33FX6.js");await a(t.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-E2T66AOL.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-MVMHRDM6.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-KHRGMVKB.js");await a(t.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-UKVZZ52B.js");await a(t.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-55EDLMPA.js");await a(t.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-GFQYXJVD.js");await a(t.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-GKB36CKN.js");await a(t.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-Z2O7JY3O.js");await a(t.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-SX4NL3N4.js");await a(t.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-NJMIIBUR.js");await a(t.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-VENV6XNR.js");await a(t.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-EXL7RKQ7.js");await a(t.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-U476YCIN.js");await a(t.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-KVBASG57.js"),e=await a(t.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-CSUCCH35.js"),e=await a(t.commandArgs);process.exit(e)}case"skills":{let{runSkills:a}=await import("./chunks/skills-KZMAEPI7.js");await a(t.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-INJR46LD.js");await a(t.commandArgs,{port:o,verbose:n});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-LK57Q63V.js");await a(t.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-GTUK7PES.js");a(t.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
10
+ `),process.exit(1))}var t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-MZWJNMXL.js");a({event:"cli_command_invoked",properties:{command:t.command||(t.version?"version":t.help?"help":"none"),arg_count:t.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:e}=await import("./chunks/telemetry-MZWJNMXL.js");await e(),process.exit(a)}if(t.version){let{getCliVersion:a}=await import("./chunks/cli-version-SHSHHYXU.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-TKYV2VUL.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-23FGUKN4.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(t.help&&!t.command){let{printHelp:a}=await import("./chunks/help-ZFJBFDNU.js");a(),await c(0)}var o=t.globalFlags.port,n=t.verbose,p=t.globalFlags.device,l=t.globalFlags.theme,S=t.globalFlags.driver,E=t.globalFlags.headless===!0,b=t.globalFlags.sim??t.globalFlags.session??t.globalFlags.tab,s=b?["--sim",b,...t.commandArgs]:t.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-3I5TVDYR.js"),e={};p&&(e.deviceModel=p),l&&(e.colorScheme=l),a.apply(e)}if(!t.command&&t.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-R54AVUYP.js");await a([],{port:o}),await c(0)}var r=t.command??"";if(!r){if(t.commandArgs.length>0){let e=t.commandArgs.find(i=>!i.startsWith("-"))??t.commandArgs[0];console.error(` unknown command: ${e}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-ZFJBFDNU.js");a(),await c(0)}if(r in d){let a=d[r],e=t.commandArgs.length>0?` ${t.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),e&&console.error(` \u2192 ${a}${e}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(t.help||t.commandArgs.includes("--help")||t.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",e=t.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!e){let{printGroupHelp:i}=await import("./chunks/help-ZFJBFDNU.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-ZFJBFDNU.js");i(a&&e?e:r,{prefer:a&&e?"verb":"command",group:a&&e?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-7QUYTCK3.js"),i=e(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-HEJB6NB6.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-7GTOVITS.js");await a(t.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-SOFJ7QI3.js"),e=await a(s);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:a}=await import("./chunks/test-6EZ2YHEN.js");await a(t.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-MPVMCPWZ.js");await a(t.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-KLROSFMP.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-O4365QYC.js");await a(t.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-GVWF4BNF.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-VAEKDLEX.js"),e=await a(t.commandArgs,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-UFGS2RPI.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"react":{let{runReact:a}=await import("./chunks/react-MMA3LE34.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-C72QGUMV.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-AWDE4NDZ.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-OCTJDADF.js");await a(t.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-FWE57WZP.js");await a(t.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-HEJB6NB6.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-7TLF5GM5.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-4FFLAGNO.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-QYK3MLTS.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-FVLVFNDW.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-7QUYTCK3.js"),i=e(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-CAPNUH2B.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-CAPNUH2B.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-CAPNUH2B.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-CAPNUH2B.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-TBUMHWAL.js");await a(t.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-APKKBXMJ.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-NXBN3X4Z.js");await a(t.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-X2DEUVXA.js");await a(t.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-VLLUNVK7.js");await a(t.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-D4YKYIDG.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-XO5L3YTX.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-CI2XOBPT.js");await a(t.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-KZDLN5I2.js");await a(t.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-5XBIUQGH.js");await a(t.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-5ZBMF444.js");await a(t.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-K6KOFHSQ.js");await a(t.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-BUW7GFTP.js");await a(t.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-ZE6YLTHF.js");await a(t.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-RI62D65F.js");await a(t.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-RHWBKIPW.js");await a(t.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-6R6RY6R5.js");await a(t.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-R54AVUYP.js");await a(t.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-KNT2MNHS.js"),e=await a(t.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-OQ6MXYSM.js"),e=await a(t.commandArgs);process.exit(e)}case"skills":{let{runSkills:a}=await import("./chunks/skills-DIETG7L3.js");await a(t.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-2OQWKQOR.js");await a(t.commandArgs,{port:o,verbose:n});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-5YH5C37X.js");await a(t.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-D47SYWGV.js");a(t.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as E,b as A,c as S,d as l,e as j,g as T,h as I,j as D,m as k,n as x,o as O,p as g,q as R,r as C}from"./chunk-PSL42AVT.js";import"./chunk-3AAJ272V.js";import{c as b}from"./chunk-B3HLOZ3N.js";import"./chunk-DTHD7QGU.js";import"./chunk-J7TYQVOU.js";import"./chunk-3TDPLIKL.js";import"./chunk-PINZJVS6.js";import"./chunk-SQRVXVCM.js";import"./chunk-MQFUXG7V.js";import"./chunk-X33P2PIG.js";import{h as y,i as $}from"./chunk-KBW2VI34.js";import"./chunk-KABJPUT4.js";import w from"node:fs";import d from"node:path";import{spawn as F}from"node:child_process";import B from"node:net";import{WebSocket as M}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new M(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==M.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function L(n=7668,e=400){return new Promise(t=>{let r=new B.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function W(n={}){let e=n.port??7668;if(await L(e))return{alreadyRunning:!0};if($()){let a=y()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";throw new c(`no sootsim bridge on port ${e} and refusing to spawn a standalone daemon \u2014 ${a}. start the live \`bun dev\` stack so the bridge is up, or set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose.`,"DEV_HOST_REFUSED")}let{cmd:t,prefixArgs:r}=C(),s=[...r,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=F(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await L(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await W({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function fe(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return _(),0;case"attach":return await V(t);case"projects":return await J();case"project":return await G(t);case"sessions":return await H(t);case"start":return await q(t);case"prompt":return await K(t);case"watch":return await X(t);case"transcript":return await Q(t);case"end":return await Y(t);case"paths":return await Z();default:return process.stderr.write(`unknown agent subcommand: ${e}
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as E,b as A,c as S,d as l,e as j,g as T,h as I,j as D,m as k,n as x,o as O,p as g,q as R,r as C}from"./chunk-77BLGF7T.js";import"./chunk-SPJXGCEP.js";import{c as b}from"./chunk-KYJJSQWY.js";import"./chunk-DRHDI7V4.js";import"./chunk-MOO23TCK.js";import"./chunk-4TWK4GWQ.js";import"./chunk-5IYZIY67.js";import"./chunk-YRRFLKL4.js";import"./chunk-HCGT7RFQ.js";import"./chunk-6YFOOGMX.js";import{h as y,i as $}from"./chunk-5QO3N7MG.js";import"./chunk-4KQKAI4R.js";import w from"node:fs";import d from"node:path";import{spawn as F}from"node:child_process";import B from"node:net";import{WebSocket as M}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new M(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==M.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function L(n=7668,e=400){return new Promise(t=>{let r=new B.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function W(n={}){let e=n.port??7668;if(await L(e))return{alreadyRunning:!0};if($()){let a=y()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";throw new c(`no sootsim bridge on port ${e} and refusing to spawn a standalone daemon \u2014 ${a}. start the live \`bun dev\` stack so the bridge is up, or set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose.`,"DEV_HOST_REFUSED")}let{cmd:t,prefixArgs:r}=C(),s=[...r,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=F(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await L(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await W({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function fe(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return _(),0;case"attach":return await V(t);case"projects":return await J();case"project":return await G(t);case"sessions":return await H(t);case"start":return await q(t);case"prompt":return await K(t);case"watch":return await X(t);case"transcript":return await Q(t);case"end":return await Y(t);case"paths":return await Z();default:return process.stderr.write(`unknown agent subcommand: ${e}
3
3
  `),_(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
4
4
  `),1;throw r}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function _(){b("agent")}function P(n,e){let t={},r=[];for(let s=0;s<n.length;s++){let o=n[s],i=e[o];i==="value"?(t[o]=n[s+1]??"",s++):i==="bool"?t[o]=!0:r.push(o)}return{flags:t,positional:r}}function U(n,e="codex"){return n==="codex"||n==="claude"?n:e}async function V(n){let{flags:e,positional:t}=P(n,{"--name":"value","--provider":"value"}),r=t[0];if(!r)return process.stderr.write(`usage: sootsim agent attach <dir> [--name X] [--provider codex|claude]
5
5
  `),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as M}from"./chunk-3AAJ272V.js";import"./chunk-KABJPUT4.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as I,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as M}from"./chunk-SPJXGCEP.js";import"./chunk-4KQKAI4R.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as I,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
3
3
  `)}catch{}}return{exited:a,on(s,i){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(i),()=>{e?.delete(i)}},request(s,i){if(g)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,f)=>{r.set(e,{resolve:l=>p(l),reject:f,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:i})})},notify(s,i){n({jsonrpc:"2.0",method:s,params:i})},async shutdown(s=1500){if(g)return;try{t.stdin.end()}catch{}let i=setTimeout(()=>{if(!g)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(i)}},kill(s="SIGTERM"){if(!g)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return I(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let g=t[u];g&&(r[g]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: sootsim agent-wrapper --session-id <id> --project-id <id>
4
4
  --provider codex|claude --cwd <path>
5
5
  --prompt-in <fifo> --events-out <fifo>
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as p}from"./chunk-E3NRRI4M.js";import"./chunk-KABJPUT4.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let i=t.find(r=>r.startsWith(`--${e}=`));return i?i.slice(e.length+3):void 0}async function S(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: sootsim app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let r=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of r){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(i))try{let n=JSON.parse(y(i,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(i,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as p}from"./chunk-LBRLBJAS.js";import"./chunk-4KQKAI4R.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let i=t.find(r=>r.startsWith(`--${e}=`));return i?i.slice(e.length+3):void 0}async function S(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: sootsim app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let r=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of r){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(i))try{let n=JSON.parse(y(i,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(i,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-KABJPUT4.js";import{spawn as x}from"child_process";var w=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),S=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),q=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),P=new Set(["--path-equals"]);function j(s){let r=[],u=[],n=0,e=!1,t=!1,i=!1;for(let o=0;o<s.length;o++){let a=s[o];if(a==="--within"){let c=Number(s[o+1]);if(!Number.isFinite(c)||c<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=c,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(S.has(a)){u.push({kind:a,args:[]});continue}if(q.has(a)){let c=s[o+1];if(c==null)return{error:`${a} requires a value`};u.push({kind:a,args:[c]}),o++;continue}if(P.has(a)){let c=s[o+1],f=s[o+2];if(c==null||f==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[c,f]}),o+=2;continue}r.push(a)}return r.length===0?{error:"assert requires a verb (e.g. find, describe, get errors)"}:{verbArgs:r,predicates:u,withinMs:n,negate:e,quiet:t,allowTimeout:i}}function N(s){return s[0]==="get"||s[0]==="debug"?w.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:w.has(s[0])?s[0]:null}async function R(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=x(process.execPath,u,{stdio:["ignore","pipe","pipe"],env:process.env}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",o=>{n({ok:!1,payload:null,reason:`spawn failed: ${o.message}`})}),e.on("close",o=>{if(o!==0){let a=i.trim().split(`
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-4KQKAI4R.js";import{spawn as x}from"child_process";var w=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),S=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),q=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),P=new Set(["--path-equals"]);function j(s){let r=[],u=[],n=0,e=!1,t=!1,i=!1;for(let o=0;o<s.length;o++){let a=s[o];if(a==="--within"){let c=Number(s[o+1]);if(!Number.isFinite(c)||c<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=c,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(S.has(a)){u.push({kind:a,args:[]});continue}if(q.has(a)){let c=s[o+1];if(c==null)return{error:`${a} requires a value`};u.push({kind:a,args:[c]}),o++;continue}if(P.has(a)){let c=s[o+1],f=s[o+2];if(c==null||f==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[c,f]}),o+=2;continue}r.push(a)}return r.length===0?{error:"assert requires a verb (e.g. find, describe, get errors)"}:{verbArgs:r,predicates:u,withinMs:n,negate:e,quiet:t,allowTimeout:i}}function N(s){return s[0]==="get"||s[0]==="debug"?w.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:w.has(s[0])?s[0]:null}async function R(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=x(process.execPath,u,{stdio:["ignore","pipe","pipe"],env:process.env}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",o=>{n({ok:!1,payload:null,reason:`spawn failed: ${o.message}`})}),e.on("close",o=>{if(o!==0){let a=i.trim().split(`
3
3
  `).slice(-2).join(" | ").slice(0,200);n({ok:!1,payload:null,reason:`verb exited ${o}${a?`: ${a}`:""}`});return}if(!t.trim()){n({ok:!1,payload:null,reason:"verb produced no output"});return}try{let a=JSON.parse(t);n({ok:!0,payload:a})}catch{n({ok:!1,payload:null,reason:`verb output was not valid json: ${t.slice(0,120)}`})}})})}function y(s,r){let u=r.split(".").filter(e=>e.length>0),n=s;for(let e of u){if(n==null)return{found:!1};if(Array.isArray(n)){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{found:!1};n=n[t];continue}if(typeof n=="object"){let t=n;if(!(e in t))return{found:!1};n=t[e];continue}return{found:!1}}return{found:!0,value:n}}function d(s){return Array.isArray(s)?s.length:s&&typeof s=="object"?Object.keys(s).length:null}async function A(s,r){let{kind:u,args:n}=s;switch(u){case"--exists":return r==null?{ok:!1,reason:"payload is null"}:d(r)===0?{ok:!1,reason:"payload is empty"}:{ok:!0,reason:"exists"};case"--empty":{if(r==null)return{ok:!0,reason:"payload is null"};let e=d(r);return e===0?{ok:!0,reason:"payload is empty"}:{ok:!1,reason:`payload has ${e} item(s)`}}case"--count":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:`payload not countable (${typeof r})`}:{ok:t===e,reason:`count=${t}, want=${e}`}}case"--count-at-least":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t>=e,reason:`count=${t}, want>=${e}`}}case"--count-at-most":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t<=e,reason:`count=${t}, want<=${e}`}}case"--contains":{let e=n[0],t=JSON.stringify(r);return{ok:t.includes(e),reason:t.includes(e)?`contains "${e}"`:`missing "${e}"`}}case"--not-contains":{let e=n[0],t=JSON.stringify(r);return{ok:!t.includes(e),reason:t.includes(e)?`unexpected "${e}"`:`not contains "${e}"`}}case"--matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=e.test(t);return{ok:i,reason:i?`matches /${n[0]}/`:`no match for /${n[0]}/`}}case"--not-matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=!e.test(t);return{ok:i,reason:i?`not matches /${n[0]}/`:`unexpected /${n[0]}/`}}case"--equals":{let e=n[0],t=typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):JSON.stringify(r);return{ok:t===e,reason:`got=${JSON.stringify(t)}, want=${JSON.stringify(e)}`}}case"--has-path":{let e=y(r,n[0]);return{ok:e.found,reason:e.found?`path ${n[0]} present`:`path ${n[0]} missing`}}case"--path-equals":{let[e,t]=n,i=y(r,e);if(!i.found)return{ok:!1,reason:`path ${e} missing`};let o=typeof i.value=="string"||typeof i.value=="number"||typeof i.value=="boolean"?String(i.value):JSON.stringify(i.value);return{ok:o===t,reason:`${e}=${o}, want=${t}`}}case"--jq":{let e=n[0];try{let i=(await O(e,r)).trim();return{ok:i.length>0&&i!=="null"&&i!=="false"&&i!=='""',reason:`jq: ${i.slice(0,120)}`}}catch(t){throw new Error(`jq evaluation failed: ${t.message}`)}}default:return{ok:!1,reason:`unknown predicate ${u}`}}}function O(s,r){return new Promise((u,n)=>{let e=x("jq",[s],{stdio:["pipe","pipe","pipe"]}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",n),e.on("close",o=>{if(o!==0){n(new Error(i.trim()||`jq exited ${o}`));return}u(t)}),e.stdin.end(JSON.stringify(r))})}async function T(s){(s[0]==="--help"||s[0]==="-h"||s.length===0)&&(J(),process.exit(s.length===0?2:0));let r=j(s);"error"in r&&(process.stderr.write(` assert: ${r.error}
4
4
  `),process.exit(2));let{verbArgs:u,predicates:n,withinMs:e,negate:t,quiet:i,allowTimeout:o}=r;N(u)||(process.stderr.write(` assert: unknown or non-read verb: ${u.join(" ")}
5
5
  supported: ${Array.from(w).sort().join(", ")}
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d}from"./chunk-TCYVPNQO.js";import"./chunk-R35KFNWH.js";import"./chunk-OHPV4WP2.js";import"./chunk-5IYZIY67.js";import"./chunk-5QO3N7MG.js";import"./chunk-4KQKAI4R.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d,e}from"./chunk-HCGT7RFQ.js";import"./chunk-4KQKAI4R.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,2 +1,2 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as w,i as u,j as m,k as l}from"./chunk-X33P2PIG.js";var p="sootsim:settings",v=["errorReporting","colorScheme","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function S(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let t={};for(let n of v){if(!(n in e))continue;let r=e[n],o=u[n];o.validate&&!o.validate(r)||o.options&&!o.options.includes(r)||(t[n]=r)}return t}function h(e){let t={};for(let n of v)t[n]=e[n];return t}function _(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(p);return e?g(JSON.parse(e)):{}}catch{return{}}}function V(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(p,JSON.stringify(h(e)))}catch{}}function E(){let t=S()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:g(t)}function K(e){let t=S();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:h(e)})}catch{}}function k(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function j(){let e=k()?.settings;return!e||typeof e!="object"?{}:g(e)}function D(e){if(!k())return;let t={settings:h(e)};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}function b(){let e=_(),t=j(),n=E();return{...e,...t,...n}}function R(e){V(e),K(e),D(e)}function C(e){if(typeof window>"u")return()=>{};let t=i=>{if(!(i.key!==p||i.newValue==null))try{e(g(JSON.parse(i.newValue)))}catch{}};window.addEventListener("storage",t);let n=S(),r;n?.onSharedConfigChanged&&(r=n.onSharedConfigChanged(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",t),r?.(),c?.()}}var M=l(),P=b();for(let e of Object.keys(m()))delete P[e];var s={...M,...P},f=[],a=null;function y(){for(let e of f)e();R(s)}C(e=>{let t={...s},n=!1;for(let[r,o]of Object.entries(e)){let c=r;t[c]!==o&&(t[c]=o,n=!0)}if(n){s=t,a=null;for(let r of f)r()}});var L={get(e){return s[e]},set(e,t){let n=u[e];n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]!==t&&(s={...s,[e]:t},e==="deviceModel"&&(a=null),y())},getAll(){return s},apply(e){let t=!1,n={...s};for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let c=r,i=u[c];i&&(i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||n[c]!==o&&(n[c]=o,t=!0))}t&&(s=n,a=null,y())},reset(){s=l(),a=null,y()},subscribe(e){return f.push(e),()=>{f=f.filter(t=>t!==e)}},getDeviceSpec(){return a||(a=w(s.deviceModel)),a},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{L as a};
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as w,i as u,j as m,k as l}from"./chunk-6YFOOGMX.js";var p="sootsim:settings",v=["errorReporting","colorScheme","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function S(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let t={};for(let n of v){if(!(n in e))continue;let r=e[n],o=u[n];o.validate&&!o.validate(r)||o.options&&!o.options.includes(r)||(t[n]=r)}return t}function h(e){let t={};for(let n of v)t[n]=e[n];return t}function _(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(p);return e?g(JSON.parse(e)):{}}catch{return{}}}function V(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(p,JSON.stringify(h(e)))}catch{}}function E(){let t=S()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:g(t)}function K(e){let t=S();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:h(e)})}catch{}}function k(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function j(){let e=k()?.settings;return!e||typeof e!="object"?{}:g(e)}function D(e){if(!k())return;let t={settings:h(e)};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}function b(){let e=_(),t=j(),n=E();return{...e,...t,...n}}function R(e){V(e),K(e),D(e)}function C(e){if(typeof window>"u")return()=>{};let t=i=>{if(!(i.key!==p||i.newValue==null))try{e(g(JSON.parse(i.newValue)))}catch{}};window.addEventListener("storage",t);let n=S(),r;n?.onSharedConfigChanged&&(r=n.onSharedConfigChanged(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",t),r?.(),c?.()}}var M=l(),P=b();for(let e of Object.keys(m()))delete P[e];var s={...M,...P},f=[],a=null;function y(){for(let e of f)e();R(s)}C(e=>{let t={...s},n=!1;for(let[r,o]of Object.entries(e)){let c=r;t[c]!==o&&(t[c]=o,n=!0)}if(n){s=t,a=null;for(let r of f)r()}});var L={get(e){return s[e]},set(e,t){let n=u[e];n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]!==t&&(s={...s,[e]:t},e==="deviceModel"&&(a=null),y())},getAll(){return s},apply(e){let t=!1,n={...s};for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let c=r,i=u[c];i&&(i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||n[c]!==o&&(n[c]=o,t=!0))}t&&(s=n,a=null,y())},reset(){s=l(),a=null,y()},subscribe(e){return f.push(e),()=>{f=f.filter(t=>t!==e)}},getDeviceSpec(){return a||(a=w(s.deviceModel)),a},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{L as a};
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as y}from"./chunk-CYKPWI35.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as p}from"fs";import{tmpdir as m}from"os";import{dirname as v,join as w}from"path";var d=new Map;function s(e,r){d.set(e,r)}var c=1;function i(){return w(m(),`sootsim-cli-hints-${y()}.json`)}function l(){return w(m(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:c,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==c||!r?.shown?{version:c,shown:{}}:r}catch{return{version:c,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as y}from"./chunk-OHPV4WP2.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as p}from"fs";import{tmpdir as m}from"os";import{dirname as v,join as w}from"path";var d=new Map;function s(e,r){d.set(e,r)}var c=1;function i(){return w(m(),`sootsim-cli-hints-${y()}.json`)}function l(){return w(m(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:c,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==c||!r?.shown?{version:c,shown:{}}:r}catch{return{version:c,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
3
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(i());return t.shown[e]?!1:(t.shown[e]=n,f(i(),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(i()),a=t.shown[e]??0;return n-a<r.cooldownMs?!1:(t.shown[e]=n,f(i(),t),!0)}return!0}function k(e,...r){let o=d.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],a=o.stream==="error"?console.error:console.log;for(let g of t)a(` hint: ${g}`);return!0}function M(){p(i(),{force:!0})}function O(){p(l(),{force:!0})}function T(){return Array.from(d.entries()).map(([e,r])=>({id:e,frequency:r.frequency}))}s("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});s("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`,stream:"error"});s("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(r=>` ${r}`)]:null,stream:"error"});s("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>"]});s("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `sootsim describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});s("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{k as a,M as b,O as c,T as d};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var d=Object.defineProperty;var e=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var f=(a,b)=>{for(var c in b)d(a,c,{get:b[c],enumerable:!0})};export{e as a,f as b};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ var t="http://localhost:5173/";export{t as a};
@@ -0,0 +1 @@
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var t=4001,n="sootsim close";export{t as a,n as b};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import n from"node:fs";import{homedir as k}from"node:os";import r from"node:path";var L="SOOTSIM_HOME",E="active",A="daemon.json",_="config.json",I=3e4;function c(){let e=process.env[L];return e&&e.length>0?r.resolve(e):r.join(k(),".sootsim")}function N(){if(process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1")return!1;let e=process.env.SOOTSIM_DEV;if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;let t=process.argv[1];if(!t)return!1;try{return n.realpathSync(t).includes(`${r.sep}packages${r.sep}sootsim${r.sep}`)}catch{return!1}}function j(){return process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1"?!1:process.env.IS_TAMAGUI_DEV==="1"}function K(){return N()||j()}function f(){return r.join(c(),"runtimes")}function T(e){return r.join(f(),e)}function h(){return r.join(f(),E)}function S(){return r.join(c(),"electron")}function Y(){return r.join(S(),"userData")}function W(e){return r.join(S(),e)}function F(){return r.join(c(),"profiles")}function M(){return r.join(c(),"daemon-app")}function C(){return r.join(M(),"SootSim Daemon.app")}function X(){return r.join(C(),"Contents","MacOS","sootsim-daemon")}function w(){return r.join(c(),"cache")}function p(){return r.join(c(),A)}function d(){return r.join(c(),_)}function v(){try{let e=n.readFileSync(d(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function P(e){y();let t=v(),s={...t,...e};e.settings&&typeof e.settings=="object"&&(s.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let u=`${d()}.tmp`;return n.writeFileSync(u,`${JSON.stringify(s,null,2)}
3
3
  `,"utf8"),n.renameSync(u,d()),s}function q(){return v().telemetry!==!1}function z(e){P({telemetry:e})}function y(){n.mkdirSync(c(),{recursive:!0}),n.mkdirSync(f(),{recursive:!0}),n.mkdirSync(S(),{recursive:!0}),n.mkdirSync(F(),{recursive:!0}),n.mkdirSync(w(),{recursive:!0})}function R(){try{let e=n.readFileSync(h(),"utf8").trim();return e.length>0?e:null}catch{return null}}function Q(e){n.mkdirSync(f(),{recursive:!0}),n.writeFileSync(h(),`${e}
4
4
  `,"utf8")}function Z(){try{return n.readdirSync(f(),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).sort($)}catch{return[]}}function $(e,t){let s=i=>{let a=i.indexOf("-"),l=a>=0?i.slice(0,a):i,O=a>=0?i.slice(a+1):"",b=l.split(".").map(g=>Number.parseInt(g,10));return b.some(g=>!Number.isFinite(g))?[[Number.POSITIVE_INFINITY],i]:[b,O]},[u,o]=s(e),[x,m]=s(t);for(let i=0;i<Math.max(u.length,x.length);i++){let a=u[i]??0,l=x[i]??0;if(a!==l)return a-l}return o===m?0:o?m?o<m?-1:1:-1:1}function ee(){let e=R();if(!e)return null;let t=T(e);try{if(n.statSync(t).isDirectory())return t}catch{}return null}var D=16*1024;function V(){try{let e=n.openSync(p(),"r");try{let t=Buffer.alloc(D),s=n.readSync(e,t,0,D,0),u=t.subarray(0,s).toString("utf8"),o=JSON.parse(u);return o&&o.schema===1&&typeof o.pid=="number"&&typeof o.bridgePort=="number"&&typeof o.runtimePort=="number"&&typeof o.startedAt=="number"&&typeof o.heartbeatAt=="number"?o:null}finally{n.closeSync(e)}}catch{return null}}function H(e,t=Date.now()){if(!e||t-e.heartbeatAt>I)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function J(e){y();let t=`${p()}.tmp`;n.writeFileSync(t,`${JSON.stringify(e,null,2)}
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var o={width:3,lock:{top:253,height:103},ringToggle:{top:152,height:32},volumeUp:{top:214,height:61},volumeDown:{top:290,height:61}},m={width:2.5,lock:{top:130,height:78},ringToggle:{top:94,height:22},volumeUp:{top:126,height:48},volumeDown:{top:188,height:48}},c={width:3,lock:{top:238,height:78},ringToggle:{top:-1e3,height:0},volumeUp:{top:336,height:62},volumeDown:{top:408,height:62}},p={width:3,lock:{top:248,height:72},ringToggle:{top:-1e3,height:0},volumeUp:{top:144,height:62},volumeDown:{top:216,height:62}},r=48;function t(e){return{...e,platform:"ios",navigationBarHeight:0,navigationBarMode:e.homeIndicatorHeight>0?"gesture":"none",displayCutout:{top:e.dynamicIsland?e.statusBarHeight:0,bottom:0,left:0,right:0},cameraCutout:null,osVersion:e.iosVersion,androidApiLevel:null,systemName:"iOS",manufacturer:"Apple",brand:"Apple",modelName:e.name}}var h={"iphone-se":t({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:m}),"iphone-14":t({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:o}),"iphone-15":t({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:o}),"iphone-15-plus":t({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:o}),"iphone-15-pro":t({name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro-max":t({name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-16":t({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:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-plus":t({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:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro":t({name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro-max":t({name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17":t({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:o}),"iphone-17-air":t({name:"iPhone 17 Air",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro":t({name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro-max":t({name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"ipad-pro-13":t({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:o}),"pixel-8":{platform:"android",name:"Pixel 8",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-8-three-button":{platform:"android",name:"Pixel 8 (3-button)",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:48,navigationBarMode:"three-button",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:48,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-9-pro-xl":{platform:"android",name:"Pixel 9 Pro XL",width:448,height:997,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:41,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 9 Pro XL",physicalPPI:486,hardwareButtons:c},"galaxy-s24":{platform:"android",name:"Galaxy S24",width:360,height:780,scale:3,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:36,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S921B",physicalPPI:416,hardwareButtons:p},"galaxy-s24-ultra":{platform:"android",name:"Galaxy S24 Ultra",width:384,height:824,scale:3.75,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:24,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S928B",physicalPPI:505,hardwareButtons:p}},u="iphone-17-pro";function S(e){return h[e]}function g(){return Object.keys(h)}var i={"iphone-6-9":{name:"iphone-6-9",label:'iPhone 6.7"',width:1284,height:2778,store:"apple"},"iphone-6-1":{name:"iphone-6-1",label:'iPhone 6.5"',width:1242,height:2688,store:"apple"},"ipad-13":{name:"ipad-13",label:'iPad 13"',width:2064,height:2752,store:"apple"},"android-phone":{name:"android-phone",label:"Google Play phone",width:1080,height:1920,store:"google"},"android-tablet-7":{name:"android-tablet-7",label:'Google Play 7" tablet',width:1200,height:1920,store:"google"},"android-tablet-10":{name:"android-tablet-10",label:'Google Play 10" tablet',width:1600,height:2560,store:"google"}},s={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"}]}},P={color:"#25c3ec",blur:120,spread:52,opacity:.34},v="iphone-17-pro";var f=[{name:"white",value:"#ffffff"},{name:"gray-light",value:"#d1d5db"},{name:"gray",value:"#6b7280"},{name:"gray-dark",value:"#3b4350"},{name:"slate",value:"#2a3644"},{name:"black",value:"#000000"},{name:"cyan",value:"#25c3ec"},{name:"blue",value:"#3f7cff"},{name:"teal",value:"#1fc7b4"},{name:"green",value:"#42c95d"},{name:"lime",value:"#92d21b"},{name:"gold",value:"#f5c518"},{name:"orange",value:"#ff912e"},{name:"coral",value:"#ff6f5b"},{name:"red",value:"#ff4f6f"},{name:"berry",value:"#d054ff"},{name:"magenta",value:"#ff4eb8"}],x=Object.fromEntries(f.map(e=>[e.name,e.value]));function B(e){return Object.prototype.hasOwnProperty.call(i,e)?i[e]:null}function b(e){return{type:e.type,color:e.color,direction:e.direction,glow:e.glow,stops:e.stops?.map(n=>({...n}))}}function I(e){return Object.prototype.hasOwnProperty.call(s,e)?b(s[e]):null}var d={deviceModel:{type:"enum",default:u,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:g(),group:"device"},orientation:{type:"enum",default:"portrait",description:"screen orientation",cliFlag:"orientation",options:["portrait","landscape"],group:"device"},colorScheme:{type:"enum",default:"auto",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"},threeMode:{type:"boolean",default:!1,description:"show the experimental 3d device stage in the browser shell",group:"simulator"},threeRecordingEditor:{type:"boolean",default:!1,description:"dock the 3d recording editor in the 3d stage (toggled from its rail)",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(s),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"},agentProvider:{type:"enum",default:"codex",description:"ai agent used by the sootsim agent prompt bar",options:["codex","claude"],group:"agent"},onboardingComplete:{type:"boolean",default:!1,description:"first-run onboarding completed",group:"beta"},betaConsentVersion:{type:"number",default:0,description:"last accepted beta telemetry policy version",group:"beta"},detailedTelemetry:{type:"boolean",default:!0,description:"send detailed usage telemetry (sessions, perf samples)",group:"beta"}};function y(){if(typeof window>"u")return{};let e={};try{let n=new URLSearchParams(window.location.search),a=n.get("device");a&&d.deviceModel.options?.includes(a)&&(e.deviceModel=a);let l=n.get("colorScheme")??n.get("theme");l&&d.colorScheme.options?.includes(l)&&(e.colorScheme=l)}catch{}return e}function R(){let e={};for(let[n,a]of Object.entries(d))e[n]=a.default;return Object.assign(e,y()),e}export{P as a,v as b,B as c,b as d,I as e,h as f,S as g,g as h,d as i,y as j,R as k};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as i,e as d,h as c}from"./chunk-OULIZJPC.js";function g(r){let e=r[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function u(r,e,t){let l=i(r,{port:e.port}),s=g(l.positional),a=d({...l,commandTimeoutMs:5e3});try{let n=!!(await c(a,"SootSim.bridges.settings.get"))?.[t.modeKey],o=s==="on"?!0:s==="off"?!1:!n;if(n===o)return console.log(` ${t.displayName}: already ${o?"on":"off"}`),{current:n,target:o,changed:!1};if(!await a.send({type:"evaluate",acquireLock:!0,code:`(async () => {
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as i,e as d,h as c}from"./chunk-R35KFNWH.js";function g(r){let e=r[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function u(r,e,t){let l=i(r,{port:e.port}),s=g(l.positional),a=d({...l,commandTimeoutMs:5e3});try{let n=!!(await c(a,"SootSim.bridges.settings.get"))?.[t.modeKey],o=s==="on"?!0:s==="off"?!1:!n;if(n===o)return console.log(` ${t.displayName}: already ${o?"on":"off"}`),{current:n,target:o,changed:!1};if(!await a.send({type:"evaluate",acquireLock:!0,code:`(async () => {
3
3
  const modeKey = ${JSON.stringify(t.modeKey)}
4
4
  const target = ${JSON.stringify(o)}
5
5
  window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as R}from"./chunk-3AAJ272V.js";import{n as D}from"./chunk-KBW2VI34.js";import{a as T}from"./chunk-KABJPUT4.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import m from"node:fs";import y from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||D()}function h(){return _()}function U(){return y.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=m.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{m.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=U();m.mkdirSync(y.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=m.openSync(r,"w",384);try{m.writeFileSync(n,JSON.stringify(e,null,2)),m.fsyncSync(n)}finally{m.closeSync(n)}m.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function B(e){return q("sha256").update(y.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ge(e){let t=y.resolve(e.cwd),r=B(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??y.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function ye(){return S().attachedProjects}var Q=336*60*60*1e3;function he(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-Q,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Se(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function we(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function ve(){if(S().attachedProjects.length>0)return;let t;try{t=(await import("sootsim/scripts/demo-app-registry")).APPS}catch(n){console.warn("[sootsim] seedFromDemoAppRegistry: could not load demo registry:",n.message);return}if(!Array.isArray(t))return;let r=t;w(n=>{for(let o of r){if(!m.existsSync(o.dir))continue;let s=y.resolve(o.dir),a=B(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as V,spawnSync as z}from"node:child_process";import{randomUUID as Z}from"node:crypto";import i,{constants as f}from"node:fs";import u from"node:path";import ee from"node:readline";function j(e){return u.join(h(),"sessions",e)}function W(e){return u.join(j(e),"prompt.in")}function J(e){return u.join(j(e),"events.out")}function te(e){return u.join(h(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(j(t)))}function re(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ne();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ne(){try{let e=se();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function se(){try{let r=T.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=oe();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function oe(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ie(e,t,r){let n=u.join(h(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,f.O_WRONLY|f.O_CREAT|f.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ce(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ce(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ie(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?Z():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=W(s.id),d=J(s.id),c=te(s.id);L(a),L(d);let g=u.dirname(c);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=re(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=V(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:h()}});x.unref();let E=e.readyTimeoutMs??6e3,b=await ae(d,p=>p.type==="ready"||p.type==="error",E);if(!b||b.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(j(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=b&&b.type==="error"?b.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function De(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,f.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as R}from"./chunk-SPJXGCEP.js";import{n as D}from"./chunk-5QO3N7MG.js";import{a as T}from"./chunk-4KQKAI4R.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import m from"node:fs";import y from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||D()}function h(){return _()}function U(){return y.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=m.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{m.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=U();m.mkdirSync(y.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=m.openSync(r,"w",384);try{m.writeFileSync(n,JSON.stringify(e,null,2)),m.fsyncSync(n)}finally{m.closeSync(n)}m.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function B(e){return q("sha256").update(y.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ge(e){let t=y.resolve(e.cwd),r=B(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??y.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function ye(){return S().attachedProjects}var Q=336*60*60*1e3;function he(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-Q,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Se(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function we(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function ve(){if(S().attachedProjects.length>0)return;let t;try{t=(await import("sootsim/scripts/demo-app-registry")).APPS}catch(n){console.warn("[sootsim] seedFromDemoAppRegistry: could not load demo registry:",n.message);return}if(!Array.isArray(t))return;let r=t;w(n=>{for(let o of r){if(!m.existsSync(o.dir))continue;let s=y.resolve(o.dir),a=B(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as V,spawnSync as z}from"node:child_process";import{randomUUID as Z}from"node:crypto";import i,{constants as f}from"node:fs";import u from"node:path";import ee from"node:readline";function j(e){return u.join(h(),"sessions",e)}function W(e){return u.join(j(e),"prompt.in")}function J(e){return u.join(j(e),"events.out")}function te(e){return u.join(h(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(j(t)))}function re(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ne();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ne(){try{let e=se();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function se(){try{let r=T.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=oe();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function oe(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ie(e,t,r){let n=u.join(h(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,f.O_WRONLY|f.O_CREAT|f.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ce(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ce(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ie(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?Z():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=W(s.id),d=J(s.id),c=te(s.id);L(a),L(d);let g=u.dirname(c);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=re(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=V(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:h()}});x.unref();let E=e.readyTimeoutMs??6e3,b=await ae(d,p=>p.type==="ready"||p.type==="error",E);if(!b||b.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(j(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=b&&b.type==="error"?b.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function De(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,f.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
3
3
  `)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function Re(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(O(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=j(e),n=h();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function Ne(e,t){let r=J(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,f.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=ee.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let c=I(d);c&&t(c)});let a=!1;return()=>{if(!a){a=!0;try{s.close()}catch{}try{o.destroy()}catch{}}}}async function ae(e,t,r){let n=i.openSync(e,f.O_RDWR|f.O_NONBLOCK),o=Buffer.alloc(8192),s="",a=Date.now()+r;try{for(;Date.now()<a;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(c){if(c.code!=="EAGAIN")throw c;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let c;for(;(c=s.indexOf(`
4
4
  `))>=0;){let g=s.slice(0,c);s=s.slice(c+1);let A=I(g);if(A&&t(A))return A}}else await new Promise(c=>setTimeout(c,30))}return null}finally{i.closeSync(n)}}export{I as a,h as b,ge as c,F as d,ye as e,he as f,Se as g,we as h,k as i,C as j,v as k,ve as l,j as m,W as n,J as o,te as p,O as q,re as r,l as s,Te as t,De as u,Re as v,Ne as w};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as Ae}from"./chunk-WBVNZ7R3.js";import{a as _e}from"./chunk-HDW4B3FW.js";import{a as Ee}from"./chunk-ZTHTQNVD.js";import{a as V,b as ye,c as be,d as Z,e as ee,f as ve,g as te,i as re,j as Se,k as xe}from"./chunk-JBVHVSVC.js";import{g as ke,n as Me,p as Ie,t as Pe}from"./chunk-KG3XVCAL.js";import{d as Te,f as Fe}from"./chunk-XF5W3CGA.js";import{m as ge}from"./chunk-WEGRCMET.js";import{c as X,d as Q,e as he}from"./chunk-OULIZJPC.js";import{a as $e}from"./chunk-OAZYZXMH.js";import{d as Y}from"./chunk-CYKPWI35.js";import{a as pe,b as G}from"./chunk-AJ34QMR4.js";import{f as we}from"./chunk-X33P2PIG.js";import*as A from"fs";import{tmpdir as Re}from"os";import*as y from"path";import*as g from"fs";import*as w from"path";var L=1e4,B=393,C=852,Ce="__sootsimCliPerf",He="maestroCopiedText",De=new Map;function f(o){return new Promise(e=>setTimeout(e,o))}function qe(o){return o?w.basename(o)===".maestro"?w.dirname(o):o:process.cwd()}function ze(o,e,t){let r=e.endsWith(".png")?e:`${e}.png`;if(w.isAbsolute(r))return r;if(t.mode==="flow"&&/[\\/]/.test(r)){let i=r.startsWith("./")||r.startsWith("../")?t.flowDir??process.cwd():qe(t.flowDir);return w.resolve(i,r)}return w.join(o,r)}function Ge(o){if(typeof o=="string")return{path:o,withFrame:!1};let e=o.path?.trim()||o.name?.trim();if(!e)throw new Error("takeScreenshot object form requires path or name");return{path:e,withFrame:o.withFrame===!0,layers:o.layers}}function ie(o){let[e,t]=o.split(",").map(i=>i.trim()),r=(i,n)=>i.endsWith("%")?Number.parseFloat(i)/100*n:Number.parseFloat(i);return{x:r(e,B),y:r(t,C)}}function Ye(o){let e=o.split(/^---$/m),t=e.length>1?e[e.length-1]:o,r=be(ye.parse(t),De);return Array.isArray(r)?r:[]}var W=class{constructor(e,t){this.bridge=e;this.opts=t}stepDelay=0;firstLaunchDone=!1;profilingEnabled=!1;recordingEnabled=!1;recordingAccessChecked=!1;recordingStartedAtMs=null;lastRecordingDurationMs=null;simRouteHint=null;lastFailedStep=null;get simId(){return this.opts.simId}setSimRouteHint(e){this.simRouteHint=this.normalizeSimRoute(e)}normalizeSimRoute(e){if(!e)return null;try{let t=new URL(e);t.searchParams.delete("inspectOpen");let r=t.searchParams.toString();return`${t.origin}${t.pathname}${r?`?${r}`:""}`}catch{return e}}async refreshSimId(){if(this.opts.simId)try{let e=await this.bridge.listSims(),t=e.find(a=>a.id===this.opts.simId);if(t&&(this.simRouteHint=this.normalizeSimRoute(t.url||t.origin)),e.find(a=>a.id===this.opts.simId&&a.readyState==="open")||!this.simRouteHint)return;let i=this.simRouteHint&&e.find(a=>a.readyState==="open"&&this.normalizeSimRoute(a.url||a.origin)===this.simRouteHint);if(!i)return;let n=e.find(a=>a.isPrimary&&a.readyState==="open"),s=e.find(a=>a.readyState==="open"),l=i??n??s;l&&(this.opts.simId=l.id,console.log(` [flow] sim rotated to ${l.id}`))}catch{}}async evaluate(e,t){return this.bridge.send({type:"evaluate",simId:this.opts.simId,code:e},t?{timeoutMs:t}:void 0)}async callTest(e,...t){return this.bridge.send({type:"call",simId:this.opts.simId,path:`__sootsimTest.${e}`,args:t})}async waitForTree(e=L){let t=Date.now()+e,r=Date.now(),i=null,n=0,s=0;for(;Date.now()<t;){try{let a=await this.evaluate(`(async () => {
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as Ae}from"./chunk-XRIPNBCE.js";import{a as _e}from"./chunk-SK4G3KBR.js";import{a as Ee}from"./chunk-BIWTU6Y6.js";import{a as V,b as ye,c as be,d as Z,e as ee,f as ve,g as te,i as re,j as Se,k as xe}from"./chunk-7YASUTHS.js";import{g as ke,n as Me,p as Ie,t as Pe}from"./chunk-JALLIXYA.js";import{d as Te,f as Fe}from"./chunk-DLYAXBRT.js";import{m as ge}from"./chunk-YYCJASBO.js";import{c as X,d as Q,e as he}from"./chunk-R35KFNWH.js";import{a as $e}from"./chunk-NEXDOXJ3.js";import{d as Y}from"./chunk-OHPV4WP2.js";import{a as pe,b as G}from"./chunk-IGQ54SMC.js";import{f as we}from"./chunk-6YFOOGMX.js";import*as A from"fs";import{tmpdir as Re}from"os";import*as y from"path";import*as g from"fs";import*as w from"path";var L=1e4,B=393,C=852,Ce="__sootsimCliPerf",He="maestroCopiedText",De=new Map;function f(o){return new Promise(e=>setTimeout(e,o))}function qe(o){return o?w.basename(o)===".maestro"?w.dirname(o):o:process.cwd()}function ze(o,e,t){let r=e.endsWith(".png")?e:`${e}.png`;if(w.isAbsolute(r))return r;if(t.mode==="flow"&&/[\\/]/.test(r)){let i=r.startsWith("./")||r.startsWith("../")?t.flowDir??process.cwd():qe(t.flowDir);return w.resolve(i,r)}return w.join(o,r)}function Ge(o){if(typeof o=="string")return{path:o,withFrame:!1};let e=o.path?.trim()||o.name?.trim();if(!e)throw new Error("takeScreenshot object form requires path or name");return{path:e,withFrame:o.withFrame===!0,layers:o.layers}}function ie(o){let[e,t]=o.split(",").map(i=>i.trim()),r=(i,n)=>i.endsWith("%")?Number.parseFloat(i)/100*n:Number.parseFloat(i);return{x:r(e,B),y:r(t,C)}}function Ye(o){let e=o.split(/^---$/m),t=e.length>1?e[e.length-1]:o,r=be(ye.parse(t),De);return Array.isArray(r)?r:[]}var W=class{constructor(e,t){this.bridge=e;this.opts=t}stepDelay=0;firstLaunchDone=!1;profilingEnabled=!1;recordingEnabled=!1;recordingAccessChecked=!1;recordingStartedAtMs=null;lastRecordingDurationMs=null;simRouteHint=null;lastFailedStep=null;get simId(){return this.opts.simId}setSimRouteHint(e){this.simRouteHint=this.normalizeSimRoute(e)}normalizeSimRoute(e){if(!e)return null;try{let t=new URL(e);t.searchParams.delete("inspectOpen");let r=t.searchParams.toString();return`${t.origin}${t.pathname}${r?`?${r}`:""}`}catch{return e}}async refreshSimId(){if(this.opts.simId)try{let e=await this.bridge.listSims(),t=e.find(a=>a.id===this.opts.simId);if(t&&(this.simRouteHint=this.normalizeSimRoute(t.url||t.origin)),e.find(a=>a.id===this.opts.simId&&a.readyState==="open")||!this.simRouteHint)return;let i=this.simRouteHint&&e.find(a=>a.readyState==="open"&&this.normalizeSimRoute(a.url||a.origin)===this.simRouteHint);if(!i)return;let n=e.find(a=>a.isPrimary&&a.readyState==="open"),s=e.find(a=>a.readyState==="open"),l=i??n??s;l&&(this.opts.simId=l.id,console.log(` [flow] sim rotated to ${l.id}`))}catch{}}async evaluate(e,t){return this.bridge.send({type:"evaluate",simId:this.opts.simId,code:e},t?{timeoutMs:t}:void 0)}async callTest(e,...t){return this.bridge.send({type:"call",simId:this.opts.simId,path:`__sootsimTest.${e}`,args:t})}async waitForTree(e=L){let t=Date.now()+e,r=Date.now(),i=null,n=0,s=0;for(;Date.now()<t;){try{let a=await this.evaluate(`(async () => {
3
3
  const test = window.__sootsimTest
4
4
  if (!test) return { count: 0, loading: true }
5
5
  const count = (await test.getNodeCount?.()) || 0
@@ -372,7 +372,7 @@ flow extension:
372
372
  + completed (${M.length} steps)`),c>0&&console.log(` screenshots: ${c} \u2192 ${s}`),I&&Oe(I),S&&console.log(` video: ${S}`),console.log()}catch(u){if(r&&!I)try{I=await d.stopProfile()}catch{}if(T&&!S)try{S=await d.stopRecording(),_=d.getLastRecordingDurationMs()}catch(c){console.warn(` recording stop failed: ${c?.message||String(c)}`)}console.error(`
373
373
  x failed: ${u.message}
374
374
  `),I&&(console.log(" partial profile:"),Oe(I)),S&&console.log(` partial video: ${S}`);try{let c=d.lastFailedStep,h=c?`step-${String(c.index+1).padStart(2,"0")}-${c.kind}`:"unstaged",R=y.join(s,h);await d.captureFailureBundle(R,{error:u,stepIndex:c?.index,stepKind:c?.kind,stepTarget:c?.target}),console.log(` failure bundle: ${R}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(c){try{let h=y.join(s,"error.png");await d.captureFailureScreenshot(h),console.log(` error screenshot: ${h}`)}catch{}console.log(` (failure bundle capture failed: ${c instanceof Error?c.message:String(c)})`)}await ge($,{errorsCommand:`sootsim get errors 5${d.simId?` --sim ${d.simId}`:""}`,warningsCommand:`sootsim get warnings 5${d.simId?` --sim ${d.simId}`:""}`,requestsCommand:`sootsim get requests 5${d.simId?` --sim ${d.simId}`:""}`}),O=1}finally{$.close()}if(O===0&&v)try{let u=await et(z??[]),c=["--origin",U,"--events",u];oe&&c.push("--public-origin",oe),S&&c.push("--video",S),S&&_&&Number.isFinite(_)&&c.push("--video-duration-ms",String(Math.round(_))),d.simId&&c.push("--sim",d.simId),Ve&&c.push("--open"),se&&c.push("--owner",se),ne&&c.push("--repo",ne),console.log(`
375
- preparing preview upload\u2026`);let{runUpload:h}=await import("./upload-INJR46LD.js");await h(c,{})}catch(u){console.error(` preview upload failed: ${u?.message||u}`),O=1}return J&&(d.simId&&H.add(d.simId),await Ze(b.wsPort,b.commandTimeoutMs,[...H])),await G(),O}async function Ze(o,e,t){let r=[...new Set(t.filter(Boolean))];if(r.length===0)return;let i=Q(o,{commandTimeoutMs:e});try{let n=await i.listSims(),s=r.filter(a=>n.some(m=>m.id===a&&m.readyState==="open"));if(s.length===0)return;let l=await Pe(i,o,e,s);await Me(n,s),l.closed.length>0&&console.log(` closed flow sim(s): ${l.closed.join(", ")}`),l.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${l.remaining.join(", ")}`)}catch(n){console.warn(` warn: failed to close flow sim(s): ${n instanceof Error?n.message:String(n)}`)}finally{i.close()}}async function et(o){let{gzipSync:e}=await import("zlib"),t=o.map(n=>JSON.stringify(n)).join(`
375
+ preparing preview upload\u2026`);let{runUpload:h}=await import("./upload-2OQWKQOR.js");await h(c,{})}catch(u){console.error(` preview upload failed: ${u?.message||u}`),O=1}return J&&(d.simId&&H.add(d.simId),await Ze(b.wsPort,b.commandTimeoutMs,[...H])),await G(),O}async function Ze(o,e,t){let r=[...new Set(t.filter(Boolean))];if(r.length===0)return;let i=Q(o,{commandTimeoutMs:e});try{let n=await i.listSims(),s=r.filter(a=>n.some(m=>m.id===a&&m.readyState==="open"));if(s.length===0)return;let l=await Pe(i,o,e,s);await Me(n,s),l.closed.length>0&&console.log(` closed flow sim(s): ${l.closed.join(", ")}`),l.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${l.remaining.join(", ")}`)}catch(n){console.warn(` warn: failed to close flow sim(s): ${n instanceof Error?n.message:String(n)}`)}finally{i.close()}}async function et(o){let{gzipSync:e}=await import("zlib"),t=o.map(n=>JSON.stringify(n)).join(`
376
376
  `)+(o.length?`
377
377
  `:""),r=e(Buffer.from(t,"utf8")),i=y.join(Re(),`sootsim-events-${Date.now()}.jsonl.gz`);return A.writeFileSync(i,r),console.log(` events: ${o.length} written to ${i} (${r.length} bytes gz)`),i}async function tt(o){let e=o[0],t=r=>o.find((i,n)=>o[n-1]===r);switch(e){case"start":{let{path:r,state:i}=ve();console.log(" flow draft started"),console.log(` session: ${r}`),console.log(` steps: ${i.steps.length}`);return}case"keep":case"good":{let r=re();if(r.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!r.kept){console.log(" no pending action to keep");return}console.log(` kept: ${r.candidate.summary}`),console.log(` steps: ${r.stepCount}`);return}case"end":{let r=t("--output")||(o[1]&&!o[1].startsWith("-")?o[1]:void 0),i=o.includes("--validate")||o.includes("--video"),n=o.includes("--video"),s=re();s.active&&s.kept&&console.log(` auto-kept trailing action: ${s.candidate.summary}`);let l=Se(r||(i?it():void 0));if(l.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!l.valid){console.error(" flow draft is not valid:");for(let a of l.issues)console.error(` - ${a}`);console.error(" draft preserved \u2014 keep at least one real interaction or run `sootsim flow start` to reset"),process.exit(1)}if(i){let a=ot(o,l.outputPath),m=await Ne(a);if(m!==0){console.error(`
378
378
  validation failed \u2014 draft preserved so you can keep iterating`),process.exitCode=m;return}te(),console.log(` flow draft validated (${l.stepCount} step${l.stepCount===1?"":"s"})`),l.outputPath&&console.log(` saved: ${l.outputPath}`),n&&console.log(" video: recorded during validation run");return}if(te(),console.log(` flow draft ended (${l.stepCount} step${l.stepCount===1?"":"s"})`),l.outputPath){console.log(` saved: ${l.outputPath}`),console.log(` next: sootsim flow ${l.outputPath} --record`);return}console.log(""),process.stdout.write(l.yaml);return}case"validate":{let r=o[1];(!r||r.startsWith("-"))&&(console.error(" usage: sootsim flow validate <path>"),process.exit(1));let i=ee(r);if(i.length>0){console.error(` x ${r} failed validation:`);for(let n of i)console.error(` - ${n}`);process.exit(1)}console.log(` + ${r} looks valid`);return}}}function rt(o){return o[0]==="--sim"&&o.length>=2?[...o.slice(2),"--sim",o[1]]:o}async function kt(o){let e=rt(o),t=e[0];if(t==="start"||t==="keep"||t==="good"||t==="end"||t==="validate")return await tt(e),0;let r=await Ne(e);return r!==0&&(process.exitCode=r),r}function Oe(o){let e=o.avgMs>0?(1e3/o.avgMs).toFixed(1):"?",t=o.sampleCount>0?(o.jankFrames/o.sampleCount*100).toFixed(1):"0";console.log(`
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as Ns}from"./chunk-KABJPUT4.js";var ui=`(async () => {
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as Ns}from"./chunk-4KQKAI4R.js";var ui=`(async () => {
3
3
  try { localStorage.clear() } catch {}
4
4
  try { sessionStorage.clear() } catch {}
5
5
  try {
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as ue,e as de,f as pe}from"./chunk-DKK3CC3D.js";import{d as ce}from"./chunk-E3NRRI4M.js";import{c as ae,e as le,g as P}from"./chunk-OULIZJPC.js";import{d as ie}from"./chunk-OLXRO2UE.js";import{a as se,b as T}from"./chunk-AJ34QMR4.js";import{a as oe}from"./chunk-H7O2EPCU.js";import{createHash as He}from"crypto";import{readFileSync as K}from"fs";import{gzipSync as Ce}from"zlib";function fe(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}import{brotliCompressSync as Le,constants as Ee}from"node:zlib";var ke=9;function ge(e){return Le(e,{params:{[Ee.BROTLI_PARAM_QUALITY]:ke}})}function G(e,t){let r=new AbortController,o=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(o)}}async function Ae(e){let t=G(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 o=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${o.slice(0,200)}`)}}async function Fe(e,t=8,r){let o=0,i=0,a=e.length;await Promise.all(Array.from({length:Math.min(t,a)},async()=>{for(;o<a;){let c=e[o++];await Ae(c),i++,r?.(i,a)}}))}function ze(e,t,r,o){let i=[];i.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let a of e.files){let c=r.get(a.urlhash);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}e.events&&o?.eventsBytes&&i.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:o.eventsBytes}),e.flowVideo&&o?.videoBytes&&i.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:o.videoBytes}),e.storage&&o?.storageBytes&&i.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:o.storageBytes});for(let a of e.snapshots??[]){let c=o?.snapshotBytes?.get(a.id);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}return i}function Me(e){return e.replace(/\/+$/,"")}var F=class extends Error{constructor(r,o,i,a=""){super(r);this.status=o;this.phase=i;this.responseText=a;this.name="PresignedUploadError"}};async function he(e){let t=Me(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let o=G(3e4,"init"),i;try{i=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:o.signal})}finally{o.cancel()}if(!i.ok){let p=await i.text().catch(()=>"");throw new F(`init failed: ${i.status} ${p.slice(0,200)}`,i.status,"init",p)}let a=await i.json(),c=ze(a,e.bundleBytes,e.filesByHash,e.extras);await Fe(c,e.concurrency??8,e.onPutProgress);let y=G(3e4,"finalize"),u;try{u=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:y.signal})}finally{y.cancel()}if(!u.ok){let p=await u.text().catch(()=>"");throw new F(`finalize failed: ${u.status} ${p.slice(0,200)}`,u.status,"finalize",p)}let S=await u.json();return{init:a,finalize:S}}function Ne(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 be=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",ve=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",J="http://localhost:3000",We=2e3;async function qe(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${J}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(We)});if(t.ok||t.status===204||t.status===405)return J}catch{}return be}function x(e){return e.replace(/\/$/,"")}function De(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 Ve(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function Ge(e,t){return t?x(t):process.env.SOOTSIM_PREVIEW_ORIGIN?x(process.env.SOOTSIM_PREVIEW_ORIGIN):De(e)?x(e):Ve(e)?x(ve):x(e)}function Ke(){console.log(`
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as ue,e as de,f as pe}from"./chunk-OOTZNIHU.js";import{d as ce}from"./chunk-LBRLBJAS.js";import{c as ae,e as le,g as P}from"./chunk-R35KFNWH.js";import{d as ie}from"./chunk-T77EKSH4.js";import{a as se,b as T}from"./chunk-IGQ54SMC.js";import{a as oe}from"./chunk-OP5XM4ED.js";import{createHash as He}from"crypto";import{readFileSync as K}from"fs";import{gzipSync as Ce}from"zlib";function fe(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}import{brotliCompressSync as Le,constants as Ee}from"node:zlib";var ke=9;function ge(e){return Le(e,{params:{[Ee.BROTLI_PARAM_QUALITY]:ke}})}function G(e,t){let r=new AbortController,o=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(o)}}async function Ae(e){let t=G(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 o=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${o.slice(0,200)}`)}}async function Fe(e,t=8,r){let o=0,i=0,a=e.length;await Promise.all(Array.from({length:Math.min(t,a)},async()=>{for(;o<a;){let c=e[o++];await Ae(c),i++,r?.(i,a)}}))}function ze(e,t,r,o){let i=[];i.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let a of e.files){let c=r.get(a.urlhash);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}e.events&&o?.eventsBytes&&i.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:o.eventsBytes}),e.flowVideo&&o?.videoBytes&&i.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:o.videoBytes}),e.storage&&o?.storageBytes&&i.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:o.storageBytes});for(let a of e.snapshots??[]){let c=o?.snapshotBytes?.get(a.id);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}return i}function Me(e){return e.replace(/\/+$/,"")}var F=class extends Error{constructor(r,o,i,a=""){super(r);this.status=o;this.phase=i;this.responseText=a;this.name="PresignedUploadError"}};async function he(e){let t=Me(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let o=G(3e4,"init"),i;try{i=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:o.signal})}finally{o.cancel()}if(!i.ok){let p=await i.text().catch(()=>"");throw new F(`init failed: ${i.status} ${p.slice(0,200)}`,i.status,"init",p)}let a=await i.json(),c=ze(a,e.bundleBytes,e.filesByHash,e.extras);await Fe(c,e.concurrency??8,e.onPutProgress);let y=G(3e4,"finalize"),u;try{u=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:y.signal})}finally{y.cancel()}if(!u.ok){let p=await u.text().catch(()=>"");throw new F(`finalize failed: ${u.status} ${p.slice(0,200)}`,u.status,"finalize",p)}let S=await u.json();return{init:a,finalize:S}}function Ne(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 be=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",ve=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",J="http://localhost:3000",We=2e3;async function Ve(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${J}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(We)});if(t.ok||t.status===204||t.status===405)return J}catch{}return be}function x(e){return e.replace(/\/$/,"")}function qe(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 De(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function Ge(e,t){return t?x(t):process.env.SOOTSIM_PREVIEW_ORIGIN?x(process.env.SOOTSIM_PREVIEW_ORIGIN):qe(e)?x(e):De(e)?x(ve):x(e)}function Ke(){console.log(`
3
3
  sootsim upload \u2014 publish the current recorded bundle as a /preview/<id> link
4
4
 
5
5
  usage:
@@ -39,7 +39,7 @@ examples:
39
39
  sootsim upload --events ./my-session.jsonl.gz
40
40
  sootsim upload --origin http://localhost:3000 --events ./my-session.jsonl.gz --open
41
41
  sootsim upload --video /tmp/soot-flow.webm --video-duration-ms 12000
42
- `)}function b(e,t){let r=e.findIndex(i=>i===t);if(r<0)return;let o=e[r+1];return e.splice(r,2),o}function ye(e,t){let r=e.findIndex(o=>o===t);return r<0?!1:(e.splice(r,1),!0)}function me(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 we(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 je(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function Je(e){try{return new URL(e).searchParams.get("appFonts")||""}catch{return""}}function Ye(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 Qe(e,t){let o=[];for(let i=0;i<t;i+=15e5){let a=Math.min(i+15e5,t),c=await P(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${i}, ${a})`);if(typeof c!="string")return null;o.push(c)}return o.join("")}function j(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function ht(e,t){(e.includes("--help")||e.includes("-h"))&&(Ke(),process.exit(0));let r=[...e],o=await qe(b(r,"--origin")),i=Ge(o,b(r,"--public-origin")),a=b(r,"--events"),c=b(r,"--screenshot"),y=b(r,"--video"),u=b(r,"--video-duration-ms"),S=b(r,"--owner"),p=b(r,"--repo"),Ue=ye(r,"--open");(S&&!p||!S&&p)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),!a&&!y&&(console.error(" preview uploads require playback data: pass --events or --video.\n for a normal local preview, use `sootsim record --mode combined --open`\n or `sootsim flow --preview` instead of uploading a bundle-only snapshot."),process.exit(1));let Y=ye(r,"--assets-only"),Be=ae(r,{stripBooleanFlags:[],stripValueFlags:[]}),v=le(Be),l,Q=[],m=[],z=null;try{if(l=await P(v,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),l?.bundleUrl){let n=new URL(l.bundleUrl).origin,[s,h]=await Promise.all([P(v,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(n)}) || [])`),P(v,`(async () => {
42
+ `)}function b(e,t){let r=e.findIndex(i=>i===t);if(r<0)return;let o=e[r+1];return e.splice(r,2),o}function ye(e,t){let r=e.findIndex(o=>o===t);return r<0?!1:(e.splice(r,1),!0)}function me(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 we(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 je(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function Je(e){try{return new URL(e).searchParams.get("appFonts")||""}catch{return""}}function Ye(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 Qe(e,t){let o=[];for(let i=0;i<t;i+=15e5){let a=Math.min(i+15e5,t),c=await P(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${i}, ${a})`);if(typeof c!="string")return null;o.push(c)}return o.join("")}function j(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function ht(e,t){(e.includes("--help")||e.includes("-h"))&&(Ke(),process.exit(0));let r=[...e],o=await Ve(b(r,"--origin")),i=Ge(o,b(r,"--public-origin")),a=b(r,"--events"),c=b(r,"--screenshot"),y=b(r,"--video"),u=b(r,"--video-duration-ms"),S=b(r,"--owner"),p=b(r,"--repo"),Ue=ye(r,"--open");(S&&!p||!S&&p)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),!a&&!y&&(console.error(" preview uploads require playback data: pass --events or --video.\n for a normal local preview, use `sootsim record --mode combined --open`\n or `sootsim flow --preview` instead of uploading a bundle-only snapshot."),process.exit(1));let Y=ye(r,"--assets-only"),Be=ae(r,{stripBooleanFlags:[],stripValueFlags:[]}),v=le(Be),l,Q=[],m=[],z=null;try{if(l=await P(v,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),l?.bundleUrl){let n=new URL(l.bundleUrl).origin,[s,h]=await Promise.all([P(v,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(n)}) || [])`),P(v,`(async () => {
43
43
  const list = window.__sootsimListWorkerFetchRecorder
44
44
  return typeof list === 'function'
45
45
  ? await list(${JSON.stringify(n)})
@@ -74,6 +74,6 @@ examples:
74
74
  ? (await workerDump()).filter(keep)
75
75
  : [],
76
76
  }
77
- })()`);if(m=j([...d.main,...d.worker]),Y){let O=m.length;m=m.filter(V=>me(V.contentType));let D=B.totalBytes-m.reduce((V,$e)=>V+($e.size||0),0);console.log(` --assets-only: kept ${m.length}/${O} records (dropped ${(D/1024).toFixed(1)} KiB of API responses)`)}}}l?.transformedBundle&&(z=await Qe(v,l.transformedBundle.byteLength))}finally{v.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.
78
- open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let f,M=!1;if(z!==null)f=new TextEncoder().encode(z),M=!0,console.log(` using post-transform bundle: ${(f.byteLength/1024).toFixed(1)} KiB`);else{let n=Ye(l.bundleUrl);n!==l.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),f=await we(n),console.log(` main bundle: ${(f.byteLength/1024).toFixed(1)} KiB`)}let E=Q.filter(n=>n.url!==l.bundleUrl);Y&&(E=E.filter(n=>me(n.contentType))),console.log(` fetching ${E.length} extra files\u2026`);let k=(await Promise.all(E.map(async n=>{try{let s=await we(n.url);return{...n,bytes:s}}catch(s){return console.error(` warning: failed to re-fetch ${n.url}: ${s instanceof Error?s.message:s}`),null}}))).filter(n=>!!n),Te=k.reduce((n,s)=>n+s.bytes.byteLength,0);console.log(` ${k.length} extra files: ${(Te/1024).toFixed(1)} KiB`);let U;a&&(U=K(a));let g;c&&(g=K(c),console.log(` attaching screenshot: ${(g.byteLength/1024).toFixed(1)} KiB`));let w,A,X;if(y){if(w=K(y),A=y.endsWith(".mp4")?"video/mp4":y.endsWith(".gif")?"image/gif":"video/webm",u){let n=Number(u);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${u}`),await T(),process.exit(1)),X=Math.round(n)}console.log(` attaching flow video: ${(w.byteLength/1024).toFixed(1)} KiB (${A})`)}let I=ue(),R=pe(I),Pe=oe();se({event:"preview_upload_started",identity:{userId:I?.kind==="session"?Pe?.user?.id??null:null,repoId:R?.repoId??null,installationId:R?.installationId??null},properties:{origin:o,hasAuth:!!I,authMode:I?.kind??"none",bundleBytes:f.byteLength,isTransformed:M,extraFiles:k.length,recordedFetches:m.length,hasEvents:!!U,hasScreenshot:!!g,hasVideo:!!w}}),I||(console.error(" preview uploads need auth."),console.error(" set SOOTSIM_API_KEY=sk_sootsim_..., run `sootsim login`, or use the soot github runner."),await T(),process.exit(1));let Ie=de(I),Re=(()=>{try{return new URL(l.bundleUrl).origin}catch{return null}})(),H=(n,s,h,L,re,_,B,d)=>{let O=fe(_),D=O?Ce(n):n;return{url:s,urlhash:h,method:L,bodyHash:re,requestVaryHash:d,contentType:_,responseHeaders:B,bytes:D,encoding:O?"gzip":void 0}},Z=[],C=Je(l.pageHref)||"";if(C){let n=await ce(C,{onStaged:({url:s,byteLength:h})=>console.log(` staged app font: ${s} (${(h/1024).toFixed(1)} KiB)`),onError:(s,h)=>console.error(` warning: failed to fetch app font ${s}: ${h instanceof Error?h.message:h}`)});for(let s of n)Z.push(H(Buffer.from(s.bytes),s.url,s.urlhash,"GET","-",s.contentType))}let N=[...k.map(n=>H(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders,n.requestVaryHash)),...m.map(n=>H(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders,n.requestVaryHash)),...Z],W=ge(f),_e=He("sha256").update(f).digest("hex");console.log(` bundle raw=${(f.byteLength/1024).toFixed(1)} KiB br=${(W.byteLength/1024).toFixed(1)} KiB`);let Oe={contentHash:_e,bundleSizeBytes:f.byteLength,bundleContentType:je(l.bundleUrl),bundleEncoding:"br",bundleOrigin:Re,appFonts:C||void 0,entry:l.entry,isTransformed:M,deviceSpec:l.deviceSpec,installationId:R?.installationId??void 0,repoId:R?.repoId,owner:S??R?.owner,repo:p??R?.repo,files:N.map(n=>({url:n.url,urlhash:n.urlhash,method:n.method,bodyHash:n.bodyHash,contentType:n.contentType,responseHeaders:n.responseHeaders,requestVaryHash:n.requestVaryHash,encoding:n.encoding,sizeBytes:n.bytes.byteLength})),events:U?{sizeBytes:U.byteLength}:void 0,snapshots:g?[{id:"landing",label:"Landing",kind:"landing",t:0,contentType:"image/png",sizeBytes:g.byteLength}]:void 0,flowVideo:w&&A?{sizeBytes:w.byteLength,contentType:A,durationMs:X}:void 0},ee=new Map;for(let n of N)ee.set(n.urlhash,n.bytes);let te=new Map;g&&te.set("landing",g);let xe=Date.now(),$=W.byteLength;for(let n of N)$+=n.bytes.byteLength;U&&($+=U.byteLength),g&&($+=g.byteLength),w&&($+=w.byteLength);let Se=`${x(o)}/api/preview/upload/init`;console.log(` init: ${Se}`);let q;try{let n=await he({originBase:o,initBody:Oe,bundleBytes:W,filesByHash:ee,extras:{eventsBytes:U,videoBytes:w,snapshotBytes:te},authHeader:Ie,concurrency:16});q=n.finalize;let s=1+n.init.files.length+(n.init.events?1:0)+n.init.snapshots.length+(n.init.flowVideo?1:0);console.log(` PUT ${s} objects in ${Date.now()-xe}ms (${($/1024).toFixed(1)} KiB)`)}catch(n){let s=n;s.phase==="init"&&s.status===401&&(console.error(" preview upload requires a valid login."),console.error(" run `sootsim login` and retry."),await T(),process.exit(1)),s.status===402&&(console.error(` ${Ne(s.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await T(),process.exit(1)),console.error(` ${s.message??`${s.phase??"upload"} failed: ${String(n)}`}`),await T(),process.exit(1)}let ne=`${i}${q.url}`;console.log(`
79
- stored ${q.filesStored??0} extra files`),console.log(` preview: ${ne}`),Ue&&await ie(ne),await T()}export{qe as a,Ge as b,ht as c};
77
+ })()`);if(m=j([...d.main,...d.worker]),Y){let O=m.length;m=m.filter(D=>me(D.contentType));let q=B.totalBytes-m.reduce((D,$e)=>D+($e.size||0),0);console.log(` --assets-only: kept ${m.length}/${O} records (dropped ${(q/1024).toFixed(1)} KiB of API responses)`)}}}l?.transformedBundle&&(z=await Qe(v,l.transformedBundle.byteLength))}finally{v.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.
78
+ open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let f,M=!1;if(z!==null)f=new TextEncoder().encode(z),M=!0,console.log(` using post-transform bundle: ${(f.byteLength/1024).toFixed(1)} KiB`);else{let n=Ye(l.bundleUrl);n!==l.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),f=await we(n),console.log(` main bundle: ${(f.byteLength/1024).toFixed(1)} KiB`)}let E=Q.filter(n=>n.url!==l.bundleUrl);Y&&(E=E.filter(n=>me(n.contentType))),console.log(` fetching ${E.length} extra files\u2026`);let k=(await Promise.all(E.map(async n=>{try{let s=await we(n.url);return{...n,bytes:s}}catch(s){return console.error(` warning: failed to re-fetch ${n.url}: ${s instanceof Error?s.message:s}`),null}}))).filter(n=>!!n),Te=k.reduce((n,s)=>n+s.bytes.byteLength,0);console.log(` ${k.length} extra files: ${(Te/1024).toFixed(1)} KiB`);let U;a&&(U=K(a));let g;c&&(g=K(c),console.log(` attaching screenshot: ${(g.byteLength/1024).toFixed(1)} KiB`));let w,A,X;if(y){if(w=K(y),A=y.endsWith(".mp4")?"video/mp4":y.endsWith(".gif")?"image/gif":"video/webm",u){let n=Number(u);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${u}`),await T(),process.exit(1)),X=Math.round(n)}console.log(` attaching flow video: ${(w.byteLength/1024).toFixed(1)} KiB (${A})`)}let I=ue(),R=pe(I),Pe=oe();se({event:"preview_upload_started",identity:{userId:I?.kind==="session"?Pe?.user?.id??null:null,repoId:R?.repoId??null,installationId:R?.installationId??null},properties:{origin:o,hasAuth:!!I,authMode:I?.kind??"none",bundleBytes:f.byteLength,isTransformed:M,extraFiles:k.length,recordedFetches:m.length,hasEvents:!!U,hasScreenshot:!!g,hasVideo:!!w}}),I||(console.error(" preview uploads need auth."),console.error(" set SOOTSIM_API_KEY=sk_sootsim_..., run `sootsim login`, or use the soot github runner."),await T(),process.exit(1));let Ie=de(I),Re=(()=>{try{return new URL(l.bundleUrl).origin}catch{return null}})(),H=(n,s,h,L,re,_,B,d)=>{let O=fe(_),q=O?Ce(n):n;return{url:s,urlhash:h,method:L,bodyHash:re,requestVaryHash:d,contentType:_,responseHeaders:B,bytes:q,encoding:O?"gzip":void 0}},Z=[],C=Je(l.pageHref)||"";if(C){let n=await ce(C,{onStaged:({url:s,byteLength:h})=>console.log(` staged app font: ${s} (${(h/1024).toFixed(1)} KiB)`),onError:(s,h)=>console.error(` warning: failed to fetch app font ${s}: ${h instanceof Error?h.message:h}`)});for(let s of n)Z.push(H(Buffer.from(s.bytes),s.url,s.urlhash,"GET","-",s.contentType))}let N=[...k.map(n=>H(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders,n.requestVaryHash)),...m.map(n=>H(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders,n.requestVaryHash)),...Z],W=ge(f),_e=He("sha256").update(f).digest("hex");console.log(` bundle raw=${(f.byteLength/1024).toFixed(1)} KiB br=${(W.byteLength/1024).toFixed(1)} KiB`);let Oe={contentHash:_e,bundleSizeBytes:f.byteLength,bundleContentType:je(l.bundleUrl),bundleEncoding:"br",bundleOrigin:Re,runtimeVersion:l.runtimeVersion??void 0,appFonts:C||void 0,entry:l.entry,isTransformed:M,deviceSpec:l.deviceSpec,installationId:R?.installationId??void 0,repoId:R?.repoId,owner:S??R?.owner,repo:p??R?.repo,files:N.map(n=>({url:n.url,urlhash:n.urlhash,method:n.method,bodyHash:n.bodyHash,contentType:n.contentType,responseHeaders:n.responseHeaders,requestVaryHash:n.requestVaryHash,encoding:n.encoding,sizeBytes:n.bytes.byteLength})),events:U?{sizeBytes:U.byteLength}:void 0,snapshots:g?[{id:"landing",label:"Landing",kind:"landing",t:0,contentType:"image/png",sizeBytes:g.byteLength}]:void 0,flowVideo:w&&A?{sizeBytes:w.byteLength,contentType:A,durationMs:X}:void 0},ee=new Map;for(let n of N)ee.set(n.urlhash,n.bytes);let te=new Map;g&&te.set("landing",g);let xe=Date.now(),$=W.byteLength;for(let n of N)$+=n.bytes.byteLength;U&&($+=U.byteLength),g&&($+=g.byteLength),w&&($+=w.byteLength);let Se=`${x(o)}/api/preview/upload/init`;console.log(` init: ${Se}`);let V;try{let n=await he({originBase:o,initBody:Oe,bundleBytes:W,filesByHash:ee,extras:{eventsBytes:U,videoBytes:w,snapshotBytes:te},authHeader:Ie,concurrency:16});V=n.finalize;let s=1+n.init.files.length+(n.init.events?1:0)+n.init.snapshots.length+(n.init.flowVideo?1:0);console.log(` PUT ${s} objects in ${Date.now()-xe}ms (${($/1024).toFixed(1)} KiB)`)}catch(n){let s=n;s.phase==="init"&&s.status===401&&(console.error(" preview upload requires a valid login."),console.error(" run `sootsim login` and retry."),await T(),process.exit(1)),s.status===402&&(console.error(` ${Ne(s.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await T(),process.exit(1)),console.error(` ${s.message??`${s.phase??"upload"} failed: ${String(n)}`}`),await T(),process.exit(1)}let ne=`${i}${V.url}`;console.log(`
79
+ stored ${V.filesStored??0} extra files`),console.log(` preview: ${ne}`),Ue&&await ie(ne),await T()}export{Ve as a,Ge as b,ht as c};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as x}from"./chunk-KABJPUT4.js";var J="sootsimConfig";function h(e){return!!e&&Object.keys(e).length>0}function de(e){return e?h(e.modules)||h(e.turboModules)||h(e.nativeModules)||h(e.env)||h(e.settings)||h(e.initialState):!1}function V(e,t){let n=new URL(e);return de(t)?n.searchParams.set(J,JSON.stringify(t)):n.searchParams.delete(J),n.toString()}import{existsSync as d,readFileSync as R,writeFileSync as g}from"node:fs";import{homedir as le}from"node:os";import{dirname as fe,join as c,resolve as y}from"node:path";var _=le();function me(e){let t=e;for(;;){if(d(c(t,"pnpm-workspace.yaml"))||d(c(t,"turbo.json"))||d(c(t,"nx.json"))||d(c(t,"lerna.json")))return t;let n=c(t,"package.json");if(d(n))try{if(JSON.parse(R(n,"utf8")).workspaces)return t}catch{}let r=fe(t);if(r===t)return null;t=r}}function O(e,t){let n=me(process.cwd()),r=[n?y(n,e):null,y(process.cwd(),e),y(process.cwd(),t)].filter(o=>!!o);for(let o of r)if(d(o))return o;return r[0]??y(process.cwd(),e)}var pe=()=>O("packages/sootsim-engine/scripts/expensify-web-proxy.ts","scripts/expensify-web-proxy.ts"),_e=()=>O("packages/sootsim-engine/scripts/rainbow-metadata-proxy.ts","scripts/rainbow-metadata-proxy.ts"),ge=()=>O("packages/compat/src/stubs/mattermost-rnutils-native.ts","../compat/src/stubs/mattermost-rnutils-native.ts"),Re=()=>O("packages/compat/src/stubs/native-seams/react-native-keychain-manager.ts","../compat/src/stubs/native-seams/react-native-keychain-manager.ts"),W=()=>O("packages/compat/src/stubs/mattermost-network-client-native.ts","../compat/src/stubs/mattermost-network-client-native.ts"),Ee=()=>O("packages/sootsim-engine/scripts/mattermost-preview-server.ts","scripts/mattermost-preview-server.ts"),B={USE_NGROK:"true",NGROK_URL:"http://localhost:9000/",SECURE_NGROK_URL:"http://localhost:9000/"},Se=c(_,"github/mattermost-mobile"),N=c(_,"github/uniswap-interface"),Ae=c(N,"apps/mobile"),C=c(N,".env.defaults.local"),he="stored-in-.env.local",q="# sootsim demo env overrides",Pe=c(N,"packages/uniswap/src/features/forceUpgrade/hooks/useForceUpgradeStatus.ts"),Oe=c(N,"apps/mobile/src/notification-service/data-sources/createForceUpgradeNotificationDataSource.ts"),Q="SOOTSIM_DEMO_DISABLE_FORCE_UPGRADE";function X(e){if(!d(e))return{};let t={},n=R(e,"utf8");for(let r of n.split(/\r?\n/)){let o=r.trim();if(!o||o.startsWith("#"))continue;let a=o.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);if(!a)continue;let i=a[2].trim();(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),t[a[1]]=i}return t}function $(e){if(!e)return!1;let t=e.trim();return!(!t||t.includes(he)||t==="TRADING_API_KEY"||t==="UNISWAP_API_KEY")}function z(e,t){for(let n of e)for(let r of t){let o=n[r];if($(o))return o.trim()}}function oe(){let e=X(C),t=X(c(N,"apps/web/.env")),n=[process.env,e,t],r={},o=[["AMPLITUDE_PROXY_URL_OVERRIDE",["REACT_APP_AMPLITUDE_PROXY_URL"]],["QUICKNODE_ENDPOINT_NAME",["REACT_APP_QUICKNODE_ENDPOINT_NAME"]],["QUICKNODE_ENDPOINT_TOKEN",["REACT_APP_QUICKNODE_ENDPOINT_TOKEN"]],["INFURA_KEY",["REACT_APP_INFURA_KEY"]],["STATSIG_API_KEY",["REACT_APP_STATSIG_API_KEY"]],["STATSIG_PROXY_URL_OVERRIDE",["REACT_APP_STATSIG_PROXY_URL"]],["WALLETCONNECT_PROJECT_ID",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["WALLETCONNECT_PROJECT_ID_BETA",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["WALLETCONNECT_PROJECT_ID_DEV",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["TRADING_API_KEY",["REACT_APP_TRADING_API_KEY"]],["UNISWAP_API_KEY",[]]];for(let[i,s]of o){let u=z(n,[i,...s]);if(u){r[i]=u;for(let l of s)r[l]=u}}if(!($(r.TRADING_API_KEY)&&$(r.UNISWAP_API_KEY))){let i=z(n,["GRAPHQL_URL_OVERRIDE","REACT_APP_AWS_API_ENDPOINT"])||"https://interface.gateway.uniswap.org/v1/graphql";r.API_BASE_URL_OVERRIDE="https://interface.gateway.uniswap.org",r.API_BASE_URL_V2_OVERRIDE="https://interface.gateway.uniswap.org/v2",r.GRAPHQL_URL_OVERRIDE=i,r.TRADING_API_URL_OVERRIDE="https://trading-api-labs.interface.gateway.uniswap.org",r.FOR_API_URL_OVERRIDE="https://for.interface.gateway.uniswap.org/v2/FOR.v1.FORService"}return r}function Te(){let e=d(C)?R(C,"utf8"):"";if(e&&!e.includes(q))return;let t=oe(),n=[q];for(let[r,o]of Object.entries(t).sort(([a],[i])=>a.localeCompare(i)))n.push(`${r}=${JSON.stringify(o)}`);n.push(""),g(C,`${n.join(`
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as x}from"./chunk-4KQKAI4R.js";var J="sootsimConfig";function h(e){return!!e&&Object.keys(e).length>0}function de(e){return e?h(e.modules)||h(e.turboModules)||h(e.nativeModules)||h(e.env)||h(e.settings)||h(e.initialState):!1}function V(e,t){let n=new URL(e);return de(t)?n.searchParams.set(J,JSON.stringify(t)):n.searchParams.delete(J),n.toString()}import{existsSync as d,readFileSync as R,writeFileSync as g}from"node:fs";import{homedir as le}from"node:os";import{dirname as fe,join as c,resolve as y}from"node:path";var _=le();function me(e){let t=e;for(;;){if(d(c(t,"pnpm-workspace.yaml"))||d(c(t,"turbo.json"))||d(c(t,"nx.json"))||d(c(t,"lerna.json")))return t;let n=c(t,"package.json");if(d(n))try{if(JSON.parse(R(n,"utf8")).workspaces)return t}catch{}let r=fe(t);if(r===t)return null;t=r}}function O(e,t){let n=me(process.cwd()),r=[n?y(n,e):null,y(process.cwd(),e),y(process.cwd(),t)].filter(o=>!!o);for(let o of r)if(d(o))return o;return r[0]??y(process.cwd(),e)}var pe=()=>O("packages/sootsim-engine/scripts/expensify-web-proxy.ts","scripts/expensify-web-proxy.ts"),_e=()=>O("packages/sootsim-engine/scripts/rainbow-metadata-proxy.ts","scripts/rainbow-metadata-proxy.ts"),ge=()=>O("packages/compat/src/stubs/mattermost-rnutils-native.ts","../compat/src/stubs/mattermost-rnutils-native.ts"),Re=()=>O("packages/compat/src/stubs/native-seams/react-native-keychain-manager.ts","../compat/src/stubs/native-seams/react-native-keychain-manager.ts"),W=()=>O("packages/compat/src/stubs/mattermost-network-client-native.ts","../compat/src/stubs/mattermost-network-client-native.ts"),Ee=()=>O("packages/sootsim-engine/scripts/mattermost-preview-server.ts","scripts/mattermost-preview-server.ts"),B={USE_NGROK:"true",NGROK_URL:"http://localhost:9000/",SECURE_NGROK_URL:"http://localhost:9000/"},Se=c(_,"github/mattermost-mobile"),N=c(_,"github/uniswap-interface"),Ae=c(N,"apps/mobile"),C=c(N,".env.defaults.local"),he="stored-in-.env.local",q="# sootsim demo env overrides",Pe=c(N,"packages/uniswap/src/features/forceUpgrade/hooks/useForceUpgradeStatus.ts"),Oe=c(N,"apps/mobile/src/notification-service/data-sources/createForceUpgradeNotificationDataSource.ts"),Q="SOOTSIM_DEMO_DISABLE_FORCE_UPGRADE";function X(e){if(!d(e))return{};let t={},n=R(e,"utf8");for(let r of n.split(/\r?\n/)){let o=r.trim();if(!o||o.startsWith("#"))continue;let a=o.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);if(!a)continue;let i=a[2].trim();(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),t[a[1]]=i}return t}function $(e){if(!e)return!1;let t=e.trim();return!(!t||t.includes(he)||t==="TRADING_API_KEY"||t==="UNISWAP_API_KEY")}function z(e,t){for(let n of e)for(let r of t){let o=n[r];if($(o))return o.trim()}}function oe(){let e=X(C),t=X(c(N,"apps/web/.env")),n=[process.env,e,t],r={},o=[["AMPLITUDE_PROXY_URL_OVERRIDE",["REACT_APP_AMPLITUDE_PROXY_URL"]],["QUICKNODE_ENDPOINT_NAME",["REACT_APP_QUICKNODE_ENDPOINT_NAME"]],["QUICKNODE_ENDPOINT_TOKEN",["REACT_APP_QUICKNODE_ENDPOINT_TOKEN"]],["INFURA_KEY",["REACT_APP_INFURA_KEY"]],["STATSIG_API_KEY",["REACT_APP_STATSIG_API_KEY"]],["STATSIG_PROXY_URL_OVERRIDE",["REACT_APP_STATSIG_PROXY_URL"]],["WALLETCONNECT_PROJECT_ID",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["WALLETCONNECT_PROJECT_ID_BETA",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["WALLETCONNECT_PROJECT_ID_DEV",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["TRADING_API_KEY",["REACT_APP_TRADING_API_KEY"]],["UNISWAP_API_KEY",[]]];for(let[i,s]of o){let u=z(n,[i,...s]);if(u){r[i]=u;for(let l of s)r[l]=u}}if(!($(r.TRADING_API_KEY)&&$(r.UNISWAP_API_KEY))){let i=z(n,["GRAPHQL_URL_OVERRIDE","REACT_APP_AWS_API_ENDPOINT"])||"https://interface.gateway.uniswap.org/v1/graphql";r.API_BASE_URL_OVERRIDE="https://interface.gateway.uniswap.org",r.API_BASE_URL_V2_OVERRIDE="https://interface.gateway.uniswap.org/v2",r.GRAPHQL_URL_OVERRIDE=i,r.TRADING_API_URL_OVERRIDE="https://trading-api-labs.interface.gateway.uniswap.org",r.FOR_API_URL_OVERRIDE="https://for.interface.gateway.uniswap.org/v2/FOR.v1.FORService"}return r}function Te(){let e=d(C)?R(C,"utf8"):"";if(e&&!e.includes(q))return;let t=oe(),n=[q];for(let[r,o]of Object.entries(t).sort(([a],[i])=>a.localeCompare(i)))n.push(`${r}=${JSON.stringify(o)}`);n.push(""),g(C,`${n.join(`
3
3
  `)}
4
4
  `)}function ve(){let e=`export function useForceUpgradeStatus(): ForceUpgradeStatus {
5
5
  `,t=` // sootsim demo: bypass the force-upgrade gate during local engine demos.
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{i as n}from"./chunk-X33P2PIG.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{i as n}from"./chunk-6YFOOGMX.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
3
3
  `)}export{g as a};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.128 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.130 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  function t(_){return`(async () => {
3
3
  const __t = window.__sootsimTest
4
4
  if (!__t) throw new Error('__sootsimTest not available')