sootsim 0.1.287 → 0.1.288

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist-cli/bin.js +5 -5
  2. package/dist-cli/chunks/{agent-3Y7PIJAD.js → agent-Y676XHOX.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-M2GB3CFF.js → agent-wrapper-VDTQJTDH.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-OSUZGXLN.js → app-fonts-VHJ5H6YV.js} +2 -2
  5. package/dist-cli/chunks/{assert-VGMB3XLU.js → assert-IMFPF5IL.js} +2 -2
  6. package/dist-cli/chunks/{auth-C2D2XI5T.js → auth-3V4RZW4N.js} +2 -2
  7. package/dist-cli/chunks/beta-LVZUWQRW.js +2 -0
  8. package/dist-cli/chunks/{camera-2EP7WI7X.js → camera-H6SDZMVF.js} +2 -2
  9. package/dist-cli/chunks/{chunk-D32WJN5T.js → chunk-2AZWJSDI.js} +1 -1
  10. package/dist-cli/chunks/{chunk-SALM6SYB.js → chunk-2E7NPIZK.js} +2 -2
  11. package/dist-cli/chunks/{chunk-VG4BRVYH.js → chunk-2FXHVGBY.js} +2 -2
  12. package/dist-cli/chunks/{chunk-LNEO6ZTY.js → chunk-3C72OK23.js} +2 -2
  13. package/dist-cli/chunks/{chunk-DH4IAIMY.js → chunk-3LOQ4DCR.js} +2 -2
  14. package/dist-cli/chunks/{chunk-O722YE2D.js → chunk-4SHHPFOG.js} +3 -3
  15. package/dist-cli/chunks/{chunk-OZSLCAR3.js → chunk-57SYWOXM.js} +1 -1
  16. package/dist-cli/chunks/{chunk-7NHETHT2.js → chunk-6CZJDONZ.js} +2 -2
  17. package/dist-cli/chunks/{chunk-JMCFZU73.js → chunk-6R2NNCM6.js} +1 -1
  18. package/dist-cli/chunks/{chunk-B4OWAS67.js → chunk-6T37OB55.js} +3 -3
  19. package/dist-cli/chunks/{chunk-W2N5SGMP.js → chunk-6YYWSTTR.js} +1 -1
  20. package/dist-cli/chunks/{chunk-5BH4EGSX.js → chunk-7O7ECDP6.js} +1 -1
  21. package/dist-cli/chunks/{chunk-LWCQCC4X.js → chunk-BVG6UDMP.js} +1 -1
  22. package/dist-cli/chunks/{chunk-DWZBBA2R.js → chunk-C4O44UV2.js} +2 -2
  23. package/dist-cli/chunks/{chunk-KNANFWH6.js → chunk-DKBPCF3I.js} +2 -2
  24. package/dist-cli/chunks/{chunk-YMRVH5M7.js → chunk-DTCS6PX5.js} +2 -2
  25. package/dist-cli/chunks/{chunk-UYVRZAAM.js → chunk-DUQ6NAH7.js} +1 -1
  26. package/dist-cli/chunks/{chunk-AUPDIMGR.js → chunk-DY4ETZUA.js} +3 -3
  27. package/dist-cli/chunks/{chunk-FAKE23IY.js → chunk-E5KAJLCE.js} +2 -2
  28. package/dist-cli/chunks/{chunk-4YUQA5EZ.js → chunk-EMJBIJHK.js} +1 -1
  29. package/dist-cli/chunks/{chunk-6JYHFQMU.js → chunk-ERXIEAAA.js} +2 -2
  30. package/dist-cli/chunks/{chunk-XYW7VEC5.js → chunk-EWMWHQND.js} +2 -2
  31. package/dist-cli/chunks/{chunk-XNNQOIEW.js → chunk-FBM5UMFY.js} +1 -1
  32. package/dist-cli/chunks/{chunk-FJXEQORS.js → chunk-GPEFE36K.js} +1 -1
  33. package/dist-cli/chunks/{chunk-DMJCPQ5G.js → chunk-GXDDHTOJ.js} +2 -2
  34. package/dist-cli/chunks/{chunk-2ED7AEFH.js → chunk-HF6J2BIO.js} +2 -2
  35. package/dist-cli/chunks/chunk-HYBMX6YE.js +1 -0
  36. package/dist-cli/chunks/{chunk-WO5JLB3Y.js → chunk-IE5VGFI7.js} +1 -1
  37. package/dist-cli/chunks/{chunk-PVO7KJ4U.js → chunk-IIURCDJE.js} +1 -1
  38. package/dist-cli/chunks/{chunk-EOWY6ENX.js → chunk-JDS7NQGJ.js} +1 -1
  39. package/dist-cli/chunks/{chunk-4LQHUMJD.js → chunk-LISO377N.js} +1 -1
  40. package/dist-cli/chunks/{chunk-VYCARR66.js → chunk-M7PUH4OV.js} +1 -1
  41. package/dist-cli/chunks/{chunk-X2QGJ365.js → chunk-MU5NYZW2.js} +2 -2
  42. package/dist-cli/chunks/{chunk-XNAXG3CO.js → chunk-OPLXKOJP.js} +2 -2
  43. package/dist-cli/chunks/{chunk-CAVS43NZ.js → chunk-P7WHR67J.js} +2 -2
  44. package/dist-cli/chunks/{chunk-7XETMEVG.js → chunk-QJR4A3AT.js} +2 -2
  45. package/dist-cli/chunks/{chunk-JNF5Q27W.js → chunk-SGIRBGTQ.js} +2 -2
  46. package/dist-cli/chunks/{chunk-MS3I76VW.js → chunk-V62SROO2.js} +1 -1
  47. package/dist-cli/chunks/{chunk-LSARMXMK.js → chunk-WGBXASPC.js} +2 -2
  48. package/dist-cli/chunks/{chunk-IL67IGWO.js → chunk-XRWQYYRY.js} +1 -1
  49. package/dist-cli/chunks/{chunk-O5JBF7EI.js → chunk-XYVOQPAW.js} +1 -1
  50. package/dist-cli/chunks/{chunk-O564XXIK.js → chunk-YSJTYIZG.js} +2 -2
  51. package/dist-cli/chunks/{chunk-WDDAJEF2.js → chunk-YWUKWQC6.js} +2 -2
  52. package/dist-cli/chunks/{chunk-V7QFQAEP.js → chunk-Z472LVDA.js} +1 -1
  53. package/dist-cli/chunks/{chunk-GJWLFLCH.js → chunk-ZEJWSA35.js} +1 -1
  54. package/dist-cli/chunks/{chunk-7TTDBWWX.js → chunk-ZPQBCWBR.js} +3 -3
  55. package/dist-cli/chunks/{cleanup-4CMHC5XY.js → cleanup-GHJTGGY7.js} +2 -2
  56. package/dist-cli/chunks/cli-version-M24PIJH6.js +2 -0
  57. package/dist-cli/chunks/{compat-AEK4ZDP6.js → compat-XKTM3M7W.js} +3 -3
  58. package/dist-cli/chunks/{config-E2DPFBWE.js → config-DB5WUN4B.js} +2 -2
  59. package/dist-cli/chunks/control-7QH4PRCO.js +2 -0
  60. package/dist-cli/chunks/daemon-OMCLCKGX.js +2 -0
  61. package/dist-cli/chunks/{debug-GCMVHL3Y.js → debug-DYSWVVNG.js} +3 -3
  62. package/dist-cli/chunks/{desktop-U34JDZSL.js → desktop-CLE46QCT.js} +3 -3
  63. package/dist-cli/chunks/{detox-HFGJMV6S.js → detox-K4ZQQ36C.js} +2 -2
  64. package/dist-cli/chunks/{device-2JSOB3ND.js → device-VYMGAGMD.js} +2 -2
  65. package/dist-cli/chunks/{diagnose-VGZOE32C.js → diagnose-4IJ7OIKZ.js} +2 -2
  66. package/dist-cli/chunks/disk-cleanup-4QDVAVCP.js +2 -0
  67. package/dist-cli/chunks/drivers-MXV3L74Q.js +2 -0
  68. package/dist-cli/chunks/{film-4B5RQBZA.js → film-Z2PSEJF5.js} +3 -3
  69. package/dist-cli/chunks/flow-CI4W7CB7.js +2 -0
  70. package/dist-cli/chunks/help-MSJI6T7H.js +2 -0
  71. package/dist-cli/chunks/{hidden-runtime-alias-XZPYIJJL.js → hidden-runtime-alias-OAE76Q46.js} +2 -2
  72. package/dist-cli/chunks/{home-paths-URBZE5DX.js → home-paths-W277VF23.js} +2 -2
  73. package/dist-cli/chunks/inspect-MQQS3PL7.js +2 -0
  74. package/dist-cli/chunks/install-desktop-6OHIHZBG.js +2 -0
  75. package/dist-cli/chunks/{login-6ZZQHORX.js → login-26BKHAQL.js} +4 -4
  76. package/dist-cli/chunks/{logout-R3H4H5XS.js → logout-WCOKGMYQ.js} +2 -2
  77. package/dist-cli/chunks/{maestro-TJ5IJVWZ.js → maestro-UDB3IHJ7.js} +3 -3
  78. package/dist-cli/chunks/{maestro-generate-BM3TFJM3.js → maestro-generate-CTXLTIAL.js} +3 -3
  79. package/dist-cli/chunks/{mode-QEHTO5QB.js → mode-UJBQNCG3.js} +2 -2
  80. package/dist-cli/chunks/optional-demo-registry-RVZEEKXA.js +2 -0
  81. package/dist-cli/chunks/{perf-GQ6H7BMI.js → perf-3DCFEOFO.js} +2 -2
  82. package/dist-cli/chunks/{record-UNDNOP7I.js → record-Q5C4E5DS.js} +3 -3
  83. package/dist-cli/chunks/runtime-4TUHMJHY.js +2 -0
  84. package/dist-cli/chunks/{screenshot-command-ONR3W4IB.js → screenshot-command-PXNYWNJU.js} +3 -3
  85. package/dist-cli/chunks/{screenshots-capture-ME4I6HDK.js → screenshots-capture-TLOFBC2U.js} +2 -2
  86. package/dist-cli/chunks/{serve-76PISKNL.js → serve-KUHJQO7L.js} +2 -2
  87. package/dist-cli/chunks/{setup-TJMKUTMZ.js → setup-2JAIBVNC.js} +3 -3
  88. package/dist-cli/chunks/{skills-RWONRRTS.js → skills-PCGOTJR5.js} +2 -2
  89. package/dist-cli/chunks/{storage-K42LEKBP.js → storage-3NLFAHM6.js} +2 -2
  90. package/dist-cli/chunks/store-DNGROAER.js +2 -0
  91. package/dist-cli/chunks/telemetry-RJLEHABK.js +2 -0
  92. package/dist-cli/chunks/{timeline-W7O56I3Y.js → timeline-G42TNE2L.js} +2 -2
  93. package/dist-cli/chunks/{upgrade-E42I2WQ6.js → upgrade-LBVHIFE6.js} +2 -2
  94. package/dist-cli/chunks/upload-SRSHTDNT.js +2 -0
  95. package/dist-cli/chunks/{version-KYDANRIA.js → version-VLZAAAFN.js} +2 -2
  96. package/dist-cli/chunks/{web-BZX7OTFR.js → web-FTIRIJF5.js} +2 -2
  97. package/dist-cli/chunks/{what-happened-EU22AIF6.js → what-happened-3SKL7YDL.js} +2 -2
  98. package/dist-lib/agent-daemon-client.cjs +1 -1
  99. package/dist-lib/agent-events.cjs +1 -1
  100. package/dist-lib/agent-identity.cjs +1 -1
  101. package/dist-lib/agent-sessions.cjs +1 -1
  102. package/dist-lib/attached-projects.cjs +1 -1
  103. package/dist-lib/auth/shared-session.cjs +1 -1
  104. package/dist-lib/backend-origin.cjs +1 -1
  105. package/dist-lib/beta.cjs +1 -1
  106. package/dist-lib/beta.mjs +1 -1
  107. package/dist-lib/bridge-constants.cjs +1 -1
  108. package/dist-lib/cli-constants.cjs +1 -1
  109. package/dist-lib/config.cjs +1 -1
  110. package/dist-lib/detox/index.cjs +1 -1
  111. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  112. package/dist-lib/home-paths.cjs +1 -1
  113. package/dist-lib/host/bridge-host.cjs +1 -1
  114. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  115. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  116. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  117. package/dist-lib/host/websocket-proxy.cjs +1 -1
  118. package/dist-lib/index.cjs +1 -1
  119. package/dist-lib/jump-to-source-babel.cjs +1 -1
  120. package/dist-lib/menu.cjs +1 -1
  121. package/dist-lib/menu.mjs +1 -1
  122. package/dist-lib/metro.cjs +1 -1
  123. package/dist-lib/profiles.cjs +1 -1
  124. package/dist-lib/render-mode.cjs +1 -1
  125. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  126. package/dist-lib/sdk.cjs +1 -1
  127. package/dist-lib/sdk.mjs +1 -1
  128. package/dist-lib/skills.cjs +1 -1
  129. package/dist-lib/vite.cjs +1 -1
  130. package/package.json +1 -1
  131. package/src/native-seam-manifest.ts +10 -0
  132. package/dist-cli/chunks/beta-VB4CHGW7.js +0 -2
  133. package/dist-cli/chunks/chunk-LS4XU3D6.js +0 -1
  134. package/dist-cli/chunks/cli-version-TZMWSGH2.js +0 -2
  135. package/dist-cli/chunks/control-JNIZAS3K.js +0 -2
  136. package/dist-cli/chunks/daemon-7PINPJHO.js +0 -2
  137. package/dist-cli/chunks/disk-cleanup-II246KS3.js +0 -2
  138. package/dist-cli/chunks/drivers-U44673LK.js +0 -2
  139. package/dist-cli/chunks/flow-4PV7VMJX.js +0 -2
  140. package/dist-cli/chunks/help-ZY4B4G45.js +0 -2
  141. package/dist-cli/chunks/inspect-2KZSDWZ2.js +0 -2
  142. package/dist-cli/chunks/install-desktop-66NOHS5U.js +0 -2
  143. package/dist-cli/chunks/optional-demo-registry-DHBZACNG.js +0 -2
  144. package/dist-cli/chunks/runtime-U6UYTNPH.js +0 -2
  145. package/dist-cli/chunks/store-GZ3LRYT5.js +0 -2
  146. package/dist-cli/chunks/telemetry-2QOKHTLI.js +0 -2
  147. package/dist-cli/chunks/upload-TPETTHGS.js +0 -2
