sootsim 0.1.268 → 0.1.270

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 (155) hide show
  1. package/README.md +7 -3
  2. package/detox/index.ts +5 -2
  3. package/dist-cli/bin.js +4 -4
  4. package/dist-cli/chunks/{agent-KQSZFG6R.js → agent-4YXUPSJ2.js} +2 -2
  5. package/dist-cli/chunks/{agent-wrapper-DLDQVS7O.js → agent-wrapper-BMJPWHWK.js} +2 -2
  6. package/dist-cli/chunks/{app-fonts-6XVNNHAB.js → app-fonts-EDRH6ETC.js} +2 -2
  7. package/dist-cli/chunks/{assert-DLGUW4JS.js → assert-CRDV324D.js} +2 -2
  8. package/dist-cli/chunks/{auth-MTSJWWMS.js → auth-WYRQIJEN.js} +2 -2
  9. package/dist-cli/chunks/beta-NBANSL2S.js +2 -0
  10. package/dist-cli/chunks/{camera-MGJUBHWZ.js → camera-5TO6IVBP.js} +3 -3
  11. package/dist-cli/chunks/{chunk-LJGOZ77E.js → chunk-2J3E5TPS.js} +1 -1
  12. package/dist-cli/chunks/{chunk-GUXMUE5A.js → chunk-3VIMSXQZ.js} +2 -2
  13. package/dist-cli/chunks/{chunk-YUDUKMJV.js → chunk-3ZOF2BTJ.js} +1 -1
  14. package/dist-cli/chunks/{chunk-RCU4A7LU.js → chunk-44ISBOEK.js} +3 -3
  15. package/dist-cli/chunks/{chunk-F7DMZRQX.js → chunk-4HPWZVBS.js} +1 -1
  16. package/dist-cli/chunks/{chunk-K5ZMEBMQ.js → chunk-557IYHPC.js} +1 -1
  17. package/dist-cli/chunks/{chunk-RG6QF6DY.js → chunk-5IHDZOMR.js} +1 -1
  18. package/dist-cli/chunks/{chunk-XIBSRCKK.js → chunk-6CI73D3X.js} +2 -2
  19. package/dist-cli/chunks/chunk-6JLIPPNB.js +2 -0
  20. package/dist-cli/chunks/{chunk-YMTVQA6W.js → chunk-74HIBIJQ.js} +4 -4
  21. package/dist-cli/chunks/{chunk-6TXGR4HK.js → chunk-ABSUFSOH.js} +2 -2
  22. package/dist-cli/chunks/{chunk-NPSDN7D7.js → chunk-AG563BSO.js} +2 -2
  23. package/dist-cli/chunks/{chunk-IWJTCFAE.js → chunk-AMA3YGJ5.js} +2 -2
  24. package/dist-cli/chunks/{chunk-EG3JCOGS.js → chunk-AMVYE3F4.js} +2 -2
  25. package/dist-cli/chunks/{chunk-LOOHTTDV.js → chunk-B5IBLYEO.js} +3 -3
  26. package/dist-cli/chunks/{chunk-M2LYCMW4.js → chunk-DCJXHSIA.js} +2 -2
  27. package/dist-cli/chunks/{chunk-ITQ7WKNC.js → chunk-ERXCR7NU.js} +2 -2
  28. package/dist-cli/chunks/{chunk-KR4LGQWN.js → chunk-FCMEOOQE.js} +2 -2
  29. package/dist-cli/chunks/{chunk-YNMYUJYR.js → chunk-FHPXOPMC.js} +2 -2
  30. package/dist-cli/chunks/{chunk-V27FSRID.js → chunk-FNBFRG64.js} +1 -1
  31. package/dist-cli/chunks/{chunk-5JH5F4TM.js → chunk-GAYG7AO4.js} +1 -1
  32. package/dist-cli/chunks/chunk-GQDQO3KU.js +5 -0
  33. package/dist-cli/chunks/{chunk-JERNRAFO.js → chunk-HWGKGIWE.js} +2 -2
  34. package/dist-cli/chunks/{chunk-YLMP3AEX.js → chunk-IIXRM6BB.js} +2 -2
  35. package/dist-cli/chunks/{chunk-EPKHW3XW.js → chunk-LHMVSKKD.js} +3 -3
  36. package/dist-cli/chunks/chunk-M32JVXHU.js +5 -0
  37. package/dist-cli/chunks/{chunk-FGKDYXO3.js → chunk-M5VURHXD.js} +1 -1
  38. package/dist-cli/chunks/{chunk-6YB3URLB.js → chunk-MD24VVKT.js} +2 -2
  39. package/dist-cli/chunks/{chunk-CWC7QMVM.js → chunk-MYBY7OHL.js} +1 -1
  40. package/dist-cli/chunks/{chunk-7XWLSCXZ.js → chunk-NTO6SKS5.js} +1 -1
  41. package/dist-cli/chunks/{chunk-H2WCONSC.js → chunk-OUKH6UGN.js} +1 -1
  42. package/dist-cli/chunks/{chunk-OOVGROTR.js → chunk-PDFKRVDC.js} +1 -1
  43. package/dist-cli/chunks/{chunk-74QJWGDX.js → chunk-SDKIUJUO.js} +2 -2
  44. package/dist-cli/chunks/chunk-SLR3HWMB.js +13 -0
  45. package/dist-cli/chunks/{chunk-WUOPQL2J.js → chunk-SW5HZ5LK.js} +1 -1
  46. package/dist-cli/chunks/{chunk-WT3OYHU7.js → chunk-TIONGRTA.js} +3 -3
  47. package/dist-cli/chunks/{chunk-EH3A54PO.js → chunk-TLNGREAA.js} +2 -2
  48. package/dist-cli/chunks/{chunk-5MIRQ65V.js → chunk-TMWNOQAA.js} +1 -1
  49. package/dist-cli/chunks/{chunk-3MZJ2KVR.js → chunk-TZH4VH32.js} +3 -3
  50. package/dist-cli/chunks/{chunk-FGY5ESGU.js → chunk-UPRCATUH.js} +2 -2
  51. package/dist-cli/chunks/chunk-XTTXSDDA.js +1 -0
  52. package/dist-cli/chunks/{chunk-ZTOWO5CK.js → chunk-YKK2QUGO.js} +1 -1
  53. package/dist-cli/chunks/{chunk-SV6D5FXN.js → chunk-ZTKDHPA6.js} +2 -2
  54. package/dist-cli/chunks/chunk-ZZH2AFPJ.js +1 -0
  55. package/dist-cli/chunks/cli-version-BLKUTVJ2.js +2 -0
  56. package/dist-cli/chunks/{compat-IVBKZVGH.js → compat-IZEDAAUW.js} +3 -3
  57. package/dist-cli/chunks/{config-PQ3KBTIM.js → config-I4CXZ6M7.js} +2 -2
  58. package/dist-cli/chunks/{control-BKTYM5XP.js → control-DVF7UL5D.js} +2 -2
  59. package/dist-cli/chunks/daemon-FPKQPSSY.js +2 -0
  60. package/dist-cli/chunks/{debug-HRR2LK2J.js → debug-5X2F2WRP.js} +3 -3
  61. package/dist-cli/chunks/{desktop-466O4AQA.js → desktop-JHEYQZGF.js} +3 -3
  62. package/dist-cli/chunks/{detox-UH44KHQJ.js → detox-W64UENQG.js} +2 -2
  63. package/dist-cli/chunks/{device-FZLXTC3W.js → device-ZBSW2EHS.js} +2 -2
  64. package/dist-cli/chunks/{diagnose-RJMRI27P.js → diagnose-WER4X3P5.js} +2 -2
  65. package/dist-cli/chunks/drivers-6P53DLMM.js +2 -0
  66. package/dist-cli/chunks/{film-VL66UAM3.js → film-TIXNUTR6.js} +3 -3
  67. package/dist-cli/chunks/flow-53XFDYLL.js +2 -0
  68. package/dist-cli/chunks/help-MPYJLD7I.js +2 -0
  69. package/dist-cli/chunks/{hidden-runtime-alias-3ZAR7GCH.js → hidden-runtime-alias-R3JH3INM.js} +2 -2
  70. package/dist-cli/chunks/{home-paths-S2GRJWV3.js → home-paths-CNNARPCT.js} +2 -2
  71. package/dist-cli/chunks/inspect-JBDDYUA5.js +2 -0
  72. package/dist-cli/chunks/install-desktop-BBP7AMK4.js +2 -0
  73. package/dist-cli/chunks/{login-TR3YAEA2.js → login-6NCCZ3CZ.js} +4 -4
  74. package/dist-cli/chunks/{logout-WPY2DOYZ.js → logout-C4VKXUH4.js} +2 -2
  75. package/dist-cli/chunks/{maestro-DSG7V2BA.js → maestro-ZRGFQ3MV.js} +3 -3
  76. package/dist-cli/chunks/{maestro-generate-6KA7PCN5.js → maestro-generate-A5XZS5GC.js} +3 -3
  77. package/dist-cli/chunks/{mode-QUYGPNBW.js → mode-IFFZ55HM.js} +2 -2
  78. package/dist-cli/chunks/optional-demo-registry-TQZA65K3.js +2 -0
  79. package/dist-cli/chunks/{perf-ELBRUVVU.js → perf-44KZNTIV.js} +2 -2
  80. package/dist-cli/chunks/{record-6PDTULUN.js → record-GZLZNXYZ.js} +3 -3
  81. package/dist-cli/chunks/runtime-F4FCEPPB.js +2 -0
  82. package/dist-cli/chunks/{screenshot-command-E2A4VY6D.js → screenshot-command-GL3STSWK.js} +3 -3
  83. package/dist-cli/chunks/{screenshots-capture-TRCRHK2E.js → screenshots-capture-QSSBWHN6.js} +2 -2
  84. package/dist-cli/chunks/serve-AFK6X2Q3.js +42 -0
  85. package/dist-cli/chunks/{setup-5BHQNK2L.js → setup-DYSDNEUE.js} +3 -3
  86. package/dist-cli/chunks/{skills-NQLI6WXW.js → skills-YXWQ43PZ.js} +2 -2
  87. package/dist-cli/chunks/{storage-SKARYTYK.js → storage-C7IS5GTM.js} +2 -2
  88. package/dist-cli/chunks/store-LVF2C2XZ.js +2 -0
  89. package/dist-cli/chunks/telemetry-5V3OXY6C.js +2 -0
  90. package/dist-cli/chunks/{timeline-DYJ4GKGE.js → timeline-FDTIHQ5V.js} +2 -2
  91. package/dist-cli/chunks/{upgrade-PHUUE5QV.js → upgrade-VRQCFJEI.js} +2 -2
  92. package/dist-cli/chunks/upload-CRCPDN6G.js +2 -0
  93. package/dist-cli/chunks/{version-XQQSXS3E.js → version-MP6NKJ27.js} +2 -2
  94. package/dist-cli/chunks/web-XYPFJHKW.js +2 -0
  95. package/dist-cli/chunks/{what-happened-I2N3FFIV.js → what-happened-IM6UH24Q.js} +2 -2
  96. package/dist-lib/agent-daemon-client.cjs +1 -1
  97. package/dist-lib/agent-events.cjs +1 -1
  98. package/dist-lib/agent-identity.cjs +10 -10
  99. package/dist-lib/agent-sessions.cjs +29 -13
  100. package/dist-lib/attached-projects.cjs +33 -13
  101. package/dist-lib/auth/shared-session.cjs +1 -1
  102. package/dist-lib/backend-origin.cjs +1 -1
  103. package/dist-lib/beta.cjs +1 -1
  104. package/dist-lib/beta.mjs +1 -1
  105. package/dist-lib/bridge-constants.cjs +23 -6
  106. package/dist-lib/cli-constants.cjs +1 -1
  107. package/dist-lib/config.cjs +1 -1
  108. package/dist-lib/detox/index.cjs +6 -4
  109. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  110. package/dist-lib/home-paths.cjs +1 -1
  111. package/dist-lib/host/bridge-host.cjs +110 -54
  112. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  113. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  114. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  115. package/dist-lib/host/websocket-proxy.cjs +1 -1
  116. package/dist-lib/index.cjs +1 -1
  117. package/dist-lib/jump-to-source-babel.cjs +1 -1
  118. package/dist-lib/menu.cjs +1 -1
  119. package/dist-lib/menu.mjs +1 -1
  120. package/dist-lib/metro.cjs +1 -1
  121. package/dist-lib/profiles.cjs +1 -1
  122. package/dist-lib/render-mode.cjs +1 -1
  123. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  124. package/dist-lib/sdk.cjs +1 -1
  125. package/dist-lib/sdk.mjs +1 -1
  126. package/dist-lib/skills.cjs +220 -148
  127. package/dist-lib/vite.cjs +1 -1
  128. package/package.json +1 -1
  129. package/src/agent-daemon-client.ts +2 -2
  130. package/src/agent-identity.ts +7 -5
  131. package/src/attached-projects.ts +35 -11
  132. package/src/bridge-constants.ts +23 -4
  133. package/src/host/agent-host.ts +63 -14
  134. package/src/{agentbus-prompt.ts → team-machine-prompt.ts} +13 -20
  135. package/dist-cli/chunks/beta-7R4DRB3R.js +0 -2
  136. package/dist-cli/chunks/chunk-2LWDKYJ3.js +0 -1
  137. package/dist-cli/chunks/chunk-346C7547.js +0 -2
  138. package/dist-cli/chunks/chunk-CD2GF6PV.js +0 -5
  139. package/dist-cli/chunks/chunk-PN2LR6T4.js +0 -5
  140. package/dist-cli/chunks/chunk-Y3IYHVEX.js +0 -13
  141. package/dist-cli/chunks/chunk-ZHSXFJ7W.js +0 -1
  142. package/dist-cli/chunks/cli-version-362THKXA.js +0 -2
  143. package/dist-cli/chunks/daemon-SCTA3HTZ.js +0 -2
  144. package/dist-cli/chunks/drivers-S7D5OZQN.js +0 -2
  145. package/dist-cli/chunks/flow-IM5OXO5S.js +0 -2
  146. package/dist-cli/chunks/help-G5CN3KXU.js +0 -2
  147. package/dist-cli/chunks/inspect-WI7GXOH5.js +0 -2
  148. package/dist-cli/chunks/install-desktop-PVBWQQHY.js +0 -2
  149. package/dist-cli/chunks/optional-demo-registry-CROVHXTW.js +0 -2
  150. package/dist-cli/chunks/runtime-ITR3EUXS.js +0 -2
  151. package/dist-cli/chunks/serve-JLLSEZDN.js +0 -41
  152. package/dist-cli/chunks/store-VR5QRAYX.js +0 -2
  153. package/dist-cli/chunks/telemetry-PMYZDJGO.js +0 -2
  154. package/dist-cli/chunks/upload-OUKKXVNC.js +0 -2
  155. package/dist-cli/chunks/web-AZI3JODI.js +0 -2
