sootsim 0.1.296 → 0.1.297

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/detox/index.ts +380 -28
  2. package/detox/motion-change.cjs +109 -0
  3. package/detox/motion-change.d.cts +35 -0
  4. package/dist-cli/bin.js +5 -5
  5. package/dist-cli/chunks/{agent-3F4K6MQK.js → agent-EYT6T2IB.js} +2 -2
  6. package/dist-cli/chunks/{agent-wrapper-5LLVCQRZ.js → agent-wrapper-UU4WV5UG.js} +2 -2
  7. package/dist-cli/chunks/{app-fonts-LPTY7A5G.js → app-fonts-6SO36STZ.js} +2 -2
  8. package/dist-cli/chunks/{assert-R2ZUXEMS.js → assert-M4AVODJW.js} +2 -2
  9. package/dist-cli/chunks/{auth-CA62Q6IS.js → auth-JJNP2L7C.js} +2 -2
  10. package/dist-cli/chunks/{beta-4AXSOQLU.js → beta-BIJ5MU6X.js} +2 -2
  11. package/dist-cli/chunks/{camera-Y4RBIONE.js → camera-FGQGSHG5.js} +2 -2
  12. package/dist-cli/chunks/{chunk-FUPQIX4U.js → chunk-2JCUNWU2.js} +2 -2
  13. package/dist-cli/chunks/{chunk-F2MS365Z.js → chunk-3QVML26F.js} +2 -2
  14. package/dist-cli/chunks/{chunk-BVWIR4CD.js → chunk-445FUUZC.js} +1 -1
  15. package/dist-cli/chunks/{chunk-74FOMZP7.js → chunk-4EAJWGB4.js} +2 -2
  16. package/dist-cli/chunks/{chunk-P7HBJBHH.js → chunk-63UBXHOB.js} +1 -1
  17. package/dist-cli/chunks/{chunk-S5Z4HKWX.js → chunk-6YIHNXMZ.js} +1 -1
  18. package/dist-cli/chunks/{chunk-AUBP44CY.js → chunk-74ATIHUI.js} +2 -2
  19. package/dist-cli/chunks/{chunk-C462URRQ.js → chunk-7O6HJRGX.js} +2 -2
  20. package/dist-cli/chunks/{chunk-MQ6QX46T.js → chunk-7XXIMTJR.js} +2 -2
  21. package/dist-cli/chunks/{chunk-FROCFR77.js → chunk-AC2HNBEI.js} +1 -1
  22. package/dist-cli/chunks/{chunk-WJVBD2UL.js → chunk-BAFDYXCM.js} +1 -1
  23. package/dist-cli/chunks/{chunk-ZPBIHFQW.js → chunk-DMJN3NC3.js} +2 -2
  24. package/dist-cli/chunks/{chunk-CS23DQB2.js → chunk-E4O5A2QP.js} +2 -2
  25. package/dist-cli/chunks/{chunk-6C24WCDK.js → chunk-EKA2DXOV.js} +2 -2
  26. package/dist-cli/chunks/{chunk-2XUKWIAL.js → chunk-ERRHAM2H.js} +1 -1
  27. package/dist-cli/chunks/{chunk-4NFGOGB7.js → chunk-FC2ULGKP.js} +2 -2
  28. package/dist-cli/chunks/{chunk-7V3JNANH.js → chunk-H6RQAFD5.js} +2 -2
  29. package/dist-cli/chunks/{chunk-XMVVZCIM.js → chunk-HNQ2FYAG.js} +2 -2
  30. package/dist-cli/chunks/{chunk-CAAADPRH.js → chunk-HRPE3IND.js} +2 -2
  31. package/dist-cli/chunks/{chunk-LHUY46GE.js → chunk-HTX6BHJZ.js} +2 -2
  32. package/dist-cli/chunks/{chunk-2LQOLMRK.js → chunk-I4G2BKZB.js} +1 -1
  33. package/dist-cli/chunks/{chunk-5FNPAMP4.js → chunk-I6HFNMYG.js} +1 -1
  34. package/dist-cli/chunks/{chunk-222Y7NQA.js → chunk-IKQSTS2U.js} +1 -1
  35. package/dist-cli/chunks/{chunk-IR3DUBRF.js → chunk-IMXVXXWX.js} +2 -2
  36. package/dist-cli/chunks/{chunk-B2LDO55K.js → chunk-IVV2KJTY.js} +1 -1
  37. package/dist-cli/chunks/{chunk-MDBR4XTV.js → chunk-K36T5764.js} +3 -3
  38. package/dist-cli/chunks/{chunk-7YQXQSG7.js → chunk-KQ7WHS3C.js} +1 -1
  39. package/dist-cli/chunks/{chunk-EJ6BAJKX.js → chunk-LGU5JGT6.js} +1 -1
  40. package/dist-cli/chunks/{chunk-G2SO5FPN.js → chunk-O4IGQ7XT.js} +2 -2
  41. package/dist-cli/chunks/{chunk-4MDLYOEI.js → chunk-OBKNUUIF.js} +2 -2
  42. package/dist-cli/chunks/{chunk-GG5PWLGC.js → chunk-OTYWESTV.js} +2 -2
  43. package/dist-cli/chunks/{chunk-DUYKBCM7.js → chunk-QDL6YYL4.js} +1 -1
  44. package/dist-cli/chunks/{chunk-3PAZJSIG.js → chunk-QRFC2ZZC.js} +2 -2
  45. package/dist-cli/chunks/{chunk-B2FB6IYX.js → chunk-RZQ7SBBQ.js} +2 -2
  46. package/dist-cli/chunks/{chunk-ZIBKGZJD.js → chunk-SDHGPSEC.js} +1 -1
  47. package/dist-cli/chunks/{chunk-QIDFGREY.js → chunk-U37NEIQF.js} +1 -1
  48. package/dist-cli/chunks/{chunk-GG6XOQ5P.js → chunk-V4N34AOX.js} +2 -2
  49. package/dist-cli/chunks/{chunk-7GQWF7HE.js → chunk-VTYVJJHN.js} +1 -1
  50. package/dist-cli/chunks/{chunk-EISE56VD.js → chunk-VVSQCLBU.js} +2 -2
  51. package/dist-cli/chunks/{chunk-HSGS2U7P.js → chunk-W2QIWNCW.js} +2 -2
  52. package/dist-cli/chunks/{chunk-NEARYPSC.js → chunk-WDZ4PVKV.js} +3 -3
  53. package/dist-cli/chunks/{chunk-54TQ3ZGI.js → chunk-WFXFYXUA.js} +3 -3
  54. package/dist-cli/chunks/{chunk-SUJSGGSS.js → chunk-X5J5A63F.js} +2 -2
  55. package/dist-cli/chunks/{chunk-N3FZRJT7.js → chunk-XKACQ3MD.js} +1 -1
  56. package/dist-cli/chunks/{chunk-CDCVWGNU.js → chunk-XLT6Y654.js} +2 -2
  57. package/dist-cli/chunks/{chunk-R65XMN4D.js → chunk-Y7TQDOU5.js} +1 -1
  58. package/dist-cli/chunks/{chunk-PEUWZRXA.js → chunk-YNN2AELC.js} +3 -3
  59. package/dist-cli/chunks/{chunk-TIOPG6QZ.js → chunk-YTTBKONB.js} +1 -1
  60. package/dist-cli/chunks/{chunk-X7B5KJ6N.js → chunk-Z3VP4WF6.js} +1 -1
  61. package/dist-cli/chunks/{cleanup-4RSKYPQ7.js → cleanup-Q4GUW4DU.js} +2 -2
  62. package/dist-cli/chunks/{cli-version-VZFF7GGM.js → cli-version-Y74RBK4R.js} +2 -2
  63. package/dist-cli/chunks/{compat-FABLN4UI.js → compat-CSFBMTVO.js} +2 -2
  64. package/dist-cli/chunks/{config-74J37LKC.js → config-4ZW7VYBV.js} +2 -2
  65. package/dist-cli/chunks/{control-VBK32Y7F.js → control-BFFHTY4I.js} +2 -2
  66. package/dist-cli/chunks/daemon-746DWYWS.js +4 -0
  67. package/dist-cli/chunks/{debug-AOYA2CLR.js → debug-EEYUHHSR.js} +3 -3
  68. package/dist-cli/chunks/{desktop-G7XWDCTM.js → desktop-Q4NXGDCY.js} +3 -3
  69. package/dist-cli/chunks/{detox-QXJ3L2ZI.js → detox-UMSQ33AB.js} +2 -2
  70. package/dist-cli/chunks/{device-NZZ5ZT3Q.js → device-7STN6X5G.js} +2 -2
  71. package/dist-cli/chunks/{diagnose-5CAEJ42M.js → diagnose-7L67FGJY.js} +2 -2
  72. package/dist-cli/chunks/disk-cleanup-IISQYADA.js +4 -0
  73. package/dist-cli/chunks/drivers-RD6OW2D5.js +4 -0
  74. package/dist-cli/chunks/{film-C25VRUNC.js → film-2MP5BL6J.js} +3 -3
  75. package/dist-cli/chunks/flow-MKSEPFWS.js +4 -0
  76. package/dist-cli/chunks/help-4ADSAOGD.js +4 -0
  77. package/dist-cli/chunks/{hidden-runtime-alias-NSLIK6XT.js → hidden-runtime-alias-HTJVTEHX.js} +2 -2
  78. package/dist-cli/chunks/{home-paths-OC6JZXIM.js → home-paths-KOZFBUVS.js} +2 -2
  79. package/dist-cli/chunks/inspect-6D7Q27PN.js +4 -0
  80. package/dist-cli/chunks/install-desktop-WZBAUSKT.js +4 -0
  81. package/dist-cli/chunks/{login-LB4TMM4T.js → login-XWITDS34.js} +4 -4
  82. package/dist-cli/chunks/{logout-33IOBD4X.js → logout-C6EVSNGO.js} +2 -2
  83. package/dist-cli/chunks/{maestro-EEVXX536.js → maestro-Y3RDSX5X.js} +3 -3
  84. package/dist-cli/chunks/{maestro-generate-ICPWVXGA.js → maestro-generate-WHUYPFMX.js} +3 -3
  85. package/dist-cli/chunks/{mode-6IXOZDK3.js → mode-3D6W3Y2Y.js} +2 -2
  86. package/dist-cli/chunks/{optional-demo-registry-KBMC7SNI.js → optional-demo-registry-MRBZKL5R.js} +2 -2
  87. package/dist-cli/chunks/{perf-CTTJSAIJ.js → perf-CRMSVQX4.js} +2 -2
  88. package/dist-cli/chunks/{permissions-BFQS4DIY.js → permissions-RFASUZIH.js} +2 -2
  89. package/dist-cli/chunks/{record-MJR5ELHE.js → record-SKX3SUNS.js} +3 -3
  90. package/dist-cli/chunks/{report-issue-FMJRNDKH.js → report-issue-I7VXCIGQ.js} +2 -2
  91. package/dist-cli/chunks/runtime-OJ26HJM7.js +4 -0
  92. package/dist-cli/chunks/{screenshot-command-MGNASAXR.js → screenshot-command-PIMVRGAW.js} +3 -3
  93. package/dist-cli/chunks/{screenshots-capture-N6PANAVT.js → screenshots-capture-RRZUJDIO.js} +2 -2
  94. package/dist-cli/chunks/{serve-RS6TIO7U.js → serve-JHBXNJ77.js} +2 -2
  95. package/dist-cli/chunks/{setup-MFYGYR2F.js → setup-A3I3R4FB.js} +2 -2
  96. package/dist-cli/chunks/{skills-TD35LDKK.js → skills-7KS6HD4G.js} +2 -2
  97. package/dist-cli/chunks/{storage-VCFXDJNO.js → storage-H2ODISXF.js} +2 -2
  98. package/dist-cli/chunks/store-ARKALTX7.js +4 -0
  99. package/dist-cli/chunks/telemetry-ZMRUVMCZ.js +4 -0
  100. package/dist-cli/chunks/{timeline-UJCZAWJV.js → timeline-5N5AUCOX.js} +2 -2
  101. package/dist-cli/chunks/{upgrade-S24NH4YG.js → upgrade-UM4K5PH4.js} +2 -2
  102. package/dist-cli/chunks/upload-WGPI5XX6.js +4 -0
  103. package/dist-cli/chunks/{version-IVPWT2ZQ.js → version-B2MBTUMC.js} +2 -2
  104. package/dist-cli/chunks/{web-6BMWAWJL.js → web-ZM5Y5GRE.js} +2 -2
  105. package/dist-cli/chunks/{what-happened-HRHB6ETL.js → what-happened-K443NB2H.js} +2 -2
  106. package/dist-lib/agent-daemon-client.cjs +1 -1
  107. package/dist-lib/agent-events.cjs +1 -1
  108. package/dist-lib/agent-identity.cjs +1 -1
  109. package/dist-lib/agent-sessions.cjs +1 -1
  110. package/dist-lib/attached-projects.cjs +1 -1
  111. package/dist-lib/auth/shared-session.cjs +1 -1
  112. package/dist-lib/backend-origin.cjs +1 -1
  113. package/dist-lib/beta.cjs +1 -1
  114. package/dist-lib/beta.mjs +1 -1
  115. package/dist-lib/bridge-constants.cjs +1 -1
  116. package/dist-lib/cli-constants.cjs +1 -1
  117. package/dist-lib/config.cjs +1 -1
  118. package/dist-lib/detox/index.cjs +312 -27
  119. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  120. package/dist-lib/home-paths.cjs +1 -1
  121. package/dist-lib/host/bridge-host.cjs +1 -1
  122. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  123. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  124. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  125. package/dist-lib/host/websocket-proxy.cjs +1 -1
  126. package/dist-lib/index.cjs +1 -1
  127. package/dist-lib/jump-to-source-babel.cjs +1 -1
  128. package/dist-lib/menu.cjs +1 -1
  129. package/dist-lib/menu.mjs +1 -1
  130. package/dist-lib/metro.cjs +1 -1
  131. package/dist-lib/profiles.cjs +1 -1
  132. package/dist-lib/render-mode.cjs +1 -1
  133. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  134. package/dist-lib/sdk.cjs +1 -1
  135. package/dist-lib/sdk.mjs +1 -1
  136. package/dist-lib/skills.cjs +1 -1
  137. package/dist-lib/vite.cjs +1 -1
  138. package/package.json +1 -1
  139. package/dist-cli/chunks/daemon-VFO7LRR4.js +0 -4
  140. package/dist-cli/chunks/disk-cleanup-GZSUZJ6Y.js +0 -4
  141. package/dist-cli/chunks/drivers-OLJCUSPO.js +0 -4
  142. package/dist-cli/chunks/flow-IW3WUF5D.js +0 -4
  143. package/dist-cli/chunks/help-GEVJF2DA.js +0 -4
  144. package/dist-cli/chunks/inspect-KXJNI7CU.js +0 -4
  145. package/dist-cli/chunks/install-desktop-IYWPRFPB.js +0 -4
  146. package/dist-cli/chunks/runtime-PV4HH2OB.js +0 -4
  147. package/dist-cli/chunks/store-VNSTKYBQ.js +0 -4
  148. package/dist-cli/chunks/telemetry-GPNHSYFF.js +0 -4
  149. package/dist-cli/chunks/upload-CCKAO2M5.js +0 -4
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- 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-4MDLYOEI.js";import"./chunk-TIOPG6QZ.js";import{c as $}from"./chunk-CAAADPRH.js";import"./chunk-FUPQIX4U.js";import"./chunk-6C24WCDK.js";import"./chunk-3PAZJSIG.js";import"./chunk-CDCVWGNU.js";import"./chunk-2LQOLMRK.js";import"./chunk-7GQWF7HE.js";import"./chunk-5FNPAMP4.js";import{j as y}from"./chunk-WJVBD2UL.js";import"./chunk-QIDFGREY.js";import"./chunk-7YQXQSG7.js";import"./chunk-X7B5KJ6N.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}
4
+ 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-OBKNUUIF.js";import"./chunk-YTTBKONB.js";import{c as $}from"./chunk-HRPE3IND.js";import"./chunk-2JCUNWU2.js";import"./chunk-EKA2DXOV.js";import"./chunk-QRFC2ZZC.js";import"./chunk-XLT6Y654.js";import"./chunk-I4G2BKZB.js";import"./chunk-VTYVJJHN.js";import"./chunk-I6HFNMYG.js";import{j as y}from"./chunk-BAFDYXCM.js";import"./chunk-U37NEIQF.js";import"./chunk-KQ7WHS3C.js";import"./chunk-Z3VP4WF6.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}
5
5
  `),L(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
6
6
  `),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]