package/dist-cli/bin.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
- import{a as w,b as g}from"./chunks/chunk-O5JBF7EI.js";import"./chunks/chunk-UYVRZAAM.js";function b(t){let a=t instanceof Error?t.message:String(t);(/^command timed out after \d+s$/.test(a)||a.startsWith("sim disconnected:")||a.startsWith("bridge never reconnected")||a.startsWith("multiple sims are connected:")||a.startsWith("saved sim ")||a.startsWith("no sim connected with id ")||a.startsWith("could not connect to ws://")||a.startsWith("sootsim bridge daemon is not running")||a.startsWith("sootsim bridge lockfile is fresh")||a.startsWith("sootsim bridge exited before becoming ready")||a.startsWith("background daemon setup is unavailable")||a.startsWith("sootsim bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${a}
2
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
+ import{a as w,b as g}from"./chunks/chunk-XYVOQPAW.js";import"./chunks/chunk-DUQ6NAH7.js";function b(t){let a=t instanceof Error?t.message:String(t);(/^command timed out after \d+s$/.test(a)||a.startsWith("sim disconnected:")||a.startsWith("bridge never reconnected")||a.startsWith("multiple sims are connected:")||a.startsWith("saved sim ")||a.startsWith("no sim connected with id ")||a.startsWith("could not connect to ws://")||a.startsWith("sootsim bridge daemon is not running")||a.startsWith("sootsim bridge lockfile is fresh")||a.startsWith("sootsim bridge exited before becoming ready")||a.startsWith("background daemon setup is unavailable")||a.startsWith("sootsim bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${a}
4
4
  `),process.exit(1)),t instanceof Error&&t.stack?process.stderr.write(`${t.stack}
5
5
  `):process.stderr.write(`${a}
6
6
  `),process.exit(1)}process.on("unhandledRejection",b);process.on("uncaughtException",b);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["desktop"]);function S(t){!A||!k.has(t)||(process.stderr.write(` sootsim ${t} isn't available in the standalone binary \u2014
7
7
  it needs vite / electron / playwright from a project's node_modules.
8
8
  run the npm package instead:
9
9
  sootsim ${t}
10
- `),process.exit(1))}var e=g(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:t}=await import("./chunks/hidden-runtime-alias-XZPYIJJL.js");e=t(e)}var _=e.command==="cleanup"&&e.commandArgs.length===1&&e.commandArgs[0]==="--automatic-worker";if(!_){let{trackCliEvent:t}=await import("./chunks/telemetry-2QOKHTLI.js");t({event:"cli_command_invoked",properties:{command:e.command||(e.version?"version":e.help?"help":"none"),arg_count:e.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}if(e.command!=="serve"&&e.command!=="daemon"){let{consumeRuntimeUpgradeNotice:t}=await import("./chunks/home-paths-URBZE5DX.js"),a=t();a&&process.stderr.write(` SootSim engine upgraded to v${a.to}`+(a.from?` (from v${a.from})`:"")+` \xB7 what's new: https://sootsim.com/changelog
11
- `)}var f=!1;async function v(){if(!f&&(f=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{isAutomaticSootsimCleanupComplete:t}=await import("./chunks/disk-cleanup-II246KS3.js");if(t())return;let{spawn:a}=await import("node:child_process"),n=["cleanup","--automatic-worker"],m=process.argv[1],d=A?a(process.execPath,n,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):m?a(process.execPath,[m,...n],{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):a("sootsim",n,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env});d.once("error",p=>{process.stderr.write(` SootSim automatic cleanup will retry on the next run: ${p.message}
10
+ `),process.exit(1))}var e=g(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:t}=await import("./chunks/hidden-runtime-alias-OAE76Q46.js");e=t(e)}var _=e.command==="cleanup"&&e.commandArgs.length===1&&e.commandArgs[0]==="--automatic-worker";if(!_){let{trackCliEvent:t}=await import("./chunks/telemetry-RJLEHABK.js");t({event:"cli_command_invoked",properties:{command:e.command||(e.version?"version":e.help?"help":"none"),arg_count:e.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}if(e.command!=="serve"&&e.command!=="daemon"){let{consumeRuntimeUpgradeNotice:t}=await import("./chunks/home-paths-W277VF23.js"),a=t();a&&process.stderr.write(` SootSim engine upgraded to v${a.to}`+(a.from?` (from v${a.from})`:"")+` \xB7 what's new: https://sootsim.com/changelog
11
+ `)}var f=!1;async function v(){if(!f&&(f=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{isAutomaticSootsimCleanupComplete:t}=await import("./chunks/disk-cleanup-4QDVAVCP.js");if(t())return;let{spawn:a}=await import("node:child_process"),n=["cleanup","--automatic-worker"],m=process.argv[1],d=A?a(process.execPath,n,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):m?a(process.execPath,[m,...n],{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):a("sootsim",n,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env});d.once("error",p=>{process.stderr.write(` SootSim automatic cleanup will retry on the next run: ${p.message}
12
12
  `)}),d.unref()}catch(t){process.stderr.write(` SootSim automatic cleanup will retry on the next run: ${t instanceof Error?t.message:String(t)}
13
- `)}}async function r(t){let{flushCliTelemetry:a}=await import("./chunks/telemetry-2QOKHTLI.js");await a(),await v(),process.exit(t)}if(e.version){let{getCliVersion:t}=await import("./chunks/cli-version-TZMWSGH2.js"),{IS_BETA:a,BETA_LABEL:n}=await import("./chunks/beta-VB4CHGW7.js"),m=a?` \xB7 ${n}`:"";console.log(`sootsim v${t()}${m}`);let{readActiveRuntime:d}=await import("./chunks/home-paths-URBZE5DX.js"),p=d();console.log(p?`runtime v${p}`:"runtime not installed"),await r(0)}if(e.help&&!e.command){let{printHelp:t}=await import("./chunks/help-ZY4B4G45.js");t(),await r(0)}var o=e.globalFlags.port,c=e.verbose,l=e.globalFlags.device,u=e.globalFlags.theme,C=e.globalFlags.driver,O=e.globalFlags.headless===!0,h=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,i=h?["--sim",h,...e.commandArgs]:e.commandArgs;if(l||u){let{settingsStore:t}=await import("./chunks/store-GZ3LRYT5.js"),a={};l&&(a.deviceModel=l),u&&(a.colorScheme=u),t.apply(a)}if(!e.command&&e.commandArgs.length===0){let{runSetup:t,shouldRunSetupForBareCommand:a}=await import("./chunks/setup-TJMKUTMZ.js");a()&&(await t(["--from-welcome"]),await r(0));let{printHelp:n}=await import("./chunks/help-ZY4B4G45.js");n(),await r(0)}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let a=e.commandArgs.find(n=>!n.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${a}`),console.error(" run `sootsim --help` to see the full surface."),await r(1)}let{printHelp:t}=await import("./chunks/help-ZY4B4G45.js");t(),await r(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:n}=await import("./chunks/skills-RWONRRTS.js");await n(e.commandArgs),await r(0)}let t=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",a=e.commandArgs.find(n=>!n.startsWith("-"));if(!(s==="shell"||s==="perf"))if(t&&!a){let{printGroupHelp:n}=await import("./chunks/help-ZY4B4G45.js");n(s)&&await r(0)}else{let{printCommandHelp:n}=await import("./chunks/help-ZY4B4G45.js");n(t&&a?a:s,{prefer:t&&a?"verb":"command",group:t&&a?s:void 0}),await r(0)}}S(s);if(w.has(s)){let{runInspect:t}=await import("./chunks/inspect-2KZSDWZ2.js");await t([s,...i],{port:o,verbose:c})}else switch(s){case"assert":{let{runAssert:t}=await import("./chunks/assert-VGMB3XLU.js");await t(e.commandArgs);break}case"detox":{let{runDetox:t}=await import("./chunks/detox-HFGJMV6S.js");await t(e.commandArgs,{port:o,verbose:c});break}case"maestro":{let{runMaestro:t}=await import("./chunks/maestro-TJ5IJVWZ.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"record":{let{runRecord:t}=await import("./chunks/record-UNDNOP7I.js");await t(i,{port:o,verbose:c});break}case"film":{let{runFilm:t}=await import("./chunks/film-4B5RQBZA.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"storage":{let{runStorage:t}=await import("./chunks/storage-K42LEKBP.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"perf":{let{runPerf:t}=await import("./chunks/perf-GQ6H7BMI.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"screenshot":{let{runScreenshotCommand:t}=await import("./chunks/screenshot-command-ONR3W4IB.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"mode":{let{runMode:t}=await import("./chunks/mode-QEHTO5QB.js");await t(i,{port:o,verbose:c});break}case"inspect":{let{runInspect:t}=await import("./chunks/inspect-2KZSDWZ2.js");await t(i,{port:o,verbose:c});break}case"debug":{let{runDebug:t}=await import("./chunks/debug-GCMVHL3Y.js");await t(i,{port:o,verbose:c});break}case"timeline":{let{runTimeline:t}=await import("./chunks/timeline-W7O56I3Y.js");await t(i,{port:o,verbose:c});break}case"what-happened":{let{runWhatHappened:t}=await import("./chunks/what-happened-EU22AIF6.js");await t(i,{port:o,verbose:c});break}case"open":{let{runOpenCommand:t}=await import("./chunks/control-JNIZAS3K.js");await t(i,{port:o});break}case"use":{let{runUseCommand:t}=await import("./chunks/control-JNIZAS3K.js");await t(i,{port:o});break}case"claim":{let{runClaimCommand:t}=await import("./chunks/control-JNIZAS3K.js");await t(i,{port:o});break}case"close":{let{runCloseCommand:t}=await import("./chunks/control-JNIZAS3K.js");await t(i,{port:o});break}case"device":{let{runDeviceCommand:t}=await import("./chunks/device-2JSOB3ND.js");await t(i,{port:o});break}case"compat":{let{runCompat:t}=await import("./chunks/compat-AEK4ZDP6.js");await t(e.commandArgs);break}case"desktop":{let{runDesktop:t}=await import("./chunks/desktop-U34JDZSL.js");await t(e.commandArgs,{port:o,device:l,driver:C});break}case"login":{let{runLogin:t}=await import("./chunks/login-6ZZQHORX.js");await t(e.commandArgs);break}case"logout":{let{runLogout:t}=await import("./chunks/logout-R3H4H5XS.js");await t();break}case"auth":{let{runAuth:t}=await import("./chunks/auth-C2D2XI5T.js");await t(e.commandArgs);break}case"setup":{let{runSetup:t}=await import("./chunks/setup-TJMKUTMZ.js");await t(e.commandArgs);break}case"serve":{let{runServe:t}=await import("./chunks/serve-76PISKNL.js");await t(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:t}=await import("./chunks/daemon-7PINPJHO.js");await t(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:t}=await import("./chunks/runtime-U6UYTNPH.js");await t(e.commandArgs);break}case"upgrade":{let{runUpgrade:t}=await import("./chunks/upgrade-E42I2WQ6.js");await t(e.commandArgs);break}case"version":{let{runVersion:t}=await import("./chunks/version-KYDANRIA.js");await t(e.commandArgs);break}case"agent":{let{runAgentCommand:t}=await import("./chunks/agent-3Y7PIJAD.js"),a=await t(e.commandArgs);await r(a)}case"agent-wrapper":{let{runAgentWrapper:t}=await import("./chunks/agent-wrapper-M2GB3CFF.js"),a=await t(e.commandArgs);await r(a)}case"skill":{let{runSkill:t}=await import("./chunks/skills-RWONRRTS.js");await t(e.commandArgs);break}case"app-fonts":{let{runAppFonts:t}=await import("./chunks/app-fonts-OSUZGXLN.js");await t(e.commandArgs);break}case"config":{let{runConfig:t}=await import("./chunks/config-E2DPFBWE.js");await t(e.commandArgs);break}case"cleanup":{let{runCleanup:t}=await import("./chunks/cleanup-4CMHC5XY.js"),a=await t(e.commandArgs);await r(a)}default:console.error(` unknown command: ${s}`),console.error(" run `sootsim --help` to see the full surface."),await r(1)}await v();
13
+ `)}}async function r(t){let{flushCliTelemetry:a}=await import("./chunks/telemetry-RJLEHABK.js");await a(),await v(),process.exit(t)}if(e.version){let{getCliVersion:t}=await import("./chunks/cli-version-M24PIJH6.js"),{IS_BETA:a,BETA_LABEL:n}=await import("./chunks/beta-LVZUWQRW.js"),m=a?` \xB7 ${n}`:"";console.log(`sootsim v${t()}${m}`);let{readActiveRuntime:d}=await import("./chunks/home-paths-W277VF23.js"),p=d();console.log(p?`runtime v${p}`:"runtime not installed"),await r(0)}if(e.help&&!e.command){let{printHelp:t}=await import("./chunks/help-MSJI6T7H.js");t(),await r(0)}var o=e.globalFlags.port,c=e.verbose,l=e.globalFlags.device,u=e.globalFlags.theme,C=e.globalFlags.driver,O=e.globalFlags.headless===!0,h=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,i=h?["--sim",h,...e.commandArgs]:e.commandArgs;if(l||u){let{settingsStore:t}=await import("./chunks/store-DNGROAER.js"),a={};l&&(a.deviceModel=l),u&&(a.colorScheme=u),t.apply(a)}if(!e.command&&e.commandArgs.length===0){let{runSetup:t,shouldRunSetupForBareCommand:a}=await import("./chunks/setup-2JAIBVNC.js");a()&&(await t(["--from-welcome"]),await r(0));let{printHelp:n}=await import("./chunks/help-MSJI6T7H.js");n(),await r(0)}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let a=e.commandArgs.find(n=>!n.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${a}`),console.error(" run `sootsim --help` to see the full surface."),await r(1)}let{printHelp:t}=await import("./chunks/help-MSJI6T7H.js");t(),await r(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:n}=await import("./chunks/skills-PCGOTJR5.js");await n(e.commandArgs),await r(0)}let t=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",a=e.commandArgs.find(n=>!n.startsWith("-"));if(!(s==="shell"||s==="perf"))if(t&&!a){let{printGroupHelp:n}=await import("./chunks/help-MSJI6T7H.js");n(s)&&await r(0)}else{let{printCommandHelp:n}=await import("./chunks/help-MSJI6T7H.js");n(t&&a?a:s,{prefer:t&&a?"verb":"command",group:t&&a?s:void 0}),await r(0)}}S(s);if(w.has(s)){let{runInspect:t}=await import("./chunks/inspect-MQQS3PL7.js");await t([s,...i],{port:o,verbose:c})}else switch(s){case"assert":{let{runAssert:t}=await import("./chunks/assert-IMFPF5IL.js");await t(e.commandArgs);break}case"detox":{let{runDetox:t}=await import("./chunks/detox-K4ZQQ36C.js");await t(e.commandArgs,{port:o,verbose:c});break}case"maestro":{let{runMaestro:t}=await import("./chunks/maestro-UDB3IHJ7.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"record":{let{runRecord:t}=await import("./chunks/record-Q5C4E5DS.js");await t(i,{port:o,verbose:c});break}case"film":{let{runFilm:t}=await import("./chunks/film-Z2PSEJF5.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"storage":{let{runStorage:t}=await import("./chunks/storage-3NLFAHM6.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"perf":{let{runPerf:t}=await import("./chunks/perf-3DCFEOFO.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"screenshot":{let{runScreenshotCommand:t}=await import("./chunks/screenshot-command-PXNYWNJU.js"),a=await t(i,{port:o,verbose:c});await r(typeof a=="number"?a:0)}case"mode":{let{runMode:t}=await import("./chunks/mode-UJBQNCG3.js");await t(i,{port:o,verbose:c});break}case"inspect":{let{runInspect:t}=await import("./chunks/inspect-MQQS3PL7.js");await t(i,{port:o,verbose:c});break}case"debug":{let{runDebug:t}=await import("./chunks/debug-DYSWVVNG.js");await t(i,{port:o,verbose:c});break}case"timeline":{let{runTimeline:t}=await import("./chunks/timeline-G42TNE2L.js");await t(i,{port:o,verbose:c});break}case"what-happened":{let{runWhatHappened:t}=await import("./chunks/what-happened-3SKL7YDL.js");await t(i,{port:o,verbose:c});break}case"open":{let{runOpenCommand:t}=await import("./chunks/control-7QH4PRCO.js");await t(i,{port:o});break}case"use":{let{runUseCommand:t}=await import("./chunks/control-7QH4PRCO.js");await t(i,{port:o});break}case"claim":{let{runClaimCommand:t}=await import("./chunks/control-7QH4PRCO.js");await t(i,{port:o});break}case"close":{let{runCloseCommand:t}=await import("./chunks/control-7QH4PRCO.js");await t(i,{port:o});break}case"device":{let{runDeviceCommand:t}=await import("./chunks/device-VYMGAGMD.js");await t(i,{port:o});break}case"compat":{let{runCompat:t}=await import("./chunks/compat-XKTM3M7W.js");await t(e.commandArgs);break}case"desktop":{let{runDesktop:t}=await import("./chunks/desktop-CLE46QCT.js");await t(e.commandArgs,{port:o,device:l,driver:C});break}case"login":{let{runLogin:t}=await import("./chunks/login-26BKHAQL.js");await t(e.commandArgs);break}case"logout":{let{runLogout:t}=await import("./chunks/logout-WCOKGMYQ.js");await t();break}case"auth":{let{runAuth:t}=await import("./chunks/auth-3V4RZW4N.js");await t(e.commandArgs);break}case"setup":{let{runSetup:t}=await import("./chunks/setup-2JAIBVNC.js");await t(e.commandArgs);break}case"serve":{let{runServe:t}=await import("./chunks/serve-KUHJQO7L.js");await t(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:t}=await import("./chunks/daemon-OMCLCKGX.js");await t(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:t}=await import("./chunks/runtime-4TUHMJHY.js");await t(e.commandArgs);break}case"upgrade":{let{runUpgrade:t}=await import("./chunks/upgrade-LBVHIFE6.js");await t(e.commandArgs);break}case"version":{let{runVersion:t}=await import("./chunks/version-VLZAAAFN.js");await t(e.commandArgs);break}case"agent":{let{runAgentCommand:t}=await import("./chunks/agent-Y676XHOX.js"),a=await t(e.commandArgs);await r(a)}case"agent-wrapper":{let{runAgentWrapper:t}=await import("./chunks/agent-wrapper-VDTQJTDH.js"),a=await t(e.commandArgs);await r(a)}case"skill":{let{runSkill:t}=await import("./chunks/skills-PCGOTJR5.js");await t(e.commandArgs);break}case"app-fonts":{let{runAppFonts:t}=await import("./chunks/app-fonts-VHJ5H6YV.js");await t(e.commandArgs);break}case"config":{let{runConfig:t}=await import("./chunks/config-DB5WUN4B.js");await t(e.commandArgs);break}case"cleanup":{let{runCleanup:t}=await import("./chunks/cleanup-GHJTGGY7.js"),a=await t(e.commandArgs);await r(a)}default:console.error(` unknown command: ${s}`),console.error(" run `sootsim --help` to see the full surface."),await r(1)}await v();
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as b,b as E,c as A,d as l,e as S,g as j,h as T,j as I,n as k,o as D,p as x,q as g,r as O,s as C}from"./chunk-2ED7AEFH.js";import"./chunk-OZSLCAR3.js";import{c as $}from"./chunk-CAVS43NZ.js";import"./chunk-6JYHFQMU.js";import"./chunk-JNF5Q27W.js";import"./chunk-DH4IAIMY.js";import"./chunk-IL67IGWO.js";import"./chunk-GJWLFLCH.js";import"./chunk-W2N5SGMP.js";import"./chunk-PVO7KJ4U.js";import{j as y}from"./chunk-FJXEQORS.js";import"./chunk-LWCQCC4X.js";import"./chunk-JMCFZU73.js";import"./chunk-UYVRZAAM.js";import w from"node:fs";import d from"node:path";import{spawn as _}from"node:child_process";import F from"node:net";import{WebSocket as R}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 R(`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 sendClaimedPrompt(e,t){return this.send("agent:send-claimed-prompt",{simId: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!==R.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 M(n=7668,e=400){return new Promise(t=>{let r=new F.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 B(n={}){let e=n.port??7668;if(await M(e))return{alreadyRunning:!0};if(y())throw new c(`no sootsim bridge on port ${e}. run \`sootsim setup\` to install the background daemon, or \`sootsim serve\` in another shell.`,"DEV_HOST_REFUSED");let{cmd:t,prefixArgs:r}=C(),s=[...r,"serve","--quiet"];e!==7668&&s.push("--port",String(e));let o=_(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 M(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 serve\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await B({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 ge(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return L(),0;case"attach":return await W(t);case"projects":return await J();case"project":return await V(t);case"sessions":return await H(t);case"start":return await G(t);case"prompt":return await q(t);case"watch":return await K(t);case"transcript":return await z(t);case"end":return await Q(t);case"paths":return await Y();default:return process.stderr.write(`unknown agent subcommand: ${e}
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as b,b as E,c as A,d as l,e as S,g as j,h as T,j as I,n as k,o as D,p as x,q as g,r as O,s as C}from"./chunk-HF6J2BIO.js";import"./chunk-57SYWOXM.js";import{c as $}from"./chunk-P7WHR67J.js";import"./chunk-ERXIEAAA.js";import"./chunk-SGIRBGTQ.js";import"./chunk-3LOQ4DCR.js";import"./chunk-XRWQYYRY.js";import"./chunk-ZEJWSA35.js";import"./chunk-6YYWSTTR.js";import"./chunk-IIURCDJE.js";import{j as y}from"./chunk-GPEFE36K.js";import"./chunk-BVG6UDMP.js";import"./chunk-6R2NNCM6.js";import"./chunk-DUQ6NAH7.js";import w from"node:fs";import d from"node:path";import{spawn as _}from"node:child_process";import F from"node:net";import{WebSocket as R}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 R(`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 sendClaimedPrompt(e,t){return this.send("agent:send-claimed-prompt",{simId: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!==R.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 M(n=7668,e=400){return new Promise(t=>{let r=new F.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 B(n={}){let e=n.port??7668;if(await M(e))return{alreadyRunning:!0};if(y())throw new c(`no sootsim bridge on port ${e}. run \`sootsim setup\` to install the background daemon, or \`sootsim serve\` in another shell.`,"DEV_HOST_REFUSED");let{cmd:t,prefixArgs:r}=C(),s=[...r,"serve","--quiet"];e!==7668&&s.push("--port",String(e));let o=_(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 M(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 serve\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await B({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 ge(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return L(),0;case"attach":return await W(t);case"projects":return await J();case"project":return await V(t);case"sessions":return await H(t);case"start":return await G(t);case"prompt":return await q(t);case"watch":return await K(t);case"transcript":return await z(t);case"end":return await Q(t);case"paths":return await Y();default:return process.stderr.write(`unknown agent subcommand: ${e}
3
3
  `),L(),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 L(){$("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 W(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.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as M}from"./chunk-OZSLCAR3.js";import"./chunk-UYVRZAAM.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 C,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,f=!1,a=new Promise(s=>{t.on("exit",(o,e)=>{f=!0;let p=new Error(`codex app-server exited (code=${o}, signal=${e??""})`);for(let{reject:y}of r.values())y(p);r.clear(),s({code:o,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let o=s.trim();if(!o)return;let e;try{e=JSON.parse(o)}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,y=p!=null?r.get(p):void 0;if(!y)return;r.delete(p),e.error?y.reject(new b(e.error.message,e.error.code,e.error.data)):y.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let y of p)try{y(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 o=m.get("__stderr__");if(o)for(let e of o)try{e({text:s})}catch{}});function n(s){if(!f)try{t.stdin.write(JSON.stringify(s)+`
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as M}from"./chunk-57SYWOXM.js";import"./chunk-DUQ6NAH7.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 C,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,f=!1,a=new Promise(s=>{t.on("exit",(o,e)=>{f=!0;let p=new Error(`codex app-server exited (code=${o}, signal=${e??""})`);for(let{reject:y}of r.values())y(p);r.clear(),s({code:o,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let o=s.trim();if(!o)return;let e;try{e=JSON.parse(o)}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,y=p!=null?r.get(p):void 0;if(!y)return;r.delete(p),e.error?y.reject(new b(e.error.message,e.error.code,e.error.data)):y.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let y of p)try{y(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 o=m.get("__stderr__");if(o)for(let e of o)try{e({text:s})}catch{}});function n(s){if(!f)try{t.stdin.write(JSON.stringify(s)+`
3
3
  `)}catch{}}return{exited:a,on(s,o){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(o),()=>{e?.delete(o)}},request(s,o){if(f)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,y)=>{r.set(e,{resolve:l=>p(l),reject:y,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:o})})},notify(s,o){n({jsonrpc:"2.0",method:s,params:o})},async shutdown(s=1500){if(f)return;try{t.stdin.end()}catch{}let o=setTimeout(()=>{if(!f)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(o)}},kill(s="SIGTERM"){if(!f)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 C(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 f=t[u];f&&(r[f]=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.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as p}from"./chunk-5BH4EGSX.js";import"./chunk-UYVRZAAM.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.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as p}from"./chunk-7O7ECDP6.js";import"./chunk-DUQ6NAH7.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.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-UYVRZAAM.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.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-DUQ6NAH7.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(", ")}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as t}from"./chunk-DMJCPQ5G.js";import{d as s}from"./chunk-DWZBBA2R.js";import"./chunk-FJXEQORS.js";import"./chunk-UYVRZAAM.js";function i(){console.log(`
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as t}from"./chunk-GXDDHTOJ.js";import{d as s}from"./chunk-C4O44UV2.js";import"./chunk-GPEFE36K.js";import"./chunk-DUQ6NAH7.js";function i(){console.log(`
3
3
  sootsim auth \u2014 inspect CLI auth
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d}from"./chunk-6R2NNCM6.js";import"./chunk-DUQ6NAH7.js";export{d as BETA_ASK_HEADLINE,b as BETA_LABEL,c as BETA_TAGLINE,a as IS_BETA};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{m as d}from"./chunk-7XETMEVG.js";import"./chunk-EOWY6ENX.js";import{g as l,i as m,k as p}from"./chunk-7NHETHT2.js";import"./chunk-GJWLFLCH.js";import"./chunk-W2N5SGMP.js";import"./chunk-FJXEQORS.js";import"./chunk-UYVRZAAM.js";function f(){console.log(`
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{m as d}from"./chunk-QJR4A3AT.js";import"./chunk-JDS7NQGJ.js";import{g as l,i as m,k as p}from"./chunk-6CZJDONZ.js";import"./chunk-ZEJWSA35.js";import"./chunk-6YYWSTTR.js";import"./chunk-GPEFE36K.js";import"./chunk-DUQ6NAH7.js";function f(){console.log(`
3
3
  sootsim do scan \u2014 inject a barcode scan
4
4
 
5
5
  usage:
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(o){return new Promise(n=>{let r=c();r.question(o,t=>{r.close(),n(t.trim())})})}async function u(o,n=!0){let r=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${o} ${r} ${n?"y":"n"} (non-interactive)`),n;let t=await s(` ${o} ${r} `);return t===""?n:t.toLowerCase().startsWith("y")}async function a(o,n){console.log(`
3
3
  ${o}
4
4
  `);for(let e=0;e<n.length;e++)console.log(` ${e+1}. ${n[e]}`);if(console.log(),!process.stdin.isTTY)return console.log(` choose [1-${n.length}]: 1 (non-interactive)`),0;let r=await s(` choose [1-${n.length}]: `),t=parseInt(r,10);return t>=1&&t<=n.length?t-1:0}export{u as a,a as b};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{G as _,H as E,I as F,k as N,l as U,u as L,x as A}from"./chunk-FJXEQORS.js";import W from"node:fs";import z from"node:path";function T(e){try{return W.readdirSync(e.runtimesDir(),{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name).sort(k)}catch{return[]}}function D(e,a){return z.posix.basename(e.tarballPath(a))}function k(e,a){let o=f=>{let p=f.indexOf("-"),P=p>=0?f.slice(0,p):f,C=p>=0?f.slice(p+1):"",M=P.split(".").map(b=>Number.parseInt(b,10));return M.some(b=>!Number.isFinite(b))?[[Number.POSITIVE_INFINITY],f]:[M,C]},[m,u]=o(e),[R,S]=o(a);for(let f=0;f<Math.max(m.length,R.length);f++){let p=m[f]??0,P=R[f]??0;if(p!==P)return p-P}return u===S?0:u?S?u<S?-1:1:-1:1}import{spawn as G}from"node:child_process";import J from"node:crypto";import l from"node:fs";import w from"node:path";import{Readable as Y}from"node:stream";import{pipeline as q}from"node:stream/promises";var B=2;function j(e){function a(){try{let t=JSON.parse(l.readFileSync(e.configFile(),"utf8"));return t&&typeof t=="object"?t:{}}catch{return{}}}function o(t){let n=a();return(t||process.env[e.env.cdnOrigin]||n.cdnOrigin||e.defaultCdnOrigin).replace(/\/+$/,"")}function m(t){let n=a();return t||process.env[e.env.channel]||n.runtimeChannel||"stable"}function u(){let t=process.env[e.env.pin];if(t&&t.trim())return t.trim();let n=a();return typeof n.runtimeVersion=="string"&&n.runtimeVersion.trim()?n.runtimeVersion.trim():null}function R(t){let n=new URL(`${o(t)}${e.manifestPath}`);return n.searchParams.set("t",String(Date.now())),n.toString()}function S(t,n){return`${o(n)}${e.tarballPath(t)}`}async function f(t){let n=R(t),r=await fetch(n,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${n})`);return await r.json()}function p(t,n={}){let r=m(n.channel),i=n.version||u()||t.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let h=t.versions[i];if(!h)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(t.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:h}}async function P(t={}){e.ensureHome();let n=o(t.cdnOrigin),r=await f(n),{version:i,channel:h,entry:s}=p(r,t),d=e.runtimeDir(i),g=t.setActive!==!1;if(x({protectVersions:[i]}),!t.force&&l.existsSync(w.join(d,e.installedMarker)))return g&&e.writeActiveRuntime(i),x({protectVersions:[i]}),{version:i,channel:h,cdnOrigin:n,runtimeDir:d,installed:!1,activated:g,manifest:r};let I=s.tarball||S(i,n),v=w.join(e.cacheDir(),D(e,i));process.stderr.write(`${e.id}: downloading runtime ${i}\u2026
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{G as _,H as E,I as F,k as N,l as U,u as L,x as A}from"./chunk-GPEFE36K.js";import W from"node:fs";import z from"node:path";function T(e){try{return W.readdirSync(e.runtimesDir(),{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name).sort(k)}catch{return[]}}function D(e,a){return z.posix.basename(e.tarballPath(a))}function k(e,a){let o=f=>{let p=f.indexOf("-"),P=p>=0?f.slice(0,p):f,C=p>=0?f.slice(p+1):"",M=P.split(".").map(b=>Number.parseInt(b,10));return M.some(b=>!Number.isFinite(b))?[[Number.POSITIVE_INFINITY],f]:[M,C]},[m,u]=o(e),[R,S]=o(a);for(let f=0;f<Math.max(m.length,R.length);f++){let p=m[f]??0,P=R[f]??0;if(p!==P)return p-P}return u===S?0:u?S?u<S?-1:1:-1:1}import{spawn as G}from"node:child_process";import J from"node:crypto";import l from"node:fs";import w from"node:path";import{Readable as Y}from"node:stream";import{pipeline as q}from"node:stream/promises";var B=2;function j(e){function a(){try{let t=JSON.parse(l.readFileSync(e.configFile(),"utf8"));return t&&typeof t=="object"?t:{}}catch{return{}}}function o(t){let n=a();return(t||process.env[e.env.cdnOrigin]||n.cdnOrigin||e.defaultCdnOrigin).replace(/\/+$/,"")}function m(t){let n=a();return t||process.env[e.env.channel]||n.runtimeChannel||"stable"}function u(){let t=process.env[e.env.pin];if(t&&t.trim())return t.trim();let n=a();return typeof n.runtimeVersion=="string"&&n.runtimeVersion.trim()?n.runtimeVersion.trim():null}function R(t){let n=new URL(`${o(t)}${e.manifestPath}`);return n.searchParams.set("t",String(Date.now())),n.toString()}function S(t,n){return`${o(n)}${e.tarballPath(t)}`}async function f(t){let n=R(t),r=await fetch(n,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${n})`);return await r.json()}function p(t,n={}){let r=m(n.channel),i=n.version||u()||t.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let h=t.versions[i];if(!h)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(t.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:h}}async function P(t={}){e.ensureHome();let n=o(t.cdnOrigin),r=await f(n),{version:i,channel:h,entry:s}=p(r,t),d=e.runtimeDir(i),g=t.setActive!==!1;if(x({protectVersions:[i]}),!t.force&&l.existsSync(w.join(d,e.installedMarker)))return g&&e.writeActiveRuntime(i),x({protectVersions:[i]}),{version:i,channel:h,cdnOrigin:n,runtimeDir:d,installed:!1,activated:g,manifest:r};let I=s.tarball||S(i,n),v=w.join(e.cacheDir(),D(e,i));process.stderr.write(`${e.id}: downloading runtime ${i}\u2026
3
3
  `),await K(I,v),process.stderr.write(`${e.id}: extracting runtime ${i}\u2026
4
4
  `);let O=w.join(w.dirname(d),`.installing-${i}-${process.pid}`);l.rmSync(O,{recursive:!0,force:!0});try{let y=await Q(v);if(y!==s.sha256)throw new Error(`sha256 mismatch for runtime ${i}: expected ${s.sha256}, actual ${y}`);if(l.mkdirSync(O,{recursive:!0}),await X(v,O),!l.existsSync(w.join(O,e.installedMarker)))throw new Error(`extracted tarball for runtime ${i} is missing ${e.installedMarker}`);l.rmSync(d,{recursive:!0,force:!0}),l.renameSync(O,d)}catch(y){throw l.rmSync(O,{recursive:!0,force:!0}),y}finally{l.rmSync(v,{force:!0})}return g&&e.writeActiveRuntime(i),x({protectVersions:[i]}),{version:i,channel:h,cdnOrigin:n,runtimeDir:d,installed:!0,activated:g,manifest:r}}async function C(t={}){e.ensureHome(),x();let n=o(t.cdnOrigin),r=m(t.channel),i=u();if(i){let V=e.readActiveRuntime(),c=l.existsSync(w.join(e.runtimeDir(i),e.installedMarker));if(V===i&&c)return{checked:!0,updated:!1,reason:`runtime is pinned to ${i}`,activeVersion:V,latestVersion:i};let $=await P({version:i,channel:r,cdnOrigin:n,setActive:!1});return{checked:!0,updated:!0,reason:`runtime is pinned to ${i}`,activeVersion:i,latestVersion:i,install:$}}let h=await f(n),s=h.channels[r]?.latest;if(!s)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:e.readActiveRuntime()};if(!h.versions[s])return{checked:!0,updated:!1,reason:`manifest is missing version ${s}`,activeVersion:e.readActiveRuntime(),latestVersion:s};let g=e.readActiveRuntime(),I=g?e.runtimeDir(g):null,v=I?l.existsSync(w.join(I,e.installedMarker)):!1;if(!(!g||!v||k(s,g)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:g,latestVersion:s};let y=await P({version:s,channel:r,cdnOrigin:n,setActive:!1});return{checked:!0,updated:!0,activeVersion:s,latestVersion:s,install:y}}async function M(t={}){let n=e.readActiveRuntime(),r=u();if(r)return{active:n,latest:r,pinned:r,outdated:n!==r};try{let i=await f(o(t.cdnOrigin)),h=m(t.channel),s=i.channels[h]?.latest??null,d=!!(s&&(!n||k(s,n)>0));return{active:n,latest:s,pinned:null,outdated:d}}catch{return{active:n,latest:null,pinned:null,outdated:!1}}}function b(t={}){e.ensureHome();let n=Math.max(1,Math.floor(t.retainVersions??B)),r=T(e),i=new Set(r),h=e.readActiveRuntime(),s=u(),d=new Set;for(let c of[h,s,...t.protectVersions??[]])c&&i.has(c)&&d.add(c);for(let c of[...r].reverse()){if(d.size>=n)break;d.add(c)}let g="__RUNTIME_VERSION__",I=D(e,g),v=I.indexOf(g),O=I.slice(0,v),y=I.slice(v+g.length),V=[];if(v>=0)try{V=l.readdirSync(e.cacheDir(),{withFileTypes:!0}).filter(c=>{if(!c.isFile())return!1;let $=c.name.startsWith(O)&&c.name.endsWith(y),H=c.name.startsWith(O)&&c.name.endsWith(`${y}.partial`);return $||H}).map(c=>w.join(e.cacheDir(),c.name)).sort()}catch{}return{activeVersion:h,pinnedVersion:s,keepVersions:r.filter(c=>d.has(c)),removeVersions:r.filter(c=>!d.has(c)),removeCacheFiles:V}}function x(t={}){let n=b(t);for(let r of n.removeVersions)l.rmSync(e.runtimeDir(r),{recursive:!0,force:!0});for(let r of n.removeCacheFiles)l.rmSync(r,{force:!0});return n}return{product:e,resolveCdnOrigin:o,resolveChannel:m,resolvePin:u,manifestUrl:R,tarballUrl:S,fetchManifest:f,resolveVersion:p,install:P,updateToLatest:C,checkUpToDate:M,planLocalRetention:b,pruneLocalRetention:x,listInstalled:()=>T(e)}}async function K(e,a){let o=await fetch(e);if(!o.ok||!o.body)throw new Error(`download failed: ${o.status} ${o.statusText} (${e})`);l.mkdirSync(w.dirname(a),{recursive:!0});let m=`${a}.partial`;try{await q(Y.fromWeb(o.body),l.createWriteStream(m)),l.renameSync(m,a)}catch(u){try{l.unlinkSync(m)}catch{}throw u}}function Q(e){return new Promise((a,o)=>{let m=J.createHash("sha256"),u=l.createReadStream(e);u.on("data",R=>m.update(R)),u.on("error",o),u.on("end",()=>a(m.digest("hex")))})}function X(e,a){return new Promise((o,m)=>{let u=G("tar",["-xzf",e,"-C",a],{stdio:["ignore","inherit","inherit"]});u.on("error",m),u.on("exit",R=>{R===0?o():m(new Error(`tar exited with code ${R}`))})})}var Z="https://contrast.dev",he="https://sootsim.com/changelog",ee={id:"sootsim",defaultCdnOrigin:Z,manifestPath:"/runtimes/manifest.json",tarballPath:e=>`/runtimes/sootsim-runtime-${e}.tar.gz`,installedMarker:"index.html",env:{cdnOrigin:"SOOTSIM_CDN_ORIGIN",channel:"SOOTSIM_RUNTIME_CHANNEL",pin:"SOOTSIM_RUNTIME_VERSION"},ensureHome:_,configFile:A,runtimesDir:N,runtimeDir:U,cacheDir:L,readActiveRuntime:E,writeActiveRuntime:F},Re=j(ee);export{k as a,Z as b,he as c,Re as d};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as F,d as M}from"./chunk-FAKE23IY.js";import{c as H}from"./chunk-CAVS43NZ.js";import{g as R,j as L,r as U,s as x,t as O}from"./chunk-FJXEQORS.js";import{a as j}from"./chunk-LWCQCC4X.js";import{execFileSync as Q,spawnSync as a}from"child_process";import{existsSync as l,mkdirSync as E,readFileSync as it,realpathSync as at,rmSync as h,writeFileSync as q}from"fs";import{homedir as b}from"os";import{basename as ct,dirname as C,resolve as u,sep as W}from"path";import{execFileSync as Z}from"child_process";import{chmodSync as tt,mkdirSync as A,rmSync as et,writeFileSync as I}from"fs";import{dirname as _}from"path";var rt="dev.sootsim.daemon",V="SootSim Daemon",Y="0.1.36";function G(t,e,r){let n=x(),o=O(),i=_(_(o)),c=_(o),p=`${i}/Resources`;et(n,{recursive:!0,force:!0}),A(U(),{recursive:!0}),A(c,{recursive:!0}),A(p,{recursive:!0}),I(`${i}/Info.plist`,ot()),I(`${i}/PkgInfo`,"APPL????"),I(o,nt(t,e,r)),tt(o,493);try{Z("codesign",["--force","--sign","-","--deep",n],{stdio:"pipe"})}catch(s){let f=s instanceof Error?s.message:String(s);console.warn(` warning: ad-hoc codesign of ${n} failed: ${f}
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as F,d as M}from"./chunk-E5KAJLCE.js";import{c as H}from"./chunk-P7WHR67J.js";import{g as R,j as L,r as U,s as x,t as O}from"./chunk-GPEFE36K.js";import{a as j}from"./chunk-BVG6UDMP.js";import{execFileSync as Q,spawnSync as a}from"child_process";import{existsSync as l,mkdirSync as E,readFileSync as it,realpathSync as at,rmSync as h,writeFileSync as q}from"fs";import{homedir as b}from"os";import{basename as ct,dirname as C,resolve as u,sep as W}from"path";import{execFileSync as Z}from"child_process";import{chmodSync as tt,mkdirSync as A,rmSync as et,writeFileSync as I}from"fs";import{dirname as _}from"path";var rt="dev.sootsim.daemon",V="SootSim Daemon",Y="0.1.36";function G(t,e,r){let n=x(),o=O(),i=_(_(o)),c=_(o),p=`${i}/Resources`;et(n,{recursive:!0,force:!0}),A(U(),{recursive:!0}),A(c,{recursive:!0}),A(p,{recursive:!0}),I(`${i}/Info.plist`,ot()),I(`${i}/PkgInfo`,"APPL????"),I(o,nt(t,e,r)),tt(o,493);try{Z("codesign",["--force","--sign","-","--deep",n],{stdio:"pipe"})}catch(s){let f=s instanceof Error?s.message:String(s);console.warn(` warning: ad-hoc codesign of ${n} failed: ${f}
3
3
  the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:n,launcherPath:o}}function ot(){return`<?xml version="1.0" encoding="UTF-8"?>
4
4
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
5
5
  <plist version="1.0">
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as K,b as V,c as Ne}from"./chunk-DMJCPQ5G.js";import{c as Pe}from"./chunk-VYCARR66.js";import{d as _e}from"./chunk-5BH4EGSX.js";import{d as Oe}from"./chunk-4LQHUMJD.js";import{g as $e,i as Fe,k as B}from"./chunk-7NHETHT2.js";import{c as Ue,d as E}from"./chunk-FAKE23IY.js";import{a as Ae}from"./chunk-DWZBBA2R.js";import{createHash as St}from"crypto";import{readFileSync as M}from"fs";import je from"path";import{gzipSync as ge,gunzipSync as vt}from"zlib";function Ce(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 ut,constants as ct}from"node:zlib";var dt=9;function Le(e){return ut(e,{params:{[ct.BROTLI_PARAM_QUALITY]:dt}})}function ce(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function pt(e){let t=ce(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function mt(e,t=8,r){let s=0,o=0,i=e.length;await Promise.all(Array.from({length:Math.min(t,i)},async()=>{for(;s<i;){let l=e[s++];await pt(l),o++,r?.(o,i)}}))}function ft(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let i of e.files){let l=r.get(i.urlhash);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.timeline&&s?.timelineBytes&&o.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:s.timelineBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),e.failureBundle&&s?.failureBundleBytes&&o.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:s.failureBundleBytes});for(let i of e.snapshots??[]){let l=s?.snapshotBytes?.get(i.id);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}return o}function gt(e){return e.replace(/\/+$/,"")}var W=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function ze(e){let t=gt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-contrast-admin-upload-bypass"]=e.adminBypassToken);let s=ce(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let T=await o.text().catch(()=>"");throw new W(`init failed: ${o.status} ${T.slice(0,200)}`,o.status,"init",T)}let i=await o.json(),l=ft(i,e.bundleBytes,e.filesByHash,e.extras);await mt(l,e.concurrency??8,e.onPutProgress);let m=ce(3e4,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:m.signal})}finally{m.cancel()}if(!c.ok){let T=await c.text().catch(()=>"");throw new W(`finalize failed: ${c.status} ${T.slice(0,200)}`,c.status,"finalize",T)}let h=await c.json();return{init:i,finalize:h}}function ht(e){return e!==null&&typeof e=="object"?e:null}function De(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function de(e){let t=ht(e);return t?t.schemaVersion===1&&De(t.t)!==void 0&&De(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function yt(e,t){let r=[];for(let s of e.split(`
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as K,b as V,c as Ne}from"./chunk-GXDDHTOJ.js";import{c as Pe}from"./chunk-M7PUH4OV.js";import{d as _e}from"./chunk-7O7ECDP6.js";import{d as Oe}from"./chunk-LISO377N.js";import{g as $e,i as Fe,k as B}from"./chunk-6CZJDONZ.js";import{c as Ue,d as E}from"./chunk-E5KAJLCE.js";import{a as Ae}from"./chunk-C4O44UV2.js";import{createHash as St}from"crypto";import{readFileSync as M}from"fs";import je from"path";import{gzipSync as ge,gunzipSync as vt}from"zlib";function Ce(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 ut,constants as ct}from"node:zlib";var dt=9;function Le(e){return ut(e,{params:{[ct.BROTLI_PARAM_QUALITY]:dt}})}function ce(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function pt(e){let t=ce(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function mt(e,t=8,r){let s=0,o=0,i=e.length;await Promise.all(Array.from({length:Math.min(t,i)},async()=>{for(;s<i;){let l=e[s++];await pt(l),o++,r?.(o,i)}}))}function ft(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let i of e.files){let l=r.get(i.urlhash);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.timeline&&s?.timelineBytes&&o.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:s.timelineBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),e.failureBundle&&s?.failureBundleBytes&&o.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:s.failureBundleBytes});for(let i of e.snapshots??[]){let l=s?.snapshotBytes?.get(i.id);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}return o}function gt(e){return e.replace(/\/+$/,"")}var W=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function ze(e){let t=gt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-contrast-admin-upload-bypass"]=e.adminBypassToken);let s=ce(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let T=await o.text().catch(()=>"");throw new W(`init failed: ${o.status} ${T.slice(0,200)}`,o.status,"init",T)}let i=await o.json(),l=ft(i,e.bundleBytes,e.filesByHash,e.extras);await mt(l,e.concurrency??8,e.onPutProgress);let m=ce(3e4,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:m.signal})}finally{m.cancel()}if(!c.ok){let T=await c.text().catch(()=>"");throw new W(`finalize failed: ${c.status} ${T.slice(0,200)}`,c.status,"finalize",T)}let h=await c.json();return{init:i,finalize:h}}function ht(e){return e!==null&&typeof e=="object"?e:null}function De(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function de(e){let t=ht(e);return t?t.schemaVersion===1&&De(t.t)!==void 0&&De(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function yt(e,t){let r=[];for(let s of e.split(`
3
3
  `)){let o=s.trim();if(o)try{let i=JSON.parse(o);t(i)&&r.push(i)}catch{}}return r}function He(e){return yt(e,de)}import{execSync as bt}from"child_process";function me(e){try{return bt(e,{stdio:["ignore","pipe","ignore"],timeout:3e3,encoding:"utf8"}).trim()||null}catch{return null}}function pe(e){let t=e?.trim();return!t||!/^\d+$/.test(t)?null:Number(t)}function wt(){let e=me("git remote get-url origin");if(!e)return null;let t=e.match(/github\.com[/:]([^/\s]+)\/([^/\s]+?)(?:\.git)?\/?$/i);return t?{owner:t[1],repo:t[2]}:null}function fe(){let e=process.env.GITHUB_ACTIONS==="true",t=process.env.CONTRAST_BRANCH?.trim()||null,r=process.env.CONTRAST_SHA?.trim()||null,s=process.env.CONTRAST_PR_TITLE?.trim()||null,o=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim(),[i,l]=o.includes("/")?o.split("/",2):[null,null];if(e){let h=process.env.GITHUB_REF?.match(/^refs\/pull\/(\d+)\//)?.[1];return{owner:i,repo:l,branch:t||process.env.GITHUB_HEAD_REF?.trim()||process.env.GITHUB_REF_NAME?.trim()||null,commitSha:r||process.env.GITHUB_SHA?.trim()||null,githubUsername:process.env.GITHUB_ACTOR?.trim()||null,pullRequestNumber:pe(process.env.CONTRAST_PR_NUMBER)??pe(h),pullRequestTitle:s,githubRunId:process.env.GITHUB_RUN_ID?.trim()||null,source:"ci"}}let m=t??me("git rev-parse --abbrev-ref HEAD"),c=i?null:wt();return{owner:i??c?.owner??null,repo:l??c?.repo??null,branch:m==="HEAD"?null:m,commitSha:r??me("git rev-parse HEAD"),githubUsername:null,pullRequestNumber:pe(process.env.CONTRAST_PR_NUMBER),pullRequestTitle:s,githubRunId:null,source:"cli"}}function Yt(e){if(e.length===0)return{stepCount:null,failedStepIndex:null};let t=e.find(r=>r.status==="failure");return{stepCount:e.length,failedStepIndex:t?t.stepIndex:null}}function Qt(e){return e.auth?e.uploadedShare?!0:e.auth.kind==="github"||process.env.GITHUB_ACTIONS==="true":!1}async function Xt(e){let t=e.auth??K();if(!t)return null;let r=fe(),s=e.owner??(t.kind==="github"?t.owner:null)??r.owner,o=e.repo??(t.kind==="github"?t.repo:null)??r.repo;try{let i=await fetch(`${e.origin.replace(/\/$/,"")}/api/sootsim/test-runs`,{method:"POST",headers:{"content-type":"application/json",authorization:V(t)},body:JSON.stringify({kind:e.kind,source:r.source,name:e.name??void 0,prompt:e.prompt??void 0,summary:e.summary??void 0,status:e.status,failureMessage:e.failureMessage??void 0,previewShareId:e.previewShareId??void 0,owner:s??void 0,repo:o??void 0,branch:r.branch??void 0,commitSha:r.commitSha??void 0,githubUsername:r.githubUsername??void 0,pullRequestNumber:r.pullRequestNumber??void 0,githubRunId:r.githubRunId??void 0,stepCount:e.stepCount??void 0,failedStepIndex:e.failedStepIndex??void 0,durationMs:e.durationMs??void 0,flowYamlSizeBytes:e.flowYamlSizeBytes??void 0})});if(!i.ok){let m=await i.text().catch(()=>"");return console.warn(` warn: run registration failed: /api/sootsim/test-runs ${i.status}${m?`: ${m.slice(0,200)}`:""}`),null}let l=await i.json();return l.run?.id?{id:l.run.id,previewUrl:l.run.previewUrl??null,traceUrl:l.run.traceUrl??null}:(console.warn(" warn: run registration returned no id"),null)}catch(i){return console.warn(` warn: run registration failed: ${i instanceof Error?i.message:String(i)}`),null}}function Rt(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}function xt(e){let t=JSON.parse(M(e,"utf8"));if(!Array.isArray(t))throw new Error("snapshot manifest must be an array");let r=new Set;return t.map((s,o)=>{if(s===null||typeof s!="object")throw new Error(`snapshot manifest entry ${o} must be an object`);let i=Reflect.get(s,"id"),l=Reflect.get(s,"label"),m=Reflect.get(s,"path"),c=Reflect.get(s,"t");if(typeof i!="string"||!i||r.has(i))throw new Error(`snapshot manifest entry ${o} has an invalid or duplicate id`);if(typeof m!="string"||!m)throw new Error(`snapshot manifest entry ${o} has no PNG path`);if(typeof c!="number"||!Number.isFinite(c)||c<0)throw new Error(`snapshot manifest entry ${o} has an invalid capture time`);r.add(i);let h=M(m);return{meta:{id:i,label:typeof l=="string"&&l?l:i,kind:"interaction",t:Math.round(c),contentType:"image/png",sizeBytes:h.byteLength},bytes:h}})}var Ve=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://contrast.dev",We=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",ye="https://contrast.localhost:3000",kt=2e3;async function Et(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${ye}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(kt)});if(t.ok||t.status===204||t.status===405)return ye}catch{}return Ve}function N(e){return e.replace(/\/$/,"")}function Bt(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 It(e){try{let t=new URL(e).hostname.toLowerCase();return t==="contrast.dev"||t.endsWith(".contrast.dev")}catch{return!1}}function At(e,t){return t?N(t):process.env.SOOTSIM_PREVIEW_ORIGIN?N(process.env.SOOTSIM_PREVIEW_ORIGIN):Bt(e)?N(e):It(e)?N(We):N(e)}function Ut(){console.log(`
4
4
  sootsim record upload \u2014 publish the current recorded bundle as a /preview/<id> link
5
5
 
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{k as n}from"./chunk-IL67IGWO.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.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{k as n}from"./chunk-XRWQYYRY.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,5 +1,5 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as de}from"./chunk-WDDAJEF2.js";import{b as Rt,c as Pt,k as At}from"./chunk-LSARMXMK.js";import{a as oe,b as D,c as A,d as Ie,e as ae,f as X,g as pe,h as ye,i as Ft,j as Ot,k as Te,l as Et}from"./chunk-7XETMEVG.js";import{A as $t,B as xt,E as St,G as vt,I as ue,J as kt,P as Le,a as ke,b as rt,c as it,d as at,e as lt,f as ct,g as dt,h as ut,i as pt,j as mt,k as Be,l as Ce,q as je,r as ft,s as gt,t as ge,u as yt,v as _e,w as qe,x as ht,y as bt,z as wt}from"./chunk-EOWY6ENX.js";import{e as _t,g as It,i as Tt,j as Mt,k as Nt,l as ce}from"./chunk-7NHETHT2.js";import{a as ot}from"./chunk-O5JBF7EI.js";import{a as Q}from"./chunk-JNF5Q27W.js";import{c as st}from"./chunk-GJWLFLCH.js";import{c as nt}from"./chunk-W2N5SGMP.js";import{c as Ae,e as De}from"./chunk-PVO7KJ4U.js";function We(e){return`(async () => {
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as de}from"./chunk-YWUKWQC6.js";import{b as Rt,c as Pt,k as At}from"./chunk-WGBXASPC.js";import{a as oe,b as D,c as A,d as Ie,e as ae,f as X,g as pe,h as ye,i as Ft,j as Ot,k as Te,l as Et}from"./chunk-QJR4A3AT.js";import{A as $t,B as xt,E as St,G as vt,I as ue,J as kt,P as Le,a as ke,b as rt,c as it,d as at,e as lt,f as ct,g as dt,h as ut,i as pt,j as mt,k as Be,l as Ce,q as je,r as ft,s as gt,t as ge,u as yt,v as _e,w as qe,x as ht,y as bt,z as wt}from"./chunk-JDS7NQGJ.js";import{e as _t,g as It,i as Tt,j as Mt,k as Nt,l as ce}from"./chunk-6CZJDONZ.js";import{a as ot}from"./chunk-XYVOQPAW.js";import{a as Q}from"./chunk-SGIRBGTQ.js";import{c as st}from"./chunk-ZEJWSA35.js";import{c as nt}from"./chunk-6YYWSTTR.js";import{c as Ae,e as De}from"./chunk-IIURCDJE.js";function We(e){return`(async () => {
3
3
  const bridge = globalThis.SootSim && globalThis.SootSim.bridges && globalThis.SootSim.bridges.hotRemount
4
4
  if (!bridge || typeof bridge.reloadExternalApp !== 'function') return false
5
5
  await bridge.reloadExternalApp({ resetStorage: ${e?"true":"false"} })
@@ -588,7 +588,7 @@ import{a as de}from"./chunk-WDDAJEF2.js";import{b as Rt,c as Pt,k as At}from"./c
588
588
  `);console.log(`${o??""}
589
589
 
590
590
  ${n}
591
- `),process.exit(0)}let N=c.wsPort,M=c.simId,j=c.simIdSource,O=c.commandTimeoutMs;if(p==="get"&&f==="diagnosis"){let x=i.indexOf("diagnosis"),o=x>=0?[...i.slice(0,x),...i.slice(x+1)]:i,{runDiagnose:n}=await import("./diagnose-VGZOE32C.js"),r=await n(["recent",...o],t);process.exitCode=r;return}if(p==="do"&&f==="scan"){let{runCamera:x}=await import("./camera-2EP7WI7X.js");await x(i,{port:t.port});return}if(f==="list"&&i.some(x=>x==="--drivers"||x==="-D")){let{buildDriverListRows:x}=await import("./drivers-U44673LK.js"),o=x();console.log(` available drivers (${o.length}):
591
+ `),process.exit(0)}let N=c.wsPort,M=c.simId,j=c.simIdSource,O=c.commandTimeoutMs;if(p==="get"&&f==="diagnosis"){let x=i.indexOf("diagnosis"),o=x>=0?[...i.slice(0,x),...i.slice(x+1)]:i,{runDiagnose:n}=await import("./diagnose-4IJ7OIKZ.js"),r=await n(["recent",...o],t);process.exitCode=r;return}if(p==="do"&&f==="scan"){let{runCamera:x}=await import("./camera-H6SDZMVF.js");await x(i,{port:t.port});return}if(f==="list"&&i.some(x=>x==="--drivers"||x==="-D")){let{buildDriverListRows:x}=await import("./drivers-MXV3L74Q.js"),o=x();console.log(` available drivers (${o.length}):
592
592
  `);let n=Math.max(...o.map(a=>a.id.length),6),r=Math.max(...o.map(a=>a.kind.length),4);for(let a of o){let u=a.available?"\u2713":"\u2717",m=a.id.padEnd(n),g=a.kind.padEnd(r);console.log(` ${u} ${m} ${g} ${a.description}`),a.available&&a.detail?console.log(` ${a.detail}`):!a.available&&a.reason&&console.log(` unavailable: ${a.reason}`)}return}let d=Tt(c),q=M||"default",E=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","storage-clear","list","wait","sleep"]),P=200;function J(x){let o=x.replace(/\s+/g," ").trim();if(!o)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(o)){let r=/<title[^>]*>([^<]+)<\/title>/i.exec(x)?.[1]?.trim(),a=/<body[^>]*>([\s\S]*?)<\//i.exec(x)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),u=r||a||"html error page";return`<html ${x.length}B> "${u}" (body elided \u2014 add --json for the full payload)`}return o.length<=P?o:`${o.slice(0,P)}\u2026 (+${o.length-P} more bytes)`}function U(x){let o=x.displayUrl||x.url;return x.status!=null?`${x.method} ${o} -> ${x.status}${x.statusText?` ${x.statusText}`:""}`:x.error?`${x.method} ${o} -> ${x.error}`:`${x.method} ${o}`}async function _(x){let o=fe()?400:200;try{let{settled:n,elapsed:r}=await se({bridge:x,maxMs:o,pollMs:32,stablePolls:2});n||process.stderr.write(` \u26A0 auto-wait timed out after ${r??o}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
593
593
  `)}catch{}}function F(x,o){if(o.result?.reason==="offscreen"){let{x:n,y:r,screen:a}=o.result;console.error(` tap failed: ${x} resolved to (${Math.round(n)},${Math.round(r)}), outside the ${a?.width}x${a?.height} screen`),console.error(" the node exists but is scrolled out of view \u2014 scroll it on-screen first (sootsim do scroll / swipe), then tap.");return}console.error(` tap failed: ${x} stayed visible but did not receive a hittable press after ${o.attempts} attempt${o.attempts===1?"":"s"}`),o.result&&console.error(` last result: ${JSON.stringify(o.result)}`)}async function H(){try{return await d.send({type:"evaluate",code:`(() => ({
594
594
  console: ${_e},
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as b}from"./chunk-GJWLFLCH.js";import{b as L,e as T,g as E}from"./chunk-W2N5SGMP.js";import{K as S,L as I,M as B,N as P,g as A}from"./chunk-FJXEQORS.js";import{WebSocket as $}from"ws";var W=null;function O(){let i=A();if(W?.homeDir===i)return W.world;let r=U();return W={homeDir:i,world:r},r}function U(){let i=I();if(i&&P(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:b};let r=S();return r&&B(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:b}:{source:"default",bridgePort:7668,shellBaseUrl:b}}function _(i){let r=I();if(r&&P(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:b};let e=S();return e&&B(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:b}:null}function K(i){let r;try{let l=new URL(i);r=l.port?Number(l.port):l.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(r)||r<=0)return null;let e=I();if(e&&P(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let d=S();return d&&B(d)&&(d.runtimePort===r||d.bridgePort===r)?d.bridgePort:null}function D(){return O().bridgePort}function Q(i,r){let e=_(i),d=e?.source==="dev-bridge"?"dev bridge":e?.source==="daemon"?"daemon bridge":"bridge",l=e?`${e.source}.json`:"no lockfile",t=r??e?.shellBaseUrl;process.stderr.write(` \u2192 ${d} :${i} (${t?`shell ${t}, `:""}${l})
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as b}from"./chunk-ZEJWSA35.js";import{b as L,e as T,g as E}from"./chunk-6YYWSTTR.js";import{K as S,L as I,M as B,N as P,g as A}from"./chunk-GPEFE36K.js";import{WebSocket as $}from"ws";var W=null;function O(){let i=A();if(W?.homeDir===i)return W.world;let r=U();return W={homeDir:i,world:r},r}function U(){let i=I();if(i&&P(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:b};let r=S();return r&&B(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:b}:{source:"default",bridgePort:7668,shellBaseUrl:b}}function _(i){let r=I();if(r&&P(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:b};let e=S();return e&&B(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:b}:null}function K(i){let r;try{let l=new URL(i);r=l.port?Number(l.port):l.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(r)||r<=0)return null;let e=I();if(e&&P(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let d=S();return d&&B(d)&&(d.runtimePort===r||d.bridgePort===r)?d.bridgePort:null}function D(){return O().bridgePort}function Q(i,r){let e=_(i),d=e?.source==="dev-bridge"?"dev bridge":e?.source==="daemon"?"daemon bridge":"bridge",l=e?`${e.source}.json`:"no lockfile",t=r??e?.shellBaseUrl;process.stderr.write(` \u2192 ${d} :${i} (${t?`shell ${t}, `:""}${l})
3
3
  `)}var C=class extends Error{lock;constructor(r,e){super(r),this.name="BridgeSimLockedError",this.lock=e}};function N(i){return i==="flag"?"via --sim":i==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function z(i,r={}){let e=new Set,d=r.port??D(),l=r.commandTimeoutMs??15e3,t,u="none",v=new Set(r.stripBooleanFlags??[]),y=new Set(r.stripValueFlags??[]);for(let n=0;n<i.length;n++){let a=i[n];if(a==="--port"||a==="-p"){e.add(n),n+1<i.length&&(e.add(n+1),d=Number(i[n+1])),n++;continue}if(a.startsWith("--port=")){e.add(n),d=Number(a.slice(7));continue}if(a==="--timeout"){e.add(n),n+1<i.length&&(e.add(n+1),l=Number(i[n+1])),n++;continue}if(a==="--sim"||a==="--session"||a==="--tab"){e.add(n),n+1<i.length&&(e.add(n+1),t=i[n+1]?.trim()||void 0,u="flag"),n++;continue}let s=a.startsWith("--sim=")?a.slice(6):a.startsWith("--session=")?a.slice(10):a.startsWith("--tab=")?a.slice(6):void 0;if(s!==void 0){e.add(n),t=s.trim()||void 0,u="flag";continue}if(v.has(a)){e.add(n);continue}y.has(a)&&(e.add(n),n+1<i.length&&e.add(n+1),n++)}if(!t){let n=T();n&&(t=n.trim()||void 0,u="saved")}return{positional:i.filter((n,a)=>!e.has(a)),wsPort:d,simId:t,simIdSource:u,commandTimeoutMs:l}}function R(i,r={}){let e=1,d=r.commandTimeoutMs??15e3,l=new Map,t=new $(`ws://localhost:${i}`),u=L(),v=new Promise((s,o)=>{t.on("open",()=>{try{t.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:u.key,cliIdentitySource:u.source,cliLabel:r.cliLabel}))}catch{}s()}),t.on("error",c=>{let m=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${i}${m}`))})}),y=!1,n=!1;function a(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",m=N(o?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${m})
4
4
  `)}return t.on("message",s=>{let o;try{o=JSON.parse(s.toString())}catch{return}if(o.id===0)return;let c=l.get(o.id);c&&(l.delete(o.id),o._otherCliCount>0&&!y&&(y=!0,process.stderr.write(`
5
5
  \u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var o=!0,e="public beta",t=e,n="we send anonymous error and dependency data while you use it";export{o as a,e as b,t as c,n as d};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as R}from"./chunk-7NHETHT2.js";import{a as w,b as y,c as b,d as r}from"./chunk-SALM6SYB.js";import{G as d,H as u,I as $,l as p,z as g}from"./chunk-FJXEQORS.js";import k from"fs";import{WebSocket as x}from"ws";async function H(t,e={}){let[s,...n]=t;if(!s||s==="--help"||s==="-h"){I();return}switch(s){case"install":return S(n,e);case"list":case"ls":return D(n);case"use":return N(n);case"remove":case"rm":return T(n);case"which":case"active":return L();case"pin":return _(n);case"unpin":return C();case"notes":case"changelog":return P(n);default:console.error(` unknown runtime subcommand: ${s}`),I(),process.exit(1)}}function I(){console.log(`
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as R}from"./chunk-6CZJDONZ.js";import{a as w,b as y,c as b,d as r}from"./chunk-2E7NPIZK.js";import{G as d,H as u,I as $,l as p,z as g}from"./chunk-GPEFE36K.js";import k from"fs";import{WebSocket as x}from"ws";async function H(t,e={}){let[s,...n]=t;if(!s||s==="--help"||s==="-h"){I();return}switch(s){case"install":return S(n,e);case"list":case"ls":return D(n);case"use":return N(n);case"remove":case"rm":return T(n);case"which":case"active":return L();case"pin":return _(n);case"unpin":return C();case"notes":case"changelog":return P(n);default:console.error(` unknown runtime subcommand: ${s}`),I(),process.exit(1)}}function I(){console.log(`
3
3
  sootsim runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
4
4
 
5
5
  usage:
@@ -26,4 +26,4 @@ examples:
26
26
  sootsim runtime install --channel beta
27
27
  sootsim runtime use 1.2.3
28
28
  sootsim runtime notes
29
- `)}async function S(t,e){let{version:s,flags:n}=U(t),o=n.channel??e.channel??"stable",c=n.force===!0,l=n.setActive!==!1;d(),console.log("sootsim runtime install"),console.log(` cdn: ${r.resolveCdnOrigin()}`);try{let i=await r.install({version:s,channel:o,force:c,setActive:l});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),l&&await m(i.version)}catch(i){console.error(` ${v(i)}`),process.exit(1)}}async function m(t){$(t),console.log(` active: ${t}`),await A(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function A(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:s}=await import("./home-paths-URBZE5DX.js"),n=s();if(!e(n))return!1;let o=R();return new Promise(c=>{let l=!1,i=!1,f=O=>{l||(l=!0,c(O))},a=new x(`ws://127.0.0.1:${o}`,{handshakeTimeout:800}),h=setTimeout(()=>{try{a.close()}catch{}f(i)},1500);a.on("open",()=>{try{a.send(JSON.stringify({type:"runtime:use",version:t,id:0})),i=!0}catch{}setTimeout(()=>{try{a.close()}catch{}},100)}),a.on("close",()=>{clearTimeout(h),f(i)}),a.on("error",()=>{clearTimeout(h),f(!1)})})}async function D(t){d();let e=r.listInstalled(),s=u(),n=r.resolvePin();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let o of e)console.log(` ${o===s?"*":" "} ${o}${o===n?" (pinned)":""}`);n&&!e.includes(n)&&console.log(`pinned: ${n} (not installed \u2014 run \`sootsim runtime install\`)`);try{let o=await r.fetchManifest();console.log("available (latest per channel):");for(let[l,i]of Object.entries(o.channels))console.log(` ${l.padEnd(8)} ${i.latest}`);let c=Object.keys(o.versions).sort(w).reverse();if(c.length>1){console.log("hosted versions:");for(let l of c)console.log(` ${l}`)}}catch(o){console.log(`available: (could not fetch manifest: ${v(o)})`)}}async function N(t){let e=t[0];e||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let s=r.listInstalled();s.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${s.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${e}\` first`),process.exit(1)),await m(e)}async function T(t){let e=t[0];e||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),u()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let n=p(e);if(!k.existsSync(n)){console.error(` ${e} is not installed`);return}k.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function L(){let t=u();if(!t){console.log(" no active runtime");return}console.log(t)}async function _(t){let e=t[0];if(!e){let n=r.resolvePin();n?console.log(` runtime pinned to ${n}`):(console.log(" no pin \u2014 runtime follows channel latest"),console.log(" usage: sootsim runtime pin <version>"));return}if(g({runtimeVersion:e}),console.log(` pinned runtime to ${e}`),r.listInstalled().includes(e)){u()!==e&&await m(e);return}try{let n=await r.install({version:e,setActive:!1});console.log(n.installed?` installed ${n.version}`:` already installed at ${n.runtimeDir}`),await m(e)}catch(n){console.error(` ${v(n)}`),console.error(` pin saved, but ${e} could not be installed \u2014 check \`sootsim runtime list\` for hosted versions`),process.exit(1)}}async function C(){let t=r.resolvePin();if(!t){console.log(" no pin set");return}g({runtimeVersion:void 0}),console.log(` unpinned (was ${t}) \u2014 runtime follows channel latest again`),console.log(" run `sootsim upgrade` to move to the latest now")}async function P(t){t.length>0&&(console.error(" usage: sootsim runtime notes"),process.exit(1));let e=u();e&&console.log(` active runtime: v${e}`),console.log(` release notes: ${b}`)}function U(t){let e={},s=[];for(let n=0;n<t.length;n++){let o=t[n];if(o==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(o.startsWith("--channel=")){e.channel=o.slice(10);continue}if(o==="--force"){e.force=!0;continue}if(o==="--set-active=false"||o==="--no-set-active"){e.setActive=!1;continue}s.push(o)}return{version:s[0]??null,flags:e}}function v(t){return t instanceof Error?t.message:String(t)}export{H as a};
29
+ `)}async function S(t,e){let{version:s,flags:n}=U(t),o=n.channel??e.channel??"stable",c=n.force===!0,l=n.setActive!==!1;d(),console.log("sootsim runtime install"),console.log(` cdn: ${r.resolveCdnOrigin()}`);try{let i=await r.install({version:s,channel:o,force:c,setActive:l});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),l&&await m(i.version)}catch(i){console.error(` ${v(i)}`),process.exit(1)}}async function m(t){$(t),console.log(` active: ${t}`),await A(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function A(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:s}=await import("./home-paths-W277VF23.js"),n=s();if(!e(n))return!1;let o=R();return new Promise(c=>{let l=!1,i=!1,f=O=>{l||(l=!0,c(O))},a=new x(`ws://127.0.0.1:${o}`,{handshakeTimeout:800}),h=setTimeout(()=>{try{a.close()}catch{}f(i)},1500);a.on("open",()=>{try{a.send(JSON.stringify({type:"runtime:use",version:t,id:0})),i=!0}catch{}setTimeout(()=>{try{a.close()}catch{}},100)}),a.on("close",()=>{clearTimeout(h),f(i)}),a.on("error",()=>{clearTimeout(h),f(!1)})})}async function D(t){d();let e=r.listInstalled(),s=u(),n=r.resolvePin();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let o of e)console.log(` ${o===s?"*":" "} ${o}${o===n?" (pinned)":""}`);n&&!e.includes(n)&&console.log(`pinned: ${n} (not installed \u2014 run \`sootsim runtime install\`)`);try{let o=await r.fetchManifest();console.log("available (latest per channel):");for(let[l,i]of Object.entries(o.channels))console.log(` ${l.padEnd(8)} ${i.latest}`);let c=Object.keys(o.versions).sort(w).reverse();if(c.length>1){console.log("hosted versions:");for(let l of c)console.log(` ${l}`)}}catch(o){console.log(`available: (could not fetch manifest: ${v(o)})`)}}async function N(t){let e=t[0];e||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let s=r.listInstalled();s.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${s.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${e}\` first`),process.exit(1)),await m(e)}async function T(t){let e=t[0];e||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),u()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let n=p(e);if(!k.existsSync(n)){console.error(` ${e} is not installed`);return}k.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function L(){let t=u();if(!t){console.log(" no active runtime");return}console.log(t)}async function _(t){let e=t[0];if(!e){let n=r.resolvePin();n?console.log(` runtime pinned to ${n}`):(console.log(" no pin \u2014 runtime follows channel latest"),console.log(" usage: sootsim runtime pin <version>"));return}if(g({runtimeVersion:e}),console.log(` pinned runtime to ${e}`),r.listInstalled().includes(e)){u()!==e&&await m(e);return}try{let n=await r.install({version:e,setActive:!1});console.log(n.installed?` installed ${n.version}`:` already installed at ${n.runtimeDir}`),await m(e)}catch(n){console.error(` ${v(n)}`),console.error(` pin saved, but ${e} could not be installed \u2014 check \`sootsim runtime list\` for hosted versions`),process.exit(1)}}async function C(){let t=r.resolvePin();if(!t){console.log(" no pin set");return}g({runtimeVersion:void 0}),console.log(` unpinned (was ${t}) \u2014 runtime follows channel latest again`),console.log(" run `sootsim upgrade` to move to the latest now")}async function P(t){t.length>0&&(console.error(" usage: sootsim runtime notes"),process.exit(1));let e=u();e&&console.log(` active runtime: v${e}`),console.log(` release notes: ${b}`)}function U(t){let e={},s=[];for(let n=0;n<t.length;n++){let o=t[n];if(o==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(o.startsWith("--channel=")){e.channel=o.slice(10);continue}if(o==="--force"){e.force=!0;continue}if(o==="--set-active=false"||o==="--no-set-active"){e.setActive=!1;continue}s.push(o)}return{version:s[0]??null,flags:e}}function v(t){return t instanceof Error?t.message:String(t)}export{H as a};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{existsSync as A,mkdirSync as M,readFileSync as v,rmSync as f,writeFileSync as h}from"fs";import{tmpdir as w}from"os";import{dirname as B,join as $,resolve as U}from"path";import{execFileSync as _}from"child_process";import{readFileSync as b}from"fs";import{createRequire as y}from"module";var c=null,p=null;function m(r){c||(c=T());try{return c(r)}catch{return null}}function C(r){p||(p=O());try{return p(r)}catch{return null}}function O(){if(process.platform==="linux")return r=>{try{return b(`/proc/${r}/comm`,"utf8").trim()||null}catch{return null}};if(process.platform==="darwin"){let r=x();return r||F()}return()=>null}function T(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return D();if(process.platform==="darwin"){let n=R();return n||k()}return()=>null}function D(){return r=>{try{let n=b(`/proc/${r}/stat`,"utf8"),t=n.lastIndexOf(")");if(t<0)return null;let e=n.slice(t+1).trim().split(/\s+/),i=Number(e[1]);return Number.isFinite(i)&&i>0?i:null}catch{return null}}}var N=3,l=216,P=16,S=48,L=16;function R(){if(!process.versions?.bun)return null;try{let r=y(import.meta.url),{dlopen:n,FFIType:t}=r("bun:ffi"),e=n("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[t.i32,t.i32,t.u64,t.ptr,t.i32],returns:t.i32}}),i=Buffer.alloc(l);return o=>{if(Number(e.symbols.proc_pidinfo(o,N,0n,i,l))<=0)return null;let u=i.readUInt32LE(P);return u>0?u:null}}catch{return null}}function x(){if(!process.versions?.bun)return null;try{let r=y(import.meta.url),{dlopen:n,FFIType:t}=r("bun:ffi"),e=n("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[t.i32,t.i32,t.u64,t.ptr,t.i32],returns:t.i32}}),i=Buffer.alloc(l);return o=>{if(Number(e.symbols.proc_pidinfo(o,N,0n,i,l))<=0)return null;let u=i.subarray(S,S+L),I=u.indexOf(0);return u.subarray(0,I<0?u.length:I).toString("utf8")||null}}catch{return null}}function F(){return r=>{try{let t=_("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
3
3
  `)[1];return t&&t.trim().split(/\s+/)[0]||null}catch{return null}}}function k(){return r=>{try{let t=_("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
4
4
  `)[1];if(!t)return null;let e=t.trim().split(/\s+/),i=Number(e[2]);return Number.isFinite(i)&&i>1?i:null}catch{return null}}}var d=1,g="SOOTSIM_CLI_CURRENT_SIM_PATH",V=["SOOTSIM_CLI_IDENTITY","AGENTBUS_SESSION","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"],W=/^(?:tmux|screen)|^tm$/i;function E(r,n=20){let t=r,e=m(r);if(!e||e<=1)return null;for(let i=0;i<n;i++){let o=C(e);if(o&&W.test(o))return t;let s=m(e);if(!s||s<=1)return o?e:t;t=e,e=s}return e}function Y(){for(let n of V){let t=process.env[n];if(t&&t.trim())return{key:`${n}:${t.trim()}`,source:n,stable:!0}}let r=E(process.ppid);return r&&r>1?{key:`gppid-${r}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function H(){return Y().key}function tr(){return E(process.ppid)}function a(){if(process.env[g])return U(process.env[g]);let r=H();return $(w(),`sootsim-current-sim-${r}.json`)}function J(){let r=a();if(!A(r))return null;try{let n=JSON.parse(v(r,"utf8"));return n.version!==d||typeof n.simId!="string"||!n.simId.trim()||typeof n.updatedAt!="string"?(f(r,{force:!0}),null):{version:d,simId:n.simId.trim(),updatedAt:n.updatedAt}}catch{return f(r,{force:!0}),null}}function nr(){return J()?.simId||null}function er(r){let n=r.trim();if(!n)return;let t=a();M(B(t),{recursive:!0}),h(t,JSON.stringify({version:d,simId:n,updatedAt:new Date().toISOString()},null,2)+`
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{createHash as b}from"node:crypto";import g from"node:fs";import{createRequire as R}from"node:module";import u from"node:path";var y=/\.(ttf|otf|woff|woff2)$/i;function P(t,n,r){if(!t||typeof t!="object")return;let o=t.fonts;if(Array.isArray(o))for(let i of o)typeof i=="string"&&r.push(i);let e=t[n];if(!e||typeof e!="object")return;let s=e.fonts;if(Array.isArray(s))for(let i of s){if(typeof i=="string"){r.push(i);continue}if(!i||typeof i!="object")continue;let c=i.fontDefinitions;if(Array.isArray(c))for(let a of c){if(!a||typeof a!="object")continue;let p=a.path;typeof p=="string"&&r.push(p)}}}function m(t,n){if(!Array.isArray(t))return[];let r=[];for(let o of t){let e=Array.isArray(o)?o[0]:o;if(typeof e!="string"||!/(^|\/)expo-font$/.test(e))continue;let s=Array.isArray(o)?o[1]??{}:{};P(s,n,r)}return r}function C(t){return t.slice(t.lastIndexOf("/")+1).replace(y,"")}function h(t,n){let r=n.replace(/\/+$/,""),o=new Set,e=[];for(let s of t){let i=s.replace(/^\.\//,"").replace(/^\/+/,"");!i||o.has(i)||(o.add(i),y.test(i)&&e.push({family:C(i),url:`${r}/assets/${i}`}))}return e}var d=R(import.meta.url);function x(t){try{let n=new URL(t),r=n.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r))return n.origin}catch{}return null}var S=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"];function w(t){for(let n of S)try{if(g.statSync(u.join(t,n)).isFile())return!0}catch{}return!1}var j=new Set(["node_modules","artifacts","dist","build","out","coverage","tmp","public","ios","android","macos","windows","__fixtures__","__tests__","examples","example"]);function A(t,n){w(t)&&n.push(t);let r;try{r=g.readdirSync(t,{withFileTypes:!0})}catch{return}for(let o of r)o.isDirectory()&&(o.name.startsWith(".")||j.has(o.name)||A(u.join(t,o.name),n))}function _(t){try{return g.statSync(u.join(t,"package.json")).isFile()}catch{return!1}}function I(t){let n=x(t.bundleUrl);if(!n)return[];let r=t.repoDir||process.env.CONTRAST_REPO_DIR,o=r?u.resolve(r):process.cwd();if(!r&&!_(o))return[];let e=[];if(r)A(o,e),e.includes(o)||e.push(o);else{if(!w(o))return[];e.push(o)}if(e.length===0)return[];let s=(t.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),i=null;try{let l=d.resolve("@expo/config",{paths:[...e,o]}),f=d(l);typeof f.getConfig=="function"&&(i=f.getConfig)}catch{}if(!i)return[];let c;for(let l of e)try{let f=i(l,{skipSDKVersionRequirement:!0});if(f?.exp&&typeof f.exp=="object"){let F=f.exp.plugins;if(Array.isArray(F)){c=f.exp;break}}}catch{}if(!c||typeof c!="object")return[];let a=c.plugins;if(!Array.isArray(a))return[];let p=m(a,s==="android"?"android":"ios");return h(p,n)}async function L(t,n){let r=x(t);if(!r)return null;let o=new AbortController,e=setTimeout(()=>o.abort(),n?.timeoutMs??1500);try{let s=await fetch(`${r}/`,{headers:{"expo-platform":"ios",Accept:"application/json"},signal:o.signal});if(!s.ok)return null;let c=(await s.json())?.extra?.expoClient?._internal?.projectRoot;return typeof c=="string"&&c.length>0?c:null}catch{return null}finally{clearTimeout(e)}}function M(t){return t.map(n=>`${encodeURIComponent(n.url)}::${encodeURIComponent(n.family)}`).join(",")}function k(t){let n=[];for(let r of t.split(",")){let o=r.trim();if(!o)continue;let e=o.indexOf("::"),s=e===-1?o:o.slice(0,e);try{n.push(decodeURIComponent(s))}catch{n.push(s)}}return n.filter(Boolean)}function D(t){let n=(t.split("?")[0].split(".").pop()||"").toLowerCase();return n==="ttf"?"font/ttf":n==="otf"?"font/otf":n==="woff"?"font/woff":n==="woff2"?"font/woff2":"application/octet-stream"}async function N(t,n){let r=[],o=new Set;for(let e of k(t)){let s=b("sha256").update(e).digest("hex");if(!o.has(s)){o.add(s);try{let i=await fetch(e);if(!i.ok){n?.onError?.(e,new Error(`${i.status} ${i.statusText}`));continue}let c=new Uint8Array(await i.arrayBuffer());r.push({url:e,urlhash:s,contentType:D(e),bytes:c}),n?.onStaged?.({url:e,byteLength:c.byteLength})}catch(i){n?.onError?.(e,i)}}}return r}export{I as a,L as b,M as c,N as d};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{readFileSync as i}from"node:fs";import{fileURLToPath as e}from"node:url";var r=null;function l(){if(r!=null)return r;let o=[()=>e(import.meta.resolve("sootsim/package.json")),()=>e(new URL("../package.json",import.meta.url))];for(let n of o)try{let t=JSON.parse(i(n(),"utf8")).version;if(typeof t=="string"&&t)return r=t,r}catch{}return r="0.0.0",r}export{l as a};
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{o as d}from"./chunk-FJXEQORS.js";import{chmodSync as S,existsSync as f,mkdirSync as k,readFileSync as A,rmSync as i,writeFileSync as y}from"node:fs";import{dirname as c,join as D,resolve as m}from"node:path";var s=1,p="SOOTSIM_SHARED_AUTH_FILE",u="https://contrast.dev";function w(){let t=process.env[p];return t?.trim()?c(m(t)):d()}function a(){let t=process.env[p];return t?.trim()?m(t):D(w(),"desktop-auth.json")}function g(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.id!="string"||!e.id.trim()?null:{id:e.id.trim(),name:typeof e.name=="string"?e.name:void 0,email:typeof e.email=="string"?e.email:void 0,image:typeof e.image=="string"?e.image:void 0,githubUsername:typeof e.githubUsername=="string"?e.githubUsername:void 0,teams:Array.isArray(e.teams)?e.teams.map(r=>{if(!r||typeof r!="object")return null;let n=r;return typeof n.id!="string"||typeof n.name!="string"?null:{id:n.id,name:n.name,role:n.role==="owner"?"owner":"member",githubOrg:typeof n.githubOrg=="string"?n.githubOrg:null}}).filter(r=>!!r):void 0}}function v(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==s||typeof e.token!="string"||!e.token.trim())return null;let r=typeof e.origin=="string"&&e.origin.trim()?e.origin.trim():u,n=e.source==="cli"||e.source==="electron"||e.source==="browser"||e.source==="unknown"?e.source:"unknown",o=typeof e.updatedAt=="string"&&e.updatedAt?e.updatedAt:new Date().toISOString(),h=typeof e.validatedAt=="string"&&e.validatedAt?e.validatedAt:void 0;return{version:s,token:e.token.trim(),user:g(e.user),origin:r,source:n,updatedAt:o,validatedAt:h}}function O(){let t=a();if(!f(t))return null;try{let e=JSON.parse(A(t,"utf8")),r=v(e);return r||(i(t,{force:!0}),null)}catch{return i(t,{force:!0}),null}}function b(t){let e=a();k(c(e),{recursive:!0});let r={version:s,token:t.token.trim(),user:t.user?g(t.user):null,origin:t.origin?.trim()||u,source:t.source,updatedAt:t.updatedAt||new Date().toISOString(),validatedAt:t.validatedAt};y(e,JSON.stringify(r,null,2)+`
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{o as d}from"./chunk-GPEFE36K.js";import{chmodSync as S,existsSync as f,mkdirSync as k,readFileSync as A,rmSync as i,writeFileSync as y}from"node:fs";import{dirname as c,join as D,resolve as m}from"node:path";var s=1,p="SOOTSIM_SHARED_AUTH_FILE",u="https://contrast.dev";function w(){let t=process.env[p];return t?.trim()?c(m(t)):d()}function a(){let t=process.env[p];return t?.trim()?m(t):D(w(),"desktop-auth.json")}function g(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.id!="string"||!e.id.trim()?null:{id:e.id.trim(),name:typeof e.name=="string"?e.name:void 0,email:typeof e.email=="string"?e.email:void 0,image:typeof e.image=="string"?e.image:void 0,githubUsername:typeof e.githubUsername=="string"?e.githubUsername:void 0,teams:Array.isArray(e.teams)?e.teams.map(r=>{if(!r||typeof r!="object")return null;let n=r;return typeof n.id!="string"||typeof n.name!="string"?null:{id:n.id,name:n.name,role:n.role==="owner"?"owner":"member",githubOrg:typeof n.githubOrg=="string"?n.githubOrg:null}}).filter(r=>!!r):void 0}}function v(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==s||typeof e.token!="string"||!e.token.trim())return null;let r=typeof e.origin=="string"&&e.origin.trim()?e.origin.trim():u,n=e.source==="cli"||e.source==="electron"||e.source==="browser"||e.source==="unknown"?e.source:"unknown",o=typeof e.updatedAt=="string"&&e.updatedAt?e.updatedAt:new Date().toISOString(),h=typeof e.validatedAt=="string"&&e.validatedAt?e.validatedAt:void 0;return{version:s,token:e.token.trim(),user:g(e.user),origin:r,source:n,updatedAt:o,validatedAt:h}}function O(){let t=a();if(!f(t))return null;try{let e=JSON.parse(A(t,"utf8")),r=v(e);return r||(i(t,{force:!0}),null)}catch{return i(t,{force:!0}),null}}function b(t){let e=a();k(c(e),{recursive:!0});let r={version:s,token:t.token.trim(),user:t.user?g(t.user):null,origin:t.origin?.trim()||u,source:t.source,updatedAt:t.updatedAt||new Date().toISOString(),validatedAt:t.validatedAt};y(e,JSON.stringify(r,null,2)+`
3
3
  `);try{S(e,384)}catch{}return r}function l(){i(a(),{force:!0})}async function E(t){let e=O();if(!e?.token)return null;let r=t||e.origin||u;try{let n=await fetch(`${r.replace(/\/$/,"")}/api/auth/me`,{headers:{authorization:`Bearer ${e.token}`}});if(n.status===401)return l(),null;if(!n.ok)return e;let o=await n.json();return o.user?.id?b({token:e.token,user:o.user,origin:r,source:e.source,validatedAt:new Date().toISOString()}):(l(),null)}catch{return e}}export{O as a,b,l as c,E as d};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as m,b as T}from"./chunk-WO5JLB3Y.js";import{a as w,b as A,c as C}from"./chunk-4LQHUMJD.js";import{a as I}from"./chunk-MS3I76VW.js";import{a as _,d as E}from"./chunk-W2N5SGMP.js";import{G as O,o as x,q as f}from"./chunk-FJXEQORS.js";import h from"fs";import v from"path";var c="default",j="profiles.json",a=1;function s(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function g(){return v.join(f(),j)}function H(e){return`sootsim-profile-${s(e)}`}function z(e){return v.join(x(),"Partitions",H(e))}function y(e){return v.join(f(),"playwright",s(e))}function b(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function M(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:M(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:M([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){O();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as m,b as T}from"./chunk-IE5VGFI7.js";import{a as w,b as A,c as C}from"./chunk-LISO377N.js";import{a as I}from"./chunk-V62SROO2.js";import{a as _,d as E}from"./chunk-6YYWSTTR.js";import{G as O,o as x,q as f}from"./chunk-GPEFE36K.js";import h from"fs";import v from"path";var c="default",j="profiles.json",a=1;function s(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function g(){return v.join(f(),j)}function H(e){return`sootsim-profile-${s(e)}`}function z(e){return v.join(x(),"Partitions",H(e))}function y(e){return v.join(f(),"playwright",s(e))}function b(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function M(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:M(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:M([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){O();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
3
3
  `,"utf8"),h.renameSync(t,g()),r}function K(){return S(b()).profiles}function Y(e){let r=s(e);return K().find(t=>t.id===r)??null}function L(e=c){let r=s(e),t=Y(r);return t||V(r)}function V(e){let r=s(e),t=P(b());if(t.profiles.some(i=>i.id===r))throw new Error(`profile already exists: ${r}`);let o=new Date().toISOString(),n={id:r,createdAt:o,updatedAt:o};return S({version:a,profiles:[...t.profiles,n]}),n}function ge(e){let r=s(e);if(r===c)throw new Error("the default profile cannot be deleted; clear it instead");let t=P(b()),o=t.profiles.find(n=>n.id===r);if(!o)throw new Error(`profile not found: ${r}`);return S({version:a,profiles:t.profiles.filter(n=>n.id!==r)}),J(r),o}function J(e){let r=s(e);for(let t of[z(r),y(r)])try{h.rmSync(t,{recursive:!0,force:!0})}catch{}}function X(){let e=w();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function Z(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=w();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await C(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var R={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:X,launch:Z};function Q(){let e=m();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim desktop install`)"}}async function ee(e){let r=m();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await T(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile,ownerPid:e.ownerPid});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var W={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:Q,launch:ee};import{spawn as re}from"child_process";import{closeSync as te,mkdtempSync as oe,openSync as ie,readFileSync as ne}from"fs";import{createRequire as se}from"module";import{tmpdir as N}from"os";import{join as $}from"path";var ae=`
4
4
  const modulePath = process.env.SOOTSIM_PW_MODULE;
5
5
  const url = process.env.SOOTSIM_PW_URL;
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as C,b as D}from"./chunk-V7QFQAEP.js";import{H as E}from"./chunk-FJXEQORS.js";var N="sootsimConfig";function p(e){return!!e&&Object.keys(e).length>0}function $(e){return e?p(e.modules)||p(e.turboModules)||p(e.nativeModules)||p(e.env)||p(e.network?.remap)||p(e.settings)||p(e.initialState):!1}function A(e,n){let t=new URL(e);return $(n)?t.searchParams.set(N,JSON.stringify(n)):t.searchParams.delete(N),t.toString()}var pe="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function j(e){return/^https?:\/\//i.test(e)}function O(e){return e.endsWith(".bundle")}function H(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function I(e){try{let n=j(e),t=new URL(e,"http://sootsim.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),O(t.pathname)?(t.searchParams.delete("transform.bytecode"),t.searchParams.get("lazy")==="true"&&t.searchParams.set("lazy","false"),H(t),n?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}function ge(e,n){try{let t=j(e),o=new URL(e,"http://sootsim.local");return O(o.pathname)?(o.searchParams.set("hot",n?"true":"false"),t?o.toString():`${o.pathname}${o.search}${o.hash}`):e}catch{return e}}import{exec as B}from"child_process";import W from"http";import F from"net";import{promisify as G}from"util";var T=G(B);C();var z=250,J=1500,K=120;function V(e,n=K){return new Promise(t=>{let o=new F.Socket,s=!1,i=a=>{s||(s=!0,o.destroy(),t(a))};o.setTimeout(n),o.once("connect",()=>i(!0)),o.once("timeout",()=>i(!1)),o.once("error",()=>i(!1)),o.connect(e,"localhost")})}function h(e,n,t="GET",o=z,s={}){return new Promise(i=>{let a=W.request({hostname:"localhost",port:e,path:n,method:t,timeout:o,headers:s},r=>{let c="";r.on("data",l=>c+=l.toString());let u=(()=>{let l=r.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();r.on("end",()=>i({statusCode:r.statusCode||0,body:c,contentType:u}))});a.on("error",()=>i(null)),a.setTimeout(o,()=>{a.destroy(),i(null)}),a.end()})}var q=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function k(e,n){return!(e<=0||e>=2e4||n.has(e)||e>=5170&&e<=5200)}async function Y(e=[]){let n=new Set(e);try{let{stdout:t}=await T("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
1
+ /*! sootsim v0.1.288 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as C,b as D}from"./chunk-Z472LVDA.js";import{H as E}from"./chunk-GPEFE36K.js";var N="sootsimConfig";function p(e){return!!e&&Object.keys(e).length>0}function $(e){return e?p(e.modules)||p(e.turboModules)||p(e.nativeModules)||p(e.env)||p(e.network?.remap)||p(e.settings)||p(e.initialState):!1}function A(e,n){let t=new URL(e);return $(n)?t.searchParams.set(N,JSON.stringify(n)):t.searchParams.delete(N),t.toString()}var pe="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function j(e){return/^https?:\/\//i.test(e)}function O(e){return e.endsWith(".bundle")}function H(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function I(e){try{let n=j(e),t=new URL(e,"http://sootsim.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),O(t.pathname)?(t.searchParams.delete("transform.bytecode"),t.searchParams.get("lazy")==="true"&&t.searchParams.set("lazy","false"),H(t),n?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}function ge(e,n){try{let t=j(e),o=new URL(e,"http://sootsim.local");return O(o.pathname)?(o.searchParams.set("hot",n?"true":"false"),t?o.toString():`${o.pathname}${o.search}${o.hash}`):e}catch{return e}}import{exec as B}from"child_process";import W from"http";import F from"net";import{promisify as G}from"util";var T=G(B);C();var z=250,J=1500,K=120;function V(e,n=K){return new Promise(t=>{let o=new F.Socket,s=!1,i=a=>{s||(s=!0,o.destroy(),t(a))};o.setTimeout(n),o.once("connect",()=>i(!0)),o.once("timeout",()=>i(!1)),o.once("error",()=>i(!1)),o.connect(e,"localhost")})}function h(e,n,t="GET",o=z,s={}){return new Promise(i=>{let a=W.request({hostname:"localhost",port:e,path:n,method:t,timeout:o,headers:s},r=>{let c="";r.on("data",l=>c+=l.toString());let u=(()=>{let l=r.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();r.on("end",()=>i({statusCode:r.statusCode||0,body:c,contentType:u}))});a.on("error",()=>i(null)),a.setTimeout(o,()=>{a.destroy(),i(null)}),a.end()})}var q=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function k(e,n){return!(e<=0||e>=2e4||n.has(e)||e>=5170&&e<=5200)}async function Y(e=[]){let n=new Set(e);try{let{stdout:t}=await T("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
3
3
  `)){let i=s.trim().split(/\s+/);if(i.length<9)continue;let a=Number(i[1]),c=i[8].match(/:(\d+)$/);if(!c)continue;let u=Number(c[1]);k(u,n)&&(o.has(u)||o.set(u,a))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}try{let{stdout:t}=await T(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
4
4
  `)){let i=s.match(/:(\d+)\s/),a=s.match(/pid=(\d+)/);if(!i)continue;let r=Number(i[1]),c=a?Number(a[1]):0;k(r,n)&&(o.has(r)||o.set(r,c))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}return q.filter(t=>k(t.port,n))}var x=new Map;async function Q(e){if(e<=0)return null;let n=x.get(e);if(n)return n;try{let{stdout:t}=await T(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let o of t.split(`
5
5
  `))if(o.startsWith("n")&&o.length>1){let s=o.slice(1).trim();if(s)return x.set(e,s),s}}catch{}return null}function X(e,n){return{port:e,framework:n,bundleUrl:S(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function S(e,n){let t=D().find(s=>s.preferredPort===e),o=t?.runtimeConfig?A(n,t.runtimeConfig):n;return I(o)}function Z(e){return e.includes("/node_modules/one/metro-entry.bundle")}function ee(e){try{let n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}function w(e,n,t){if(!n)return e;try{let o=JSON.parse(n.body),s=o?.extra?.expoClient||o?.extra||{};s.name&&(e.projectName=s.name),s.ios?.bundleIdentifier&&(e.bundleId=s.ios.bundleIdentifier),e.framework==="metro"&&s.sdkVersion&&(e.framework="expo");let i=o?.launchAsset?.url;i&&!e.patched&&!Z(e.bundleUrl)&&(e.bundleUrl=S(e.port,i));let a=s.iconUrl||s.ios?.iconUrl||s.icon||s.ios?.icon;if(a)if(e.iconPath=a,t)if(a.startsWith("http"))e.iconUrl=t(a);else{let r=a.replace(/^\.\//,"");e.iconUrl=t(`http://localhost:${e.port}/assets/${r}`)}else e.iconUrl=a.startsWith("http")?a:`http://localhost:${e.port}/assets/${a.replace(/^\.\//,"")}`}catch{}return e}var ne=2e4,v=new Map,M=new Set;function _(e,n){if(e.projectName)return e;let t=v.get(e.port);if(t)return t.projectName&&(e.projectName=t.projectName),t.iconUrl&&!e.iconUrl&&(e.iconUrl=t.iconUrl,e.iconPath=t.iconPath),t.bundleId&&!e.bundleId&&(e.bundleId=t.bundleId),e;if(!M.has(e.port)){M.add(e.port);let o=e.port;te(o,n).finally(()=>M.delete(o))}return e}async function te(e,n){let t=await h(e,"/","GET",ne,{"expo-platform":"ios"});if(!t||t.statusCode!==200)return;let o=w({port:e,framework:"one",bundleUrl:"",lastSeen:0},t,n);!o.projectName&&!o.iconUrl||(v.set(e,{projectName:o.projectName,iconUrl:o.iconUrl,iconPath:o.iconPath,bundleId:o.bundleId}),b.delete(e))}var d=new Set,g=new Set,y=new Set;async function oe(e,n){if(!await V(e))return null;let t="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[o,s,i,a]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),y.has(e)?Promise.resolve(null):h(e,"/","GET",J,{"expo-platform":"ios"}),g.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);a&&a.statusCode===200?g.delete(e):g.has(e)||g.add(e);let r=i?ee(i.body):null,c=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:null,u=r?.extra?.expoClient||r?.extra||{};if(r&&(c||typeof u.name=="string")){d.add(e);let U=c||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,L=U.includes("/one/metro-entry.bundle")?"one":"expo";return w({port:e,framework:L,bundleUrl:S(e,U),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,n)}if(s&&s.body.includes("packager-status:running"))return d.add(e),_(w(X(e,a&&a.statusCode===200?"expo":"metro"),i,n),n);if(o&&o.statusCode===200&&o.body.includes("sootsim-patched"))return d.delete(e),_(w({port:e,framework:"one",bundleUrl:S(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},i,n),n);if(s&&s.statusCode===200||a&&a.statusCode===200||i&&i.statusCode===200&&r!=null)return null;let m=await h(e,t,"HEAD");return m&&m.statusCode>0&&m.statusCode<400&&/application\/javascript/i.test(m.contentType||"")?(d.add(e),y.add(e),_(w({port:e,framework:"one",bundleUrl:S(e,`http://localhost:${e}${t}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,n),n)):(d.add(e),null)}function re(e){return!!e.bundleId?.trim().toLowerCase()?.startsWith("dev.sootsim.")}var b=new Map,se=3e4,ie=1500;function ae(e){return!e||e.framework==="metro"||e.framework==="unknown"}function ce(e){return e?S(e.port,e.bundleUrl)===e.bundleUrl:!0}function ue(e,n,t=Date.now()){if(n===0||e.pid!==n||!ce(e.result))return!1;let o=t-e.cachedAt;return!(e.result===null&&o>=se||ae(e.result)&&o>=ie)}async function Pe(e={}){await C();let n=await Y(e.excludePorts),t=new Set(n.map(r=>r.port));for(let r of[...b.keys()])t.has(r)||b.delete(r);for(let r of[...d])t.has(r)||d.delete(r);for(let r of[...g])t.has(r)||g.delete(r);for(let r of[...y])t.has(r)||y.delete(r);for(let r of[...v.keys()])t.has(r)||v.delete(r);let o=[],s=[];for(let{port:r,pid:c}of n){let u=b.get(r);if(u&&ue(u,c)){u.result&&o.push(u.result);continue}u&&u.pid!==c&&(d.delete(r),g.delete(r),y.delete(r),v.delete(r)),s.push({port:r,pid:c})}s.length>0&&(await Promise.all(s.map(c=>oe(c.port,e.buildIconProxyUrl)))).forEach((c,u)=>{let{port:l,pid:m}=s[u];m!==0&&b.set(l,{pid:m,result:c,cachedAt:Date.now()}),c&&o.push(c)});let i=new Map;for(let{port:r,pid:c}of n)c>0&&i.set(r,c);await Promise.all(o.map(async r=>{let c=i.get(r.port);if(!c)return;r.pid=c;let u=await Q(c);u&&(r.cwd=u)}));let a=new Set(i.values());for(let r of[...x.keys()])a.has(r)||x.delete(r);return o.filter(r=>!re(r))}function le(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function ke(e){let n=le(e);return n==="localhost"||n.endsWith(".localhost")||n==="0.0.0.0"||n==="::1"||/^127(?:\.\d{1,3}){3}$/.test(n)}import R from"fs";import f from"path";import{fileURLToPath as de}from"url";var P;function fe(){if(P!==void 0)return P;let e=f.dirname(de(import.meta.url));for(let n=0;n<12&&e!==f.dirname(e);n++){if(R.existsSync(f.join(e,"packages/sootsim-engine/package.json"))&&R.existsSync(f.join(e,"public/sootsim")))return P=e,e;e=f.dirname(e)}return P=null,null}function Ne(){if(process.env.SOOTSIM_HOME&&E())return null;let e=fe();if(!e)return null;let n=f.join(e,"public/sootsim");return R.existsSync(f.join(n,"index.html"))&&R.existsSync(f.join(n,"engine/index.html"))&&R.existsSync(f.join(n,"engine-tenant/worker.js"))?n:null}export{A as a,pe as b,I as c,ge as d,oe as e,Pe as f,ke as g,Ne as h};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.287 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.288 | (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};