sootsim 0.1.168 → 0.1.170

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 (189) hide show
  1. package/README.md +66 -63
  2. package/detox/index.ts +3 -3
  3. package/dist-cli/bin.js +3 -3
  4. package/dist-cli/chunks/agent-3C2BKQKX.js +46 -0
  5. package/dist-cli/chunks/{agent-wrapper-M32Q4WRZ.js → agent-wrapper-OIKCYOXZ.js} +2 -2
  6. package/dist-cli/chunks/{app-fonts-QJCMHTWY.js → app-fonts-25O32NAP.js} +2 -2
  7. package/dist-cli/chunks/{assert-FUPVKOCV.js → assert-ONEP4NQU.js} +2 -2
  8. package/dist-cli/chunks/beta-4E5USTEI.js +2 -0
  9. package/dist-cli/chunks/{camera-6Z3YMMEG.js → camera-RORW4MAA.js} +2 -2
  10. package/dist-cli/chunks/{chunk-MHEP6UMF.js → chunk-25RFZ6WP.js} +6 -6
  11. package/dist-cli/chunks/chunk-35GMFXVJ.js +2 -0
  12. package/dist-cli/chunks/{chunk-BKYCQJKE.js → chunk-3TM7DHWE.js} +2 -2
  13. package/dist-cli/chunks/{chunk-MGB5W5VY.js → chunk-4XVY5TUF.js} +2 -2
  14. package/dist-cli/chunks/{chunk-2DDHS4Z3.js → chunk-5ZHUPPS5.js} +1 -1
  15. package/dist-cli/chunks/{chunk-MO3L5VGD.js → chunk-6FAEORJ2.js} +2 -2
  16. package/dist-cli/chunks/{chunk-HIAR3KTT.js → chunk-6TSXXN2W.js} +4 -4
  17. package/dist-cli/chunks/chunk-AJF3QF4K.js +1 -0
  18. package/dist-cli/chunks/{chunk-QMQBMB4S.js → chunk-AUCNBB6Q.js} +2 -2
  19. package/dist-cli/chunks/{chunk-27Q45J2N.js → chunk-BP3EGFER.js} +2 -2
  20. package/dist-cli/chunks/{chunk-XWG6NJJE.js → chunk-DAXME77O.js} +3 -3
  21. package/dist-cli/chunks/chunk-DGJTEFE7.js +13 -0
  22. package/dist-cli/chunks/chunk-DIRDEKRW.js +23 -0
  23. package/dist-cli/chunks/{chunk-QWNLVJ4P.js → chunk-DKTC53HV.js} +1 -1
  24. package/dist-cli/chunks/{chunk-QBYYAPTB.js → chunk-DWXC25XG.js} +1 -1
  25. package/dist-cli/chunks/{chunk-OC4Y3UIV.js → chunk-E3FKMY5E.js} +1 -1
  26. package/dist-cli/chunks/chunk-ER4GBJRY.js +2 -0
  27. package/dist-cli/chunks/chunk-EX6V4ZV6.js +6 -0
  28. package/dist-cli/chunks/{chunk-MRPFNK2L.js → chunk-GQH3PD3W.js} +5 -5
  29. package/dist-cli/chunks/{chunk-IHVCKNFX.js → chunk-GST4YSBO.js} +4 -4
  30. package/dist-cli/chunks/{chunk-YNTWHWFY.js → chunk-I4RV5I6V.js} +1 -1
  31. package/dist-cli/chunks/{chunk-AFPKG2L6.js → chunk-I5WXVKR6.js} +1 -1
  32. package/dist-cli/chunks/{chunk-WUKEI6SL.js → chunk-IO7KAVFK.js} +2 -2
  33. package/dist-cli/chunks/{chunk-7YQ7CJFO.js → chunk-LMX7UB5T.js} +2 -2
  34. package/dist-cli/chunks/{chunk-ZIEXUO4S.js → chunk-N4YCSOCR.js} +2 -2
  35. package/dist-cli/chunks/{chunk-YR7WIUVL.js → chunk-NI3L4A65.js} +2 -2
  36. package/dist-cli/chunks/{chunk-TXZKEW6C.js → chunk-ODGEH6OW.js} +2 -2
  37. package/dist-cli/chunks/{chunk-LCHPOJOO.js → chunk-Q4NDYO2U.js} +1 -1
  38. package/dist-cli/chunks/{chunk-SHCQRQJA.js → chunk-QPRF3UYX.js} +2 -2
  39. package/dist-cli/chunks/chunk-QXJMXSQP.js +2 -0
  40. package/dist-cli/chunks/chunk-RLKSLUNR.js +2 -0
  41. package/dist-cli/chunks/{chunk-XUABY4IN.js → chunk-S244IT4W.js} +1 -1
  42. package/dist-cli/chunks/chunk-SDHOM6ZG.js +62 -0
  43. package/dist-cli/chunks/{chunk-ENK2SG5R.js → chunk-TXKOJ3P5.js} +1 -1
  44. package/dist-cli/chunks/{chunk-QGL6XWHB.js → chunk-UDMJSFSH.js} +8 -8
  45. package/dist-cli/chunks/{chunk-FZ656TJA.js → chunk-ULV4PWN4.js} +1 -1
  46. package/dist-cli/chunks/{chunk-VHVFXSXT.js → chunk-V4HTQPMA.js} +2 -2
  47. package/dist-cli/chunks/chunk-VATHADSI.js +2 -0
  48. package/dist-cli/chunks/{chunk-BSKD5K5N.js → chunk-VUOCUCJ2.js} +2 -2
  49. package/dist-cli/chunks/{chunk-BUCBIG2A.js → chunk-WN7R4GL4.js} +1 -1
  50. package/dist-cli/chunks/chunk-XOTJD6PU.js +118 -0
  51. package/dist-cli/chunks/chunk-XUNPVF5K.js +1 -0
  52. package/dist-cli/chunks/{chunk-SMBSZIDN.js → chunk-YMFSRCHL.js} +4 -4
  53. package/dist-cli/chunks/{chunk-JJIJVKAV.js → chunk-YV74D4MG.js} +2 -2
  54. package/dist-cli/chunks/{chunk-5GGI6NGS.js → chunk-YVTWSC5Y.js} +3 -3
  55. package/dist-cli/chunks/cli-version-EKKWCHRX.js +2 -0
  56. package/dist-cli/chunks/{compat-CH6BYJ4T.js → compat-ZVZM5TML.js} +3 -3
  57. package/dist-cli/chunks/control-TWINYHMY.js +2 -0
  58. package/dist-cli/chunks/{cpu-profile-VMHZN3WB.js → cpu-profile-RWGQTWLP.js} +2 -2
  59. package/dist-cli/chunks/daemon-AOSMNBD4.js +2 -0
  60. package/dist-cli/chunks/{debug-WQP3TJ62.js → debug-R7PL3MHF.js} +5 -5
  61. package/dist-cli/chunks/{detox-IAWL5YVJ.js → detox-UIJMKIGQ.js} +2 -2
  62. package/dist-cli/chunks/{device-GYJ6BHY7.js → device-7SRVX2PU.js} +2 -2
  63. package/dist-cli/chunks/{diagnose-GFDUQYHG.js → diagnose-OXAKLLZT.js} +2 -2
  64. package/dist-cli/chunks/drivers-BPPG22VP.js +2 -0
  65. package/dist-cli/chunks/{electron-CF7HUVQL.js → electron-CTCH4VOL.js} +3 -3
  66. package/dist-cli/chunks/flow-KA2WCWDL.js +2 -0
  67. package/dist-cli/chunks/help-XBQIK2XY.js +2 -0
  68. package/dist-cli/chunks/{hints-HF2LDTK7.js → hints-P3ZIAP3Z.js} +2 -2
  69. package/dist-cli/chunks/home-paths-ZSCTLOYE.js +2 -0
  70. package/dist-cli/chunks/{inspect-P2MPMFR3.js → inspect-2ABU5WET.js} +24 -24
  71. package/dist-cli/chunks/{install-desktop-QYLXYZQJ.js → install-desktop-4NOQ3YY4.js} +3 -3
  72. package/dist-cli/chunks/{keys-LJ37JUG2.js → keys-RPVEUNUC.js} +2 -2
  73. package/dist-cli/chunks/{login-RUZ7MAPC.js → login-6D6DXBO3.js} +4 -4
  74. package/dist-cli/chunks/{logout-4RE2BP3H.js → logout-T5OSWDTJ.js} +2 -2
  75. package/dist-cli/chunks/{maestro-V62C4AQM.js → maestro-MKCHEOKA.js} +2 -2
  76. package/dist-cli/chunks/optional-demo-registry-EYD2K3QH.js +2 -0
  77. package/dist-cli/chunks/{preview-3HWBUCVM.js → preview-S52ZNGN2.js} +2 -2
  78. package/dist-cli/chunks/{profile-D2CAEFO5.js → profile-IG5F3LTL.js} +2 -2
  79. package/dist-cli/chunks/{react-PXYQBCAK.js → react-275HCOFC.js} +2 -2
  80. package/dist-cli/chunks/{record-R7IDN3T6.js → record-YT63SUHO.js} +4 -4
  81. package/dist-cli/chunks/runtime-WYZMDZAK.js +2 -0
  82. package/dist-cli/chunks/{screenshot-YGGPEX7B.js → screenshot-5AZ4MY3A.js} +4 -4
  83. package/dist-cli/chunks/{screenshot-mode-QDUWRQUF.js → screenshot-mode-4S4EX2XJ.js} +2 -2
  84. package/dist-cli/chunks/{screenshots-6PNFJNLF.js → screenshots-UUJNZSG7.js} +2 -2
  85. package/dist-cli/chunks/screenshots-capture-I66JD3AD.js +41 -0
  86. package/dist-cli/chunks/{server-7Q3NW5MV.js → serve-O46Q4WAD.js} +18 -17
  87. package/dist-cli/chunks/setup-C44N54O7.js +77 -0
  88. package/dist-cli/chunks/skills-PPVS4XOQ.js +40 -0
  89. package/dist-cli/chunks/{slides-HJXHSWEF.js → slides-ZWSZJZUY.js} +2 -2
  90. package/dist-cli/chunks/store-3SLGP5O3.js +2 -0
  91. package/dist-cli/chunks/telemetry-2XLLWARK.js +2 -0
  92. package/dist-cli/chunks/{test-4TUHEODP.js → test-362G4M5A.js} +3 -3
  93. package/dist-cli/chunks/{three-mode-IL5442GI.js → three-mode-JNVTM2UT.js} +2 -2
  94. package/dist-cli/chunks/{timeline-JILPOKRF.js → timeline-VKC6ULRK.js} +2 -2
  95. package/dist-cli/chunks/{upgrade-SL5WMHSF.js → upgrade-SJPX4SPA.js} +2 -2
  96. package/dist-cli/chunks/upload-MXOBV6RT.js +2 -0
  97. package/dist-cli/chunks/version-4Z7AFNH3.js +4 -0
  98. package/dist-cli/chunks/web-WB2I2AWL.js +2 -0
  99. package/dist-cli/chunks/{what-happened-KKAJOJWO.js → what-happened-KQCWMQJT.js} +3 -3
  100. package/dist-cli/chunks/{whoami-QDJPYI2O.js → whoami-K76PXAD4.js} +2 -2
  101. package/dist-lib/agent-daemon-client.cjs +4 -5
  102. package/dist-lib/agent-events.cjs +1 -1
  103. package/dist-lib/agent-sessions.cjs +1 -1
  104. package/dist-lib/attached-projects.cjs +1 -1
  105. package/dist-lib/auth/shared-session.cjs +1 -1
  106. package/dist-lib/backend-origin.cjs +1 -1
  107. package/dist-lib/beta.cjs +3 -6
  108. package/dist-lib/beta.mjs +3 -5
  109. package/dist-lib/bridge-constants.cjs +1 -1
  110. package/dist-lib/cli-constants.cjs +1 -1
  111. package/dist-lib/config.cjs +1 -1
  112. package/dist-lib/detox/index.cjs +4 -4
  113. package/dist-lib/dev-bundle-resolution.cjs +2 -9
  114. package/dist-lib/home-paths.cjs +59 -1
  115. package/dist-lib/host/bridge-host.cjs +67 -5
  116. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  117. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  118. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  119. package/dist-lib/host/websocket-proxy.cjs +1 -1
  120. package/dist-lib/index.cjs +2 -2
  121. package/dist-lib/menu.cjs +1 -1
  122. package/dist-lib/menu.mjs +1 -1
  123. package/dist-lib/metro.cjs +2 -2
  124. package/dist-lib/profiles.cjs +1 -1
  125. package/dist-lib/render-mode.cjs +1 -1
  126. package/dist-lib/scripts/dev-server-scanner.cjs +5 -4
  127. package/dist-lib/sdk.cjs +1 -1
  128. package/dist-lib/sdk.mjs +1 -1
  129. package/dist-lib/skills.cjs +136 -20
  130. package/dist-lib/vite.cjs +2 -2
  131. package/package.json +2 -1
  132. package/scripts/dev-server-scanner.ts +3 -4
  133. package/scripts/postinstall.cjs +2 -2
  134. package/scripts/preuninstall.cjs +5 -7
  135. package/skills/soot.md +178 -0
  136. package/skills/sootsim-debug.md +384 -0
  137. package/skills/sootsim-setup.md +96 -0
  138. package/skills/sootsim-test.md +292 -0
  139. package/skills/sootsim-visual.md +122 -0
  140. package/src/agent-daemon-client.ts +4 -14
  141. package/src/beta.ts +3 -5
  142. package/src/dev-bundle-resolution.ts +1 -14
  143. package/src/home-paths.ts +77 -2
  144. package/src/host/agent-host.ts +1 -1
  145. package/src/host/bridge-host.ts +65 -6
  146. package/src/metro-plugin.ts +1 -1
  147. package/src/runtime-assets.ts +1 -1
  148. package/src/skills/builtin/a11y-review.ts +4 -1
  149. package/src/skills/builtin/perf-profile.ts +4 -1
  150. package/src/skills/builtin/screenshot-all.ts +4 -1
  151. package/src/skills/builtin/visual-diff.ts +4 -1
  152. package/src/vite-plugin.ts +1 -0
  153. package/dist-cli/chunks/agent-V5N6TSVL.js +0 -46
  154. package/dist-cli/chunks/auto-bootstrap-BMAKK4FR.js +0 -2
  155. package/dist-cli/chunks/beta-ERD6Z2EE.js +0 -2
  156. package/dist-cli/chunks/chunk-2UDB2A2Z.js +0 -119
  157. package/dist-cli/chunks/chunk-4PXQB4KC.js +0 -2
  158. package/dist-cli/chunks/chunk-4TJ2FLZX.js +0 -2
  159. package/dist-cli/chunks/chunk-5PEYA6XI.js +0 -1
  160. package/dist-cli/chunks/chunk-6MBEHPFK.js +0 -1
  161. package/dist-cli/chunks/chunk-BLRVSHCX.js +0 -7
  162. package/dist-cli/chunks/chunk-EMWWY2MH.js +0 -2
  163. package/dist-cli/chunks/chunk-FAEIKMNH.js +0 -1
  164. package/dist-cli/chunks/chunk-L62FIJ3P.js +0 -2
  165. package/dist-cli/chunks/chunk-L7F7QBGM.js +0 -23
  166. package/dist-cli/chunks/chunk-MQWZBKOF.js +0 -5
  167. package/dist-cli/chunks/chunk-N6CHIBHJ.js +0 -79
  168. package/dist-cli/chunks/chunk-PPIRXSWS.js +0 -13
  169. package/dist-cli/chunks/cli-version-P4CDXF4L.js +0 -2
  170. package/dist-cli/chunks/config-ST33XAYN.js +0 -45
  171. package/dist-cli/chunks/control-FW6XTHQE.js +0 -2
  172. package/dist-cli/chunks/daemon-5DEUBHYC.js +0 -67
  173. package/dist-cli/chunks/drivers-VTVBB4KQ.js +0 -2
  174. package/dist-cli/chunks/flow-GZZ7OVM3.js +0 -2
  175. package/dist-cli/chunks/help-EUSCLRLF.js +0 -2
  176. package/dist-cli/chunks/home-paths-ZBDTVPMF.js +0 -2
  177. package/dist-cli/chunks/install-N4QT365P.js +0 -2
  178. package/dist-cli/chunks/launch-3TUC2YGM.js +0 -16
  179. package/dist-cli/chunks/optional-demo-registry-ZEPUCMEO.js +0 -2
  180. package/dist-cli/chunks/runtime-RQOM2I2S.js +0 -2
  181. package/dist-cli/chunks/runtime-delivery-K4LFILF7.js +0 -2
  182. package/dist-cli/chunks/setup-repo-UZMY3JFZ.js +0 -2
  183. package/dist-cli/chunks/skills-GDYPRMR5.js +0 -10
  184. package/dist-cli/chunks/start-HDWGM5WJ.js +0 -23
  185. package/dist-cli/chunks/store-5DYIIFYH.js +0 -2
  186. package/dist-cli/chunks/telemetry-TMT3DYZU.js +0 -2
  187. package/dist-cli/chunks/upload-35XW4DMZ.js +0 -2
  188. package/dist-cli/chunks/version-ZEBIO5HC.js +0 -4
  189. package/dist-cli/chunks/web-JICQ5RN4.js +0 -2