7
7
  `),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{b as M}from"./chunk-TIOPG6QZ.js";import"./chunk-X7B5KJ6N.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as C,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,f=!1,a=new Promise(s=>{t.on("exit",(o,e)=>{f=!0;let p=new Error(`codex app-server exited (code=${o}, signal=${e??""})`);for(let{reject:y}of r.values())y(p);r.clear(),s({code:o,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let o=s.trim();if(!o)return;let e;try{e=JSON.parse(o)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,y=p!=null?r.get(p):void 0;if(!y)return;r.delete(p),e.error?y.reject(new b(e.error.message,e.error.code,e.error.data)):y.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let y of p)try{y(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let o=m.get("__stderr__");if(o)for(let e of o)try{e({text:s})}catch{}});function n(s){if(!f)try{t.stdin.write(JSON.stringify(s)+`
4
+ import{b as M}from"./chunk-YTTBKONB.js";import"./chunk-Z3VP4WF6.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as C,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,f=!1,a=new Promise(s=>{t.on("exit",(o,e)=>{f=!0;let p=new Error(`codex app-server exited (code=${o}, signal=${e??""})`);for(let{reject:y}of r.values())y(p);r.clear(),s({code:o,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let o=s.trim();if(!o)return;let e;try{e=JSON.parse(o)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,y=p!=null?r.get(p):void 0;if(!y)return;r.delete(p),e.error?y.reject(new b(e.error.message,e.error.code,e.error.data)):y.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let y of p)try{y(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let o=m.get("__stderr__");if(o)for(let e of o)try{e({text:s})}catch{}});function n(s){if(!f)try{t.stdin.write(JSON.stringify(s)+`
5
5
  `)}catch{}}return{exited:a,on(s,o){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(o),()=>{e?.delete(o)}},request(s,o){if(f)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,y)=>{r.set(e,{resolve:l=>p(l),reject:y,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:o})})},notify(s,o){n({jsonrpc:"2.0",method:s,params:o})},async shutdown(s=1500){if(f)return;try{t.stdin.end()}catch{}let o=setTimeout(()=>{if(!f)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(o)}},kill(s="SIGTERM"){if(!f)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return C(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let f=t[u];f&&(r[f]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: sootsim agent-wrapper --session-id <id> --project-id <id>
6
6
  --provider codex|claude --cwd <path>
7
7
  --prompt-in <fifo> --events-out <fifo>
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{d as p}from"./chunk-F2MS365Z.js";import"./chunk-ZIBKGZJD.js";import"./chunk-X7B5KJ6N.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};
4
+ import{d as p}from"./chunk-3QVML26F.js";import"./chunk-SDHGPSEC.js";import"./chunk-Z3VP4WF6.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,7 +1,7 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import"./chunk-X7B5KJ6N.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(`
4
+ import"./chunk-Z3VP4WF6.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(`
5
5
  `).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}
6
6
  `),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(" ")}