package/README.md CHANGED
@@ -211,7 +211,9 @@ from the CLI. There is no iOS native build in the inner loop; Metro alone is
211
211
  enough. `sootsim open` starts a local bridge when no daemon is reachable; the
212
212
  guided setup installs the faster background daemon so later CLI commands reuse
213
213
  one server. A desktop GUI (Electron) is optional on top, via `sootsim desktop
214
- install`. In Electron, `File > New Window`
214
+ install`. Native Electron windows created by `sootsim open` belong to that CLI
215
+ session and close when the session exits; `sootsim desktop` keeps the persistent
216
+ desktop-app lifecycle. In Electron, `File > New Window`
215
217
  duplicates the focused simulator, while `File > New Simulator >` opens a new
216
218
  window for a selected device (same device list as the `Window >` menu).
217
219
 
@@ -233,13 +235,15 @@ plugins: [
233
235
  include: [__dirname],
234
236
  },
235
237
  ],
236
- 'react-native-reanimated/plugin',
238
+ 'react-native-worklets/plugin',
237
239
  ]
238
240
  ```
239
241
 
240
242
  The plugin adds an `srcloc="/absolute/path/App.tsx:12:3"` prop to JSX elements
241
243
  outside `node_modules`, `dist`, and `build`. Keep it before
242
- `react-native-reanimated/plugin` when reanimated is present.
244
+ `react-native-worklets/plugin` in a custom Babel stack that lists both plugins.
245
+ Apps using `babel-preset-expo` omit the explicit Worklets plugin because the
246
+ preset configures it automatically.
243
247
 
244
248
  ## CLI
245
249
 