package/README.md CHANGED
@@ -51,7 +51,8 @@ internally splits into a **shell worker** and a **tenant worker**.
51
51
  graph TD
52
52
  subgraph cli["sootsim CLI process (short-lived, cli/)"]
53
53
  BIN["bin.ts (dispatcher + telemetry)"]
54
- BOOT["auto-bootstrap.ts (ensure runtime + daemon)"]
54
+ SETUP["commands/setup.ts (daemon + optional repo setup)"]
55
+ RUNTIMECMD["commands/runtime.ts (runtime install/use)"]
55
56
  INSPECT["commands/inspect/* (describe/find/do/get/wait)"]
56
57
  FLOW["bridge-flow-runner.ts (maestro + flow)"]
57
58
  DETOXCMD["commands/detox.ts + detox/ driver"]
@@ -86,16 +87,17 @@ graph TD
86
87
  CFG["config.json"]
87
88
  end
88
89
  CDN["sootbean.com CDN (runtimes/manifest.json + tarballs)"]
89
- BIN --> BOOT
90
+ BIN --> SETUP
91
+ BIN --> RUNTIMECMD
90
92
  BIN --> INSPECT
91
93
  BIN --> FLOW
92
94
  BIN --> DETOXCMD
93
95
  BIN --> SHOTS