7
7
  supported: ${Array.from(w).sort().join(", ")}
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as t}from"./chunk-AUBP44CY.js";import{d as s}from"./chunk-MQ6QX46T.js";import"./chunk-WJVBD2UL.js";import"./chunk-X7B5KJ6N.js";function i(){console.log(`
4
+ import{a as t}from"./chunk-74ATIHUI.js";import{d as s}from"./chunk-7XXIMTJR.js";import"./chunk-BAFDYXCM.js";import"./chunk-Z3VP4WF6.js";function i(){console.log(`
5
5
  sootsim auth \u2014 inspect CLI auth
6
6
 
7
7
  usage:
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c,d}from"./chunk-7YQXQSG7.js";import"./chunk-X7B5KJ6N.js";export{d as BETA_ASK_HEADLINE,b as BETA_LABEL,c as BETA_TAGLINE,a as IS_BETA};
4
+ import{a,b,c,d}from"./chunk-KQ7WHS3C.js";import"./chunk-Z3VP4WF6.js";export{d as BETA_ASK_HEADLINE,b as BETA_LABEL,c as BETA_TAGLINE,a as IS_BETA};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{m as d}from"./chunk-C462URRQ.js";import"./chunk-2XUKWIAL.js";import{h as l,j as m,l as p}from"./chunk-IR3DUBRF.js";import"./chunk-2LQOLMRK.js";import"./chunk-7GQWF7HE.js";import"./chunk-WJVBD2UL.js";import"./chunk-X7B5KJ6N.js";function f(){console.log(`
4
+ import{m as d}from"./chunk-7O6HJRGX.js";import"./chunk-ERRHAM2H.js";import{h as l,j as m,l as p}from"./chunk-IMXVXXWX.js";import"./chunk-I4G2BKZB.js";import"./chunk-VTYVJJHN.js";import"./chunk-BAFDYXCM.js";import"./chunk-Z3VP4WF6.js";function f(){console.log(`
5
5
  sootsim do scan \u2014 inject a barcode scan
6
6
 
7
7
  usage:
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{H as t,L as n,N as l,j as r}from"./chunk-WJVBD2UL.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};
4
+ import{H as t,L as n,N as l,j as r}from"./chunk-BAFDYXCM.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,4 +1,4 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as S}from"./chunk-ZIBKGZJD.js";import{createHash as W}from"node:crypto";import A from"node:fs";import{createRequire as O}from"node:module";import c from"node:path";var C=/\.(ttf|otf|woff|woff2)$/i;function _(t,n,e){if(!t||typeof t!="object")return;let o=t.fonts;if(Array.isArray(o))for(let i of o)typeof i=="string"&&e.push(i);let r=t[n];if(!r||typeof r!="object")return;let s=r.fonts;if(Array.isArray(s))for(let i of s){if(typeof i=="string"){e.push(i);continue}if(!i||typeof i!="object")continue;let a=i.fontDefinitions;if(Array.isArray(a))for(let y of a){if(!y||typeof y!="object")continue;let d=y.path;typeof d=="string"&&e.push(d)}}}function D(t,n){if(!Array.isArray(t))return[];let e=[];for(let o of t){let r=Array.isArray(o)?o[0]:o;if(typeof r!="string"||!/(^|\/)expo-font$/.test(r))continue;let s=Array.isArray(o)?o[1]??{}:{};_(s,n,e)}return e}function N(t){return t.slice(t.lastIndexOf("/")+1).replace(C,"")}function $(t,n){let e=n.replace(/\/+$/,""),o=new Set,r=[];for(let s of t){let i=s.replace(/^\.\//,"").replace(/^\/+/,"");!i||o.has(i)||(o.add(i),C.test(i)&&r.push({family:N(i),url:`${e}/assets/${i}`}))}return r}var T=O(import.meta.url);function E(t){try{let n=new URL(t),e=n.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(e==="localhost"||e.endsWith(".localhost")||e==="0.0.0.0"||e==="::1"||/^127(?:\.\d{1,3}){3}$/.test(e))return n.origin}catch{}return null}function q(t){try{return A.statSync(c.join(t,"package.json")).isFile()}catch{return!1}}function Q(t){let n=E(t.bundleUrl);if(!n)return[];let e=t.repoDir||process.env.CONTRAST_REPO_DIR,o=e?c.resolve(e):process.cwd();if(!e&&!q(o))return[];let r=S(o,{trustStart:t.exactProjectDir}),s=r?.appDir??null;if(!s)return[];let i=(t.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),a=null;if(e||r)try{let p=T.resolve("@expo/config",{paths:[s,o]}),u=T(p);typeof u.getConfig=="function"&&(a=u.getConfig)}catch{}let y=[];if(a)try{let p=a(s,{skipSDKVersionRequirement:!0});if(p?.exp&&typeof p.exp=="object"){let u=p.exp.plugins;Array.isArray(u)&&(y=u)}}catch{}let d=D(y,i==="android"?"android":"ios").slice(0,256),I=Date.now(),P=0,j=(p,u)=>{let h=[{dir:p,depth:0}],l=0;for(;l<h.length&&P<64&&d.length<256&&Date.now()-I<50;){let f=h[l++];if(!f)continue;P++;let m;try{m=A.readdirSync(f.dir,{withFileTypes:!0})}catch{continue}for(let g of m){if(g.isSymbolicLink())continue;let x=c.join(f.dir,g.name);if(g.isDirectory()){f.depth<4&&h.length<64&&!g.name.startsWith(".")&&h.push({dir:x,depth:f.depth+1});continue}if(!g.isFile()||!/\.(ttf|otf|woff|woff2)$/i.test(g.name))continue;let w=c.relative(p,x).split(c.sep).join("/");if(d.push(c.posix.join(u,w)),d.length>=256)break}}};try{let p=JSON.parse(A.readFileSync(c.join(s,"package.json"),"utf8")),u=new Set;for(let l of["dependencies","devDependencies","optionalDependencies"]){let f=Reflect.get(p,l);if(!(!f||typeof f!="object"))for(let m of Object.keys(f))u.add(m)}let h=[...u].filter(l=>l==="react-native-vector-icons"||l.startsWith("@react-native-vector-icons/"));if(h.length>0){let l=Reflect.get(p,"reactNativeVectorIcons"),f=l&&typeof l=="object"?Reflect.get(l,"fontDir"):null,m=typeof f=="string"?f:"rnvi-fonts",g=c.resolve(s,m),x=c.relative(s,g);!x.startsWith("..")&&!c.isAbsolute(x)&&j(g,x.split(c.sep).join("/"));let w=O(c.join(s,"package.json"));for(let F of h)try{let v=w.resolve(F),L=F.split("/").join(c.sep),b=`${c.sep}node_modules${c.sep}${L}${c.sep}`,R=v.lastIndexOf(b);if(R===-1)continue;let U=v.slice(0,R+b.length-1),k=F==="react-native-vector-icons"?"Fonts":"fonts";j(c.join(U,k),c.posix.join("node_modules",F,k))}catch{}}}catch{}return $(d,n)}async function Y(t,n){let e=E(t);if(!e)return null;let o=new AbortController,r=setTimeout(()=>o.abort(),n?.timeoutMs??1500);try{let s=await fetch(`${e}/`,{headers:{"expo-platform":"ios",Accept:"application/json"},signal:o.signal});if(!s.ok)return null;let a=(await s.json())?.extra?.expoClient?._internal?.projectRoot;return typeof a=="string"&&a.length>0?a:null}catch{return null}finally{clearTimeout(r)}}function Z(t){return t.map(n=>`${encodeURIComponent(n.url)}::${encodeURIComponent(n.family)}`).join(",")}function M(t){let n=[];for(let e of t.split(",")){let o=e.trim();if(!o)continue;let r=o.indexOf("::"),s=r===-1?o:o.slice(0,r);try{n.push(decodeURIComponent(s))}catch{n.push(s)}}return n.filter(Boolean)}function G(t){let n=(t.split("?")[0].split(".").pop()||"").toLowerCase();return n==="ttf"?"font/ttf":n==="otf"?"font/otf":n==="woff"?"font/woff":n==="woff2"?"font/woff2":"application/octet-stream"}async function tt(t,n){let e=[],o=new Set;for(let r of M(t)){let s=W("sha256").update(r).digest("hex");if(!o.has(s)){o.add(s);try{let i=await fetch(r);if(!i.ok){n?.onError?.(r,new Error(`${i.status} ${i.statusText}`));continue}let a=new Uint8Array(await i.arrayBuffer());e.push({url:r,urlhash:s,contentType:G(r),bytes:a}),n?.onStaged?.({url:r,byteLength:a.byteLength})}catch(i){n?.onError?.(r,i)}}}return e}export{Q as a,Y as b,Z as c,tt as d};
4
+ import{a as S}from"./chunk-SDHGPSEC.js";import{createHash as W}from"node:crypto";import A from"node:fs";import{createRequire as O}from"node:module";import c from"node:path";var C=/\.(ttf|otf|woff|woff2)$/i;function _(t,n,e){if(!t||typeof t!="object")return;let o=t.fonts;if(Array.isArray(o))for(let i of o)typeof i=="string"&&e.push(i);let r=t[n];if(!r||typeof r!="object")return;let s=r.fonts;if(Array.isArray(s))for(let i of s){if(typeof i=="string"){e.push(i);continue}if(!i||typeof i!="object")continue;let a=i.fontDefinitions;if(Array.isArray(a))for(let y of a){if(!y||typeof y!="object")continue;let d=y.path;typeof d=="string"&&e.push(d)}}}function D(t,n){if(!Array.isArray(t))return[];let e=[];for(let o of t){let r=Array.isArray(o)?o[0]:o;if(typeof r!="string"||!/(^|\/)expo-font$/.test(r))continue;let s=Array.isArray(o)?o[1]??{}:{};_(s,n,e)}return e}function N(t){return t.slice(t.lastIndexOf("/")+1).replace(C,"")}function $(t,n){let e=n.replace(/\/+$/,""),o=new Set,r=[];for(let s of t){let i=s.replace(/^\.\//,"").replace(/^\/+/,"");!i||o.has(i)||(o.add(i),C.test(i)&&r.push({family:N(i),url:`${e}/assets/${i}`}))}return r}var T=O(import.meta.url);function E(t){try{let n=new URL(t),e=n.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(e==="localhost"||e.endsWith(".localhost")||e==="0.0.0.0"||e==="::1"||/^127(?:\.\d{1,3}){3}$/.test(e))return n.origin}catch{}return null}function q(t){try{return A.statSync(c.join(t,"package.json")).isFile()}catch{return!1}}function Q(t){let n=E(t.bundleUrl);if(!n)return[];let e=t.repoDir||process.env.CONTRAST_REPO_DIR,o=e?c.resolve(e):process.cwd();if(!e&&!q(o))return[];let r=S(o,{trustStart:t.exactProjectDir}),s=r?.appDir??null;if(!s)return[];let i=(t.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),a=null;if(e||r)try{let p=T.resolve("@expo/config",{paths:[s,o]}),u=T(p);typeof u.getConfig=="function"&&(a=u.getConfig)}catch{}let y=[];if(a)try{let p=a(s,{skipSDKVersionRequirement:!0});if(p?.exp&&typeof p.exp=="object"){let u=p.exp.plugins;Array.isArray(u)&&(y=u)}}catch{}let d=D(y,i==="android"?"android":"ios").slice(0,256),I=Date.now(),P=0,j=(p,u)=>{let h=[{dir:p,depth:0}],l=0;for(;l<h.length&&P<64&&d.length<256&&Date.now()-I<50;){let f=h[l++];if(!f)continue;P++;let m;try{m=A.readdirSync(f.dir,{withFileTypes:!0})}catch{continue}for(let g of m){if(g.isSymbolicLink())continue;let x=c.join(f.dir,g.name);if(g.isDirectory()){f.depth<4&&h.length<64&&!g.name.startsWith(".")&&h.push({dir:x,depth:f.depth+1});continue}if(!g.isFile()||!/\.(ttf|otf|woff|woff2)$/i.test(g.name))continue;let w=c.relative(p,x).split(c.sep).join("/");if(d.push(c.posix.join(u,w)),d.length>=256)break}}};try{let p=JSON.parse(A.readFileSync(c.join(s,"package.json"),"utf8")),u=new Set;for(let l of["dependencies","devDependencies","optionalDependencies"]){let f=Reflect.get(p,l);if(!(!f||typeof f!="object"))for(let m of Object.keys(f))u.add(m)}let h=[...u].filter(l=>l==="react-native-vector-icons"||l.startsWith("@react-native-vector-icons/"));if(h.length>0){let l=Reflect.get(p,"reactNativeVectorIcons"),f=l&&typeof l=="object"?Reflect.get(l,"fontDir"):null,m=typeof f=="string"?f:"rnvi-fonts",g=c.resolve(s,m),x=c.relative(s,g);!x.startsWith("..")&&!c.isAbsolute(x)&&j(g,x.split(c.sep).join("/"));let w=O(c.join(s,"package.json"));for(let F of h)try{let v=w.resolve(F),L=F.split("/").join(c.sep),b=`${c.sep}node_modules${c.sep}${L}${c.sep}`,R=v.lastIndexOf(b);if(R===-1)continue;let U=v.slice(0,R+b.length-1),k=F==="react-native-vector-icons"?"Fonts":"fonts";j(c.join(U,k),c.posix.join("node_modules",F,k))}catch{}}}catch{}return $(d,n)}async function Y(t,n){let e=E(t);if(!e)return null;let o=new AbortController,r=setTimeout(()=>o.abort(),n?.timeoutMs??1500);try{let s=await fetch(`${e}/`,{headers:{"expo-platform":"ios",Accept:"application/json"},signal:o.signal});if(!s.ok)return null;let a=(await s.json())?.extra?.expoClient?._internal?.projectRoot;return typeof a=="string"&&a.length>0?a:null}catch{return null}finally{clearTimeout(r)}}function Z(t){return t.map(n=>`${encodeURIComponent(n.url)}::${encodeURIComponent(n.family)}`).join(",")}function M(t){let n=[];for(let e of t.split(",")){let o=e.trim();if(!o)continue;let r=o.indexOf("::"),s=r===-1?o:o.slice(0,r);try{n.push(decodeURIComponent(s))}catch{n.push(s)}}return n.filter(Boolean)}function G(t){let n=(t.split("?")[0].split(".").pop()||"").toLowerCase();return n==="ttf"?"font/ttf":n==="otf"?"font/otf":n==="woff"?"font/woff":n==="woff2"?"font/woff2":"application/octet-stream"}async function tt(t,n){let e=[],o=new Set;for(let r of M(t)){let s=W("sha256").update(r).digest("hex");if(!o.has(s)){o.add(s);try{let i=await fetch(r);if(!i.ok){n?.onError?.(r,new Error(`${i.status} ${i.statusText}`));continue}let a=new Uint8Array(await i.arrayBuffer());e.push({url:r,urlhash:s,contentType:G(r),bytes:a}),n?.onStaged?.({url:r,byteLength:a.byteLength})}catch(i){n?.onError?.(r,i)}}}return e}export{Q as a,Y as b,Z as c,tt as d};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  import{execFileSync as b,execSync as A}from"node:child_process";var p=new WeakMap,u=new Set,y=!1;function d(){return{platform:process.platform,env:process.env}}function g(e=d()){return e.platform==="linux"&&e.env.GITHUB_ACTIONS==="true"&&e.env.RUNNER_OS==="Linux"}function I(e){let r=String(e);return/^--disable-gpu(?:=.*)?$/i.test(r)||/^--enable-unsafe-swiftshader(?:=.*)?$/i.test(r)||/^--use-angle=(?:swiftshader|swiftshader-webgl)$/i.test(r)||/^--use-gl=swiftshader$/i.test(r)}function E(e){return e.match(/(?:^|\s)(--disable-gpu(?:=[^\s]+)?|--enable-unsafe-swiftshader(?:=[^\s]+)?|--use-angle=(?:swiftshader|swiftshader-webgl)|--use-gl=swiftshader)(?=\s|$)/i)?.[1]??null}function v(e){return e==="darwin"?"metal":e==="linux"?"vulkan":"default"}function P(e,r=d()){if(g(r))return;let n=E(e);if(n)throw new Error(`[reap-browser] refused software-rendering Chrome process argument ${n}`);let o=v(r.platform),s=e.split(/\s+/);if(!s.includes(`--use-angle=${o}`)||!s.includes("--enable-gpu"))throw new Error(`[reap-browser] Chrome process did not retain the required ${o} GPU arguments`);if(r.platform==="darwin"&&e.includes("/Applications/Google Chrome.app/"))throw new Error("[reap-browser] refused the user's installed Google Chrome; use Playwright channel chromium")}function G(e){if(!e||typeof e!="object")return[];let n=e.gpu;if(!n||typeof n!="object")return[];let o=n,s=[],a=o.auxAttributes;if(a&&typeof a=="object")for(let t of Object.values(a))typeof t=="string"&&s.push(t);let i=o.devices;if(Array.isArray(i)){for(let t of i)if(!(!t||typeof t!="object"))for(let c of Object.values(t))typeof c=="string"&&s.push(c)}return s}function C(e){if(!e||typeof e!="object")return null;let r=e;if(!Array.isArray(r.processInfo))return null;for(let n of r.processInfo){if(!n||typeof n!="object")continue;let o=n;if(o.type==="browser"&&typeof o.id=="number"&&Number.isInteger(o.id)&&o.id>0)return o.id}return null}function L(e,r=d()){if(g(r))return;let o=G(e).join(" | ");if(!o||/swiftshader|llvmpipe|software rasterizer/i.test(o))throw new Error(`[reap-browser] Chrome reported a software renderer${o?`: ${o}`:""}`);if(r.platform==="darwin"&&!/metal/i.test(o))throw new Error(`[reap-browser] Chrome did not report an ANGLE Metal renderer: ${o}`)}function w(e){if(e&&typeof e=="object"){let n=p.get(e);if(n!==void 0)return n}let r=e;if(r&&typeof r.process=="function")try{let n=r.process();if(n&&typeof n.pid=="number"&&n.pid>0)return n.pid}catch{}if(r&&typeof r.browser=="function")try{let n=r.browser();if(n)return w(n)}catch{}return null}function h(e){let r=[];try{r=A(`pgrep -P ${e} || true`).toString().split(`
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.296 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.297 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as m,b as T}from"./chunk-FROCFR77.js";import{a as w,b as A,c as C}from"./chunk-EJ6BAJKX.js";import{a as I}from"./chunk-S5Z4HKWX.js";import{a as _,d as E}from"./chunk-7GQWF7HE.js";import{G as O,o as x,q as f}from"./chunk-WJVBD2UL.js";import h from"fs";import v from"path";var c="default",j="profiles.json",a=1;function s(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function g(){return v.join(f(),j)}function H(e){return`sootsim-profile-${s(e)}`}function z(e){return v.join(x(),"Partitions",H(e))}function y(e){return v.join(f(),"playwright",s(e))}function b(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function M(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:M(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:M([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){O();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
4
+ import{a as m,b as T}from"./chunk-AC2HNBEI.js";import{a as w,b as A,c as C}from"./chunk-LGU5JGT6.js";import{a as I}from"./chunk-6YIHNXMZ.js";import{a as _,d as E}from"./chunk-VTYVJJHN.js";import{G as O,o as x,q as f}from"./chunk-BAFDYXCM.js";import h from"fs";import v from"path";var c="default",j="profiles.json",a=1;function s(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function g(){return v.join(f(),j)}function H(e){return`sootsim-profile-${s(e)}`}function z(e){return v.join(x(),"Partitions",H(e))}function y(e){return v.join(f(),"playwright",s(e))}function b(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function M(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:M(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:M([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){O();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
5
5
  `,"utf8"),h.renameSync(t,g()),r}function K(){return S(b()).profiles}function Y(e){let r=s(e);return K().find(t=>t.id===r)??null}function L(e=c){let r=s(e),t=Y(r);return t||V(r)}function V(e){let r=s(e),t=P(b());if(t.profiles.some(i=>i.id===r))throw new Error(`profile already exists: ${r}`);let o=new Date().toISOString(),n={id:r,createdAt:o,updatedAt:o};return S({version:a,profiles:[...t.profiles,n]}),n}function ge(e){let r=s(e);if(r===c)throw new Error("the default profile cannot be deleted; clear it instead");let t=P(b()),o=t.profiles.find(n=>n.id===r);if(!o)throw new Error(`profile not found: ${r}`);return S({version:a,profiles:t.profiles.filter(n=>n.id!==r)}),J(r),o}function J(e){let r=s(e);for(let t of[z(r),y(r)])try{h.rmSync(t,{recursive:!0,force:!0})}catch{}}function X(){let e=w();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function Z(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=w();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await C(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var R={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:X,launch:Z};function Q(){let e=m();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim desktop install`)"}}async function ee(e){let r=m();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await T(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile,ownerPid:e.ownerPid});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var W={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:Q,launch:ee};import{spawn as re}from"child_process";import{closeSync as te,mkdtempSync as oe,openSync as ie,readFileSync as ne}from"fs";import{createRequire as se}from"module";import{tmpdir as N}from"os";import{join as $}from"path";var ae=`
6
6
  const modulePath = process.env.SOOTSIM_PW_MODULE;
7
7
  const url = process.env.SOOTSIM_PW_URL;