package/detox/index.ts CHANGED
@@ -1366,6 +1366,7 @@ export const device = {
1366
1366
  async takeScreenshotStagesFast(
1367
1367
  namePrefix: string,
1368
1368
  stages: Array<{ label: string; offsetMs: number }>,
1369
+ options?: { skipWarmup?: boolean },
1369
1370
  ): Promise<Array<{ label: string; offsetMs: number; actualMs: number; path: string }>> {
1370
1371
  const page = getPage()
1371
1372
  const frames: Array<{
@@ -1398,7 +1399,9 @@ export const device = {
1398
1399
  // (a pump at higher cadence was tried and starved tap propagation —
1399
1400
  // the tenant React commit for setOpen never landed between
1400
1401
  // forceRender calls.)
1401
- await screenshot({ format: 'png' })
1402
+ if (!input.skipWarmup) {
1403
+ await screenshot({ format: 'png' })
1404
+ }
1402
1405
  const start = performance.now()
1403
1406
  type Snapshot = {
1404
1407
  label: string
@@ -1481,7 +1484,7 @@ export const device = {
1481
1484
  }
1482
1485
  return out
1483
1486
  },
1484
- { stages },
1487
+ { stages, skipWarmup: options?.skipWarmup === true },
1485
1488
  )
1486
1489
  ensureScreenshotDir()
1487
1490
  return frames.map((f) => {
package/dist-cli/bin.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
- import{a as w,b as u}from"./chunks/chunk-H2WCONSC.js";import"./chunks/chunk-RG6QF6DY.js";function f(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("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.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
+ import{a as w,b as u}from"./chunks/chunk-OUKH6UGN.js";import"./chunks/chunk-5IHDZOMR.js";function f(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("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",f);process.on("uncaughtException",f);var h=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,A=new Set(["desktop"]);function k(t){!h||!A.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=u(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:t}=await import("./chunks/hidden-runtime-alias-3ZAR7GCH.js");e=t(e)}{let{trackCliEvent:t}=await import("./chunks/telemetry-PMYZDJGO.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-S2GRJWV3.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
- `)}async function c(t){let{flushCliTelemetry:a}=await import("./chunks/telemetry-PMYZDJGO.js");await a(),process.exit(t)}if(e.version){let{getCliVersion:t}=await import("./chunks/cli-version-362THKXA.js"),{IS_BETA:a,BETA_LABEL:i}=await import("./chunks/beta-7R4DRB3R.js"),p=a?` \xB7 ${i}`:"";console.log(`sootsim v${t()}${p}`);let{readActiveRuntime:b}=await import("./chunks/home-paths-S2GRJWV3.js"),l=b();console.log(l?`runtime v${l}`:"runtime not installed"),await c(0)}if(e.help&&!e.command){let{printHelp:t}=await import("./chunks/help-G5CN3KXU.js");t(),await c(0)}var o=e.globalFlags.port,r=e.verbose,m=e.globalFlags.device,d=e.globalFlags.theme,v=e.globalFlags.driver,_=e.globalFlags.headless===!0,g=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,n=g?["--sim",g,...e.commandArgs]:e.commandArgs;if(m||d){let{settingsStore:t}=await import("./chunks/store-VR5QRAYX.js"),a={};m&&(a.deviceModel=m),d&&(a.colorScheme=d),t.apply(a)}if(!e.command&&e.commandArgs.length===0){let{runSetup:t,shouldRunSetupForBareCommand:a}=await import("./chunks/setup-5BHQNK2L.js");a()&&(await t(["--from-welcome"]),await c(0));let{printHelp:i}=await import("./chunks/help-G5CN3KXU.js");i(),await c(0)}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let a=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${a}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:t}=await import("./chunks/help-G5CN3KXU.js");t(),await c(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:i}=await import("./chunks/skills-NQLI6WXW.js");await i(e.commandArgs),await c(0)}let t=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",a=e.commandArgs.find(i=>!i.startsWith("-"));if(!(s==="shell"||s==="perf"))if(t&&!a){let{printGroupHelp:i}=await import("./chunks/help-G5CN3KXU.js");i(s)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-G5CN3KXU.js");i(t&&a?a:s,{prefer:t&&a?"verb":"command",group:t&&a?s:void 0}),await c(0)}}k(s);if(w.has(s)){let{runInspect:t}=await import("./chunks/inspect-WI7GXOH5.js");await t([s,...n],{port:o,verbose:r})}else switch(s){case"assert":{let{runAssert:t}=await import("./chunks/assert-DLGUW4JS.js");await t(e.commandArgs);break}case"detox":{let{runDetox:t}=await import("./chunks/detox-UH44KHQJ.js");await t(e.commandArgs,{port:o,verbose:r});break}case"maestro":{let{runMaestro:t}=await import("./chunks/maestro-DSG7V2BA.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"record":{let{runRecord:t}=await import("./chunks/record-6PDTULUN.js");await t(n,{port:o,verbose:r});break}case"film":{let{runFilm:t}=await import("./chunks/film-VL66UAM3.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"storage":{let{runStorage:t}=await import("./chunks/storage-SKARYTYK.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"perf":{let{runPerf:t}=await import("./chunks/perf-ELBRUVVU.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"screenshot":{let{runScreenshotCommand:t}=await import("./chunks/screenshot-command-E2A4VY6D.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"mode":{let{runMode:t}=await import("./chunks/mode-QUYGPNBW.js");await t(n,{port:o,verbose:r});break}case"inspect":{let{runInspect:t}=await import("./chunks/inspect-WI7GXOH5.js");await t(n,{port:o,verbose:r});break}case"debug":{let{runDebug:t}=await import("./chunks/debug-HRR2LK2J.js");await t(n,{port:o,verbose:r});break}case"timeline":{let{runTimeline:t}=await import("./chunks/timeline-DYJ4GKGE.js");await t(n,{port:o,verbose:r});break}case"what-happened":{let{runWhatHappened:t}=await import("./chunks/what-happened-I2N3FFIV.js");await t(n,{port:o,verbose:r});break}case"open":{let{runOpenCommand:t}=await import("./chunks/control-BKTYM5XP.js");await t(n,{port:o});break}case"use":{let{runUseCommand:t}=await import("./chunks/control-BKTYM5XP.js");await t(n,{port:o});break}case"claim":{let{runClaimCommand:t}=await import("./chunks/control-BKTYM5XP.js");await t(n,{port:o});break}case"close":{let{runCloseCommand:t}=await import("./chunks/control-BKTYM5XP.js");await t(n,{port:o});break}case"device":{let{runDeviceCommand:t}=await import("./chunks/device-FZLXTC3W.js");await t(n,{port:o});break}case"compat":{let{runCompat:t}=await import("./chunks/compat-IVBKZVGH.js");await t(e.commandArgs);break}case"desktop":{let{runDesktop:t}=await import("./chunks/desktop-466O4AQA.js");await t(e.commandArgs,{port:o,device:m,driver:v});break}case"login":{let{runLogin:t}=await import("./chunks/login-TR3YAEA2.js");await t(e.commandArgs);break}case"logout":{let{runLogout:t}=await import("./chunks/logout-WPY2DOYZ.js");await t();break}case"auth":{let{runAuth:t}=await import("./chunks/auth-MTSJWWMS.js");await t(e.commandArgs);break}case"setup":{let{runSetup:t}=await import("./chunks/setup-5BHQNK2L.js");await t(e.commandArgs);break}case"serve":{let{runServe:t}=await import("./chunks/serve-JLLSEZDN.js");await t(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:t}=await import("./chunks/daemon-SCTA3HTZ.js");await t(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:t}=await import("./chunks/runtime-ITR3EUXS.js");await t(e.commandArgs);break}case"upgrade":{let{runUpgrade:t}=await import("./chunks/upgrade-PHUUE5QV.js");await t(e.commandArgs);break}case"version":{let{runVersion:t}=await import("./chunks/version-XQQSXS3E.js");await t(e.commandArgs);break}case"agent":{let{runAgentCommand:t}=await import("./chunks/agent-KQSZFG6R.js"),a=await t(e.commandArgs);process.exit(a)}case"agent-wrapper":{let{runAgentWrapper:t}=await import("./chunks/agent-wrapper-DLDQVS7O.js"),a=await t(e.commandArgs);process.exit(a)}case"skill":{let{runSkill:t}=await import("./chunks/skills-NQLI6WXW.js");await t(e.commandArgs);break}case"app-fonts":{let{runAppFonts:t}=await import("./chunks/app-fonts-6XVNNHAB.js");await t(e.commandArgs);break}case"config":{let{runConfig:t}=await import("./chunks/config-PQ3KBTIM.js");await t(e.commandArgs);break}default:console.error(` unknown command: ${s}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
10
+ `),process.exit(1))}var e=u(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:t}=await import("./chunks/hidden-runtime-alias-R3JH3INM.js");e=t(e)}{let{trackCliEvent:t}=await import("./chunks/telemetry-5V3OXY6C.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-CNNARPCT.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
+ `)}async function c(t){let{flushCliTelemetry:a}=await import("./chunks/telemetry-5V3OXY6C.js");await a(),process.exit(t)}if(e.version){let{getCliVersion:t}=await import("./chunks/cli-version-BLKUTVJ2.js"),{IS_BETA:a,BETA_LABEL:i}=await import("./chunks/beta-NBANSL2S.js"),p=a?` \xB7 ${i}`:"";console.log(`sootsim v${t()}${p}`);let{readActiveRuntime:b}=await import("./chunks/home-paths-CNNARPCT.js"),l=b();console.log(l?`runtime v${l}`:"runtime not installed"),await c(0)}if(e.help&&!e.command){let{printHelp:t}=await import("./chunks/help-MPYJLD7I.js");t(),await c(0)}var o=e.globalFlags.port,r=e.verbose,m=e.globalFlags.device,d=e.globalFlags.theme,v=e.globalFlags.driver,_=e.globalFlags.headless===!0,g=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,n=g?["--sim",g,...e.commandArgs]:e.commandArgs;if(m||d){let{settingsStore:t}=await import("./chunks/store-LVF2C2XZ.js"),a={};m&&(a.deviceModel=m),d&&(a.colorScheme=d),t.apply(a)}if(!e.command&&e.commandArgs.length===0){let{runSetup:t,shouldRunSetupForBareCommand:a}=await import("./chunks/setup-DYSDNEUE.js");a()&&(await t(["--from-welcome"]),await c(0));let{printHelp:i}=await import("./chunks/help-MPYJLD7I.js");i(),await c(0)}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let a=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${a}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:t}=await import("./chunks/help-MPYJLD7I.js");t(),await c(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:i}=await import("./chunks/skills-YXWQ43PZ.js");await i(e.commandArgs),await c(0)}let t=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",a=e.commandArgs.find(i=>!i.startsWith("-"));if(!(s==="shell"||s==="perf"))if(t&&!a){let{printGroupHelp:i}=await import("./chunks/help-MPYJLD7I.js");i(s)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-MPYJLD7I.js");i(t&&a?a:s,{prefer:t&&a?"verb":"command",group:t&&a?s:void 0}),await c(0)}}k(s);if(w.has(s)){let{runInspect:t}=await import("./chunks/inspect-JBDDYUA5.js");await t([s,...n],{port:o,verbose:r})}else switch(s){case"assert":{let{runAssert:t}=await import("./chunks/assert-CRDV324D.js");await t(e.commandArgs);break}case"detox":{let{runDetox:t}=await import("./chunks/detox-W64UENQG.js");await t(e.commandArgs,{port:o,verbose:r});break}case"maestro":{let{runMaestro:t}=await import("./chunks/maestro-ZRGFQ3MV.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"record":{let{runRecord:t}=await import("./chunks/record-GZLZNXYZ.js");await t(n,{port:o,verbose:r});break}case"film":{let{runFilm:t}=await import("./chunks/film-TIXNUTR6.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"storage":{let{runStorage:t}=await import("./chunks/storage-C7IS5GTM.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"perf":{let{runPerf:t}=await import("./chunks/perf-44KZNTIV.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"screenshot":{let{runScreenshotCommand:t}=await import("./chunks/screenshot-command-GL3STSWK.js"),a=await t(n,{port:o,verbose:r});process.exit(typeof a=="number"?a:0)}case"mode":{let{runMode:t}=await import("./chunks/mode-IFFZ55HM.js");await t(n,{port:o,verbose:r});break}case"inspect":{let{runInspect:t}=await import("./chunks/inspect-JBDDYUA5.js");await t(n,{port:o,verbose:r});break}case"debug":{let{runDebug:t}=await import("./chunks/debug-5X2F2WRP.js");await t(n,{port:o,verbose:r});break}case"timeline":{let{runTimeline:t}=await import("./chunks/timeline-FDTIHQ5V.js");await t(n,{port:o,verbose:r});break}case"what-happened":{let{runWhatHappened:t}=await import("./chunks/what-happened-IM6UH24Q.js");await t(n,{port:o,verbose:r});break}case"open":{let{runOpenCommand:t}=await import("./chunks/control-DVF7UL5D.js");await t(n,{port:o});break}case"use":{let{runUseCommand:t}=await import("./chunks/control-DVF7UL5D.js");await t(n,{port:o});break}case"claim":{let{runClaimCommand:t}=await import("./chunks/control-DVF7UL5D.js");await t(n,{port:o});break}case"close":{let{runCloseCommand:t}=await import("./chunks/control-DVF7UL5D.js");await t(n,{port:o});break}case"device":{let{runDeviceCommand:t}=await import("./chunks/device-ZBSW2EHS.js");await t(n,{port:o});break}case"compat":{let{runCompat:t}=await import("./chunks/compat-IZEDAAUW.js");await t(e.commandArgs);break}case"desktop":{let{runDesktop:t}=await import("./chunks/desktop-JHEYQZGF.js");await t(e.commandArgs,{port:o,device:m,driver:v});break}case"login":{let{runLogin:t}=await import("./chunks/login-6NCCZ3CZ.js");await t(e.commandArgs);break}case"logout":{let{runLogout:t}=await import("./chunks/logout-C4VKXUH4.js");await t();break}case"auth":{let{runAuth:t}=await import("./chunks/auth-WYRQIJEN.js");await t(e.commandArgs);break}case"setup":{let{runSetup:t}=await import("./chunks/setup-DYSDNEUE.js");await t(e.commandArgs);break}case"serve":{let{runServe:t}=await import("./chunks/serve-AFK6X2Q3.js");await t(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:t}=await import("./chunks/daemon-FPKQPSSY.js");await t(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:t}=await import("./chunks/runtime-F4FCEPPB.js");await t(e.commandArgs);break}case"upgrade":{let{runUpgrade:t}=await import("./chunks/upgrade-VRQCFJEI.js");await t(e.commandArgs);break}case"version":{let{runVersion:t}=await import("./chunks/version-MP6NKJ27.js");await t(e.commandArgs);break}case"agent":{let{runAgentCommand:t}=await import("./chunks/agent-4YXUPSJ2.js"),a=await t(e.commandArgs);process.exit(a)}case"agent-wrapper":{let{runAgentWrapper:t}=await import("./chunks/agent-wrapper-BMJPWHWK.js"),a=await t(e.commandArgs);process.exit(a)}case"skill":{let{runSkill:t}=await import("./chunks/skills-YXWQ43PZ.js");await t(e.commandArgs);break}case"app-fonts":{let{runAppFonts:t}=await import("./chunks/app-fonts-EDRH6ETC.js");await t(e.commandArgs);break}case"config":{let{runConfig:t}=await import("./chunks/config-I4CXZ6M7.js");await t(e.commandArgs);break}default:console.error(` unknown command: ${s}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.268 | (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,m as k,n as D,o as x,p as g,q as O,r as C}from"./chunk-CD2GF6PV.js";import"./chunk-WUOPQL2J.js";import{c as $}from"./chunk-SV6D5FXN.js";import"./chunk-EG3JCOGS.js";import"./chunk-M2LYCMW4.js";import"./chunk-XIBSRCKK.js";import"./chunk-346C7547.js";import"./chunk-YMTVQA6W.js";import"./chunk-ZTOWO5CK.js";import{j as y}from"./chunk-K5ZMEBMQ.js";import"./chunk-F7DMZRQX.js";import"./chunk-YUDUKMJV.js";import"./chunk-OOVGROTR.js";import"./chunk-RG6QF6DY.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.270 | (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-GQDQO3KU.js";import"./chunk-SW5HZ5LK.js";import{c as $}from"./chunk-ZTKDHPA6.js";import"./chunk-AMVYE3F4.js";import"./chunk-DCJXHSIA.js";import"./chunk-6CI73D3X.js";import"./chunk-6JLIPPNB.js";import"./chunk-74HIBIJQ.js";import"./chunk-YKK2QUGO.js";import{j as y}from"./chunk-557IYHPC.js";import"./chunk-4HPWZVBS.js";import"./chunk-3ZOF2BTJ.js";import"./chunk-PDFKRVDC.js";import"./chunk-5IHDZOMR.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.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as M}from"./chunk-WUOPQL2J.js";import"./chunk-RG6QF6DY.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as I,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as M}from"./chunk-SW5HZ5LK.js";import"./chunk-5IHDZOMR.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as I,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
3
3
  `)}catch{}}return{exited:a,on(s,i){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(i),()=>{e?.delete(i)}},request(s,i){if(g)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,f)=>{r.set(e,{resolve:l=>p(l),reject:f,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:i})})},notify(s,i){n({jsonrpc:"2.0",method:s,params:i})},async shutdown(s=1500){if(g)return;try{t.stdin.end()}catch{}let i=setTimeout(()=>{if(!g)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(i)}},kill(s="SIGTERM"){if(!g)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return I(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let g=t[u];g&&(r[g]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: sootsim agent-wrapper --session-id <id> --project-id <id>
4
4
  --provider codex|claude --cwd <path>
5
5
  --prompt-in <fifo> --events-out <fifo>
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as p}from"./chunk-7XWLSCXZ.js";import"./chunk-RG6QF6DY.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.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as p}from"./chunk-NTO6SKS5.js";import"./chunk-5IHDZOMR.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.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-RG6QF6DY.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.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-5IHDZOMR.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.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as t}from"./chunk-6TXGR4HK.js";import{d as s}from"./chunk-GUXMUE5A.js";import"./chunk-K5ZMEBMQ.js";import"./chunk-RG6QF6DY.js";function i(){console.log(`
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as t}from"./chunk-ABSUFSOH.js";import{d as s}from"./chunk-3VIMSXQZ.js";import"./chunk-557IYHPC.js";import"./chunk-5IHDZOMR.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.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d}from"./chunk-3ZOF2BTJ.js";import"./chunk-5IHDZOMR.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.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{m as d}from"./chunk-KR4LGQWN.js";import"./chunk-FGKDYXO3.js";import{g as l,i as m,k as p}from"./chunk-ITQ7WKNC.js";import"./chunk-346C7547.js";import"./chunk-YMTVQA6W.js";import"./chunk-K5ZMEBMQ.js";import"./chunk-RG6QF6DY.js";function f(){console.log(`
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{m as d}from"./chunk-FCMEOOQE.js";import"./chunk-M5VURHXD.js";import{g as l,i as m,k as p}from"./chunk-ERXCR7NU.js";import"./chunk-6JLIPPNB.js";import"./chunk-74HIBIJQ.js";import"./chunk-557IYHPC.js";import"./chunk-5IHDZOMR.js";function f(){console.log(`
3
3
  sootsim do scan \u2014 inject a barcode scan
4
4
 
5
5
  usage:
@@ -15,6 +15,6 @@ options:
15
15
  --port <p> WS bridge port (default: 7668)
16
16
 
17
17
  examples:
18
- sootsim do scan "agentbus://connect?url=http://10.0.0.5:7777&token=abc"
18
+ sootsim do scan "tm://connect?url=http://10.0.0.5:7777&token=abc"
19
19
  sootsim do scan "https://example.com" --format qr_code
20
20
  `)}async function h(e,g={}){let a=l(e,{port:g.port,stripBooleanFlags:["--help","-h"],stripValueFlags:["--format"]}),r=a.positional,o=r[0];(!o||o==="help"||e.includes("--help")||e.includes("-h"))&&(f(),process.exit(o?0:1)),o!=="scan"&&(console.error(` unknown scan subcommand: ${o}`),f(),process.exit(1));let t=r[1];t||(console.error(" usage: sootsim do scan <text>"),process.exit(1));let i=e.indexOf("--format"),c=i>=0?e[i+1]:"qr_code",n=m(a);try{await p(n,`globalThis.__sootsimCameraInjectScan?.(${JSON.stringify(t)}, ${JSON.stringify(c)}) ?? false`)?console.log(` injected ${c} scan: ${t}`):(console.error(" no active barcode scan session \u2014 open a screen with a scanning <CameraView> first"),process.exit(1))}catch(s){console.error(` scan failed: ${s instanceof Error?s.message:s}`),await d(n),process.exit(1)}finally{n.close()}}export{h as runCamera};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{execFileSync as d,spawn as g}from"child_process";import{existsSync as m}from"fs";import{homedir as h}from"os";import{join as C}from"path";var f=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","~/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","~/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","~/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","~/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Arc.app/Contents/MacOS/Arc","~/Applications/Arc.app/Contents/MacOS/Arc"],O=["/usr/bin/google-chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/microsoft-edge","/usr/bin/brave-browser","/snap/bin/chromium"],w=["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe","C:\\Program Files (x86)\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"],U=["google-chrome","chromium","chromium-browser","microsoft-edge","brave-browser"],M=["chrome","msedge","brave"];function A(r){return r.startsWith("~/")?C(h(),r.slice(2)):r}function a(r){for(let n of r){let o=A(n);if(m(o))return o}return null}function x(r,n){try{let e=d(n==="win32"?"where":"which",[r],{encoding:"utf8",timeout:1500,stdio:["ignore","pipe","ignore"]}).trim();return e?e.split(/\r?\n/)[0]:null}catch{return null}}function c(r=process.platform){let n=process.env.CHROME_PATH||process.env.CHROMIUM_PATH;if(n&&m(n))return n;let o=a(r==="darwin"?f:r==="win32"?w:O);if(o)return o;let e=r==="win32"?M:U;for(let t of e){let i=x(t,r);if(i)return i}return null}function p(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform;return n.newWindow?s(r,{...n,platform:o,newWindow:!0}):o==="darwin"?{command:"open",args:n.background===!1?[r]:["-g",r],via:"system"}:o==="win32"?{command:"cmd",args:["/c","start","",r],via:"system"}:{command:"xdg-open",args:[r],via:"system"}}function s(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform,e="chromiumBinary"in n?n.chromiumBinary:c(o);if(!e)throw new Error("browser launch requires Chrome, Chromium, Edge, Brave, or Arc");let t=[];return n.newWindow!==!1&&t.push("--new-window"),t.push(r),{command:e,args:t,via:"chromium",target:e}}async function l(r,n,o){return new Promise((e,t)=>{let i=g(r,n,{detached:o,stdio:"ignore"});i.once("error",t),i.once("spawn",()=>{o&&i.unref(),e(i.pid)})})}async function u(r,n={}){let o=p(r,n),e=await l(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function b(r,n={}){let o=s(r,n),e=await l(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function v(r,n={}){await u(r,n)}export{c as a,u as b,b as c,v as d};
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{o as d}from"./chunk-K5ZMEBMQ.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.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{o as d}from"./chunk-557IYHPC.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,2 +1,2 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.270 | (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.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as y,b,c as R,d as r}from"./chunk-NPSDN7D7.js";import{d as w}from"./chunk-ITQ7WKNC.js";import{G as d,H as u,I as $,l as p,z as g}from"./chunk-K5ZMEBMQ.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.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as y,b,c as R,d as r}from"./chunk-AG563BSO.js";import{d as w}from"./chunk-ERXCR7NU.js";import{G as d,H as u,I as $,l as p,z as g}from"./chunk-557IYHPC.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-S2GRJWV3.js"),n=s();if(!e(n))return!1;let o=w();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(y).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: ${R}`)}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-CNNARPCT.js"),n=s();if(!e(n))return!1;let o=w();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(y).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: ${R}`)}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,2 +1,2 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.270 | (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,4 +1,4 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{randomUUID as D}from"node:crypto";import r from"node:fs";import{homedir as x}from"node:os";import o from"node:path";var h="SOOTSIM_HOME",k="active",L="daemon.json",O="dev-bridge.json",A="config.json",S=3e4;function i(){let e=process.env[h];return e&&e.length>0?o.resolve(e):o.join(x(),".sootsim")}function E(){if(process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1")return!1;let e=process.env.SOOTSIM_DEV;if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;let t=process.argv[1];if(!t)return!1;try{return r.realpathSync(t).includes(`${o.sep}packages${o.sep}sootsim${o.sep}`)}catch{return!1}}function N(){return process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1"?!1:process.env.IS_TAMAGUI_DEV==="1"}function J(){return E()||N()}function m(){return o.join(i(),"runtimes")}function _(e){return o.join(m(),e)}function b(){return o.join(m(),k)}function g(){return o.join(i(),"electron")}function V(){return o.join(g(),"userData")}function H(e){return o.join(g(),e)}function P(){return o.join(i(),"profiles")}function j(){return o.join(i(),"daemon-app")}function I(){return o.join(j(),"SootSim Daemon.app")}function G(){return o.join(I(),"Contents","MacOS","sootsim-daemon")}function w(){return o.join(i(),"cache")}function a(){return o.join(i(),L)}function f(){return o.join(i(),O)}function d(){return o.join(i(),A)}function y(){try{let e=r.readFileSync(d(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function v(e){s();let t=y(),u={...t,...e};e.settings&&typeof e.settings=="object"&&(u.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let c=`${d()}.tmp`;return r.writeFileSync(c,`${JSON.stringify(u,null,2)}
3
3
  `,"utf8"),r.renameSync(c,d()),u}function K(){return y().telemetry!==!1}function W(){let e=y().anonymousId;if(typeof e=="string"&&e.trim())return e;let t=`anon-cli-${D()}`;return v({anonymousId:t}),t}function X(e){v({telemetry:e})}function l(){return o.join(i(),"runtime-upgraded.json")}function Y(e){s();let t=`${l()}.tmp`;r.writeFileSync(t,`${JSON.stringify(e)}
4
4
  `,"utf8"),r.renameSync(t,l())}function q(){try{let e=r.readFileSync(l(),"utf8");r.unlinkSync(l());let t=JSON.parse(e);return typeof t?.to!="string"||!t.to?null:{from:typeof t.from=="string"?t.from:null,to:t.to,at:typeof t.at=="number"?t.at:0}}catch{return null}}function s(){r.mkdirSync(i(),{recursive:!0}),r.mkdirSync(m(),{recursive:!0}),r.mkdirSync(g(),{recursive:!0}),r.mkdirSync(P(),{recursive:!0}),r.mkdirSync(w(),{recursive:!0})}function F(){try{let e=r.readFileSync(b(),"utf8").trim();return e.length>0?e:null}catch{return null}}function z(e){r.mkdirSync(m(),{recursive:!0}),r.writeFileSync(b(),`${e}
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.270 | (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};
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{k as n}from"./chunk-OOVGROTR.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.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{k as n}from"./chunk-PDFKRVDC.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
3
3
  `)}export{g as a};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ var t=4001,r="sootsim close";var e="http://localhost:5173/";export{t as a,r as b,e as c};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
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 b}from"child_process";import{readFileSync as _}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 _(`/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=_(`/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 g=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,g,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,g,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=b("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
3
- `)[1];return t&&t.trim().split(/\s+/)[0]||null}catch{return null}}}function k(){return r=>{try{let t=b("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
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,N="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)|^(?:agentbus|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[N])return U(process.env[N]);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
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
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
+ `)[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
+ `)[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)+`
5
5
  `)}function ir(){f(a(),{force:!0})}export{C as a,Y as b,H as c,tr as d,nr as e,er as f,ir as g};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as o}from"./chunk-GUXMUE5A.js";var c=["ghs_","ghp_","gho_","ghu_","github_pat_"];function d(n){return!!(n&&n.length>=20&&c.some(t=>n.startsWith(t)))}function p(){let n=process.env.CONTRAST_INSTALLATION_TOKEN?.trim(),t=process.env.GITHUB_TOKEN?.trim(),e=n||t;if(!d(e))return null;let r=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!r)return null;let[i,s]=r.includes("/")?r.split("/",2):[null,null],u=(process.env.CONTRAST_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),l=(process.env.CONTRAST_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:e,repoId:r,repositoryId:u||null,owner:i||null,repo:s||null,installationId:l||null,source:n?"contrast-runner":"github-actions"}}function a(){let n=process.env.SOOTSIM_API_KEY?.trim();if(n&&n.startsWith("sk_sootsim_"))return{kind:"api-key",secret:n,source:"env"};let t=p();if(t)return t;let e=o();return e?.token?{kind:"session",token:e.token,origin:e.origin}:null}function g(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function _(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}export{a,g as b,_ as c};
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as o}from"./chunk-3VIMSXQZ.js";var c=["ghs_","ghp_","gho_","ghu_","github_pat_"];function d(n){return!!(n&&n.length>=20&&c.some(t=>n.startsWith(t)))}function p(){let n=process.env.CONTRAST_INSTALLATION_TOKEN?.trim(),t=process.env.GITHUB_TOKEN?.trim(),e=n||t;if(!d(e))return null;let r=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!r)return null;let[i,s]=r.includes("/")?r.split("/",2):[null,null],u=(process.env.CONTRAST_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),l=(process.env.CONTRAST_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:e,repoId:r,repositoryId:u||null,owner:i||null,repo:s||null,installationId:l||null,source:n?"contrast-runner":"github-actions"}}function a(){let n=process.env.SOOTSIM_API_KEY?.trim();if(n&&n.startsWith("sk_sootsim_"))return{kind:"api-key",secret:n,source:"env"};let t=p();if(t)return t;let e=o();return e?.token?{kind:"session",token:e.token,origin:e.origin}:null}function g(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function _(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}export{a,g as b,_ as c};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{G as N,H as U,I as A,k as $,l as C,u as T,x as V}from"./chunk-K5ZMEBMQ.js";import F from"node:fs";import H from"node:path";function D(n){try{return F.readdirSync(n.runtimesDir(),{withFileTypes:!0}).filter(s=>s.isDirectory()).map(s=>s.name).sort(I)}catch{return[]}}function M(n,s){return H.posix.basename(n.tarballPath(s))}function I(n,s){let a=m=>{let d=m.indexOf("-"),p=d>=0?m.slice(0,d):m,x=d>=0?m.slice(d+1):"",b=p.split(".").map(e=>Number.parseInt(e,10));return b.some(e=>!Number.isFinite(e))?[[Number.POSITIVE_INFINITY],m]:[b,x]},[o,c]=a(n),[f,y]=a(s);for(let m=0;m<Math.max(o.length,f.length);m++){let d=o[m]??0,p=f[m]??0;if(d!==p)return d-p}return c===y?0:c?y?c<y?-1:1:-1:1}import{spawn as L}from"node:child_process";import G from"node:crypto";import u from"node:fs";import O from"node:path";import{Readable as z}from"node:stream";import{pipeline as W}from"node:stream/promises";function E(n){function s(){try{let e=JSON.parse(u.readFileSync(n.configFile(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function a(e){let t=s();return(e||process.env[n.env.cdnOrigin]||t.cdnOrigin||n.defaultCdnOrigin).replace(/\/+$/,"")}function o(e){let t=s();return e||process.env[n.env.channel]||t.runtimeChannel||"stable"}function c(){let e=process.env[n.env.pin];if(e&&e.trim())return e.trim();let t=s();return typeof t.runtimeVersion=="string"&&t.runtimeVersion.trim()?t.runtimeVersion.trim():null}function f(e){let t=new URL(`${a(e)}${n.manifestPath}`);return t.searchParams.set("t",String(Date.now())),t.toString()}function y(e,t){return`${a(t)}${n.tarballPath(e)}`}async function m(e){let t=f(e),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function d(e,t={}){let r=o(t.channel),i=t.version||c()||e.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let g=e.versions[i];if(!g)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:g}}async function p(e={}){n.ensureHome();let t=a(e.cdnOrigin),r=await m(t),{version:i,channel:g,entry:l}=d(r,e),v=n.runtimeDir(i),h=e.setActive!==!1;if(!e.force&&u.existsSync(O.join(v,n.installedMarker)))return h&&n.writeActiveRuntime(i),{version:i,channel:g,cdnOrigin:t,runtimeDir:v,installed:!1,activated:h,manifest:r};let P=l.tarball||y(i,t),w=O.join(n.cacheDir(),M(n,i));process.stderr.write(`${n.id}: downloading runtime ${i}\u2026
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{G as N,H as U,I as A,k as $,l as C,u as T,x as V}from"./chunk-557IYHPC.js";import F from"node:fs";import H from"node:path";function D(n){try{return F.readdirSync(n.runtimesDir(),{withFileTypes:!0}).filter(s=>s.isDirectory()).map(s=>s.name).sort(I)}catch{return[]}}function M(n,s){return H.posix.basename(n.tarballPath(s))}function I(n,s){let a=m=>{let d=m.indexOf("-"),p=d>=0?m.slice(0,d):m,x=d>=0?m.slice(d+1):"",b=p.split(".").map(e=>Number.parseInt(e,10));return b.some(e=>!Number.isFinite(e))?[[Number.POSITIVE_INFINITY],m]:[b,x]},[o,c]=a(n),[f,y]=a(s);for(let m=0;m<Math.max(o.length,f.length);m++){let d=o[m]??0,p=f[m]??0;if(d!==p)return d-p}return c===y?0:c?y?c<y?-1:1:-1:1}import{spawn as L}from"node:child_process";import G from"node:crypto";import u from"node:fs";import O from"node:path";import{Readable as z}from"node:stream";import{pipeline as W}from"node:stream/promises";function E(n){function s(){try{let e=JSON.parse(u.readFileSync(n.configFile(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function a(e){let t=s();return(e||process.env[n.env.cdnOrigin]||t.cdnOrigin||n.defaultCdnOrigin).replace(/\/+$/,"")}function o(e){let t=s();return e||process.env[n.env.channel]||t.runtimeChannel||"stable"}function c(){let e=process.env[n.env.pin];if(e&&e.trim())return e.trim();let t=s();return typeof t.runtimeVersion=="string"&&t.runtimeVersion.trim()?t.runtimeVersion.trim():null}function f(e){let t=new URL(`${a(e)}${n.manifestPath}`);return t.searchParams.set("t",String(Date.now())),t.toString()}function y(e,t){return`${a(t)}${n.tarballPath(e)}`}async function m(e){let t=f(e),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function d(e,t={}){let r=o(t.channel),i=t.version||c()||e.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let g=e.versions[i];if(!g)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:g}}async function p(e={}){n.ensureHome();let t=a(e.cdnOrigin),r=await m(t),{version:i,channel:g,entry:l}=d(r,e),v=n.runtimeDir(i),h=e.setActive!==!1;if(!e.force&&u.existsSync(O.join(v,n.installedMarker)))return h&&n.writeActiveRuntime(i),{version:i,channel:g,cdnOrigin:t,runtimeDir:v,installed:!1,activated:h,manifest:r};let P=l.tarball||y(i,t),w=O.join(n.cacheDir(),M(n,i));process.stderr.write(`${n.id}: downloading runtime ${i}\u2026
3
3
  `),await J(P,w),process.stderr.write(`${n.id}: extracting runtime ${i}\u2026
4
4
  `);let k=await Y(w);if(k!==l.sha256)throw u.rmSync(w,{force:!0}),new Error(`sha256 mismatch for runtime ${i}: expected ${l.sha256}, actual ${k}`);let R=O.join(O.dirname(v),`.installing-${i}-${process.pid}`);u.rmSync(R,{recursive:!0,force:!0}),u.mkdirSync(R,{recursive:!0});try{if(await q(w,R),!u.existsSync(O.join(R,n.installedMarker)))throw new Error(`extracted tarball for runtime ${i} is missing ${n.installedMarker}`);u.rmSync(v,{recursive:!0,force:!0}),u.renameSync(R,v)}catch(S){throw u.rmSync(R,{recursive:!0,force:!0}),S}return h&&n.writeActiveRuntime(i),{version:i,channel:g,cdnOrigin:t,runtimeDir:v,installed:!0,activated:h,manifest:r}}async function x(e={}){n.ensureHome();let t=a(e.cdnOrigin),r=o(e.channel),i=c();if(i){let S=n.readActiveRuntime(),_=u.existsSync(O.join(n.runtimeDir(i),n.installedMarker));if(S===i&&_)return{checked:!0,updated:!1,reason:`runtime is pinned to ${i}`,activeVersion:S,latestVersion:i};let j=await p({version:i,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,reason:`runtime is pinned to ${i}`,activeVersion:i,latestVersion:i,install:j}}let g=await m(t),l=g.channels[r]?.latest;if(!l)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:n.readActiveRuntime()};if(!g.versions[l])return{checked:!0,updated:!1,reason:`manifest is missing version ${l}`,activeVersion:n.readActiveRuntime(),latestVersion:l};let h=n.readActiveRuntime(),P=h?n.runtimeDir(h):null,w=P?u.existsSync(O.join(P,n.installedMarker)):!1;if(!(!h||!w||I(l,h)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:h,latestVersion:l};let R=await p({version:l,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,activeVersion:l,latestVersion:l,install:R}}async function b(e={}){let t=n.readActiveRuntime(),r=c();if(r)return{active:t,latest:r,pinned:r,outdated:t!==r};try{let i=await m(a(e.cdnOrigin)),g=o(e.channel),l=i.channels[g]?.latest??null,v=!!(l&&(!t||I(l,t)>0));return{active:t,latest:l,pinned:null,outdated:v}}catch{return{active:t,latest:null,pinned:null,outdated:!1}}}return{product:n,resolveCdnOrigin:a,resolveChannel:o,resolvePin:c,manifestUrl:f,tarballUrl:y,fetchManifest:m,resolveVersion:d,install:p,updateToLatest:x,checkUpToDate:b,listInstalled:()=>D(n)}}async function J(n,s){let a=await fetch(n);if(!a.ok||!a.body)throw new Error(`download failed: ${a.status} ${a.statusText} (${n})`);u.mkdirSync(O.dirname(s),{recursive:!0});let o=`${s}.partial`;try{await W(z.fromWeb(a.body),u.createWriteStream(o)),u.renameSync(o,s)}catch(c){try{u.unlinkSync(o)}catch{}throw c}}function Y(n){return new Promise((s,a)=>{let o=G.createHash("sha256"),c=u.createReadStream(n);c.on("data",f=>o.update(f)),c.on("error",a),c.on("end",()=>s(o.digest("hex")))})}function q(n,s){return new Promise((a,o)=>{let c=L("tar",["-xzf",n,"-C",s],{stdio:["ignore","inherit","inherit"]});c.on("error",o),c.on("exit",f=>{f===0?a():o(new Error(`tar exited with code ${f}`))})})}var B="https://contrast.dev",fn="https://sootsim.com/changelog",K={id:"sootsim",defaultCdnOrigin:B,manifestPath:"/runtimes/manifest.json",tarballPath:n=>`/runtimes/sootsim-runtime-${n}.tar.gz`,installedMarker:"index.html",env:{cdnOrigin:"SOOTSIM_CDN_ORIGIN",channel:"SOOTSIM_RUNTIME_CHANNEL",pin:"SOOTSIM_RUNTIME_VERSION"},ensureHome:N,configFile:V,runtimesDir:$,runtimeDir:C,cacheDir:T,readActiveRuntime:U,writeActiveRuntime:A},dn=E(K);export{I as a,B as b,fn as c,dn as d};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{e as p}from"./chunk-JERNRAFO.js";import{a as c,b as l}from"./chunk-6TXGR4HK.js";import{a}from"./chunk-GUXMUE5A.js";async function g(e,t){if(t)return t.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let i=a();return i?.origin?i.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function m(e,t={}){let i=c();if(i||(process.stderr.write(`
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{e as p}from"./chunk-HWGKGIWE.js";import{a as c,b as l}from"./chunk-ABSUFSOH.js";import{a}from"./chunk-3VIMSXQZ.js";async function g(e,t){if(t)return t.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let i=a();return i?.origin?i.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function m(e,t={}){let i=c();if(i||(process.stderr.write(`
3
3
  sootsim ${e} needs auth before it can check recording access.
4
4
 
5
5
  pick one:
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{H as t,L as n,N as l,j as r}from"./chunk-K5ZMEBMQ.js";function m(){let e=t(),i=r()?n():null;return i&&l(i)?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{m as a};
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{H as t,L as n,N as l,j as r}from"./chunk-557IYHPC.js";function m(){let e=t(),i=r()?n():null;return i&&l(i)?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{m as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as ce}from"./chunk-74QJWGDX.js";import{b as Et,c as Pt,k as At}from"./chunk-Y3IYHVEX.js";import{a as oe,b as A,c as D,d as Ie,e as ae,f as X,g as ue,h as ye,i as Ft,j as Ot,k as Te,l as Rt}from"./chunk-KR4LGQWN.js";import{A as $t,B as xt,E as St,G as vt,I as de,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 fe,u as yt,v as _e,w as qe,x as ht,y as bt,z as wt}from"./chunk-FGKDYXO3.js";import{e as _t,g as It,i as Tt,j as Mt,k as Nt,l as ge}from"./chunk-ITQ7WKNC.js";import{a as ot}from"./chunk-H2WCONSC.js";import{a as Q}from"./chunk-M2LYCMW4.js";import{c as st}from"./chunk-346C7547.js";import{c as nt}from"./chunk-YMTVQA6W.js";import{c as Ae,e as De}from"./chunk-ZTOWO5CK.js";function We(e){return`(async () => {
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as ce}from"./chunk-SDKIUJUO.js";import{b as Et,c as Pt,k as At}from"./chunk-SLR3HWMB.js";import{a as oe,b as A,c as D,d as Ie,e as ae,f as X,g as ue,h as ye,i as Ft,j as Ot,k as Te,l as Rt}from"./chunk-FCMEOOQE.js";import{A as $t,B as xt,E as St,G as vt,I as de,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 fe,u as yt,v as _e,w as qe,x as ht,y as bt,z as wt}from"./chunk-M5VURHXD.js";import{e as _t,g as It,i as Tt,j as Mt,k as Nt,l as ge}from"./chunk-ERXCR7NU.js";import{a as ot}from"./chunk-OUKH6UGN.js";import{a as Q}from"./chunk-DCJXHSIA.js";import{c as st}from"./chunk-6JLIPPNB.js";import{c as nt}from"./chunk-74HIBIJQ.js";import{c as Ae,e as De}from"./chunk-YKK2QUGO.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 ce}from"./chunk-74QJWGDX.js";import{b as Et,c as Pt,k as At}from"./c
588
588
  `);console.log(`${o??""}
589
589
 
590
590
  ${n}
591
- `),process.exit(0)}let N=d.wsPort,M=d.simId,j=d.simIdSource,O=d.commandTimeoutMs;if(f==="get"&&m==="diagnosis"){let $=i.indexOf("diagnosis"),o=$>=0?[...i.slice(0,$),...i.slice($+1)]:i,{runDiagnose:n}=await import("./diagnose-RJMRI27P.js"),r=await n(["recent",...o],t);process.exitCode=r;return}if(f==="do"&&m==="scan"){let{runCamera:$}=await import("./camera-MGJUBHWZ.js");await $(i,{port:t.port});return}if(m==="list"&&i.some($=>$==="--drivers"||$==="-D")){let{buildDriverListRows:$}=await import("./drivers-S7D5OZQN.js"),o=$();console.log(` available drivers (${o.length}):
591
+ `),process.exit(0)}let N=d.wsPort,M=d.simId,j=d.simIdSource,O=d.commandTimeoutMs;if(f==="get"&&m==="diagnosis"){let $=i.indexOf("diagnosis"),o=$>=0?[...i.slice(0,$),...i.slice($+1)]:i,{runDiagnose:n}=await import("./diagnose-WER4X3P5.js"),r=await n(["recent",...o],t);process.exitCode=r;return}if(f==="do"&&m==="scan"){let{runCamera:$}=await import("./camera-5TO6IVBP.js");await $(i,{port:t.port});return}if(m==="list"&&i.some($=>$==="--drivers"||$==="-D")){let{buildDriverListRows:$}=await import("./drivers-6P53DLMM.js"),o=$();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",p=a.id.padEnd(n),g=a.kind.padEnd(r);console.log(` ${u} ${p} ${g} ${a.description}`),a.available&&a.detail?console.log(` ${a.detail}`):!a.available&&a.reason&&console.log(` unavailable: ${a.reason}`)}return}let c=Tt(d),q=M||"default",P=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","storage-clear","list","wait","sleep"]),E=200;function K($){let o=$.replace(/\s+/g," ").trim();if(!o)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(o)){let r=/<title[^>]*>([^<]+)<\/title>/i.exec($)?.[1]?.trim(),a=/<body[^>]*>([\s\S]*?)<\//i.exec($)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),u=r||a||"html error page";return`<html ${$.length}B> "${u}" (body elided \u2014 add --json for the full payload)`}return o.length<=E?o:`${o.slice(0,E)}\u2026 (+${o.length-E} more bytes)`}function U($){let o=$.displayUrl||$.url;return $.status!=null?`${$.method} ${o} -> ${$.status}${$.statusText?` ${$.statusText}`:""}`:$.error?`${$.method} ${o} -> ${$.error}`:`${$.method} ${o}`}async function _($){let o=me()?400:200;try{let{settled:n,elapsed:r}=await se({bridge:$,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($,o){if(o.result?.reason==="offscreen"){let{x:n,y:r,screen:a}=o.result;console.error(` tap failed: ${$} 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: ${$} 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 J(){try{return await c.send({type:"evaluate",code:`(() => ({
594
594
  console: ${_e},
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as f}from"./chunk-YMTVQA6W.js";import{existsSync as g,mkdirSync as h,readFileSync as S,writeFileSync as b,rmSync as x}from"fs";import{tmpdir as y}from"os";import{dirname as v,join as m}from"path";var p=new Map;function s(e,t){p.set(e,t)}var i=1;function a(){return m(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return m(y(),"sootsim-cli-hints-global.json")}function u(e){if(!g(e))return{version:i,shown:{}};try{let t=JSON.parse(S(e,"utf8"));return t?.version!==i||!t?.shown?{version:i,shown:{}}:t}catch{return{version:i,shown:{}}}}function l(e,t){try{h(v(e),{recursive:!0}),b(e,JSON.stringify(t)+`
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as f}from"./chunk-74HIBIJQ.js";import{existsSync as g,mkdirSync as h,readFileSync as S,writeFileSync as b,rmSync as x}from"fs";import{tmpdir as y}from"os";import{dirname as v,join as m}from"path";var p=new Map;function s(e,t){p.set(e,t)}var i=1;function a(){return m(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return m(y(),"sootsim-cli-hints-global.json")}function u(e){if(!g(e))return{version:i,shown:{}};try{let t=JSON.parse(S(e,"utf8"));return t?.version!==i||!t?.shown?{version:i,shown:{}}:t}catch{return{version:i,shown:{}}}}function l(e,t){try{h(v(e),{recursive:!0}),b(e,JSON.stringify(t)+`
3
3
  `)}catch{}}function H(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function F(e,t){let o=H();if(o==="off")return!1;if(o==="always"||t==="always")return!0;let n=Date.now();if(t==="once-per-identity"){let r=u(a());return r.shown[e]?!1:(r.shown[e]=n,l(a(),r),!0)}if(t==="once-ever"){let r=u(d());return r.shown[e]?!1:(r.shown[e]=n,l(d(),r),!0)}if(typeof t=="object"&&"cooldownMs"in t){let r=u(a()),c=r.shown[e]??0;return n-c<t.cooldownMs?!1:(r.shown[e]=n,l(a(),r),!0)}return!0}function $(e,...t){let o=p.get(e);if(!o)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!F(e,o.frequency))return!1;let n=o.render(...t);if(n==null)return!1;let r=Array.isArray(n)?n:[n],c=o.stream==="error"?console.error:console.log;for(let w of r)c(` hint: ${w}`);return!0}s("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});s("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`,stream:"error"});s("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(t=>` ${t}`)]:null,stream:"error"});s("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});s("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `sootsim describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});s("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`,stream:"error"});s("clean-uninstall",{frequency:"once-ever",render:()=>["to uninstall sootsim completely, run `sootsim daemon uninstall`.","it removes the launchd / systemd agent and the ~/.sootsim cache (~80MB)."]});export{$ as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as h}from"./chunk-346C7547.js";import{b as A,e as k,g as L}from"./chunk-YMTVQA6W.js";import{K as w,L as S,M as I,N as B,g as F}from"./chunk-K5ZMEBMQ.js";import{WebSocket as T}from"ws";var W=null;function M(){let i=F();if(W?.homeDir===i)return W.world;let r=U();return W={homeDir:i,world:r},r}function U(){let i=S();if(i&&B(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:h};let r=w();return r&&I(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:h}:{source:"default",bridgePort:7668,shellBaseUrl:h}}function _(i){let r=S();if(r&&B(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:h};let e=w();return e&&I(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:h}: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=S();if(e&&B(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let d=w();return d&&I(d)&&(d.runtimePort===r||d.bridgePort===r)?d.bridgePort:null}function D(){return M().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.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as h}from"./chunk-6JLIPPNB.js";import{b as A,e as k,g as L}from"./chunk-74HIBIJQ.js";import{K as w,L as S,M as I,N as B,g as F}from"./chunk-557IYHPC.js";import{WebSocket as T}from"ws";var W=null;function M(){let i=F();if(W?.homeDir===i)return W.world;let r=U();return W={homeDir:i,world:r},r}function U(){let i=S();if(i&&B(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:h};let r=w();return r&&I(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:h}:{source:"default",bridgePort:7668,shellBaseUrl:h}}function _(i){let r=S();if(r&&B(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:h};let e=w();return e&&I(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:h}: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=S();if(e&&B(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let d=w();return d&&I(d)&&(d.runtimePort===r||d.bridgePort===r)?d.bridgePort:null}function D(){return M().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 $=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",P=new Set(r.stripBooleanFlags??[]),p=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(P.has(a)){e.add(n);continue}p.has(a)&&(e.add(n),n+1<i.length&&e.add(n+1),n++)}if(!t){let n=k();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 T(`ws://localhost:${i}`),u=A(),P=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}`))})}),p=!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&&!p&&(p=!0,process.stderr.write(`
5
5
  \u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.268 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{H as I,m as B,n as E,o as y,t as v,v as A}from"./chunk-FGKDYXO3.js";import{h,l as N,m as P}from"./chunk-ITQ7WKNC.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
1
+ /*! sootsim v0.1.270 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{H as I,m as B,n as E,o as y,t as v,v as A}from"./chunk-M5VURHXD.js";import{h,l as N,m as P}from"./chunk-ERXCR7NU.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
3
3
  `)}function V(e){process.stderr.write(`${e}
4
4
  `)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function D(e,t,...r){return N(e,`__sootsimTest.${t}`,...r)}async function k(e,t,...r){return P(e,`SootSim.bridges.mainShell.${t}`,...r)}async function z(e,t={}){try{let r=await D(e,"waitForScreenTransitions",q);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function K(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await k(e,t,...n)}catch(o){if(!I(o)||Date.now()>=s)throw o;await w(50)}}async function Q(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let a=0;a<s;a++){let u=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function X(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let a=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await a.send({type:"evaluate",code:"1"}),a}catch{a.close()}await w(o)}return null}async function Z(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,a=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let i=await e.send({type:"evaluate",code:B}),g=Date.now()-o,f=Number(i?.nodes)||0,$=Number(i?.targets)||0,x=Number(i?.errors)||0,C=i?.flag===!0,p=i?.externalReady,T=typeof i?.loadingText=="string"?i.loadingText.trim():"",W=typeof i?.externalStatus=="string"?i.externalStatus.trim():"",M=typeof i?.externalError=="string"?i.externalError.trim():"",R=typeof i?.externalError=="string"&&M.length>0;if(c=p,d=R,f!==a&&(a=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,flag:i?.flag,loadingText:T,externalReady:typeof p=="boolean"?p:null,externalStatus:W,externalError:M,errors:x},C&&p!==!1&&!R&&!T&&y({nodes:f,targets:$})&&g-u>=E)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!C)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&y(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function O(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function F(e,t={}){let r=await e.send({type:"evaluate",code:A});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
5
5
  console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await v(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`