94
96
  BIN --> AGENTCMD
95
- BOOT --> RTDIR
96
- BOOT --> LOCK
97
- BOOT -->|"fetch runtime"| CDN
98
- BOOT -->|"register launchd/systemd"| HOST
97
+ SETUP --> LOCK
98
+ SETUP -->|"register launchd/systemd"| HOST
99
+ RUNTIMECMD --> RTDIR
100
+ RUNTIMECMD -->|"fetch runtime"| CDN
99
101
  INSPECT --> WSB
100
102
  FLOW --> WSB
101
103
  SHOTS --> WSB
@@ -126,20 +128,20 @@ graph TD
126
128
  ```
127
129
 
128
130
  **The CLI process** (`cli/bin.ts`) parses argv, emits invocation telemetry, and
129
- lazy-imports exactly one command module per run. Runtime commands first call
130
- `auto-bootstrap.ts`, which guarantees the engine runtime is unpacked under
131
- `~/.sootsim/runtimes/<version>` (fetching from the sootbean.com CDN via
132
- `runtime-delivery.ts` when missing) and that the bridge daemon is registered
133
- with launchd/systemd and reachable. Interactive verbs then open a `WsBridge`
134
- (`cli/ws-bridge.ts`) to the daemon on **port 7668** and send JSON commands.
135
- Inspection/interaction verbs live in `cli/commands/inspect/*` and are
136
- re-exported as the programmatic `sootsim/sdk`; the Maestro/flow runner is
137
- `cli/bridge-flow-runner.ts`; the Detox compat driver is in `detox/`. Test and
138
- screenshot paths additionally use `cli/drivers/*` (chromium, electron,
139
- playwright, system) to actually launch or attach the sim page before driving it.
131
+ lazy-imports exactly one command module per run. `sootsim setup` owns guided
132
+ one-time work: install the background daemon, optionally add the Metro/One
133
+ repo plugin, and optionally create the advanced config file. `sootsim open`
134
+ ensures the engine runtime exists and starts a local foreground bridge when no
135
+ daemon is reachable, then opens a `WsBridge` (`cli/ws-bridge.ts`) on **port
136
+ 7668** and sends JSON commands. Inspection/interaction verbs live in
137
+ `cli/commands/inspect/*` and are re-exported as the programmatic `sootsim/sdk`;
138
+ the Maestro/flow runner is `cli/bridge-flow-runner.ts`; the Detox compat driver
139
+ is in `detox/`. Test and screenshot paths additionally use `cli/drivers/*`
140
+ (chromium, electron, playwright, system) to launch or attach the sim page before
141
+ driving it.
140
142
 
141
143
  **The daemon is one process** — `SootSimBridgeHost` (`src/host/bridge-host.ts`).
142
- `sootsim server` runs it in the foreground; `sootsim daemon` is the *same
144
+ `sootsim serve` runs it in the foreground; the background daemon is the *same
143
145
  process* wrapped with autostart and the `~/.sootsim/daemon.json` lockfile. It is
144
146
  an HTTP+WS hub: sims register over WS, CLI clients connect to drive them, and
145
147
  the host forwards each command to the targeted sim and relays the reply back. It
@@ -173,30 +175,31 @@ distinguish the host page thread, the shell worker, and the tenant worker.)
173
175
 
174
176
  | component | role | key files |
175
177
  | --- | --- | --- |
176
- | sootsim CLI (bin + dispatcher) | Short-lived terminal entry point. Parses argv, emits telemetry, lazy-imports one command per run, and on runtime commands first runs auto-bootstrap to ensure the runtime + daemon exist before connecting. | `cli/bin.ts`, `cli/parse-args.ts`, `cli/auto-bootstrap.ts`, `cli/help.ts` |
178
+ | sootsim CLI (bin + dispatcher) | Short-lived terminal entry point. Parses argv, emits telemetry, lazy-imports one command per run, and routes setup/open/runtime/inspection flows without a hidden bootstrap path. | `cli/bin.ts`, `cli/parse-args.ts`, `cli/help.ts`, `cli/commands/setup.ts`, `cli/commands/control.ts` |
177
179
  | WsBridge client | Client side of the CLI→daemon link. Resolves the daemon port from the lockfile, opens a WS to `:7668`, sends JSON commands and awaits `{id,result}`/`{id,error}`. Used by every interactive command. | `cli/ws-bridge.ts`, `src/bridge-constants.ts`, `cli/current-sim.ts` |
178
180
  | inspect / SDK command surface | Runtime inspection + interaction verbs (describe, find, do tap, get errors, wait, layout, settle). Re-exported as `sootsim/sdk` so programmatic callers drive a sim the same way the CLI does. | `cli/commands/inspect/core.ts`, `cli/commands/inspect/actions.ts`, `cli/commands/inspect.ts`, `src/sdk.ts` |
179
181
  | flow / maestro / detox runners | Drop-in test compatibility. `bridge-flow-runner.ts` runs maestro-format YAML and recorded flows over the bridge; `detox/` provides a `by`/`element`/`expect`/`device` driver + jest preset so existing Detox suites run unchanged. | `cli/bridge-flow-runner.ts`, `cli/commands/maestro.ts`, `cli/commands/detox.ts`, `detox/index.ts`, `detox/jest-preset.cjs` |
180
182
  | sim drivers | Launch/attach the actual sim page. The registry resolves a driver (chromium, electron, playwright, system browser) which opens the shell URL; used by detox/preview/screenshot paths to bring a sim online for the bridge. | `cli/drivers/index.ts`, `cli/drivers/registry.ts`, `cli/drivers/chromium.ts`, `cli/drivers/electron.ts`, `cli/drivers/playwright.ts` |
181
- | SootSimBridgeHost (server/daemon) | The single persistent process (`sootsim server`, autostarted as the daemon via launchd/systemd). HTTP+WS hub on `:7668`: relays commands between CLI clients and registered sims; also serves runtime HTTP, `/__server-scan`, and fetch/WS proxies. | `src/host/bridge-host.ts`, `cli/commands/server.ts`, `cli/commands/daemon.ts`, `src/home-paths.ts` |
183
+ | SootSimBridgeHost (serve/daemon) | The bridge process (`sootsim serve`, or autostarted as the daemon via launchd/systemd). HTTP+WS hub on `:7668`: relays commands between CLI clients and registered sims; also serves runtime HTTP, `/__server-scan`, and fetch/WS proxies. | `src/host/bridge-host.ts`, `cli/commands/serve.ts`, `cli/commands/daemon.ts`, `src/home-paths.ts` |
182
184
  | AgentHost + sessions | Agent-routing extension of the host: owns the single FIFO reader per agent session and fans `agent:event`/`session-status` pushes to every WS subscriber. Backed by agent-sessions + attached-projects stores. | `src/host/agent-host.ts`, `src/agent-sessions.ts`, `src/attached-projects.ts`, `src/agent-daemon-client.ts` |
183
185
  | host proxies + dev-server scan | Host-side helpers so a cross-origin tenant worker can reach local dev servers and same-origin APIs: `/__server-scan` discovers running metro/expo/vxrn/one servers; fetch + websocket proxies relay guest-app network through the daemon. | `src/host/fetch-proxy-handler.ts`, `src/host/websocket-proxy.ts`, `scripts/dev-server-scanner.ts`, `src/dev-bundle-resolution.ts` |
184
186
  | runtime delivery + sootsim home | Versioned engine runtime management. Resolves the CDN origin (`https://sootbean.com`), fetches `runtimes/manifest.json` + the runtime tarball, verifies sha256, unpacks to `~/.sootsim/runtimes/<version>`, and tracks active version/config/daemon lockfile under the sootsim home. | `src/runtime-delivery.ts`, `src/home-paths.ts`, `src/runtime-assets.ts`, `scripts/postinstall.cjs` |
185
187
  | `sootsim/vite` + `sootsim/metro` (runtime serving) | Published bundler plugins. Both serve the installed engine runtime at `/__soot/` from `~/.sootsim/runtimes/<version>` so an app's own dev server can host the sim shell; the vite plugin can also launch the Electron app. | `src/vite-plugin-one.ts`, `src/metro-plugin.ts`, `src/runtime-assets.ts` |
186
188
  | `sootsim()` vite resolver plugin (internal) | The large RN-resolution / native-stub vite plugin: aliases `react-native` to the engine shim, native packages to `@soot/compat` stubs, applies worklets/babel transforms, and instantiates `SootSimBridgeHost` in its dev server. Distinct from the published `sootsim/vite` export. | `src/vite-plugin.ts`, `src/worklets-babel.ts`, `packages/compat/src/stub-manifest.ts` |
187
- | skills registry | SootBean-flavored automation skills (a11y-review, compat-check, perf-profile, screenshot-all, test-flow, visual-diff) discoverable by trigger; published as `sootsim/skills` and loadable from a project manifest. | `src/skills/registry.ts`, `src/skills/types.ts`, `skills/soot.md` |
189
+ | skills registry | SootSim agent skills (`sootsim-setup`, `sootsim-debug`, `sootsim-test`, `sootsim-visual`, and the generated `soot` index) installable with `sootsim skill`. | `skills/*.md`, `src/skills/registry.ts`, `src/skills/types.ts` |
188
190
 
189
191
  ## Getting started
190
192
 
191
193
  ```sh
192
194
  npm i -g sootsim
193
- cd my-app && sootsim setup-repo
195
+ sootsim setup # optional but recommended: installs the background daemon
194
196
  sootsim open 8081 # load a running metro/expo dev server
195
197
  ```
196
198
 
197
- CLI-first is the canonical path. The bridge daemon registers itself on first use
198
- you don't need to start anything to install it. A desktop GUI (Electron) is
199
- optional on top, via `sootsim install-desktop`. In Electron, `File > New Window`
199
+ CLI-first is the canonical path. `sootsim open` starts a local bridge when no
200
+ daemon is reachable; `sootsim setup` installs the faster background daemon and
201
+ offers optional repo integration. A desktop GUI (Electron) is optional on top,
202
+ via `sootsim install-desktop`. In Electron, `File > New Window`
200
203
  duplicates the focused simulator, while `File > New Simulator >` opens a new
201
204
  window for a selected device (same device list as the `Window >` menu).
202
205
 
@@ -214,24 +217,24 @@ inspection, interaction, animation debugging, shell tracing, screenshots, and
214
217
  flow capture, not just as a test runner.
215
218
 
216
219
  ```sh
217
- bun sootsim list # connected tabs
218
- bun sootsim open 8081 # load a running metro/expo dev server
219
- bun sootsim describe # dump UI tree
220
- bun sootsim get errors 5 # recent runtime failures
221
- bun sootsim find --testid cta # inspect one node deeply
222
- bun sootsim debug enable animated,layout
223
- bun sootsim debug trace shell on 240
224
- bun sootsim do tap-text "..." # interact
225
- bun sootsim debug snapshot before
226
- bun sootsim debug snapshot after
227
- bun sootsim debug diff before after
228
- bun sootsim flow start # begin a draft
229
- bun sootsim flow keep # persist the last action
230
- bun sootsim flow end --output flows/login.yaml
231
- bun sootsim test --detox # shared Detox-style parity suite against sootsim
220
+ sootsim list # connected tabs
221
+ sootsim open 8081 # load a running metro/expo dev server
222
+ sootsim describe # dump UI tree
223
+ sootsim get errors 5 # recent runtime failures
224
+ sootsim find --testid cta # inspect one node deeply
225
+ sootsim debug enable animated,layout
226
+ sootsim debug trace shell on 240
227
+ sootsim do tap-text "..." # interact
228
+ sootsim debug snapshot before
229
+ sootsim debug snapshot after
230
+ sootsim debug diff before after
231
+ sootsim flow start # begin a draft
232
+ sootsim flow keep # persist the last action
233
+ sootsim flow end --output flows/login.yaml
234
+ sootsim test --detox # shared Detox-style parity suite against sootsim
232
235
  ```
233
236
 
234
- See the full command reference via `bun sootsim --help` or at
237
+ See the full command reference via `sootsim --help` or at
235
238
  `src/features/site/docs/sootsim/cli/` in the SootBean repo.
236
239
 
237
240
  ## Bundler plugins (`sootsim/vite` and `sootsim/metro`)
@@ -270,8 +273,8 @@ no code changes — just add one line to your jest config:
270
273
  Or use the CLI directly:
271
274
 
272
275
  ```sh
273
- bun sootsim detox # auto-discovers e2e/ tests and launches a shell
274
- bun sootsim detox init # scaffold a config + sample test
276
+ sootsim detox # auto-discovers e2e/ tests and launches a shell
277
+ sootsim detox init # scaffold a config + sample test
275
278
  ```
276
279
 
277
280
  See `../../docs/migrating-from-detox.md` for details.
@@ -282,9 +285,9 @@ SootSim's flow runner natively speaks Maestro's YAML. Point it at your existing
282
285
  `.maestro/` directory:
283
286
 
284
287
  ```sh
285
- bun sootsim maestro # discover .maestro/ and run all flows
286
- bun sootsim maestro test .maestro/ # explicit
287
- bun sootsim maestro --list-compat # see the verb support matrix
288
+ sootsim maestro # discover .maestro/ and run all flows
289
+ sootsim maestro test .maestro/ # explicit
290
+ sootsim maestro --list-compat # see the verb support matrix
288
291
  ```
289
292
 
290
293
  Most Maestro verbs work out of the box (`tapOn`, `assertVisible`, `inputText`,
@@ -297,14 +300,14 @@ need real device hardware (GPS, radio, photo library) throw a clear error. See
297
300
  For animation-heavy debugging, the useful path is usually:
298
301
 
299
302
  ```sh
300
- bun sootsim debug enable animated
301
- bun sootsim debug trace shell on 240
302
- bun sootsim debug snapshot before
303
+ sootsim debug enable animated
304
+ sootsim debug trace shell on 240
305
+ sootsim debug snapshot before
303
306
  # reproduce the transition
304
- bun sootsim debug snapshot after
305
- bun sootsim debug diff before after
306
- bun sootsim screenshot --with-frame --output /tmp/sootsim-framed.png
307
- bun sootsim record --duration 5 --output /tmp/sootsim-anim.mp4
307
+ sootsim debug snapshot after
308
+ sootsim debug diff before after
309
+ sootsim screenshot --with-frame --output /tmp/sootsim-framed.png
310
+ sootsim record --duration 5 --output /tmp/sootsim-anim.mp4
308
311
  ```
309
312
 
310
313
  `sootsim screenshot --with-frame` composes the real SootSim shell device chrome
@@ -342,7 +345,7 @@ compose:
342
345
  ```
343
346
 
344
347
  ```sh
345
- bun sootsim screenshots --plan .sootsim/app-store.yaml
348
+ sootsim screenshots --plan .sootsim/app-store.yaml
346
349
  ```
347
350
 
348
351
  The plan runner can reuse a visible sim for capture (`--sim a9`), stop after
@@ -366,11 +369,11 @@ frame for quick art-direction passes.
366
369
 
367
370
  ## Skills registry
368
371
 
369
- `sootsim/skills` is a registry of SootBean-flavored automation skills
370
- (a11y-review, compat-check, perf-profile, screenshot-all, test-flow,
371
- visual-diff) discoverable/matchable by trigger and loadable from a project
372
- manifest. The published CLI registry and the generated website docs both come
373
- from `packages/sootsim-skills/`:
372
+ `sootsim skill install` installs SootSim agent skills in the standard
373
+ `<skill-name>/SKILL.md` layout used by Codex and Claude Code. The bundled
374
+ skills cover setup, debugging/perf/accessibility, testing, visual review, and
375
+ the generated `soot` command index. The published CLI registry and generated
376
+ website docs both come from `packages/sootsim-skills/`:
374
377
 
375
378
  - `packages/sootsim/skills/soot.md` is generated from that registry
376
379
  - `src/features/site/docs/sootsim/cli/*` is generated output, not hand-edited
@@ -383,10 +386,10 @@ bun run generate:sootsim-docs
383
386
 
384
387
  ## Runtime delivery (the sootsim home and CDN)
385
388
 
386
- The engine never ships inside this package. `auto-bootstrap.ts`
387
- `runtime-delivery.ts` resolves the CDN origin (default `https://sootbean.com`,
388
- overridable in `config.json`), fetches `runtimes/manifest.json` + the runtime
389
- tarball, verifies its sha256, and unpacks it under `~/.sootsim`:
389
+ The engine never ships inside this package. `runtime-delivery.ts` resolves the
390
+ CDN origin (default `https://sootbean.com`, overridable in `config.json`),
391
+ fetches `runtimes/manifest.json` + the runtime tarball, verifies its sha256,
392
+ and unpacks it under `~/.sootsim`:
390
393
 
391
394
  ```
392
395
  ~/.sootsim/
package/detox/index.ts CHANGED
@@ -237,7 +237,7 @@ async function waitForSootsimShellReady(page: Page, timeout = 30000): Promise<vo
237
237
  })
238
238
  if (transitionResult?.timedOut === true) {
239
239
  throw new Error(
240
- `sootsim launch transitions timed out: ${JSON.stringify(transitionResult)}`,
240
+ `sootsim app launch transitions timed out: ${JSON.stringify(transitionResult)}`,
241
241
  )
242
242
  }
243
243
  }
@@ -1183,7 +1183,7 @@ export const device = {
1183
1183
 
1184
1184
  // record the SootSim canvas via the engine's headless recorder
1185
1185
  // (window.__sootsimRecorder — @sootsim/plugin-recording). this is the
1186
- // SAME code path `bun sootsim record video` drives, NOT the rail-button
1186
+ // SAME code path `sootsim record video` drives, NOT the rail-button
1187
1187
  // path (SootSim.bridges.startRecording wires the dialog state machine
1188
1188
  // and never stashes the resulting blob into __sootsimRecorder.lastBlob,
1189
1189
  // which is what getBlobBase64 streams from).
@@ -1226,7 +1226,7 @@ export const device = {
1226
1226
  },
1227
1227
 
1228
1228
  // stop the headless recorder, stream the resulting blob in chunks (same
1229
- // protocol as `bun sootsim record`), and write the webm to outPath.
1229
+ // protocol as `sootsim record`), and write the webm to outPath.
1230
1230
  async stopAndSaveBridgeRecording(outPath: string): Promise<string> {
1231
1231
  const page = getPage()
1232
1232
  const stopResult = await page.evaluate(async () => {
package/dist-cli/bin.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
- import{a as u,b as d,c as g}from"./chunks/chunk-4PXQB4KC.js";import"./chunks/chunk-BUCBIG2A.js";function f(a){let e=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("no sim connected with id ")||e.startsWith("could not connect to ws://")||e.startsWith("sootsim bridge daemon is not running")||e.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${e}
2
+ /*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
+ import{a as u,b as d,c as g}from"./chunks/chunk-RLKSLUNR.js";import"./chunks/chunk-WN7R4GL4.js";function f(a){let e=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("no sim connected with id ")||e.startsWith("could not connect to ws://")||e.startsWith("sootsim bridge daemon is not running")||e.startsWith("sootsim bridge lockfile is fresh")||e.startsWith("sootsim bridge exited before becoming ready")||e.startsWith("background daemon setup is unavailable")||e.startsWith("sootsim bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${e}
4
4
  `),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
5
5
  `):process.stderr.write(`${e}
6
6
  `),process.exit(1)}process.on("unhandledRejection",f);process.on("uncaughtException",f);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["preview","electron","install-desktop"]);function v(a){!A||!k.has(a)||(process.stderr.write(` sootsim ${a} isn't available in the standalone binary \u2014
7
7
  it needs vite / electron / playwright from a project's node_modules.
8
8
  install the npm package and run via bun or node instead:
9
9
  npm i -g sootsim && sootsim ${a}
10
- `),process.exit(1))}var t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-TMT3DYZU.js");a({event:"cli_command_invoked",properties:{command:t.command||(t.version?"version":t.help?"help":"none"),arg_count:t.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:e}=await import("./chunks/telemetry-TMT3DYZU.js");await e(),process.exit(a)}if(t.version){let{getCliVersion:a}=await import("./chunks/cli-version-P4CDXF4L.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-ERD6Z2EE.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-ZBDTVPMF.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(t.help&&!t.command){let{printHelp:a}=await import("./chunks/help-EUSCLRLF.js");a(),await c(0)}var o=t.globalFlags.port,n=t.verbose,p=t.globalFlags.device,l=t.globalFlags.theme,S=t.globalFlags.driver,E=t.globalFlags.headless===!0,b=t.globalFlags.sim??t.globalFlags.session??t.globalFlags.tab,s=b?["--sim",b,...t.commandArgs]:t.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-5DYIIFYH.js"),e={};p&&(e.deviceModel=p),l&&(e.colorScheme=l),a.apply(e)}if(!t.command&&t.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-HDWGM5WJ.js");await a([],{port:o}),await c(0)}var r=t.command??"";if(!r){if(t.commandArgs.length>0){let e=t.commandArgs.find(i=>!i.startsWith("-"))??t.commandArgs[0];console.error(` unknown command: ${e}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-EUSCLRLF.js");a(),await c(0)}if(r in d){let a=d[r],e=t.commandArgs.length>0?` ${t.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),e&&console.error(` \u2192 ${a}${e}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(t.help||t.commandArgs.includes("--help")||t.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",e=t.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!e){let{printGroupHelp:i}=await import("./chunks/help-EUSCLRLF.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-EUSCLRLF.js");i(a&&e?e:r,{prefer:a&&e?"verb":"command",group:a&&e?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-BMAKK4FR.js"),i=e(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-P2MPMFR3.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-FUPVKOCV.js");await a(t.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-GZZ7OVM3.js"),e=await a(s);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:a}=await import("./chunks/test-4TUHEODP.js");await a(t.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-IAWL5YVJ.js");await a(t.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-V62C4AQM.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-3HWBUCVM.js");await a(t.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-R7IDN3T6.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-D2CAEFO5.js"),e=await a(t.commandArgs,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-VMHZN3WB.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"react":{let{runReact:a}=await import("./chunks/react-PXYQBCAK.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-YGGPEX7B.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-6PNFJNLF.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-QDUWRQUF.js");await a(t.commandArgs,{port:o,verbose:n});break}case"slides":{let{runSlides:a}=await import("./chunks/slides-HJXHSWEF.js");await a(s,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-IL5442GI.js");await a(t.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-P2MPMFR3.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-WQP3TJ62.js");await a(s,{port:o,verbose:n});break}case"camera":{let{runCamera:a}=await import("./chunks/camera-6Z3YMMEG.js");await a(s,{port:o});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-JILPOKRF.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-KKAJOJWO.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-GFDUQYHG.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-BMAKK4FR.js"),i=e(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-FW6XTHQE.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-FW6XTHQE.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-FW6XTHQE.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-FW6XTHQE.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-ST33XAYN.js");await a(t.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-GYJ6BHY7.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-CH6BYJ4T.js");await a(t.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-CF7HUVQL.js");await a(t.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-RUZ7MAPC.js");await a(t.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-4RE2BP3H.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-QDJPYI2O.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-LJ37JUG2.js");await a(t.commandArgs);break}case"setup-repo":case"init":{let{runSetupRepo:a}=await import("./chunks/setup-repo-UZMY3JFZ.js");await a(t.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-N4QT365P.js");await a(t.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-QYLXYZQJ.js");await a(t.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-7Q3NW5MV.js");await a(t.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-5DEUBHYC.js");await a(t.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-RQOM2I2S.js");await a(t.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-SL5WMHSF.js");await a(t.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-ZEBIO5HC.js");await a(t.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-3TUC2YGM.js");await a(t.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-HDWGM5WJ.js");await a(t.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-V5N6TSVL.js"),e=await a(t.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-M32Q4WRZ.js"),e=await a(t.commandArgs);process.exit(e)}case"skills":{let{runSkills:a}=await import("./chunks/skills-GDYPRMR5.js");await a(t.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-35XW4DMZ.js");await a(t.commandArgs,{port:o,verbose:n});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-QJCMHTWY.js");await a(t.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-HF2LDTK7.js");a(t.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
10
+ `),process.exit(1))}var t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-2XLLWARK.js");a({event:"cli_command_invoked",properties:{command:t.command||(t.version?"version":t.help?"help":"none"),arg_count:t.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:e}=await import("./chunks/telemetry-2XLLWARK.js");await e(),process.exit(a)}if(t.version){let{getCliVersion:a}=await import("./chunks/cli-version-EKKWCHRX.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-4E5USTEI.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-ZSCTLOYE.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(t.help&&!t.command){let{printHelp:a}=await import("./chunks/help-XBQIK2XY.js");a(),await c(0)}var o=t.globalFlags.port,s=t.verbose,p=t.globalFlags.device,l=t.globalFlags.theme,S=t.globalFlags.driver,E=t.globalFlags.headless===!0,b=t.globalFlags.sim??t.globalFlags.session??t.globalFlags.tab,n=b?["--sim",b,...t.commandArgs]:t.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-3SLGP5O3.js"),e={};p&&(e.deviceModel=p),l&&(e.colorScheme=l),a.apply(e)}if(!t.command&&t.commandArgs.length===0){let{printHelp:a}=await import("./chunks/help-XBQIK2XY.js");a(),await c(0)}var r=t.command??"";if(!r){if(t.commandArgs.length>0){let e=t.commandArgs.find(i=>!i.startsWith("-"))??t.commandArgs[0];console.error(` unknown command: ${e}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-XBQIK2XY.js");a(),await c(0)}if(r in d){let a=d[r],e=t.commandArgs.length>0?` ${t.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),e&&console.error(` \u2192 ${a}${e}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(t.help||t.commandArgs.includes("--help")||t.commandArgs.includes("-h")){if(r==="skill"){let{runSkill:i}=await import("./chunks/skills-PPVS4XOQ.js");await i(t.commandArgs),await c(0)}let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",e=t.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!e){let{printGroupHelp:i}=await import("./chunks/help-XBQIK2XY.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-XBQIK2XY.js");i(a&&e?e:r,{prefer:a&&e?"verb":"command",group:a&&e?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{runInspect:a}=await import("./chunks/inspect-2ABU5WET.js");await a([r,...n],{port:o,verbose:s})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-ONEP4NQU.js");await a(t.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-KA2WCWDL.js"),e=await a(n);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:a}=await import("./chunks/test-362G4M5A.js");await a(t.commandArgs,{port:o,verbose:s});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-UIJMKIGQ.js");await a(t.commandArgs,{port:o,verbose:s});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-MKCHEOKA.js"),e=await a(n,{port:o,verbose:s});process.exit(typeof e=="number"?e:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-S52ZNGN2.js");await a(t.commandArgs,{port:o,verbose:s});break}case"record":{let{runRecord:a}=await import("./chunks/record-YT63SUHO.js");await a(n,{port:o,verbose:s});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-IG5F3LTL.js"),e=await a(t.commandArgs,{port:o,verbose:s});process.exit(typeof e=="number"?e:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-RWGQTWLP.js"),e=await a(n,{port:o,verbose:s});process.exit(typeof e=="number"?e:0)}case"react":{let{runReact:a}=await import("./chunks/react-275HCOFC.js"),e=await a(n,{port:o,verbose:s});process.exit(typeof e=="number"?e:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-5AZ4MY3A.js");await a(n,{port:o,verbose:s});break}case"screenshots":{if(t.commandArgs[0]==="capture"){let{runScreenshotsCapture:i}=await import("./chunks/screenshots-capture-I66JD3AD.js"),m=await i(t.commandArgs.slice(1));process.exit(typeof m=="number"?m:0)}let{runScreenshots:a}=await import("./chunks/screenshots-UUJNZSG7.js"),e=await a(n,{port:o,verbose:s});process.exit(typeof e=="number"?e:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-4S4EX2XJ.js");await a(t.commandArgs,{port:o,verbose:s});break}case"slides":{let{runSlides:a}=await import("./chunks/slides-ZWSZJZUY.js");await a(n,{port:o,verbose:s});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-JNVTM2UT.js");await a(t.commandArgs,{port:o,verbose:s});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-2ABU5WET.js");await a(n,{port:o,verbose:s});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-R7PL3MHF.js");await a(n,{port:o,verbose:s});break}case"camera":{let{runCamera:a}=await import("./chunks/camera-RORW4MAA.js");await a(n,{port:o});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-VKC6ULRK.js");await a(n,{port:o,verbose:s});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-KQCWMQJT.js");await a(n,{port:o,verbose:s});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-OXAKLLZT.js"),e=await a(n,{port:o,verbose:s});process.exit(typeof e=="number"?e:0)}case"open":{let{runOpenCommand:a}=await import("./chunks/control-TWINYHMY.js");await a(n,{port:o});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-TWINYHMY.js");await a(n,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-TWINYHMY.js");await a(n,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-TWINYHMY.js");await a(n,{port:o});break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-7SRVX2PU.js");await a(n,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-ZVZM5TML.js");await a(t.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-CTCH4VOL.js");await a(t.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-6D6DXBO3.js");await a(t.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-T5OSWDTJ.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-K76PXAD4.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-RPVEUNUC.js");await a(t.commandArgs);break}case"setup":{let{runSetup:a}=await import("./chunks/setup-C44N54O7.js");await a(t.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-4NOQ3YY4.js");await a(t.commandArgs);break}case"serve":{let{runServe:a}=await import("./chunks/serve-O46Q4WAD.js");await a(t.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-AOSMNBD4.js");await a(t.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-WYZMDZAK.js");await a(t.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-SJPX4SPA.js");await a(t.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-4Z7AFNH3.js");await a(t.commandArgs);break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-3C2BKQKX.js"),e=await a(t.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-OIKCYOXZ.js"),e=await a(t.commandArgs);process.exit(e)}case"skill":{let{runSkill:a}=await import("./chunks/skills-PPVS4XOQ.js");await a(t.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-MXOBV6RT.js");await a(t.commandArgs,{port:o,verbose:s});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-25O32NAP.js");await a(t.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-P3ZIAP3Z.js");a(t.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
@@ -0,0 +1,46 @@
1
+ /*! sootsim v0.1.170 | (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 D,n as k,o as x,p as g,q as O,r as R}from"./chunk-IO7KAVFK.js";import"./chunk-5ZHUPPS5.js";import{c as $}from"./chunk-UDMJSFSH.js";import"./chunk-35GMFXVJ.js";import"./chunk-XOTJD6PU.js";import"./chunk-3TM7DHWE.js";import"./chunk-ODGEH6OW.js";import"./chunk-ER4GBJRY.js";import"./chunk-ULV4PWN4.js";import"./chunk-DWXC25XG.js";import{j as y}from"./chunk-EX6V4ZV6.js";import"./chunk-DKTC53HV.js";import"./chunk-VATHADSI.js";import"./chunk-V4HTQPMA.js";import"./chunk-WN7R4GL4.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 C}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 C(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==C.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}=R(),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
+ `),L(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
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
+ `),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
6
+ `),1;let o=A({cwd:s,name:e["--name"]||d.basename(s),preferredProvider:U(e["--provider"]),sourceRoots:[s]});return process.stdout.write(`\u2713 attached "${o.name}" (id: ${o.id})
7
+ cwd: ${o.cwd}
8
+ framework: ${o.framework}
9
+ preferred provider: ${o.preferredProvider}
10
+ `),0}async function J(){let n=[...S()].sort((t,r)=>r.updatedAt-t.updatedAt);if(n.length===0)return process.stdout.write("no attached projects yet. try `sootsim agent attach <dir>`.\n"),0;let e=`${"ID".padEnd(18)} ${"NAME".padEnd(20)} ${"FRAMEWORK".padEnd(10)} ${"PROVIDER".padEnd(8)} ${"7D COST".padEnd(10)} CWD
11
+ `;process.stdout.write(e);for(let t of n){let r=j(t),s=r>0?`$${r.toFixed(2)}`:"\u2014";process.stdout.write(`${t.id.padEnd(18)} ${p(t.name,20).padEnd(20)} ${t.framework.padEnd(10)} ${t.preferredProvider.padEnd(8)} ${s.padEnd(10)} ${t.cwd}
12
+ `)}return 0}async function V(n){let[e,t]=n;if(e==="show"){if(!t)return process.stderr.write(`usage: sootsim agent project show <id>
13
+ `),2;let r=l(t);return r?(process.stdout.write(JSON.stringify(r,null,2)+`
14
+ `),0):(process.stderr.write(`no project with id=${t}
15
+ `),1)}return e==="remove"?t?(T(t),process.stdout.write(`\u2713 removed project ${t}
16
+ `),0):(process.stderr.write(`usage: sootsim agent project remove <id>
17
+ `),2):(process.stderr.write(`usage: sootsim agent project [show|remove] <id>
18
+ `),2)}async function H(n){let{flags:e}=P(n,{"--project":"value","--all":"bool"}),t=e["--project"]||void 0,r=e["--all"]===!0,s=I(t);if(r||(s=s.filter(i=>i.status!=="ended")),s=s.sort((i,a)=>a.lastSeenAt-i.lastSeenAt),s.length===0)return process.stdout.write(r?`no sessions.
19
+ `:`no active sessions. pass --all to include ended.
20
+ `),0;let o=`${"SESSION".padEnd(26)} ${"PROJECT".padEnd(18)} ${"PROVIDER".padEnd(8)} ${"STATUS".padEnd(16)} ${"ALIVE".padEnd(5)} LAST PROMPT
21
+ `;process.stdout.write(o);for(let i of s){let a=O(i.wrapperPid,i.id)?"yes":"no",m=i.lastPrompt?p(i.lastPrompt,40):"";process.stdout.write(`${N(i.id).padEnd(26)} ${N(i.projectId).padEnd(18)} ${i.provider.padEnd(8)} ${i.status.padEnd(16)} ${a.padEnd(5)} ${m}
22
+ `)}return 0}async function G(n){let{flags:e,positional:t}=P(n,{"--provider":"value","--codex-bin":"value","--claude-bin":"value","--fresh-thread":"bool"}),r=t[0];if(!r)return process.stderr.write(`usage: sootsim agent start <projectId> [--provider codex|claude] [--fresh-thread]
23
+ `),2;let s=await v(i=>i.startSession({projectId:r,provider:U(e["--provider"],void 0)||void 0,codexBin:e["--codex-bin"]||void 0,claudeBin:e["--claude-bin"]||void 0,freshThread:e["--fresh-thread"]===!0})),o=l(s.session.projectId);return process.stdout.write(`\u2713 session ${s.session.id} started
24
+ project: ${o.name} (${o.id})
25
+ provider: ${s.session.provider}
26
+ pid: ${s.wrapperPid}
27
+ prompt with: sootsim agent prompt ${s.session.id} "<text>"
28
+ watch events: sootsim agent watch ${s.session.id}
29
+ `),0}async function q(n){let[e,...t]=n,r=t.join(" ");return!e||!r?(process.stderr.write(`usage: sootsim agent prompt <sessionId> "<text>"
30
+ `),2):(await v(s=>s.sendPrompt(e,{text:r})),process.stdout.write(`\u2713 prompt sent to ${e}
31
+ `),0)}async function K(n){let e=n[0];if(!e)return process.stderr.write(`usage: sootsim agent watch <sessionId>
32
+ `),2;process.stdout.write(`watching ${e}
33
+ ---
34
+ `);let t=await h({clientLabel:"sootsim-agent-watch"}),r,s=new Promise(a=>{r=a}),o=t.onAgentEvent(({sessionId:a,event:m})=>{a===e&&process.stdout.write(X(m)+`
35
+ `)}),i=t.onDisconnect(()=>{process.stderr.write(`
36
+ [sootsim] daemon disconnected; exiting watch.
37
+ `),r(1)});try{await t.subscribeEvents(e)}catch(a){throw o(),i(),t.close(),a}return process.on("SIGINT",()=>{o(),i(),t.unsubscribeEvents(e).catch(()=>{}),t.close(),r(130)}),s}function X(n){let e=Z(n.ts);switch(n.type){case"ready":return`[${e}] ready ${n.provider} @ ${n.cwd}`;case"prompt-received":return`[${e}] prompt "${p(n.text,120)}"`;case"turn-started":return`[${e}] turn-started ${n.turnId??""}`;case"turn-message":return`[${e}] turn-message ${n.delta.replace(/\s+$/,"")}`;case"turn-reasoning":return`[${e}] turn-reasoning ${p(n.delta,200)}`;case"tool-call":return`[${e}] tool-call ${n.name}`;case"file-edited":return`[${e}] file-edited ${n.kind.padEnd(6)} ${n.path}`;case"turn-completed":return`[${e}] turn-completed ${n.durationMs}ms files=${n.filesTouched.length}`;case"approval-needed":return`[${e}] approval ${n.kind}`;case"error":return`[${e}] error ${n.message}`;case"exited":return`[${e}] exited code=${n.code}`;case"file-diff-delta":return`[${e}] file-diff-delta ${n.path}`;case"turn-plan":return`[${e}] turn-plan steps=${n.steps.length}`;default:return`[${e}] ${n.type}`}}async function z(n){let e=n[0];if(!e)return process.stderr.write(`usage: sootsim agent transcript <sessionId>
38
+ `),2;let t=g(e);return w.existsSync(t)?(process.stdout.write(w.readFileSync(t,"utf8")),0):(process.stderr.write(`transcript not found: ${t}
39
+ `),1)}async function Q(n){let e=n[0];return e?(await v(t=>t.endSession(e)),process.stdout.write(`\u2713 ended session ${e}
40
+ `),0):(process.stderr.write(`usage: sootsim agent end <sessionId>
41
+ `),2)}async function Y(){let n=E();return process.stdout.write(`userData: ${n}
42
+ state: ${d.join(n,"attached-projects.json")}
43
+ sessions: ${d.join(n,"sessions")}
44
+ transcripts: ${d.join(n,"transcripts")}
45
+ locks: ${d.join(n,"locks")}
46
+ `),0}function p(n,e){return n.length<=e?n:n.slice(0,e-1)+"\u2026"}function N(n){return n.length>14?`${n.slice(0,14)}\u2026`:n}function Z(n){return new Date(n).toISOString().replace("T"," ").slice(0,19)}var fe={sessionDir:D,promptFifoPath:k,eventsFifoPath:x,transcriptPath:g,parseAgentEventLine:b};export{fe as __internals,ge as runAgentCommand};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as M}from"./chunk-2DDHS4Z3.js";import"./chunk-BUCBIG2A.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.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as M}from"./chunk-5ZHUPPS5.js";import"./chunk-WN7R4GL4.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.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as p}from"./chunk-ENK2SG5R.js";import"./chunk-BUCBIG2A.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.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as p}from"./chunk-TXKOJ3P5.js";import"./chunk-WN7R4GL4.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.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-BUCBIG2A.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.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-WN7R4GL4.js";import{spawn as x}from"child_process";var w=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),S=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),q=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),P=new Set(["--path-equals"]);function j(s){let r=[],u=[],n=0,e=!1,t=!1,i=!1;for(let o=0;o<s.length;o++){let a=s[o];if(a==="--within"){let c=Number(s[o+1]);if(!Number.isFinite(c)||c<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=c,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(S.has(a)){u.push({kind:a,args:[]});continue}if(q.has(a)){let c=s[o+1];if(c==null)return{error:`${a} requires a value`};u.push({kind:a,args:[c]}),o++;continue}if(P.has(a)){let c=s[o+1],f=s[o+2];if(c==null||f==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[c,f]}),o+=2;continue}r.push(a)}return r.length===0?{error:"assert requires a verb (e.g. find, describe, get errors)"}:{verbArgs:r,predicates:u,withinMs:n,negate:e,quiet:t,allowTimeout:i}}function N(s){return s[0]==="get"||s[0]==="debug"?w.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:w.has(s[0])?s[0]:null}async function R(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=x(process.execPath,u,{stdio:["ignore","pipe","pipe"],env:process.env}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",o=>{n({ok:!1,payload:null,reason:`spawn failed: ${o.message}`})}),e.on("close",o=>{if(o!==0){let a=i.trim().split(`
3
3
  `).slice(-2).join(" | ").slice(0,200);n({ok:!1,payload:null,reason:`verb exited ${o}${a?`: ${a}`:""}`});return}if(!t.trim()){n({ok:!1,payload:null,reason:"verb produced no output"});return}try{let a=JSON.parse(t);n({ok:!0,payload:a})}catch{n({ok:!1,payload:null,reason:`verb output was not valid json: ${t.slice(0,120)}`})}})})}function y(s,r){let u=r.split(".").filter(e=>e.length>0),n=s;for(let e of u){if(n==null)return{found:!1};if(Array.isArray(n)){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{found:!1};n=n[t];continue}if(typeof n=="object"){let t=n;if(!(e in t))return{found:!1};n=t[e];continue}return{found:!1}}return{found:!0,value:n}}function d(s){return Array.isArray(s)?s.length:s&&typeof s=="object"?Object.keys(s).length:null}async function A(s,r){let{kind:u,args:n}=s;switch(u){case"--exists":return r==null?{ok:!1,reason:"payload is null"}:d(r)===0?{ok:!1,reason:"payload is empty"}:{ok:!0,reason:"exists"};case"--empty":{if(r==null)return{ok:!0,reason:"payload is null"};let e=d(r);return e===0?{ok:!0,reason:"payload is empty"}:{ok:!1,reason:`payload has ${e} item(s)`}}case"--count":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:`payload not countable (${typeof r})`}:{ok:t===e,reason:`count=${t}, want=${e}`}}case"--count-at-least":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t>=e,reason:`count=${t}, want>=${e}`}}case"--count-at-most":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t<=e,reason:`count=${t}, want<=${e}`}}case"--contains":{let e=n[0],t=JSON.stringify(r);return{ok:t.includes(e),reason:t.includes(e)?`contains "${e}"`:`missing "${e}"`}}case"--not-contains":{let e=n[0],t=JSON.stringify(r);return{ok:!t.includes(e),reason:t.includes(e)?`unexpected "${e}"`:`not contains "${e}"`}}case"--matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=e.test(t);return{ok:i,reason:i?`matches /${n[0]}/`:`no match for /${n[0]}/`}}case"--not-matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=!e.test(t);return{ok:i,reason:i?`not matches /${n[0]}/`:`unexpected /${n[0]}/`}}case"--equals":{let e=n[0],t=typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):JSON.stringify(r);return{ok:t===e,reason:`got=${JSON.stringify(t)}, want=${JSON.stringify(e)}`}}case"--has-path":{let e=y(r,n[0]);return{ok:e.found,reason:e.found?`path ${n[0]} present`:`path ${n[0]} missing`}}case"--path-equals":{let[e,t]=n,i=y(r,e);if(!i.found)return{ok:!1,reason:`path ${e} missing`};let o=typeof i.value=="string"||typeof i.value=="number"||typeof i.value=="boolean"?String(i.value):JSON.stringify(i.value);return{ok:o===t,reason:`${e}=${o}, want=${t}`}}case"--jq":{let e=n[0];try{let i=(await O(e,r)).trim();return{ok:i.length>0&&i!=="null"&&i!=="false"&&i!=='""',reason:`jq: ${i.slice(0,120)}`}}catch(t){throw new Error(`jq evaluation failed: ${t.message}`)}}default:return{ok:!1,reason:`unknown predicate ${u}`}}}function O(s,r){return new Promise((u,n)=>{let e=x("jq",[s],{stdio:["pipe","pipe","pipe"]}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",n),e.on("close",o=>{if(o!==0){n(new Error(i.trim()||`jq exited ${o}`));return}u(t)}),e.stdin.end(JSON.stringify(r))})}async function T(s){(s[0]==="--help"||s[0]==="-h"||s.length===0)&&(J(),process.exit(s.length===0?2:0));let r=j(s);"error"in r&&(process.stderr.write(` assert: ${r.error}
4
4
  `),process.exit(2));let{verbArgs:u,predicates:n,withinMs:e,negate:t,quiet:i,allowTimeout:o}=r;N(u)||(process.stderr.write(` assert: unknown or non-read verb: ${u.join(" ")}
5
5
  supported: ${Array.from(w).sort().join(", ")}
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d}from"./chunk-VATHADSI.js";import"./chunk-WN7R4GL4.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.168 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{m as f}from"./chunk-SMBSZIDN.js";import"./chunk-LCHPOJOO.js";import{c as m,e as l,g as p}from"./chunk-L7F7QBGM.js";import"./chunk-FZ656TJA.js";import"./chunk-QBYYAPTB.js";import"./chunk-MQWZBKOF.js";import"./chunk-BUCBIG2A.js";function d(){console.log(`
1
+ /*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{m as f}from"./chunk-YMFSRCHL.js";import"./chunk-Q4NDYO2U.js";import{c as m,e as l,g as p}from"./chunk-DIRDEKRW.js";import"./chunk-ULV4PWN4.js";import"./chunk-DWXC25XG.js";import"./chunk-EX6V4ZV6.js";import"./chunk-WN7R4GL4.js";function d(){console.log(`
3
3
  sootsim camera \u2014 drive the sim camera
4
4
 
5
5
  usage: