sootsim 0.1.121 → 0.1.123
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.
- package/dist-cli/bin.js +4 -4
- package/dist-cli/chunks/{agent-NZ4A6JKO.js → agent-7UEXHC74.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-CYQ5L2YH.js → agent-wrapper-N3Y5JUOK.js} +2 -2
- package/dist-cli/chunks/{app-fonts-2DF4NW5D.js → app-fonts-YBLWJSIB.js} +2 -2
- package/dist-cli/chunks/{assert-PASM5PLL.js → assert-7HT2IBPA.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-6QPJNAFZ.js +2 -0
- package/dist-cli/chunks/beta-RA5NVED7.js +2 -0
- package/dist-cli/chunks/{chunk-GU3MWKJY.js → chunk-26R4EYTV.js} +1 -1
- package/dist-cli/chunks/{chunk-KTE2VIXH.js → chunk-2ESPGMYD.js} +3 -3
- package/dist-cli/chunks/{chunk-5OA35LZX.js → chunk-2MAZ4FWI.js} +2 -2
- package/dist-cli/chunks/{chunk-I26R4PE2.js → chunk-2Y24I2A3.js} +1 -1
- package/dist-cli/chunks/{chunk-3A7SRWSQ.js → chunk-4554FEPX.js} +2 -2
- package/dist-cli/chunks/{chunk-SF6W3FRS.js → chunk-46GLYZDL.js} +1 -1
- package/dist-cli/chunks/{chunk-7CA63OS4.js → chunk-54MYCRSA.js} +1 -1
- package/dist-cli/chunks/{chunk-QNQO5VHO.js → chunk-7433ONJR.js} +2 -2
- package/dist-cli/chunks/{chunk-NQ4EDJV4.js → chunk-7L4XI34A.js} +6 -6
- package/dist-cli/chunks/{chunk-MSU27JEW.js → chunk-BBEMA3ZH.js} +2 -2
- package/dist-cli/chunks/{chunk-KY6NY6WN.js → chunk-CGARJK4O.js} +1 -1
- package/dist-cli/chunks/{chunk-PMAKUYYK.js → chunk-DIH4EEFT.js} +2 -2
- package/dist-cli/chunks/{chunk-Y7ZMV3PG.js → chunk-DTHU37OI.js} +1 -1
- package/dist-cli/chunks/{chunk-OBYYAT4F.js → chunk-DVB53K4R.js} +2 -2
- package/dist-cli/chunks/{chunk-CGB6KRKN.js → chunk-EKXKWP2Z.js} +5 -5
- package/dist-cli/chunks/chunk-FEO7LRD4.js +1 -0
- package/dist-cli/chunks/{chunk-VALW4SKE.js → chunk-GKRYL2NS.js} +1 -1
- package/dist-cli/chunks/{chunk-DORQQNP4.js → chunk-H2OI6CGN.js} +2 -2
- package/dist-cli/chunks/{chunk-7RXO4KKF.js → chunk-HIZD6RBT.js} +1 -1
- package/dist-cli/chunks/{chunk-4BXESMZ7.js → chunk-HKEH5FQ2.js} +1 -1
- package/dist-cli/chunks/{chunk-W3FBNBTX.js → chunk-HMPB3UOI.js} +2 -2
- package/dist-cli/chunks/chunk-HTZ6H5WJ.js +1 -0
- package/dist-cli/chunks/{chunk-SRA2TVCG.js → chunk-IYAJCTDE.js} +1 -1
- package/dist-cli/chunks/chunk-JL26L3YO.js +33 -0
- package/dist-cli/chunks/{chunk-X4LYRBLZ.js → chunk-K22QL53C.js} +1 -1
- package/dist-cli/chunks/{chunk-B77PWTHR.js → chunk-KVM5C2VS.js} +2 -2
- package/dist-cli/chunks/chunk-L3BNIE26.js +4 -0
- package/dist-cli/chunks/{chunk-Z47GWZMZ.js → chunk-LVBTKRBM.js} +3 -3
- package/dist-cli/chunks/{chunk-SA5RP334.js → chunk-M5MHSOH6.js} +2 -2
- package/dist-cli/chunks/{chunk-MUTDER75.js → chunk-NAQF2ELK.js} +2 -2
- package/dist-cli/chunks/chunk-NU6ECUKP.js +2 -0
- package/dist-cli/chunks/{chunk-IQNZPHGD.js → chunk-OJB2YYFR.js} +2 -2
- package/dist-cli/chunks/{chunk-VSKLWCFM.js → chunk-PK442VOB.js} +2 -2
- package/dist-cli/chunks/{chunk-WHL7FMLG.js → chunk-QJPILTXK.js} +1 -1
- package/dist-cli/chunks/{chunk-LT2X5ISU.js → chunk-QKYPXERV.js} +2 -2
- package/dist-cli/chunks/{chunk-3WDN2S2A.js → chunk-QNGYCFTQ.js} +2 -2
- package/dist-cli/chunks/{chunk-VX5CAWLC.js → chunk-RDS7O4GJ.js} +2 -2
- package/dist-cli/chunks/{chunk-3DDNLPIH.js → chunk-RM7CKKXW.js} +2 -2
- package/dist-cli/chunks/{chunk-RVWJ3TAE.js → chunk-SORDKCQX.js} +2 -2
- package/dist-cli/chunks/{chunk-OEV7EOMC.js → chunk-T7JC2PB7.js} +2 -2
- package/dist-cli/chunks/{chunk-4UQMPWDA.js → chunk-TRWVVERC.js} +2 -2
- package/dist-cli/chunks/chunk-TYBEJFWV.js +1 -0
- package/dist-cli/chunks/{chunk-VSRV5LFU.js → chunk-UJJZU7BD.js} +1 -1
- package/dist-cli/chunks/{chunk-2U4CGOD6.js → chunk-ZUGEBK3G.js} +2 -2
- package/dist-cli/chunks/cli-version-67W35P43.js +2 -0
- package/dist-cli/chunks/{compat-FMBQL2CX.js → compat-P2M4T3FP.js} +3 -3
- package/dist-cli/chunks/{config-JD23SW7N.js → config-OVUHUSR7.js} +2 -2
- package/dist-cli/chunks/control-G5SOJSPE.js +2 -0
- package/dist-cli/chunks/{cpu-profile-2Z4KGCAE.js → cpu-profile-LRVI4TNA.js} +2 -2
- package/dist-cli/chunks/{daemon-NDO6JPDH.js → daemon-YJCEEAIE.js} +2 -2
- package/dist-cli/chunks/{debug-RBVMEH33.js → debug-PEJA5EWI.js} +3 -3
- package/dist-cli/chunks/{detox-TBJAZEBB.js → detox-RUIKZD2M.js} +2 -2
- package/dist-cli/chunks/{device-26YM4HM7.js → device-HEM3J3BN.js} +2 -2
- package/dist-cli/chunks/{diagnose-PW7FGUOI.js → diagnose-SEOCWTHH.js} +2 -2
- package/dist-cli/chunks/drivers-YYE536KG.js +2 -0
- package/dist-cli/chunks/{electron-TBMZ3C5I.js → electron-GIHHLI5F.js} +3 -3
- package/dist-cli/chunks/flow-UFIGCF5G.js +2 -0
- package/dist-cli/chunks/help-BU77OOJR.js +2 -0
- package/dist-cli/chunks/{hints-Q3I4PXMT.js → hints-GREBRHXF.js} +2 -2
- package/dist-cli/chunks/{home-paths-P5GMZADH.js → home-paths-Q35ZXJSG.js} +2 -2
- package/dist-cli/chunks/{inspect-UTHL2UK4.js → inspect-MJ6FVVUA.js} +3 -3
- package/dist-cli/chunks/install-U4MNYWRM.js +2 -0
- package/dist-cli/chunks/{install-desktop-XQYE3QYC.js → install-desktop-ECTBYDVD.js} +3 -3
- package/dist-cli/chunks/{keys-75OBQ7OF.js → keys-RR42UJM2.js} +2 -2
- package/dist-cli/chunks/{launch-TFE3CZZ3.js → launch-ZUMBPMS5.js} +3 -3
- package/dist-cli/chunks/{login-EIL5PLK4.js → login-P7QGXPYY.js} +4 -4
- package/dist-cli/chunks/{logout-2DXPOPWE.js → logout-KPWM5V3F.js} +2 -2
- package/dist-cli/chunks/{maestro-Q27CNJGT.js → maestro-BMKSJAVC.js} +2 -2
- package/dist-cli/chunks/{preview-ZGVCXKQZ.js → preview-CXTYD7C3.js} +2 -2
- package/dist-cli/chunks/{profile-TCX6GYV5.js → profile-OW36PZ33.js} +2 -2
- package/dist-cli/chunks/{react-24D26RLU.js → react-ZP2DMCII.js} +2 -2
- package/dist-cli/chunks/{record-3MODR5RQ.js → record-FKZDX7CK.js} +3 -3
- package/dist-cli/chunks/runtime-536W4YEQ.js +2 -0
- package/dist-cli/chunks/runtime-delivery-NKEWLU2R.js +2 -0
- package/dist-cli/chunks/{screenshot-4A6JTLUV.js → screenshot-EJ5YY5A4.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-KVMXLFJ4.js → screenshot-mode-IKPJHCKB.js} +2 -2
- package/dist-cli/chunks/{screenshots-XGG6PNXW.js → screenshots-5ULGP3TY.js} +2 -2
- package/dist-cli/chunks/{server-MRLLYDV7.js → server-PPRG6ISX.js} +3 -3
- package/dist-cli/chunks/setup-repo-7I4PUVTB.js +2 -0
- package/dist-cli/chunks/{skills-COR2GQRN.js → skills-WV3ELY6Z.js} +2 -2
- package/dist-cli/chunks/{start-SD27AJ7E.js → start-SGUXXNBN.js} +4 -4
- package/dist-cli/chunks/store-GOI4SZUQ.js +2 -0
- package/dist-cli/chunks/telemetry-MGYSYRR7.js +2 -0
- package/dist-cli/chunks/{test-4N6K3C5R.js → test-Z6JSXZED.js} +3 -3
- package/dist-cli/chunks/{three-mode-PJQGXIP4.js → three-mode-HLN2VHIP.js} +2 -2
- package/dist-cli/chunks/{timeline-C7JSMHCV.js → timeline-NT3K5ZJE.js} +2 -2
- package/dist-cli/chunks/{upgrade-SFUV6KPW.js → upgrade-CA2GU3BM.js} +2 -2
- package/dist-cli/chunks/upload-R72LSS66.js +2 -0
- package/dist-cli/chunks/version-LXZYQAKQ.js +4 -0
- package/dist-cli/chunks/{web-GK27H4NM.js → web-UUIWGXRK.js} +2 -2
- package/dist-cli/chunks/{what-happened-GAY54LBV.js → what-happened-RXFF4TUK.js} +2 -2
- package/dist-cli/chunks/{whoami-C2WULTLS.js → whoami-LBFQTOOY.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/demo-app-registry.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/runtime-delivery.ts +100 -0
- package/dist-cli/chunks/auto-bootstrap-IPNK6GF7.js +0 -2
- package/dist-cli/chunks/beta-RG7JT6HD.js +0 -2
- package/dist-cli/chunks/chunk-2FTVPI7F.js +0 -2
- package/dist-cli/chunks/chunk-BTWXWUDB.js +0 -1
- package/dist-cli/chunks/chunk-KXLYXKMA.js +0 -1
- package/dist-cli/chunks/chunk-QUEATUWT.js +0 -1
- package/dist-cli/chunks/chunk-VJPN6DQU.js +0 -4
- package/dist-cli/chunks/chunk-YQIFU3PB.js +0 -25
- package/dist-cli/chunks/cli-version-DPV7EKFK.js +0 -2
- package/dist-cli/chunks/control-IAHPU5HD.js +0 -2
- package/dist-cli/chunks/drivers-L6UY2JC6.js +0 -2
- package/dist-cli/chunks/flow-QSDMMKNZ.js +0 -2
- package/dist-cli/chunks/help-OC7HYZ5F.js +0 -2
- package/dist-cli/chunks/install-3UWGXX6F.js +0 -2
- package/dist-cli/chunks/runtime-5MJPHLRZ.js +0 -2
- package/dist-cli/chunks/runtime-delivery-NWSDCFAI.js +0 -2
- package/dist-cli/chunks/setup-repo-OUMNEC36.js +0 -2
- package/dist-cli/chunks/store-JVV7G7VY.js +0 -2
- package/dist-cli/chunks/telemetry-BMJNBZT6.js +0 -2
- package/dist-cli/chunks/upload-XQLVCUKI.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as ne,c as M,d as se,e as F,f as oe,h as ae,i as C,j as ce,k as de,l as le,p as ue,s as T,t as pe,u as he,v as me,w as fe}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.123 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as ne,c as M,d as se,e as F,f as oe,h as ae,i as C,j as ce,k as de,l as le,p as ue,s as T,t as pe,u as he,v as me,w as fe}from"./chunk-RM7CKKXW.js";import"./chunk-54MYCRSA.js";import{a as re}from"./chunk-2MAZ4FWI.js";import"./chunk-T7JC2PB7.js";import{f as P}from"./chunk-SORDKCQX.js";import"./chunk-TRWVVERC.js";import"./chunk-7L4XI34A.js";import"./chunk-HTZ6H5WJ.js";import{d as te}from"./chunk-UJJZU7BD.js";import"./chunk-46GLYZDL.js";import{a as X,b as Y}from"./chunk-DVB53K4R.js";import"./chunk-M5MHSOH6.js";import{a as Q,b as ee}from"./chunk-CGARJK4O.js";import{a as Z}from"./chunk-26R4EYTV.js";import{m as ie}from"./chunk-L3BNIE26.js";import{A as J,B as H,D as K,E as V,F as G,G as q,H as z,I as U,u as D,v as j,y as I,z as $}from"./chunk-HKEH5FQ2.js";import"./chunk-IYAJCTDE.js";import{spawn as ze}from"child_process";import A from"fs";import{createServer as Xe}from"http";import S from"path";import{WebSocket as m,WebSocketServer as Ye}from"ws";import ge from"node:fs";import R from"node:path";var x=1;function Ie(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_POSTGRES||7432),Number(process.env.VITE_PORT_R2||9500)].filter(o=>Number.isFinite(o)&&o>0)}var O=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof T?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await le()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
|
|
3
3
|
`)}}close(){for(let e of this.subscriptions.values())try{e.unsubscribe()}catch{}this.subscriptions.clear(),this.sessionsBySocket.clear(),this.allSockets.clear()}async dispatch(e,t,i){switch(t){case"agent:list-projects":return F();case"agent:upsert-project":return M(i.input??{});case"agent:delete-project":return ae(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return ce(i.projectId?String(i.projectId):void 0);case"agent:start-session":return this.doStartSession(i.input??{});case"agent:send-prompt":{let n=String(i.sessionId),a=C(n);if(!a)throw new T("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await he(n,r),this.notePromptAccepted(n,r,a.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await me(String(i.sessionId));let s=C(String(i.sessionId));return s&&this.broadcastSessionStatus(s),{ok:!0};case"agent:get-transcript":return this.getTranscript(String(i.sessionId));case"agent:get-paths":return this.getPaths();case"agent:subscribe-events":return this.subscribeSocket(e,String(i.sessionId));case"agent:unsubscribe-events":return this.unsubscribeSocket(e,String(i.sessionId));default:throw new T("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async doStartSession(e){if(!se(e.projectId))throw new T("NO_PROJECT",`no project: ${e.projectId}`);let i=await pe(e);return this.broadcastSessionStatus(i.session),i}async autoAttachForUrl(e){let t=e.bundleUrl??"",i=(()=>{try{return new URL(t).port||null}catch{return null}})();if(!i)return{project:null};let s=this.opts.getExcludePorts?.()??Ie(),a=(await P({excludePorts:s})).find(d=>String(d.port)===i);if(!a||!a.cwd)return{project:null};let r=F().find(d=>d.cwd===a.cwd)??null,c=Array.from(new Set([...r?.knownBundleUrls??[],a.bundleUrl,t]));return{project:M({cwd:a.cwd,name:a.projectName??R.basename(a.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[a.cwd],knownBundleUrls:c,framework:r?.framework??Pe(a.framework),bundleId:a.bundleId??r?.bundleId})}}getTranscript(e){let t=ue(e);return ge.existsSync(t)?ge.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=ne();return{userDataDir:e,storeFile:R.join(e,"attached-projects.json"),sessionsDir:R.join(e,"sessions"),transcriptsDir:R.join(e,"transcripts")}}subscribeSocket(e,t){let i=this.sessionsBySocket.get(e);if(i||(i=new Set,this.sessionsBySocket.set(e,i)),i.has(t))return{ok:!0,refCount:this.subscriptions.get(t)?.refCount??1};i.add(t);let s=this.subscriptions.get(t);if(s)return s.refCount++,{ok:!0,refCount:s.refCount};let n=fe(t,a=>{let r=this.coalescePromptEcho(t,a);if(r&&(this.applySessionEvent(t,r),this.fanOutEvent(t,r)),a.type==="turn-completed"){let c=C(t);if(c)try{oe(c.projectId,{usd:a.costUsd,ts:a.ts})}catch(l){process.stderr.write(`[sootsim-agent] recordTurnTelemetry failed: ${l instanceof Error?l.message:String(l)}
|
|
4
4
|
`)}}});return this.subscriptions.set(t,{unsubscribe:n,refCount:1}),{ok:!0,refCount:1}}unsubscribeSocket(e,t){let i=this.sessionsBySocket.get(e);return!i||!i.has(t)?{ok:!0,refCount:0}:(i.delete(t),this.decrementSubscription(t))}decrementSubscription(e){let t=this.subscriptions.get(e);if(!t)return{ok:!0,refCount:0};if(t.refCount--,t.refCount<=0){try{t.unsubscribe()}catch{}return this.subscriptions.delete(e),{ok:!0,refCount:0}}return{ok:!0,refCount:t.refCount}}dropSessionFanout(e){let t=this.subscriptions.get(e);if(t){try{t.unsubscribe()}catch{}this.subscriptions.delete(e)}for(let i of this.sessionsBySocket.values())i.delete(e);this.clearPromptTracking(e)}normalizePromptEnvelope(e){if(e?.prompt&&typeof e.prompt=="object"){let t=e.prompt;return{text:String(t.text??""),...typeof t.displayText=="string"?{displayText:t.displayText}:{},...typeof t.inspectSummary=="string"?{inspectSummary:t.inspectSummary}:{},...typeof t.inspectTrace=="string"?{inspectTrace:t.inspectTrace}:{}}}return{text:String(e?.text??""),...typeof e?.displayText=="string"?{displayText:e.displayText}:{},...typeof e?.inspectSummary=="string"?{inspectSummary:e.inspectSummary}:{},...typeof e?.inspectTrace=="string"?{inspectTrace:e.inspectTrace}:{}}}notePromptAccepted(e,t,i){let s=Date.now(),n=this.pendingPromptEchoes.get(e)??[];n.push({sentAt:s}),this.pendingPromptEchoes.set(e,n);let a=Math.max(this.pendingTurns.get(e)??0,i?1:0)+1;this.pendingTurns.set(e,a);let r=t.displayText??t.text;return this.patchSession(e,{lastPrompt:r,status:"working",needsAttention:!1}),this.fanOutEvent(e,{type:"prompt-received",text:r,...t.inspectSummary?{inspectSummary:t.inspectSummary}:{},...t.inspectTrace?{inspectTrace:t.inspectTrace}:{},ts:s}),{ok:!0,queued:a>1,pendingTurns:a,queueDepth:Math.max(0,a-1)}}applySessionEvent(e,t){switch(t.type){case"prompt-received":case"turn-started":this.patchSession(e,{status:"working",needsAttention:!1});return;case"turn-completed":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"idle",needsAttention:!1,lastTurnFiles:t.filesTouched,currentlyEditing:void 0});return}case"approval-needed":this.patchSession(e,{status:"needs-attention",needsAttention:!0});return;case"error":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"needs-attention",needsAttention:i<=0,currentlyEditing:void 0});return}case"exited":this.clearPromptTracking(e),this.patchSession(e,{status:"ended",needsAttention:!1,wrapperPid:void 0,currentlyEditing:void 0});return;case"ready":case"turn-reasoning":case"turn-message":case"turn-plan":case"tool-call":case"file-edited":case"file-diff-delta":return}}patchSession(e,t){de(e,t);let i=C(e);i&&this.broadcastSessionStatus(i)}coalescePromptEcho(e,t){if(t.type!=="prompt-received")return t;let i=this.pendingPromptEchoes.get(e);if(!i||i.length===0)return t;for(;i.length>0&&Date.now()-i[0].sentAt>15e3;)i.shift();return i.length===0?(this.pendingPromptEchoes.delete(e),t):(i.shift(),i.length===0?this.pendingPromptEchoes.delete(e):this.pendingPromptEchoes.set(e,i),null)}consumeSettledTurn(e){let t=Math.max(0,(this.pendingTurns.get(e)??1)-1);return t>0?this.pendingTurns.set(e,t):this.pendingTurns.delete(e),t}clearPromptTracking(e){this.pendingPromptEchoes.delete(e),this.pendingTurns.delete(e)}fanOutEvent(e,t){let i=JSON.stringify({type:"agent:event",sessionId:e,event:t});for(let[s,n]of this.sessionsBySocket)if(n.has(e)&&s.readyState===x)try{s.send(i)}catch{}}broadcastSessionStatus(e){let t=JSON.stringify({type:"agent:session-status",session:e});for(let i of this.allSockets)if(i.readyState===x)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===x)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===x)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function Pe(o){return o==="expo"?"expo":o==="one"||o==="vxrn"?"one":"unknown"}import Oe from"http";import _e from"https";var W="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36",Re=[{hostSuffix:"uniswap.org",headers:{origin:"https://app.uniswap.org",referer:"https://app.uniswap.org/"}}];function xe(o){let e=o.toLowerCase();for(let t of Re)if(e===t.hostSuffix||e.endsWith(`.${t.hostSuffix}`))return t.headers;return{}}function Se(o){return{"accept-encoding":"identity","user-agent":W,...xe(o.hostname)}}var Le=new Set(["host","origin","referer","user-agent","accept-encoding","cookie","connection","keep-alive","transfer-encoding","upgrade","content-length","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","sec-ch-ua","sec-ch-ua-mobile","sec-ch-ua-platform"]),Be={"access-control-allow-origin":"*","access-control-allow-methods":"GET,POST,PUT,DELETE,PATCH,OPTIONS","access-control-allow-headers":"*","access-control-expose-headers":"*","access-control-max-age":"3600"},Ne=new Set(["host","origin","referer","sec-fetch-site","sec-fetch-mode","sec-fetch-dest"]);function E(o){for(let[e,t]of Object.entries(Be))o.setHeader(e,t)}function De(o,e){let t=[],i=e;i?.code&&t.push(i.code),i?.message&&t.push(i.message),i?.cause?.code&&t.push(i.cause.code),i?.cause?.message&&t.push(i.cause.message);let n=[...new Set(t.filter(Boolean))].join(" | ")||String(e);return o.includes("stored-in-.env.local")?`${n} | upstream url still contains placeholder env values`:n}function He(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(Le.has(i.toLowerCase())||(t[i]=Array.isArray(s)?s.join(", "):s));return Object.assign(t,e?Se(e):{"user-agent":W}),t}function Ue(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(Ne.has(i.toLowerCase())||(t[i]=s));return t.host=e.host,t.origin=e.origin,t.referer=`${e.origin}/`,t}function ye(o){return o?.startsWith("/__fetch-proxy?")||o?.startsWith("/__proxy?")||!1}function be(o){return o?!!(o.startsWith("/__app-api?")||o.startsWith("/__app-api/")):!1}async function ve(o,e){if(o.method==="OPTIONS"){E(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((o.url||"").split("?")[1]||"").get("url");if(!i){E(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{E(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n=He(o.headers,s),a;if(o.method!=="GET"&&o.method!=="HEAD"){let d=[];for await(let u of o)d.push(Buffer.isBuffer(u)?u:Buffer.from(u));d.length>0&&(a=Buffer.concat(d))}let r;try{r=await fetch(s.href,{method:o.method,headers:n,body:a,redirect:"follow"})}catch(d){E(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${De(s.href,d)}`);return}r.headers.forEach((d,u)=>{let p=u.toLowerCase();p==="content-encoding"||p==="transfer-encoding"||p==="content-length"||p==="set-cookie"||p.startsWith("access-control-")||e.setHeader(u,d)}),E(e);let c=r.headers.getSetCookie?.()??[];c.length>0&&e.setHeader("x-sootsim-set-cookie",c.join(", ")),e.statusCode=r.status;let l=Buffer.from(await r.arrayBuffer());e.end(l)}function we(o,e){let t=o.url||"",i="",s="";if(t.startsWith("/__app-api?")){let l=new URL(t,"http://sootsim.local");i=l.searchParams.get("path")||"",s=l.searchParams.get("origin")?.trim()||""}else if(t.startsWith("/__app-api/"))i=t.slice(10);else return!1;if(!s)return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: missing origin query param"),!0;if(o.method==="OPTIONS")return e.writeHead(204,{"Access-Control-Allow-Origin":o.headers.origin||"*","Access-Control-Allow-Methods":"GET,POST,PUT,PATCH,DELETE,OPTIONS","Access-Control-Allow-Headers":o.headers["access-control-request-headers"]||"*","Access-Control-Allow-Credentials":"true","Access-Control-Max-Age":"86400"}),e.end(),!0;let n;try{n=new URL(i,s)}catch{return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: invalid origin or path"),!0}let a=n.protocol==="https:"?_e:Oe,r=Ue(o.headers,n),c=a.request({hostname:n.hostname,port:n.port||(n.protocol==="https:"?443:80),path:n.pathname+n.search,method:o.method,headers:r},l=>{let d=Object.keys(l.headers).filter(u=>{let p=u.toLowerCase();return!p.startsWith("access-control-")&&p!=="set-cookie"}).join(", ");e.writeHead(l.statusCode??502,{...l.headers,"access-control-allow-origin":o.headers.origin||"*","access-control-allow-credentials":"true","access-control-expose-headers":d}),l.pipe(e)});return c.on("error",l=>{e.statusCode=502,e.end(`app proxy error: ${l.message}`)}),o.pipe(c),!0}import{WebSocket as k,WebSocketServer as Me}from"ws";var Fe="/__websocket-proxy",We=new Set(["host","connection","upgrade","transfer-encoding","content-length","sec-websocket-accept","sec-websocket-extensions","sec-websocket-key","sec-websocket-protocol","sec-websocket-version"]);function w(o,e,t){try{o.write(`HTTP/1.1 ${e} ${t}\r
|
|
5
5
|
Connection: close\r
|
|
@@ -11,7 +11,7 @@ ${t}`)}catch{}o.destroy()}function je(o){let e=o.headers.origin,t=o.headers.host
|
|
|
11
11
|
`)}}throw new Error(`could not bind ws bridge after ${this.portFallbackCount} attempts starting at ${this.preferredPort}`)}bindOnce(e,t){return new Promise((i,s)=>{let n=Xe((c,l)=>this.handleHttpRequest(c,l)),a=!1,r=c=>{if(!a){a=!0;try{n.close()}catch{}this.httpServer=null,this.wss=null,s(c)}};n.once("error",r),n.listen(e,"127.0.0.1",()=>{a||(a=!0,n.removeListener("error",r),n.on("error",c=>{process.stderr.write(`ws bridge http error: ${String(c)}
|
|
12
12
|
`)}),this.httpServer=n,this.wss=new Ye({noServer:!0}),this.wireWebSocketServer(),n.on("upgrade",(c,l,d)=>{ke(c,l,d)||this.wss?.handleUpgrade(c,l,d,u=>{this.wss?.emit("connection",u,c)})}),i())})})}wireWebSocketServer(){this.wss&&this.wss.on("connection",(e,t)=>{let i=t.headers.origin,s=i?"sim":"cli",n=null;if(e.on("error",()=>{}),this.wsIsAlive.set(e,!0),e.on("pong",()=>{this.wsIsAlive.set(e,!0)}),this.agentHost.registerSocket(e),s==="sim")n={id:this.allocateSimId(),ws:e,origin:i,connectedAt:Date.now(),lastSeenAt:Date.now(),lastActiveAt:0,recentActions:[]},this.sims.set(n.id,n),this.shouldPromoteSim(n)&&(this.primarySimId=n.id),this.broadcastSimAssignments(),this.broadcastSimClientStates();else{let a=`ws-${this.nextCliFallbackId++}`;this.cliIdentityKeyBySocket.set(e,a)}e.on("message",a=>{let r;try{r=JSON.parse(a.toString())}catch{return}if(!(!r||typeof r!="object")){if(typeof r.type=="string"&&r.type.startsWith("agent:")){this.agentHost.handleMessage(e,r);return}if(r.type==="runtime:list"){let c=H(),l=this.getActiveRuntime(),d={type:"runtime:list:ok",id:r.id,installed:c,active:l.version,activeRuntimeDir:l.runtimeDir};try{e.send(JSON.stringify(d))}catch{}return}if(r.type==="runtime:use"){let c=typeof r.version=="string"?r.version:"";if(!H().includes(c)){try{e.send(JSON.stringify({type:"runtime:use:error",id:r.id,error:`runtime ${c||"(missing)"} is not installed`}))}catch{}return}let d=this.setActiveRuntime(c);try{e.send(JSON.stringify({type:"runtime:use:ok",id:r.id,version:d.version,runtimeDir:d.runtimeDir}))}catch{}return}if(r.type==="runtime:get"){let c=this.getActiveRuntime();try{e.send(JSON.stringify({type:"runtime:get:ok",id:r.id,active:c.version,activeRuntimeDir:c.runtimeDir}))}catch{}return}if(s==="sim"){if(n&&(n.lastSeenAt=Date.now()),r.type==="bridge:register"&&n){let d=r,u=this.tryRestoreSimId(n,d.simId);n.url=d.url,n.title=d.title,n.userAgent=d.userAgent,typeof d.kind=="string"&&d.kind.trim()&&(n.kind=d.kind.trim()),d.meta&&typeof d.meta=="object"&&(n.meta=d.meta);let p=this.primarySimId!==n.id&&this.shouldPromoteSim(n);p&&(this.primarySimId=n.id),(u||p)&&(this.broadcastSimAssignments(),this.broadcastSimClientStates());return}if(r.type==="bridge:user-focus-state"&&n){let d=r;this.updateUserFocusLease(n,d);return}if(r.type==="bridge:user-interact"&&n){this.updateUserActivity(n);return}if(r.type==="bridge:write-shared-config"){let d=r.patch&&typeof r.patch=="object"?r.patch:null;if(!d)return;let u;try{u=j(d)}catch(h){process.stderr.write(`sootsim: bridge:write-shared-config failed: ${h instanceof Error?h.message:String(h)}
|
|
13
13
|
`);return}let p=JSON.stringify({type:"bridge:shared-config-changed",config:u});for(let h of this.sims.values())if(h.ws.readyState===m.OPEN)try{h.ws.send(p)}catch{}return}if(r.type==="bridge:open-path"){let d=typeof r.path=="string"?r.path:"",u=typeof r.line=="number"&&Number.isFinite(r.line)?r.line:void 0,p=typeof r.column=="number"&&Number.isFinite(r.column)?r.column:void 0;d&&this.openPathInEditor(d,u,p);return}if(r.type==="bridge:boot-clients"&&n){let d=[];for(let[p,h]of this.cliSimBySocket)h===n.id&&d.push(p);for(let p of d){this.cliSimBySocket.delete(p);try{p.close(1e3,"booted by sim")}catch{}}let u=!!n.cliLease;n.cliLease={kind:"user-active",cliIdentityKey:"__user-active__",cliLabel:"active user",expiresAt:Date.now()+o.USER_BOOT_LEASE_TTL_MS},process.stderr.write(`sootsim booted ${d.length} cli client(s)${u?" (overrode prior lease)":""}; held sim for user [${n.id}]
|
|
14
|
-
`),this.recordSimAction(n.id,"sim booted cli clients"),this.broadcastSimClientStates();return}let c=this.pendingCommands.get(r.id);if(c){this.pendingCommands.delete(r.id),r.error?c.reject(new Error(r.error)):c.resolve(r.result);return}let l=this.cliBySentId.get(r.id);if(l&&(this.cliBySentId.delete(r.id),l.ws.readyState===m.OPEN)){let d=this.getOtherCliIdentityCount(l.ws,l.simId),u=d>0?{...r,id:l.originalId,
|
|
14
|
+
`),this.recordSimAction(n.id,"sim booted cli clients"),this.broadcastSimClientStates();return}let c=this.pendingCommands.get(r.id);if(c){this.pendingCommands.delete(r.id),r.error?c.reject(new Error(r.error)):c.resolve(r.result);return}let l=this.cliBySentId.get(r.id);if(l&&(this.cliBySentId.delete(r.id),l.ws.readyState===m.OPEN)){let d=this.getOtherCliIdentityCount(l.ws,l.simId),u=d>0?{...r,id:l.originalId,_otherCliCount:d}:{...r,id:l.originalId};l.ws.send(JSON.stringify(u))}return}(async()=>{this.cliLastCommandAt.set(e,Date.now());try{if(r.type==="bridge:bye"){let p=this.cliSimBySocket.delete(e);this.cliLastCommandAt.delete(e),this.cliIdentityKeyBySocket.delete(e),this.cliLabelBySocket.delete(e);for(let[h,f]of this.cliBySentId)f.ws===e&&this.cliBySentId.delete(h);p&&this.broadcastSimClientStates();return}if(r.type==="bridge:hello"){let p=typeof r.cliIdentityKey=="string"&&r.cliIdentityKey.trim()?r.cliIdentityKey.trim():this.cliIdentityKeyBySocket.get(e)||`ws-${this.nextCliFallbackId++}`;this.cliIdentityKeyBySocket.set(e,p),typeof r.cliLabel=="string"&&r.cliLabel.trim()&&this.cliLabelBySocket.set(e,r.cliLabel.trim()),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{cliIdentityKey:p,leaseTtlMs:o.CLI_LEASE_TTL_MS,leasing:!0}}));return}if(r.type==="bridge:list-sims"){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:this.listSims()}));return}if(r.type==="bridge:open"){if(typeof r.url!="string"||!r.url)throw new Error("bridge:open requires a url");await this.openUrl(r.url,{newWindow:r.newWindow===!0}),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{ok:!0,url:r.url}}));return}if(r.type==="bridge:claim"){let p=await this.waitForSim(r.simId),h=this.tryAcquireLease(e,p,{force:r.force===!0});if(!h.granted){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,error:`sim ${p.id} is locked by another cli`,_locked:h.lock}));return}this.setCliSimTarget(e,p.id),this.recordSimAction(p.id,h.bootedCount>0?`cli force-claimed sim (booted ${h.bootedCount})`:"cli claimed sim"),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{simId:p.id,lockedBy:h.lease.cliIdentityKey,lockExpiresAt:h.lease.expiresAt,bootedCount:h.bootedCount}}));return}let c=await this.waitForSim(r.simId);if(tt(r)){let p=this.tryAcquireLease(e,c);if(!p.granted){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,error:`sim ${c.id} is locked by another cli \u2014 use \`sootsim claim ${c.id} --force\` or \`sootsim open --new\``,_locked:p.lock}));return}}else this.ensureCliIdentityKey(e);this.setCliSimTarget(e,c.id),this.recordSimAction(c.id,this.describeForwardedCommand(r));let l=this.nextCommandId++;this.cliBySentId.set(l,{simId:c.id,ws:e,originalId:r.id});let{simId:d,...u}=r;if(c.ws.send(JSON.stringify({...u,id:l})),u.type==="close"){this.cliBySentId.delete(l),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{requested:!0,simId:c.id}}));let p=c.ws,h=setTimeout(()=>{this.closeSimSocketFromHost(p)},Qe);Ce(h)}}catch(c){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,error:c instanceof Error?c.message:String(c)}))}})()}}),e.on("close",()=>{if(this.agentHost.unregisterSocket(e),s==="sim"&&n){this.rememberDisconnectedSim(n),this.primarySimId===n.id&&(this.primarySimId=this.getOpenSim()?.id??null);for(let[a,r]of this.pendingCommands)r.simId===n.id&&(r.reject(new Error("sim disconnected")),this.pendingCommands.delete(a));for(let[a,r]of this.cliBySentId)r.simId===n.id&&(r.ws.readyState===m.OPEN&&r.ws.send(JSON.stringify({id:r.originalId,error:"sim disconnected before responding"})),this.cliBySentId.delete(a));this.broadcastSimAssignments(),this.broadcastSimClientStates()}else if(s==="cli"){let a=this.cliSimBySocket.delete(e);this.cliLastCommandAt.delete(e),this.cliIdentityKeyBySocket.delete(e),this.cliLabelBySocket.delete(e);for(let[r,c]of this.cliBySentId)c.ws===e&&this.cliBySentId.delete(r);a&&this.broadcastSimClientStates()}})})}afterBind(){if(process.stderr.write(`ws bridge listening on port ${this.port}
|
|
15
15
|
`),this.cliIdleTimer=setInterval(()=>this.sweepIdleCliClients(),3e4),this.cliIdleTimer.unref(),this.wsHeartbeatTimer=setInterval(()=>this.sweepDeadWebSockets(),o.WS_HEARTBEAT_INTERVAL_MS),this.wsHeartbeatTimer.unref(),this.shouldWriteLockfile){try{if(I(),!z(this.buildLockfileSnapshot()))throw new Error("another sootsim daemon wrote the lockfile during startup \u2014 aborting")}catch(e){throw process.stderr.write(`ws bridge failed to claim daemon lockfile: ${String(e)}
|
|
16
16
|
`),e}this.heartbeatTimer=setInterval(()=>{try{this.writeLockfileSnapshot()}catch{}},it),this.heartbeatTimer.unref(),this.startRuntimeUpdater()}this.agentHost.seedOnBoot()}bootstrapping=!0;buildLockfileSnapshot(){return{schema:1,pid:process.pid,platform:process.platform,bridgePort:this.effectivePort,runtimePort:this.effectivePort,activeRuntime:this.activeRuntimeVersion,activeRuntimeDir:this.activeRuntimeDirPath,startedAt:this.startedAt,heartbeatAt:Date.now(),bootstrapping:this.bootstrapping}}writeLockfileSnapshot(){q(this.buildLockfileSnapshot())}refreshActiveRuntime(){this.activeRuntimeVersion=$(),this.activeRuntimeDirPath=K()}runServerScan(){if(this.inflightScan)return this.inflightScan;let e=this.effectivePort>0?[this.effectivePort]:[];return this.inflightScan=P({excludePorts:e,buildIconProxyUrl:t=>`/__bundle-proxy?url=${encodeURIComponent(t)}`}).then(t=>(this.scanCache=t,this.scanCacheAt=Date.now(),t)).catch(t=>{let i=t instanceof Error?t.message:String(t);return console.error("[sootsim] /__server-scan failed:",i),this.scanCache??[]}).finally(()=>{this.inflightScan=null}),this.inflightScan}handleServerScan(e){let t=s=>{e.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}),e.end(JSON.stringify(s))},i=Date.now()-this.scanCacheAt;if(this.scanCache&&i<o.SCAN_FRESH_MS){t(this.scanCache);return}if(this.scanCache){t(this.scanCache),this.runServerScan().catch(()=>{});return}this.runServerScan().then(s=>t(s))}resolveRuntimeUpdateIntervalMs(){let e=Number(process.env[nt]);return Number.isFinite(e)&&e>0?Math.max(100,Math.round(e)):rt}startRuntimeUpdater(){if(!this.shouldWriteLockfile||this.runtimeUpdateTimer)return;this.runRuntimeUpdate("startup");let e=this.resolveRuntimeUpdateIntervalMs();this.runtimeUpdateTimer=setInterval(()=>{this.runRuntimeUpdate("periodic")},e),this.runtimeUpdateTimer.unref()}runRuntimeUpdate(e){return this.runtimeUpdateInFlight?this.runtimeUpdateInFlight:(this.runtimeUpdateInFlight=(async()=>{try{e==="startup"&&process.stderr.write(`sootsim: checking for runtime updates\u2026
|
|
17
17
|
`);let t=await ie();if(!t.updated||!t.latestVersion){e==="startup"&&process.stderr.write(`sootsim: runtime ${this.activeRuntimeVersion??"(none)"} is current
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.123 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a}from"./chunk-H2OI6CGN.js";import"./chunk-2Y24I2A3.js";import"./chunk-LVBTKRBM.js";import"./chunk-7L4XI34A.js";import"./chunk-46GLYZDL.js";import"./chunk-DVB53K4R.js";import"./chunk-M5MHSOH6.js";import"./chunk-CGARJK4O.js";import"./chunk-HKEH5FQ2.js";import"./chunk-IYAJCTDE.js";export{a as runSetupRepo};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.123 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-IYAJCTDE.js";import*as l from"fs";import*as i from"path";import{fileURLToPath as f}from"url";function g(){try{let s=f(import.meta.resolve("sootsim/package.json"));return i.join(i.dirname(s),"skills")}catch{let s=i.dirname(f(import.meta.url));return i.resolve(s,"../../skills")}}var m=g();function d(s){let n=s.match(/^---\n([\s\S]*?)\n---/);if(!n)return null;let e=n[1],o=e.match(/^name:\s*(.+)$/m),r=e.match(/^description:\s*(.+)$/m);return o?{name:o[1].trim(),description:r?.[1]?.trim()||""}:null}function p(){if(!l.existsSync(m))return[];let s=l.readdirSync(m).filter(e=>e.endsWith(".md")),n=[];for(let e of s){let o=l.readFileSync(i.join(m,e),"utf8"),r=d(o);r&&n.push({...r,filename:e})}return n}function u(s,n){let e=i.join(m,s.filename),o=i.join(n,s.filename);l.copyFileSync(e,o),console.log(` copied ${s.name} \u2192 ${o}`)}async function h(s){if(s.includes("--list")||s.includes("-l")||s.length===0){let t=p();if(t.length===0){console.log(" no skills found");return}console.log(`
|
|
3
3
|
available skills:
|
|
4
4
|
`);for(let c of t)console.log(` ${c.name}`),console.log(` ${c.description}
|
|
5
5
|
`);console.log(" usage: sootsim skills <target-dir> [skill-name...]"),console.log(" example: sootsim skills ./my-project"),console.log(` example: sootsim skills ./my-project debug perf
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.123 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-7L4XI34A.js";import{d as _}from"./chunk-UJJZU7BD.js";import"./chunk-46GLYZDL.js";import"./chunk-CGARJK4O.js";import{E as b,F as v,i as D,y as O,z as x}from"./chunk-HKEH5FQ2.js";import"./chunk-IYAJCTDE.js";import{spawn as N}from"child_process";import{existsSync as F}from"fs";import{WebSocket as B}from"ws";var T=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];var A={reset:"\x1B[0m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",cyan:"\x1B[36m",bold:"\x1B[1m"};function k(){return process.stderr.isTTY===!0}function u(t,e){return k()?`${A[t]}${e}${A.reset}`:e}function L(t,e){switch(t){case"pending":return u("dim","\xB7");case"running":return u("cyan",e);case"done":return u("green","\u2713");case"fail":return u("red","\u2717");case"skip":return u("yellow","\u25CB")}}var E=class{constructor(e,s){this.stepper=e;this.data=s}start(e){this.data.state="running",e!==void 0&&(this.data.detail=e),this.stepper.render()}update(e){this.data.detail=e,this.stepper.render()}done(e){this.data.state="done",e!==void 0&&(this.data.detail=e),this.stepper.render()}fail(e){this.data.state="fail",e!==void 0&&(this.data.detail=e),this.stepper.render()}skip(e){this.data.state="skip",e!==void 0&&(this.data.detail=e),this.stepper.render()}},S=class{steps=[];bannerText="";frame=0;timer=null;lastLineCount=0;paused=!1;finished=!1;banner(e){this.bannerText=e}add(e){let s={label:e,state:"pending"};return this.steps.push(s),new E(this,s)}render(){this.paused||this.finished||(this.startSpinner(),this.draw())}pause(){this.paused||(this.paused=!0,this.stopSpinner(),this.eraseRendered(),this.lastLineCount=0)}resume(){this.paused&&(this.paused=!1,this.draw(),this.startSpinner())}finish(){this.finished||(this.finished=!0,this.stopSpinner(),this.draw())}startSpinner(){this.timer||!k()||this.steps.some(e=>e.state==="running")&&(this.timer=setInterval(()=>{this.frame=(this.frame+1)%T.length,this.draw()},80),this.timer?.unref?.())}stopSpinner(){this.timer&&(clearInterval(this.timer),this.timer=null)}draw(){if(!k()){this.drawForwardOnly();return}this.eraseRendered();let e=[];this.bannerText&&(e.push(u("bold",this.bannerText)),e.push(""));let s=T[this.frame],r=Math.max(...this.steps.map(i=>i.label.length),0);for(let i of this.steps){let n=L(i.state,s),c=i.label.padEnd(r),y=i.detail?` ${u("dim",i.detail)}`:"";e.push(` ${n} ${c}${y}`)}process.stderr.write(e.join(`
|
|
3
3
|
`)+`
|
|
4
4
|
`),this.lastLineCount=e.length,this.steps.some(i=>i.state==="running")||this.stopSpinner()}bannerPrinted=!1;lastEmitted=new Map;drawForwardOnly(){this.bannerText&&!this.bannerPrinted&&(process.stderr.write(this.bannerText+`
|
|
5
5
|
|
|
@@ -18,6 +18,6 @@ usage:
|
|
|
18
18
|
options:
|
|
19
19
|
--port <n> bridge port (default: ${7668})
|
|
20
20
|
--no-open don't open the browser at the end
|
|
21
|
-
`);return}O();let s=t.indexOf("--port"),r=s>=0&&t[s+1]?Number(t[s+1]):e.port??7668;Number.isNaN(r)&&(console.error(` invalid --port value: ${t[s+1]}`),process.exit(1));let i=t.includes("--no-open"),n=new S,{IS_BETA:c,BETA_TAGLINE:y}=await import("./beta-
|
|
21
|
+
`);return}O();let s=t.indexOf("--port"),r=s>=0&&t[s+1]?Number(t[s+1]):e.port??7668;Number.isNaN(r)&&(console.error(` invalid --port value: ${t[s+1]}`),process.exit(1));let i=t.includes("--no-open"),n=new S,{IS_BETA:c,BETA_TAGLINE:y}=await import("./beta-RA5NVED7.js");n.banner(c?`sootsim \u2014 ${y}`:"sootsim \u2014 starting up");let m=n.add("runtime"),d=n.add("server"),$=n.add("ready"),f=n.add("open");n.render();let g=null;try{m.start("checking\u2026");let a=x();if(a&&F(D(a))){g=a;let l=await q();m.done(l?`v${a} \u2014 v${l} available, run \`sootsim upgrade\``:`v${a}`)}else{m.start("downloading engine (~6 MB)\u2026");let{runRuntime:l}=await import("./runtime-536W4YEQ.js");n.pause(),await l(["install"],{}),n.resume(),g=x(),m.done(g?`v${g}`:"installed")}}catch(a){m.fail(h(a)),n.finish(),process.exit(1)}let o=r,p="standalone";try{d.start("checking\u2026");let a=b();if(v(a)&&await P(a.bridgePort,800))o=a.bridgePort,p="daemon-existing",d.done(`already running (port ${o})`);else if(process.platform==="darwin"||process.platform==="linux"){d.start("registering background daemon\u2026");try{let{daemonInstall:l}=await import("./daemon-YJCEEAIE.js");n.pause(),await l({port:r,force:!0}),n.resume();let R=b();o=v(R)?R.bridgePort:r,p="daemon-installed",d.done(`daemon registered (port ${o})`)}catch(l){n.resume(),d.start("daemon unavailable, starting standalone server\u2026"),o=await C(r),p="standalone",d.done(`standalone (port ${o}) \u2014 ${h(l)}`)}}else d.start("starting standalone server\u2026"),o=await C(r),p="standalone",d.done(`standalone (port ${o})`)}catch(a){d.fail(h(a)),n.finish(),process.exit(1)}try{if($.start("waiting for bridge\u2026"),!await V(o,U))throw new Error(`bridge never came online on port ${o}`);$.done(`ws://localhost:${o}`)}catch(a){$.fail(h(a)),n.finish(),process.exit(1)}let w=`http://localhost:${o}/`;if(i){f.skip(w),n.finish();return}try{f.start("launching browser\u2026"),await _(w),f.done(w)}catch(a){f.skip(`${w} (open it manually \u2014 ${h(a)})`)}n.finish(),p==="standalone"?(console.log(`
|
|
22
22
|
running in standalone mode. sootsim will exit when this process does.
|
|
23
|
-
press ctrl-c to stop.`),await new Promise(()=>{})):p==="daemon-installed"&&console.log("\n installed as a background daemon \u2014 it'll restart on login.\n manage it with `sootsim daemon status / restart / uninstall`.")}function P(t,e){return new Promise(s=>{let r=new B(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,n=c=>{if(!i){i=!0;try{r.close()}catch{}s(c)}};r.once("open",()=>n(!0)),r.once("error",()=>n(!1)),setTimeout(()=>n(!1),e)})}async function V(t,e){let s=Date.now()+e;for(;Date.now()<s;){if(await P(t,500))return!0;await new Promise(r=>setTimeout(r,200))}return!1}async function C(t){let e=W();N(e,["server","--quiet","--port",String(t)],{detached:!0,stdio:"ignore",env:process.env}).unref();let r=Date.now()+I;for(;Date.now()<r;){let i=b();if(v(i))return i.bridgePort;await new Promise(n=>setTimeout(n,150))}if(await P(t,800))return t;throw new Error(`standalone server didn't come online within ${Math.round(I/1e3)}s`)}function W(){let t=process.argv[1];return t&&F(t)?t:"sootsim"}function h(t){return t instanceof Error?t.message:String(t)}async function q(){try{let{checkRuntimeUpToDate:t}=await import("./runtime-delivery-
|
|
23
|
+
press ctrl-c to stop.`),await new Promise(()=>{})):p==="daemon-installed"&&console.log("\n installed as a background daemon \u2014 it'll restart on login.\n manage it with `sootsim daemon status / restart / uninstall`.")}function P(t,e){return new Promise(s=>{let r=new B(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,n=c=>{if(!i){i=!0;try{r.close()}catch{}s(c)}};r.once("open",()=>n(!0)),r.once("error",()=>n(!1)),setTimeout(()=>n(!1),e)})}async function V(t,e){let s=Date.now()+e;for(;Date.now()<s;){if(await P(t,500))return!0;await new Promise(r=>setTimeout(r,200))}return!1}async function C(t){let e=W();N(e,["server","--quiet","--port",String(t)],{detached:!0,stdio:"ignore",env:process.env}).unref();let r=Date.now()+I;for(;Date.now()<r;){let i=b();if(v(i))return i.bridgePort;await new Promise(n=>setTimeout(n,150))}if(await P(t,800))return t;throw new Error(`standalone server didn't come online within ${Math.round(I/1e3)}s`)}function W(){let t=process.argv[1];return t&&F(t)?t:"sootsim"}function h(t){return t instanceof Error?t.message:String(t)}async function q(){try{let{checkRuntimeUpToDate:t}=await import("./runtime-delivery-NKEWLU2R.js"),e,s=await Promise.race([t(),new Promise(r=>{e=setTimeout(()=>r(null),2500)})]);return e&&clearTimeout(e),s&&s.outdated?s.latest:null}catch{return null}}export{ee as runStart};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.123 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-IYAJCTDE.js";import{spawn as m}from"child_process";import{existsSync as h,readdirSync as w}from"fs";import{resolve as u,dirname as x}from"path";import{fileURLToPath as y}from"url";var d=x(y(import.meta.resolve("sootsim-engine/package.json")));async function v(t,r){let l=t.includes("--flows"),f=t.includes("--detox"),c=t.includes("--parallel"),i=t.includes("--watch"),a=t.find((e,o)=>t[o-1]==="--reporter")||"console";if((t.includes("--help")||t.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim test \u2014 run tests against sootsim
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -26,6 +26,6 @@ examples:
|
|
|
26
26
|
notes:
|
|
27
27
|
playwright is best for smoke and package-local debugging
|
|
28
28
|
--detox is the preferred parity lane for behavior that should match real RN
|
|
29
|
-
`),process.exit(0)),l)await b(t,r,c,a);else if(f){let{runDetox:e}=await import("./detox-
|
|
29
|
+
`),process.exit(0)),l)await b(t,r,c,a);else if(f){let{runDetox:e}=await import("./detox-RUIKZD2M.js");await e(t.filter(o=>o!=="--detox"),r)}else await g(t,r)}async function g(t,r){let l=["playwright","test"],f=t.find((e,o)=>t[o-1]==="-t")||t.find((e,o)=>t[o-1]==="--testNamePattern")||t.find((e,o)=>t[o-1]==="--grep");f&&l.push("-g",f),t.includes("--watch")&&l.push("--ui");let c=new Set(["--flows","--detox","--parallel","--watch","--reporter","-t","--testNamePattern","--grep"]);for(let e=0;e<t.length;e++){if(c.has(t[e])){(t[e]==="-t"||t[e]==="--testNamePattern"||t[e]==="--grep"||t[e]==="--reporter")&&e++;continue}l.push(t[e])}console.log(` running: npx ${l.join(" ")}`);let i=m("npx",l,{cwd:d,stdio:"inherit",env:{...process.env}}),a=await new Promise(e=>{i.on("exit",o=>e(o||0))});process.exit(a)}async function b(t,r,l,f){let c=["flows","test/flows","e2e/flows",".maestro","maestro"],i=[];for(let o of c){let s=u(d,o);if(h(s)){let p=w(s).filter(n=>n.endsWith(".yaml")||n.endsWith(".yml"));for(let n of p)i.push(u(s,n))}}for(let o of c){let s=u(process.cwd(),o);if(!s.startsWith(d)&&h(s)){let p=w(s).filter(n=>n.endsWith(".yaml")||n.endsWith(".yml"));for(let n of p)i.push(u(s,n))}}i.length===0&&(console.log(" no flow files found in flows/, test/flows/, or e2e/flows/"),process.exit(0)),console.log(` found ${i.length} flow(s)`);let a=0,e=0;for(let o of i)try{let{runFlowPlayback:s}=await import("./flow-UFIGCF5G.js"),p=r.port?`http://localhost:${r.port}`:"http://localhost:5173";if(await s([o,"--url",p,"--new"])!==0){e++;continue}a++}catch{e++}console.log(`
|
|
30
30
|
results: ${a} passed, ${e} failed (${i.length} total)
|
|
31
31
|
`),process.exit(e>0?1:0)}export{v as runTest};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as k}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.123 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as k}from"./chunk-KVM5C2VS.js";import{c as u,e as g,i as y}from"./chunk-7L4XI34A.js";import"./chunk-46GLYZDL.js";import"./chunk-CGARJK4O.js";import"./chunk-HKEH5FQ2.js";import"./chunk-IYAJCTDE.js";var m=12e3;async function C(e,o){if((e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim three-mode \u2014 toggle the 3d device stage
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as m,e as d,h as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.123 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as m,e as d,h as s}from"./chunk-7L4XI34A.js";import"./chunk-46GLYZDL.js";import"./chunk-CGARJK4O.js";import"./chunk-HKEH5FQ2.js";import"./chunk-IYAJCTDE.js";import{writeFileSync as g}from"fs";function u(){console.log(`
|
|
3
3
|
sootsim timeline \u2014 control the semantic event timeline
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.123 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as s}from"./chunk-JL26L3YO.js";import"./chunk-7L4XI34A.js";import"./chunk-46GLYZDL.js";import"./chunk-CGARJK4O.js";import{a as e}from"./chunk-26R4EYTV.js";import"./chunk-L3BNIE26.js";import{C as i}from"./chunk-HKEH5FQ2.js";import"./chunk-IYAJCTDE.js";import{spawn as r}from"node:child_process";var a="https://registry.npmjs.org/sootsim/latest";async function h(o){let n=o.indexOf("--channel"),t=n>=0&&o[n+1]?o[n+1]:void 0;console.log(`sootsim upgrade
|
|
3
3
|
`),await c(),console.log(`
|
|
4
4
|
runtime:`),await s(["install",...t?["--channel",t]:[]],{})}async function c(){let o=e(),n=await u();if(!n){console.log(` cli: v${o} \u2014 couldn't reach the npm registry, skipped`);return}if(i(n,o)<=0){console.log(` cli: v${o} (latest)`);return}console.log(` cli: v${o} \u2192 v${n} \u2014 installing globally\u2026`),await m(n)?console.log(` cli: installed v${n} \u2014 restart any running \`sootsim\` process to pick it up`):(console.log(" cli: automatic install failed \u2014 upgrade it yourself with:"),console.log(" npm install -g sootsim@latest"))}async function u(){try{let o=await fetch(a,{headers:{accept:"application/json"},signal:AbortSignal.timeout(8e3)});if(!o.ok)return null;let n=await o.json();return typeof n.version=="string"&&n.version?n.version:null}catch{return null}}function m(o){return new Promise(n=>{let t=r("npm",["install","-g",`sootsim@${o}`],{stdio:"inherit",shell:!0});t.on("error",()=>n(!1)),t.on("exit",l=>n(l===0))})}export{h as runUpgrade};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.123 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c}from"./chunk-2MAZ4FWI.js";import"./chunk-T7JC2PB7.js";import"./chunk-TRWVVERC.js";import"./chunk-7L4XI34A.js";import"./chunk-HTZ6H5WJ.js";import"./chunk-UJJZU7BD.js";import"./chunk-46GLYZDL.js";import"./chunk-DVB53K4R.js";import"./chunk-M5MHSOH6.js";import"./chunk-CGARJK4O.js";import"./chunk-HKEH5FQ2.js";import"./chunk-IYAJCTDE.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! sootsim v0.1.123 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as u}from"./chunk-26R4EYTV.js";import{e as f,j as g,n as v}from"./chunk-L3BNIE26.js";import{z as m}from"./chunk-HKEH5FQ2.js";import"./chunk-IYAJCTDE.js";async function d(a){let{IS_BETA:e,BETA_LABEL:t}=await import("./beta-RA5NVED7.js"),n=e?` \xB7 ${t}`:"";console.log(`sootsim v${u()}${n}`);let i=m(),l=f();console.log(i?`runtime v${i} \xB7 ${l}`:"runtime not installed \u2014 run `sootsim runtime install`");let o=await v({channel:l});o.outdated&&o.latest&&console.log(`
|
|
3
|
+
\u2191 runtime v${o.latest} available \u2014 run \`sootsim upgrade\``);let c=[];try{c=await g()}catch{return}let r=c.find(s=>s.version===(o.latest||i));if(r){let s=R(r);s&&console.log(`
|
|
4
|
+
what's new in v${r.version}: ${s} \u2014 \`sootsim runtime notes\``)}}function R(a){let e=[];for(let t of a.sections){let n=t.items.length;n>0&&e.push(`${n} ${t.title.toLowerCase()}`)}return e.join(", ")}export{d as runVersion};
|