sootsim 0.0.1 → 0.0.3

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 (122) hide show
  1. package/README.md +12 -0
  2. package/dist-cli/bin.js +16 -10
  3. package/dist-cli/chunks/agent-D5NBV32O.js +61 -0
  4. package/dist-cli/chunks/agent-wrapper-Y7I5QGHM.js +15 -0
  5. package/dist-cli/chunks/assert-EJ7DQS2H.js +47 -0
  6. package/dist-cli/chunks/auto-bootstrap-Q7GNLISM.js +2 -0
  7. package/dist-cli/chunks/{chunk-7X6OPSRD.js → chunk-2FPPPJE5.js} +2 -2
  8. package/dist-cli/chunks/{chunk-G5MR66EB.js → chunk-3K6VDPVD.js} +2 -2
  9. package/dist-cli/chunks/{chunk-PWXPA745.js → chunk-3SLEIN6B.js} +1 -1
  10. package/dist-cli/chunks/chunk-3WPAEUOO.js +1 -0
  11. package/dist-cli/chunks/chunk-44CBTM22.js +2 -0
  12. package/dist-cli/chunks/chunk-46LRF7PH.js +5 -0
  13. package/dist-cli/chunks/chunk-4RYT6AQV.js +16 -0
  14. package/dist-cli/chunks/chunk-5AG24UFX.js +119 -0
  15. package/dist-cli/chunks/chunk-5IPP4HAW.js +5 -0
  16. package/dist-cli/chunks/{chunk-J2S3OCWA.js → chunk-AFTHIY3L.js} +1 -1
  17. package/dist-cli/chunks/chunk-BU3TZP4Y.js +11 -0
  18. package/dist-cli/chunks/chunk-BYLX2DO4.js +27 -0
  19. package/dist-cli/chunks/chunk-CPMW2QLM.js +1 -0
  20. package/dist-cli/chunks/{chunk-YCETS3B3.js → chunk-CQ6PX2EU.js} +2 -2
  21. package/dist-cli/chunks/chunk-D4JFMCXD.js +2 -0
  22. package/dist-cli/chunks/chunk-EEBR5YP5.js +62 -0
  23. package/dist-cli/chunks/chunk-EQ7G3UHS.js +4 -0
  24. package/dist-cli/chunks/{chunk-64TOMNZX.js → chunk-FTRI7SVV.js} +2 -2
  25. package/dist-cli/chunks/{chunk-GPVPHE2B.js → chunk-H3JVJXOC.js} +2 -2
  26. package/dist-cli/chunks/chunk-LV5U7TI4.js +1 -0
  27. package/dist-cli/chunks/chunk-NKJLTISU.js +4 -0
  28. package/dist-cli/chunks/chunk-O2HBPZW5.js +22 -0
  29. package/dist-cli/chunks/{chunk-KSACMDXK.js → chunk-OG5CKIPC.js} +2 -2
  30. package/dist-cli/chunks/{chunk-E522F5JW.js → chunk-P5C3UASK.js} +1 -1
  31. package/dist-cli/chunks/chunk-REYWQVAH.js +2 -0
  32. package/dist-cli/chunks/chunk-RLS6PHBW.js +4 -0
  33. package/dist-cli/chunks/chunk-SUZR2SZZ.js +34 -0
  34. package/dist-cli/chunks/{chunk-OROM7DZI.js → chunk-USRNDVQ3.js} +1 -1
  35. package/dist-cli/chunks/{chunk-JSF5LPNT.js → chunk-UZL5ZZ4E.js} +5 -5
  36. package/dist-cli/chunks/{chunk-QOBRRY5X.js → chunk-VI3VW5BL.js} +1 -1
  37. package/dist-cli/chunks/chunk-WUYJFYOW.js +2 -0
  38. package/dist-cli/chunks/chunk-X2W4IRXK.js +3 -0
  39. package/dist-cli/chunks/chunk-XJBPH4JR.js +308 -0
  40. package/dist-cli/chunks/chunk-ZSRMXBGK.js +2 -0
  41. package/dist-cli/chunks/{compat-MRN2ORY5.js → compat-5KSMOWLB.js} +4 -4
  42. package/dist-cli/chunks/{config-CO5IYWUY.js → config-NJB6PQHU.js} +5 -5
  43. package/dist-cli/chunks/control-2F3AGZAO.js +2 -0
  44. package/dist-cli/chunks/{daemon-G4XVRFHM.js → daemon-MLG65V4S.js} +2 -2
  45. package/dist-cli/chunks/{debug-ZNSZTWT6.js → debug-QVOBTTLP.js} +4 -4
  46. package/dist-cli/chunks/demo-app-registry-XRYNJ4GC.js +2 -0
  47. package/dist-cli/chunks/{detox-JEGYNTYV.js → detox-ZZSNZL4T.js} +2 -2
  48. package/dist-cli/chunks/{device-BS34FAFM.js → device-PQB3YGHN.js} +2 -2
  49. package/dist-cli/chunks/drivers-GWDQEGWD.js +2 -0
  50. package/dist-cli/chunks/electron-JB26VHOO.js +15 -0
  51. package/dist-cli/chunks/flow-7JRQXMFV.js +2 -0
  52. package/dist-cli/chunks/{hints-7Z656W4H.js → hints-IGYDXXDS.js} +2 -2
  53. package/dist-cli/chunks/home-paths-CEGSGQTD.js +2 -0
  54. package/dist-cli/chunks/{inspect-NAHXP2M5.js → inspect-DSU6ELRM.js} +153 -165
  55. package/dist-cli/chunks/install-K6IJKADG.js +65 -0
  56. package/dist-cli/chunks/{install-desktop-PYIZIH67.js → install-desktop-SC3LNFFF.js} +8 -4
  57. package/dist-cli/chunks/install-dev-desktop-4DP3UY2X.js +100 -0
  58. package/dist-cli/chunks/keys-R5LAPAAL.js +19 -0
  59. package/dist-cli/chunks/launch-K3WJV4QA.js +16 -0
  60. package/dist-cli/chunks/{login-Z5Z54HUJ.js → login-A23PYJAW.js} +5 -5
  61. package/dist-cli/chunks/{logout-T2QDYGCB.js → logout-AJ24PH5O.js} +2 -2
  62. package/dist-cli/chunks/{maestro-4AXTS7OE.js → maestro-YALWKKGU.js} +2 -2
  63. package/dist-cli/chunks/{preview-NMGWHWMX.js → preview-D35EEONY.js} +2 -2
  64. package/dist-cli/chunks/{profile-6RGJA4FR.js → profile-MAF7NM5Q.js} +3 -3
  65. package/dist-cli/chunks/record-ZCPQNGFW.js +37 -0
  66. package/dist-cli/chunks/runtime-Z2WIXYUN.js +25 -0
  67. package/dist-cli/chunks/{screenshot-R3GCCSCI.js → screenshot-NQVZYC3C.js} +3 -3
  68. package/dist-cli/chunks/screenshot-mode-E45D2ZFH.js +17 -0
  69. package/dist-cli/chunks/{screenshots-4UQJE4NC.js → screenshots-I4SQI4DA.js} +2 -2
  70. package/dist-cli/chunks/server-ZUXKJRR5.js +29 -0
  71. package/dist-cli/chunks/{skills-2PPKPL4B.js → skills-N4U63E5W.js} +2 -2
  72. package/dist-cli/chunks/store-4A6X4GBJ.js +2 -0
  73. package/dist-cli/chunks/{test-5LFKOQ4M.js → test-VBD6N3AR.js} +3 -3
  74. package/dist-cli/chunks/upload-Y6FZ5XF2.js +2 -0
  75. package/dist-cli/chunks/{whoami-H6FW34JS.js → whoami-4K6JGMWH.js} +2 -2
  76. package/dist-lib/agent-daemon-client.cjs +414 -0
  77. package/dist-lib/agent-events.cjs +48 -0
  78. package/dist-lib/agent-sessions.cjs +692 -0
  79. package/dist-lib/attached-projects.cjs +448 -0
  80. package/dist-lib/auth/shared-session.cjs +174 -0
  81. package/dist-lib/backend-origin.cjs +70 -0
  82. package/dist-lib/bridge-constants.cjs +32 -0
  83. package/dist-lib/cli-constants.cjs +32 -0
  84. package/dist-lib/config.cjs +88 -0
  85. package/dist-lib/dev-bundle-resolution.cjs +236 -0
  86. package/dist-lib/home-paths.cjs +234 -0
  87. package/dist-lib/host/bridge-host.cjs +3458 -0
  88. package/dist-lib/index.cjs +361 -0
  89. package/dist-lib/metro.cjs +215 -0
  90. package/dist-lib/render-mode.cjs +54 -0
  91. package/dist-lib/vite-base.cjs +4217 -0
  92. package/dist-lib/vite.cjs +178 -0
  93. package/package.json +80 -13
  94. package/scripts/postinstall.cjs +70 -0
  95. package/dist-cli/chunks/bridge-host-2EY7Z4AO.js +0 -2
  96. package/dist-cli/chunks/chunk-3C3ZH7PP.js +0 -4
  97. package/dist-cli/chunks/chunk-3R4ZZESY.js +0 -119
  98. package/dist-cli/chunks/chunk-74XPLOV4.js +0 -2
  99. package/dist-cli/chunks/chunk-7LMDCMSI.js +0 -8
  100. package/dist-cli/chunks/chunk-A2CZQIWO.js +0 -1
  101. package/dist-cli/chunks/chunk-CKZ376AY.js +0 -322
  102. package/dist-cli/chunks/chunk-E5UBZEYR.js +0 -2
  103. package/dist-cli/chunks/chunk-HOIHCO7S.js +0 -3
  104. package/dist-cli/chunks/chunk-KQWZZ56P.js +0 -2
  105. package/dist-cli/chunks/chunk-KSB6MSZ4.js +0 -34
  106. package/dist-cli/chunks/chunk-KXYKAYYB.js +0 -51
  107. package/dist-cli/chunks/chunk-MBFP2LVH.js +0 -3
  108. package/dist-cli/chunks/chunk-MPSZ5EWF.js +0 -16
  109. package/dist-cli/chunks/chunk-X2U72K7X.js +0 -1
  110. package/dist-cli/chunks/control-Y7TKKB6D.js +0 -2
  111. package/dist-cli/chunks/dev-ZUKCZQEX.js +0 -25
  112. package/dist-cli/chunks/dev-checkout-IEZVVTCN.js +0 -2
  113. package/dist-cli/chunks/drivers-46PFFIDF.js +0 -2
  114. package/dist-cli/chunks/electron-P2KOPX2S.js +0 -15
  115. package/dist-cli/chunks/flow-VVOF6UNC.js +0 -2
  116. package/dist-cli/chunks/install-EPUJX4AT.js +0 -67
  117. package/dist-cli/chunks/record-IE27Z2GA.js +0 -37
  118. package/dist-cli/chunks/screenshot-mode-SZQDNGYE.js +0 -17
  119. package/dist-cli/chunks/server-AN2G5KO4.js +0 -21
  120. package/dist-cli/chunks/store-PU5ES4YQ.js +0 -2
  121. package/dist-cli/chunks/upload-BYNPC54C.js +0 -2
  122. package/dist-cli/chunks/vite-plugin-5AEUUBKP.js +0 -9
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as m}from"./chunk-3C3ZH7PP.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as w}from"fs";import{tmpdir as d}from"os";import{dirname as v,join as p}from"path";var y=new Map;function i(e,r){y.set(e,r)}var a=1;function s(){return p(d(),`sootsim-cli-hints-${m()}.json`)}function l(){return p(d(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:a,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==a||!r?.shown?{version:a,shown:{}}:r}catch{return{version:a,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as m}from"./chunk-RLS6PHBW.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as w}from"fs";import{tmpdir as d}from"os";import{dirname as v,join as p}from"path";var y=new Map;function i(e,r){y.set(e,r)}var a=1;function s(){return p(d(),`sootsim-cli-hints-${m()}.json`)}function l(){return p(d(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:a,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==a||!r?.shown?{version:a,shown:{}}:r}catch{return{version:a,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
3
3
  `)}catch{}}function F(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function x(e,r){let o=F();if(o==="off")return!1;if(o==="always"||r==="always")return!0;let t=Date.now();if(r==="once-per-session"){let n=u(s());return n.shown[e]?!1:(n.shown[e]=t,f(s(),n),!0)}if(r==="once-ever"){let n=u(l());return n.shown[e]?!1:(n.shown[e]=t,f(l(),n),!0)}if(typeof r=="object"&&"cooldownMs"in r){let n=u(s()),c=n.shown[e]??0;return t-c<r.cooldownMs?!1:(n.shown[e]=t,f(s(),n),!0)}return!0}function M(e,...r){let o=y.get(e);if(!o)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!x(e,o.frequency))return!1;let t=o.render(...r);if(t==null)return!1;let n=Array.isArray(t)?t:[t],c=o.stream==="error"?console.error:console.log;for(let g of n)c(` hint: ${g}`);return!0}function O(){w(s(),{force:!0})}function k(){w(l(),{force:!0})}function T(){return Array.from(y.entries()).map(([e,r])=>({id:e,frequency:r.frequency}))}i("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});i("wait-selector-for-missing-testid",{frequency:"once-per-session",render:e=>`sootsim wait selector ${e}`,stream:"error"});i("prefer-cli-over-eval",{frequency:"once-per-session",render:e=>e.length?["try the CLI shortcut instead:",...e.map(r=>` ${r}`)]:null,stream:"error"});i("describe-use-filters",{frequency:"once-per-session",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});i("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`,stream:"error"});export{M as a,O as b,k as c,T as d};
@@ -0,0 +1 @@
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as T}from"./chunk-44CBTM22.js";import{a as I}from"./chunk-P5C3UASK.js";function G(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function O(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return G(r)?r:null}catch{return null}}import{randomBytes as H,createHash as Y}from"node:crypto";import f from"node:fs";import q from"node:os";import p from"node:path";var R=null;function _(){if(R)return R;let e=process.env.SOOTSIM_USER_DATA_DIR;if(e)return e;try{let t=I("electron");if(t.app?.getPath)return t.app.getPath("userData")}catch{}return X()}function X(){let e=q.homedir();if(process.platform==="darwin")return p.join(e,"Library","Application Support","sootsim");if(process.platform==="win32")return p.join(process.env.APPDATA||e,"sootsim");let t=process.env.XDG_CONFIG_HOME||p.join(e,".config");return p.join(t,"sootsim")}function h(){return _()}function $(){return p.join(_(),"attached-projects.json")}function N(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=$(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return N();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return N()}}function K(e){let t=$();f.mkdirSync(p.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),K(t),t}function F(e){return Y("sha256").update(p.resolve(e)).digest("hex").slice(0,16)}function Q(){return`s_${H(10).toString("hex")}`}function ye(e){let t=p.resolve(e.cwd),r=F(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},y=o.attachedProjects.indexOf(s);o.attachedProjects[y]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??p.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function U(e){return S().attachedProjects.find(t=>t.id===e)??null}function he(){return S().attachedProjects}var V=336*60*60*1e3;function Se(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-V,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function we(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function ve(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function B(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??Q(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function M(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function Ae(){if(S().attachedProjects.length>0)return;let t;try{t=(await import("./demo-app-registry-XRYNJ4GC.js")).APPS}catch(n){console.warn("[sootsim] seedFromDemoAppRegistry: could not load demo registry:",n.message);return}if(!Array.isArray(t))return;let r=t;w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=p.resolve(o.dir),a=F(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as z,spawnSync as Z}from"node:child_process";import{randomUUID as ee}from"node:crypto";import i,{constants as g}from"node:fs";import u from"node:path";import te from"node:readline";function b(e){return u.join(h(),"sessions",e)}function L(e){return u.join(b(e),"prompt.in")}function W(e){return u.join(b(e),"events.out")}function re(e){return u.join(h(),"transcripts",`${e}.log`)}function E(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function ne(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=se();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function se(){try{let e=oe();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function oe(){try{let r=I.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=ie();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ie(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ce(e,t,r){let n=u.join(h(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,g.O_WRONLY|g.O_CREAT|g.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ae(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ae(e){try{return process.kill(e,0),!0}catch{return!1}}function C(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=Z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=U(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ce(t.id,r,async()=>{let n=M(t.id).find(m=>m.provider===r&&m.status!=="ended"&&E(m.wrapperPid,m.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?ee():void 0,s=B({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=L(s.id),d=W(s.id),c=re(s.id);C(a),C(d);let y=u.dirname(c);i.mkdirSync(y,{recursive:!0});try{i.chmodSync(y,448)}catch{}let{cmd:A,prefixArgs:J}=ne(),j=[...J,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&j.push("--codex-bin",e.codexBin),e.claudeBin&&j.push("--claude-bin",e.claudeBin),o&&j.push("--claude-session-uuid",o);let P=z(A,j,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:h()}});P.unref();let D=e.readyTimeoutMs??6e3,x=await de(d,m=>m.type==="ready"||m.type==="error",D);if(!x||x.type==="error"){if(P.pid)try{process.kill(P.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let m=x&&x.type==="error"?x.message:`no ready event within ${D}ms`;throw new l("WRAPPER_FAILED",m)}return v(s.id,{wrapperPid:P.pid,status:"idle"}),{session:k(s.id),wrapperPid:P.pid}})}async function Re(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!E(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=L(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,g.O_WRONLY);try{let s=T(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
3
+ `)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function Ne(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(E(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=b(e),n=h();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function _e(e,t){let r=W(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,g.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=te.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let c=O(d);c&&t(c)});let a=!1;return()=>{if(!a){a=!0;try{s.close()}catch{}try{o.destroy()}catch{}}}}async function de(e,t,r){let n=i.openSync(e,g.O_RDWR|g.O_NONBLOCK),o=Buffer.alloc(8192),s="",a=Date.now()+r;try{for(;Date.now()<a;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(c){if(c.code!=="EAGAIN")throw c;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let c;for(;(c=s.indexOf(`
4
+ `))>=0;){let y=s.slice(0,c);s=s.slice(c+1);let A=O(y);if(A&&t(A))return A}}else await new Promise(c=>setTimeout(c,30))}return null}finally{i.closeSync(n)}}export{O as a,h as b,ye as c,U as d,he as e,Se as f,we as g,ve as h,k as i,M as j,v as k,Ae as l,b as m,L as n,W as o,re as p,E as q,ne as r,l as s,Te as t,Re as u,Ne as v,_e as w};
@@ -0,0 +1,22 @@
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as C}from"./chunk-P5C3UASK.js";import{existsSync as i,readFileSync as _,writeFileSync as E}from"node:fs";import{homedir as D}from"node:os";import{dirname as L,join as s,resolve as R}from"node:path";var f=D();function b(e){let n=e;for(;;){if(i(s(n,"pnpm-workspace.yaml"))||i(s(n,"turbo.json"))||i(s(n,"nx.json"))||i(s(n,"lerna.json")))return n;let t=s(n,"package.json");if(i(t))try{if(JSON.parse(_(t,"utf8")).workspaces)return n}catch{}let r=L(n);if(r===n)return null;n=r}}function k(e,n){let t=b(process.cwd()),r=[t?R(t,e):null,R(process.cwd(),e),R(process.cwd(),n)].filter(o=>!!o);for(let o of r)if(i(o))return o;return r[0]??R(process.cwd(),e)}var x=()=>k("packages/sootsim-engine/scripts/expensify-web-proxy.ts","scripts/expensify-web-proxy.ts"),S={USE_NGROK:"true",NGROK_URL:"http://localhost:9000/",SECURE_NGROK_URL:"http://localhost:9000/"},A=s(f,"github/uniswap-interface"),K=s(A,"apps/mobile"),m=s(A,".env.defaults.local"),W="stored-in-.env.local",T="# sootsim demo env overrides",Y=s(A,"packages/uniswap/src/features/forceUpgrade/hooks/useForceUpgradeStatus.ts"),M=s(A,"apps/mobile/src/notification-service/data-sources/createForceUpgradeNotificationDataSource.ts"),N="SOOTSIM_DEMO_DISABLE_FORCE_UPGRADE";function y(e){if(!i(e))return{};let n={},t=_(e,"utf8");for(let r of t.split(/\r?\n/)){let o=r.trim();if(!o||o.startsWith("#"))continue;let d=o.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);if(!d)continue;let c=d[2].trim();(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),n[d[1]]=c}return n}function O(e){if(!e)return!1;let n=e.trim();return!(!n||n.includes(W)||n==="TRADING_API_KEY"||n==="UNISWAP_API_KEY")}function v(e,n){for(let t of e)for(let r of n){let o=t[r];if(O(o))return o.trim()}}function U(){let e=y(m),n=y(s(A,"apps/web/.env")),t=[process.env,e,n],r={},o=[["AMPLITUDE_PROXY_URL_OVERRIDE",["REACT_APP_AMPLITUDE_PROXY_URL"]],["QUICKNODE_ENDPOINT_NAME",["REACT_APP_QUICKNODE_ENDPOINT_NAME"]],["QUICKNODE_ENDPOINT_TOKEN",["REACT_APP_QUICKNODE_ENDPOINT_TOKEN"]],["INFURA_KEY",["REACT_APP_INFURA_KEY"]],["STATSIG_API_KEY",["REACT_APP_STATSIG_API_KEY"]],["STATSIG_PROXY_URL_OVERRIDE",["REACT_APP_STATSIG_PROXY_URL"]],["WALLETCONNECT_PROJECT_ID",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["WALLETCONNECT_PROJECT_ID_BETA",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["WALLETCONNECT_PROJECT_ID_DEV",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["TRADING_API_KEY",["REACT_APP_TRADING_API_KEY"]],["UNISWAP_API_KEY",[]]];for(let[c,u]of o){let p=v(t,[c,...u]);if(p){r[c]=p;for(let g of u)r[g]=p}}if(!(O(r.TRADING_API_KEY)&&O(r.UNISWAP_API_KEY))){let c=v(t,["GRAPHQL_URL_OVERRIDE","REACT_APP_AWS_API_ENDPOINT"])||"https://interface.gateway.uniswap.org/v1/graphql";r.API_BASE_URL_OVERRIDE="https://interface.gateway.uniswap.org",r.API_BASE_URL_V2_OVERRIDE="https://interface.gateway.uniswap.org/v2",r.GRAPHQL_URL_OVERRIDE=c,r.TRADING_API_URL_OVERRIDE="https://trading-api-labs.interface.gateway.uniswap.org",r.FOR_API_URL_OVERRIDE="https://for.interface.gateway.uniswap.org/v2/FOR.v1.FORService"}return r}function F(){let e=i(m)?_(m,"utf8"):"";if(e&&!e.includes(T))return;let n=U(),t=[T];for(let[r,o]of Object.entries(n).sort(([d],[c])=>d.localeCompare(c)))t.push(`${r}=${JSON.stringify(o)}`);t.push(""),E(m,`${t.join(`
3
+ `)}
4
+ `)}function G(){let e=`export function useForceUpgradeStatus(): ForceUpgradeStatus {
5
+ `,n=` // sootsim demo: bypass the force-upgrade gate during local engine demos.
6
+ return 'not-required'
7
+
8
+ `,t=` // sootsim demo: bypass the force-upgrade gate during local engine demos.
9
+ if (process.env.${N} === 'true') {
10
+ return 'not-required'
11
+ }
12
+
13
+ `,r=` const getForceUpgradeStatus = (): ForceUpgradeStatus => {
14
+ `,o=` // sootsim demo: bypass the force-upgrade gate during local engine demos.
15
+ return 'not-required'
16
+
17
+ `,d=` // sootsim demo: bypass the force-upgrade gate during local engine demos.
18
+ if (process.env.${N} === 'true') {
19
+ return 'not-required'
20
+ }
21
+
22
+ `,c=(u,p,g,I)=>{let l=_(u,"utf8");if(!l.includes(g)){if(l.includes(I)){E(u,l.replace(I,g));return}if(!l.includes(p))throw new Error(`uniswap demo patch failed: expected snippet not found in ${u}`);E(u,l.replace(p,`${p}${g}`))}};c(Y,e,n,t),c(M,r,o,d)}var a=s(f,"github/eigen"),P=s(a,"keys.shared.json"),h=s(a,"metaflags.json"),w=s(a,"src/__generated__/.relay-complete");function V(){if(i(P))try{let e=JSON.parse(_(P,"utf8"));if(!e||typeof e!="object")return;let n=e.secure&&typeof e.secure=="object"?e.secure:void 0,t=e.public&&typeof e.public=="object"?e.public:void 0;return!n&&!t?void 0:{secure:n,public:t}}catch{return}}function j(){let e=process.env.SOOTSIM_ARTSY_EMAIL??process.env.MAESTRO_TEST_EMAIL,n=process.env.SOOTSIM_ARTSY_PASSWORD??process.env.MAESTRO_TEST_PASSWORD,t=V(),r={};if(e&&n&&(r.SOOTSIM_LAUNCH_ARGUMENTS=JSON.stringify({email:e,password:n,useMaestroInit:!0})),t&&(r.SOOTSIM_REACT_NATIVE_KEYS_JSON=JSON.stringify(t)),Object.keys(r).length!==0)return{env:r}}function J(){if(!i(a))return;let{execSync:e}=C("node:child_process"),n=s(a,".yarn/releases/yarn-4.10.3.cjs");if(i(n)){let r=_(n,"utf8"),o='["clone","-c core.autocrlf=false",';r.includes(o)&&E(n,r.replace(o,'["clone","-c","core.autocrlf=false",'))}if(i(s(a,"node_modules/.yarn-state.yml"))||e("yarn install",{cwd:a,stdio:"inherit",env:{...process.env,YARN_CHECKSUM_BEHAVIOR:"update"}}),!i(P)||!i(h))try{e("yarn setup:oss",{cwd:a,stdio:"inherit"})}catch{if(!i(P)||!i(h))throw new Error("artsy demo: setup:oss did not create keys/metaflags")}let t=s(a,"node_modules/react-native-launch-arguments/package.json");if(i(t)){let r=_(t,"utf8");r.includes('"dist/index.js"')&&E(t,r.replace('"dist/index.js"','"src/index.ts"'))}i(w)||(e("yarn relay",{cwd:a,stdio:"inherit"}),E(w,""))}var q=[{name:"bluesky",label:"Bluesky",dir:s(f,"github/bluesky"),preferredPort:8082,framework:"expo",command:e=>({cmd:`npx expo start --port ${e}`}),credentials:{envVars:["SOOTSIM_BLUESKY_PASSWORD"],known:{HANDLE:"natew.bsky.social"}}},{name:"3pc",label:"3PunchConvo",dir:s(f,"lightstrike-labs/three-punch-convo-app/apps/one"),preferredPort:8081,framework:"one",command:e=>({cmd:"npx one dev",env:{ONE_PORT:String(e)}})},{name:"uniswap",label:"Uniswap",dir:K,preferredPort:8085,framework:"expo",prepare:()=>{F(),G()},command:e=>({cmd:`npx expo start --clear --port ${e}`,env:U()})},{name:"takeout",label:"Takeout",dir:s(f,"takeout"),preferredPort:8086,framework:"one",command:e=>({cmd:"npx one dev",env:{ONE_PORT:String(e)}})},{name:"expensify",label:"Expensify",dir:s(f,"github/expensify"),preferredPort:8087,framework:"rock",runtimeConfig:{env:S},sidecars:[{name:"web-proxy",port:9e3,readyPath:"/api/Ping",command:()=>({cmd:`bun ${JSON.stringify(x())}`,env:S})}],command:e=>({cmd:`fnm exec --using=20.20.0 npx rock start --port ${e} --no-interactive`,env:S})},{name:"artsy",label:"Artsy",dir:a,preferredPort:8088,framework:"expo",runtimeConfig:j(),prepare:()=>{J()},command:e=>({cmd:`npx react-native start --port ${e}`}),credentials:{envVars:["SOOTSIM_ARTSY_EMAIL","SOOTSIM_ARTSY_PASSWORD"],note:"auto-login reuses Artsy\u2019s built-in Maestro launch-arguments hook"}}];export{q as a};
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{i as n}from"./chunk-YCETS3B3.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{i as n}from"./chunk-CQ6PX2EU.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
3
3
  `)}export{g as a};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var d=Object.defineProperty;var e=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var f=(a,b)=>{for(var c in b)d(a,c,{get:b[c],enumerable:!0})};export{e as a,f as b};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ var o="sootsimConfig";function e(n){return!!n&&Object.keys(n).length>0}function s(n){return n?e(n.modules)||e(n.turboModules)||e(n.env)||e(n.settings)||e(n.initialState):!1}function u(n,i){let t=new URL(n);return s(i)?t.searchParams.set(o,JSON.stringify(i)):t.searchParams.delete(o),t.toString()}var d="/node_modules/one/metro-entry.bundle?platform=ios&dev=true&minify=false",S="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function r(n){return/^https?:\/\//i.test(n)}function a(n){return n.endsWith(".bundle")}function f(n){try{let i=r(n),t=new URL(n,"http://soot.local");return a(t.pathname)?(t.searchParams.has("dev")||t.searchParams.set("dev","true"),t.searchParams.has("minify")||t.searchParams.set("minify","false"),i?t.toString():`${t.pathname}${t.search}${t.hash}`):n}catch{return n}}export{u as a,d as b,S as c,f as d};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{existsSync as m,mkdirSync as A,readFileSync as w,readdirSync as x,rmSync as o,writeFileSync as _}from"fs";import{tmpdir as l}from"os";import{dirname as L,join as p,resolve as h}from"path";import{execFileSync as y}from"child_process";import{readFileSync as N}from"fs";import{createRequire as E}from"module";var s=null;function u(r){s||(s=O());try{return s(r)}catch{return null}}function O(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return g();if(process.platform==="darwin"){let t=T();return t||P()}return()=>null}function g(){return r=>{try{let t=N(`/proc/${r}/stat`,"utf8"),e=t.lastIndexOf(")");if(e<0)return null;let i=t.slice(e+1).trim().split(/\s+/),n=Number(i[1]);return Number.isFinite(n)&&n>0?n:null}catch{return null}}}var C=3,a=216,D=16;function T(){if(!process.versions?.bun)return null;try{let r=E(import.meta.url),{dlopen:t,FFIType:e}=r("bun:ffi"),i=t("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[e.i32,e.i32,e.u64,e.ptr,e.i32],returns:e.i32}}),n=Buffer.alloc(a);return b=>{if(Number(i.symbols.proc_pidinfo(b,C,0n,n,a))<=0)return null;let d=n.readUInt32LE(D);return d>0?d:null}}catch{return null}}function P(){return r=>{try{let e=y("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
3
+ `)[1];if(!e)return null;let i=e.trim().split(/\s+/),n=Number(i[2]);return Number.isFinite(n)&&n>1?n:null}catch{return null}}}var c=1,S="SOOTSIM_CLI_SESSION_PATH",v=["SOOTSIM_SESSION_ID","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"];function F(r,t=20){let e=u(r);if(!e||e<=1)return null;for(let i=0;i<t;i++){let n=u(e);if(!n||n<=1)return e;e=n}return e}function R(){for(let t of v){let e=process.env[t];if(e&&e.trim())return{key:`${t}:${e.trim()}`,source:t,stable:!0}}let r=F(process.ppid);return r&&r>1?{key:`gppid-${r}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}var I=p(l(),"sootsim-legacy-gc-done");function j(){if(!m(I)){try{_(I,String(Date.now()))}catch{return}try{let r=l();for(let t of x(r))if(t.startsWith("sootsim-gppid-"))try{o(p(r,t),{force:!0})}catch{}}catch{}}}function k(){return R().key}function f(){if(process.env[S])return h(process.env[S]);let r=k();return p(l(),`sootsim-cli-session-${r}.json`)}function W(){let r=f();if(!m(r))return null;try{let t=JSON.parse(w(r,"utf8"));return t.version!==c||typeof t.browserId!="string"||!t.browserId.trim()||typeof t.updatedAt!="string"?(o(r,{force:!0}),null):{version:c,browserId:t.browserId.trim(),updatedAt:t.updatedAt}}catch{return o(r,{force:!0}),null}}function G(){return W()?.browserId||null}function X(r){let t=r.trim();if(!t)return;let e=f();A(L(e),{recursive:!0}),_(e,JSON.stringify({version:c,browserId:t,updatedAt:new Date().toISOString()},null,2)+`
4
+ `)}function Z(){o(f(),{force:!0})}export{R as a,j as b,k as c,G as d,X as e,Z as f};
@@ -0,0 +1,34 @@
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ function d(t){let e=t.displayUrl||t.url;return t.status!=null?`${t.method} ${e} -> ${t.status}${t.statusText?` ${t.statusText}`:""}`:t.error?`${t.method} ${e} -> ${t.error}`:`${t.method} ${e}`}async function u(t,e,...o){return t.send({type:"call",path:`__sootsimTest.${e}`,args:o})}async function g(t,e={}){let o=await t.send({type:"evaluate",code:"window.__sootsimConsole?.count?.() || { errors: 0, warnings: 0, total: 0 }"});if(!o||typeof o!="object")return;let n=Math.max(0,Number(o.errors)||0),s=Math.max(0,Number(o.warnings)||0);if(n===0&&s===0)return;let r=[];if(n>0&&r.push(`${n} console error${n===1?"":"s"}`),s>0&&r.push(`${s} console warning${s===1?"":"s"}`),console.log(`
3
+ console: ${r.join(", ")}`),e.errorsCommand&&console.log(` inspect: ${e.errorsCommand}`),s>0&&e.warningsCommand&&console.log(` inspect: ${e.warningsCommand}`),!e.includeTail||n===0)return;let i=await t.send({type:"evaluate",code:"window.__sootsimConsole?.getErrors?.(5) || []"});if(!(!Array.isArray(i)||i.length===0)){console.log(`
4
+ recent console errors:
5
+ `);for(let a of i){let c=new Date(a.timestamp).toLocaleTimeString(),m=Array.isArray(a.args)?a.args.map(l=>typeof l=="object"?JSON.stringify(l):String(l)).join(" "):String(a);console.log(` [${c}] ${m}`)}}}async function f(t,e={}){let o=await u(t,"getRequestCounts");if(!o||typeof o!="object")return;let n=Math.max(0,Number(o.failed)||0);if(n===0||(console.log(`
6
+ network: ${n} failed request${n===1?"":"s"}`),e.requestsCommand&&console.log(` inspect: ${e.requestsCommand}`),!e.includeTail))return;let s=await u(t,"getFailedRequests",5);if(!(!Array.isArray(s)||s.length===0)){console.log(`
7
+ recent failed requests:
8
+ `);for(let r of s){let i=new Date(r.timestamp).toLocaleTimeString();console.log(` [${i}] ${d(r)}`),r.responseBody?console.log(` ${r.responseBody}`):r.error&&console.log(` ${r.error}`)}}}async function w(t){let e=await t.send({type:"evaluate",code:`(async () => {
9
+ const test = window.__sootsimTest
10
+ const mainShell = window.SootSim?.bridges?.mainShell
11
+ let shell = null
12
+ try {
13
+ shell = typeof mainShell?.getState === 'function' ? await mainShell.getState() : null
14
+ } catch {}
15
+ let nodeCount = 0
16
+ try {
17
+ nodeCount = typeof test?.getNodeCount === 'function' ? await test.getNodeCount() : 0
18
+ } catch {}
19
+ return {
20
+ url: window.location.href,
21
+ bridgeId: window.__sootsimBridgeId || null,
22
+ nodeCount,
23
+ mode: window.__sootsimRenderHost ? 'render-worker' : 'main-thread',
24
+ shell: shell
25
+ ? {
26
+ state: shell.state || null,
27
+ activeApp: shell.activeApp || null,
28
+ showSwitcher: !!shell.showSwitcher,
29
+ switcherPhase: shell.switcherPhase || null,
30
+ }
31
+ : null,
32
+ }
33
+ })()`});if(!e||typeof e!="object")return;console.log(`
34
+ state:`),e.bridgeId&&console.log(` session: ${e.bridgeId}`),e.url&&console.log(` url: ${e.url}`),e.mode&&console.log(` mode: ${e.mode}`);let o=Number(e.nodeCount)||0;console.log(` nodes: ${o}${o>10?" (ready)":" (not ready)"}`);let n=e.shell;if(n&&typeof n=="object"){let s=[n.state?`state=${n.state}`:null,n.activeApp?`app=${n.activeApp}`:null,n.showSwitcher?"switcher=open":null,n.switcherPhase?`phase=${n.switcherPhase}`:null].filter(Boolean);s.length>0&&console.log(` shell: ${s.join(" ")}`)}}async function h(t,e={}){try{await w(t)}catch{}try{await g(t,{includeTail:!0,errorsCommand:e.errorsCommand,warningsCommand:e.warningsCommand})}catch{}try{await f(t,{includeTail:!0,requestsCommand:e.requestsCommand})}catch{}}export{w as a,h as b};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  async function o(e){let{spawn:t}=await import("child_process");if(process.platform==="darwin"){t("open",["-g",e],{detached:!0,stdio:"ignore"}).unref();return}if(process.platform==="win32"){t("cmd",["/c","start","",e],{detached:!0,stdio:"ignore"}).unref();return}t("xdg-open",[e],{detached:!0,stdio:"ignore"}).unref()}export{o as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as bs}from"./chunk-E522F5JW.js";var oi=`(async () => {
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as bs}from"./chunk-P5C3UASK.js";var oi=`(async () => {
3
3
  try { localStorage.clear() } catch {}
4
4
  try { sessionStorage.clear() } catch {}
5
5
  try {
@@ -89,7 +89,7 @@ ${i.key.commentBefore}`:n.commentBefore),n.comment){let r=i.value??i.key;r.comme
89
89
  ${r.comment}`:n.comment}n=i}s.items[t]=T(n)?n:new C(n)}}else e("Expected a sequence for this tag");return s}function Wt(s,e,t){let{replacer:n}=t,i=new D(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(Te(a,l,t))}return i}var Je={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Qt,createNode:Wt};var Ie=class s extends D{constructor(){super(),this.add=_.prototype.add.bind(this),this.delete=_.prototype.delete.bind(this),this.get=_.prototype.get.bind(this),this.has=_.prototype.has.bind(this),this.set=_.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let r,o;if(T(i)?(r=M(i.key,"",t),o=M(i.value,r,t)):r=M(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){let i=Wt(e,t,n),r=new this;return r.items=i.items,r}};Ie.tag="tag:yaml.org,2002:omap";var Ye={collection:"seq",identify:s=>s instanceof Map,nodeClass:Ie,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=Qt(s,e),n=[];for(let{key:i}of t.items)E(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Ie,t)},createNode:(s,e,t)=>Ie.from(s,e,t)};function $s({value:s,source:e},t){return e&&(s?Ht:Xt).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var Ht={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new y(!0),stringify:$s},Xt={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new y(!1),stringify:$s};var Ps={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:B},Ms={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():B(s)}},Ds={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new y(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:B};var Ge=s=>typeof s=="bigint"||Number.isInteger(s);function Tt(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return i==="-"?BigInt(-1)*o:o}let r=parseInt(s,t);return i==="-"?-1*r:r}function zt(s,e,t){let{value:n}=s;if(Ge(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return B(s)}var Bs={identify:Ge,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Tt(s,2,2,t),stringify:s=>zt(s,2,"0b")},Ks={identify:Ge,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Tt(s,1,8,t),stringify:s=>zt(s,8,"0")},js={identify:Ge,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Tt(s,0,10,t),stringify:B},Fs={identify:Ge,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Tt(s,2,16,t),stringify:s=>zt(s,16,"0x")};var Le=class s extends _{constructor(e){super(e),this.tag=s.tag}add(e){let t;T(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new C(e.key,null):t=new C(e,null),he(this.items,t.key)||this.items.push(t)}get(e,t){let n=he(this.items,e);return!t&&T(n)?E(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=he(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new C(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Te(o,null,n));return r}};Le.tag="tag:yaml.org,2002:set";var Qe={collection:"map",identify:s=>s instanceof Set,nodeClass:Le,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>Le.from(s,e,t),resolve(s,e){if(U(s)){if(s.hasAllNullValues(!0))return Object.assign(new Le,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};function Zt(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function qs(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return B(s);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var It={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>Zt(s,t),stringify:qs},Lt={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>Zt(s,!1),stringify:qs},ve={identify:s=>s instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(s){let e=s.match(ve.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l),p=e[8];if(p&&p!=="Z"){let f=Zt(p,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};var es=[W,H,pe,ye,Ht,Xt,Bs,Ks,js,Fs,Ps,Ms,Ds,Ve,Q,Ye,Je,Qe,It,Lt,ve];var xs=new Map([["core",vs],["failsafe",[W,H,pe]],["json",_s],["yaml11",es],["yaml-1.1",es]]),Rs={binary:Ve,bool:Ue,float:St,floatExp:wt,floatNaN:bt,floatTime:Lt,int:Ot,intHex:At,intOct:Nt,intTime:It,map:W,merge:Q,null:ye,omap:Ye,pairs:Je,seq:H,set:Qe,timestamp:ve},Us={"tag:yaml.org,2002:binary":Ve,"tag:yaml.org,2002:merge":Q,"tag:yaml.org,2002:omap":Ye,"tag:yaml.org,2002:pairs":Je,"tag:yaml.org,2002:set":Qe,"tag:yaml.org,2002:timestamp":ve};function vt(s,e,t){let n=xs.get(e);if(n&&!s)return t&&!n.includes(Q)?n.concat(Q):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{let r=Array.from(xs.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(let r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(Q)),i.reduce((r,o)=>{let a=typeof o=="string"?Rs[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Rs).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}var Mn=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,Ce=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?vt(e,"compat"):e?vt(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Us:{},this.tags=vt(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,Y,{value:W}),Object.defineProperty(this,F,{value:pe}),Object.defineProperty(this,re,{value:H}),this.sortMapEntries=typeof o=="function"?o:o===!0?Mn:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function Vs(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=ut(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=r(s.commentBefore);t.unshift(J(l,""))}let o=!1,a=null;if(s.contents){if(I(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let p=r(s.contents.commentBefore);t.push(J(p,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=le(s.contents,i,()=>a=null,l);a&&(c+=te(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(le(s.contents,i));if(s.directives?.docEnd)if(s.comment){let l=r(s.comment);l.includes(`
90
90
  `)?(t.push("..."),t.push(J(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=s.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(J(r(l),"")))}return t.join(`
91
91
  `)+`
92
- `}var se=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,K,{value:st});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n?.o?(this.directives=n.o.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Z({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.prototype,{[K]:{value:st}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=I(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){_e(this.contents)&&this.contents.add(e)}addIn(e,t){_e(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=qt(this);e.anchor=!t||n.has(t)?xt(t||"a",n):t}return new ee(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let m=S=>typeof S=="number"||S instanceof String||S instanceof Number,w=t.filter(m).map(String);w.length>0&&(t=t.concat(w)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:p}=n??{},{onAnchor:f,setAnchors:u,sourceObjects:d}=Os(this,o||"a"),g={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:d},h=oe(e,p,g);return a&&L(h)&&(h.flow=!0),u(),h}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new C(i,r)}delete(e){return _e(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ae(e)?this.contents==null?!1:(this.contents=null,!0):_e(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return L(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ae(e)?!t&&E(this.contents)?this.contents.value:this.contents:L(this.contents)?this.contents.getIn(e,t):void 0}has(e){return L(this.contents)?this.contents.has(e):!1}hasIn(e){return Ae(e)?this.contents!==void 0:L(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Fe(this.schema,[e],t):_e(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ae(e)?this.contents=t:this.contents==null?this.contents=Fe(this.schema,Array.from(e),t):_e(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Z({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Z({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Ce(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=M(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:p}of a.anchors.values())r(p,c);return typeof o=="function"?fe(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Vs(this,e)}};function _e(s){if(L(s))return!0;throw new Error("Expected a YAML collection as document contents")}var $e=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},x=class extends $e{constructor(e,t,n){super("YAMLParseError",e,t,n)}},Pe=class extends $e{constructor(e,t,n){super("YAMLWarning",e,t,n)}},We=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
92
+ `}var se=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,K,{value:st});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n?.s?(this.directives=n.s.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Z({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.prototype,{[K]:{value:st}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=I(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){_e(this.contents)&&this.contents.add(e)}addIn(e,t){_e(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=qt(this);e.anchor=!t||n.has(t)?xt(t||"a",n):t}return new ee(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let m=S=>typeof S=="number"||S instanceof String||S instanceof Number,w=t.filter(m).map(String);w.length>0&&(t=t.concat(w)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:p}=n??{},{onAnchor:f,setAnchors:u,sourceObjects:d}=Os(this,o||"a"),g={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:d},h=oe(e,p,g);return a&&L(h)&&(h.flow=!0),u(),h}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new C(i,r)}delete(e){return _e(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ae(e)?this.contents==null?!1:(this.contents=null,!0):_e(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return L(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ae(e)?!t&&E(this.contents)?this.contents.value:this.contents:L(this.contents)?this.contents.getIn(e,t):void 0}has(e){return L(this.contents)?this.contents.has(e):!1}hasIn(e){return Ae(e)?this.contents!==void 0:L(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Fe(this.schema,[e],t):_e(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ae(e)?this.contents=t:this.contents==null?this.contents=Fe(this.schema,Array.from(e),t):_e(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Z({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Z({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Ce(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=M(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:p}of a.anchors.values())r(p,c);return typeof o=="function"?fe(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Vs(this,e)}};function _e(s){if(L(s))return!0;throw new Error("Expected a YAML collection as document contents")}var $e=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},x=class extends $e{constructor(e,t,n){super("YAMLParseError",e,t,n)}},Pe=class extends $e{constructor(e,t,n){super("YAMLWarning",e,t,n)}},We=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
93
93
  `),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(a);t.message+=`:
94
94
 
95
95
  ${o}
@@ -131,14 +131,14 @@ ${c}
131
131
  `);)n===`
132
132
  `&&(t+=`
133
133
  `),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var xn={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
134
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Rn(s,e,t,n){let i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function is(s,e,t,n){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?_t(s,e,n):$t(e,s.options.strict,n),l=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[F]:l?c=Un(s.schema,i,l,t,n):e.type==="scalar"?c=Vn(s,i,e,n):c=s.schema[F];let p;try{let f=c.resolve(i,u=>n(t??e,"TAG_RESOLVE_FAILED",u),s.options);p=E(f)?f:new y(f)}catch(f){let u=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",u),p=new y(i)}return p.range=a,p.source=i,r&&(p.type=r),l&&(p.tag=l),c.format&&(p.format=c.format),o&&(p.comment=o),p}function Un(s,e,t,n,i){if(t==="!")return s[F];let r=[];for(let a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[F])}function Vn({atKey:s,directives:e,schema:t},n,i,r){let o=t.tags.find(a=>(a.default===!0||s&&a.default==="key")&&a.test?.test(n))||t[F];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(n))??t[F];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),p=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function Xs(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}var Jn={composeNode:rs,composeEmptyNode:Pt};function rs(s,e,t,n){let i=s.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,p=!0;switch(e.type){case"alias":c=Yn(s,e,n),(a||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=is(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Ws(Jn,s,e,t,n),a&&(c.anchor=a.source.substring(1))}catch(f){let u=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",u)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),p=!1}}return c??(c=Pt(s,e.offset,void 0,null,t,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!E(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),s.options.keepSourceTokens&&p&&(c.srcToken=e),c}function Pt(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let p={type:"scalar",offset:Xs(e,t,n),indent:-1,source:""},f=is(s,p,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function Yn({options:s},{offset:e,source:t,end:n},i){let r=new ee(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=ie(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function zs(s,e,{offset:t,start:n,value:i,end:r},o){let a=Object.assign({o:e},s),l=new se(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},p=ne(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?rs(c,i,p,o):Pt(c,p.end,n,null,p,o);let f=l.contents.range[2],u=ie(r,f,!1,o);return u.comment&&(l.comment=u.comment),l.range=[t,f,u.offset],l}function Xe(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function Zs(s){let e="",t=!1,n=!1;for(let i=0;i<s.length;++i){let r=s[i];switch(r[0]){case"#":e+=(e===""?"":n?`
134
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Rn(s,e,t,n){let i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function is(s,e,t,n){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?_t(s,e,n):$t(e,s.options.strict,n),l=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[F]:l?c=Un(s.schema,i,l,t,n):e.type==="scalar"?c=Vn(s,i,e,n):c=s.schema[F];let p;try{let f=c.resolve(i,u=>n(t??e,"TAG_RESOLVE_FAILED",u),s.options);p=E(f)?f:new y(f)}catch(f){let u=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",u),p=new y(i)}return p.range=a,p.source=i,r&&(p.type=r),l&&(p.tag=l),c.format&&(p.format=c.format),o&&(p.comment=o),p}function Un(s,e,t,n,i){if(t==="!")return s[F];let r=[];for(let a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[F])}function Vn({atKey:s,directives:e,schema:t},n,i,r){let o=t.tags.find(a=>(a.default===!0||s&&a.default==="key")&&a.test?.test(n))||t[F];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(n))??t[F];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),p=`Value may be parsed as either ${l} or ${c}`;r(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function Xs(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}var Jn={composeNode:rs,composeEmptyNode:Pt};function rs(s,e,t,n){let i=s.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=t,c,p=!0;switch(e.type){case"alias":c=Yn(s,e,n),(a||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=is(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Ws(Jn,s,e,t,n),a&&(c.anchor=a.source.substring(1))}catch(f){let u=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",u)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),p=!1}}return c??(c=Pt(s,e.offset,void 0,null,t,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!E(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),s.options.keepSourceTokens&&p&&(c.srcToken=e),c}function Pt(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let p={type:"scalar",offset:Xs(e,t,n),indent:-1,source:""},f=is(s,p,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=l),f}function Yn({options:s},{offset:e,source:t,end:n},i){let r=new ee(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=ie(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function zs(s,e,{offset:t,start:n,value:i,end:r},o){let a=Object.assign({s:e},s),l=new se(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},p=ne(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?rs(c,i,p,o):Pt(c,p.end,n,null,p,o);let f=l.contents.range[2],u=ie(r,f,!1,o);return u.comment&&(l.comment=u.comment),l.range=[t,f,u.offset],l}function Xe(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function Zs(s){let e="",t=!1,n=!1;for(let i=0;i<s.length;++i){let r=s[i];switch(r[0]){case"#":e+=(e===""?"":n?`
135
135
 
136
136
  `:`
137
137
  `)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var be=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{let o=Xe(t);r?this.warnings.push(new Pe(o,n,i)):this.errors.push(new x(o,n,i))},this.directives=new Z({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=Zs(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
138
138
  ${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(L(r)&&!r.flow&&r.items.length>0){let o=r.items[0];T(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
139
139
  ${a}`:n}else{let o=r.commentBefore;r.commentBefore=o?`${n}
140
140
  ${o}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Zs(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=Xe(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=zs(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new x(Xe(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new x(Xe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=ie(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
141
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new x(Xe(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({o:this.directives},this.options),i=new se(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};var cs={};bs(cs,{BOM:()=>ze,DOCUMENT:()=>Ze,FLOW_END:()=>et,SCALAR:()=>Me,createScalarToken:()=>tn,isCollection:()=>Wn,isScalar:()=>Hn,prettyToken:()=>Xn,resolveAsScalar:()=>en,setScalarValue:()=>sn,stringify:()=>rn,tokenType:()=>ls,visit:()=>de});function en(s,e=!0,t){if(s){let n=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new x([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return $t(s,e,n);case"block-scalar":return _t({options:{strict:e}},s,n)}}return null}function tn(s,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=ae({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:`
141
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new x(Xe(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({s:this.directives},this.options),i=new se(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};var cs={};bs(cs,{BOM:()=>ze,DOCUMENT:()=>Ze,FLOW_END:()=>et,SCALAR:()=>Me,createScalarToken:()=>tn,isCollection:()=>Wn,isScalar:()=>Hn,prettyToken:()=>Xn,resolveAsScalar:()=>en,setScalarValue:()=>sn,stringify:()=>rn,tokenType:()=>ls,visit:()=>de});function en(s,e=!0,t){if(s){let n=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new x([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return $t(s,e,n);case"block-scalar":return _t({options:{strict:e}},s,n)}}return null}function tn(s,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=ae({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:`
142
142
  `}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
143
143
  `),p=a.substring(0,c),f=a.substring(c+1)+`
144
144
  `,u=[{type:"block-scalar-header",offset:r,indent:n,source:p}];return nn(u,l)||u.push({type:"newline",offset:-1,indent:n,source:`
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.0.1 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(r){return new Promise(n=>{let e=c();e.question(r,t=>{e.close(),n(t.trim())})})}async function a(r,n=!0){let t=await s(` ${r} ${n?"[Y/n]":"[y/N]"} `);return t===""?n:t.toLowerCase().startsWith("y")}async function l(r,n){console.log(`
3
3
  ${r}
4
4
  `);for(let o=0;o<n.length;o++)console.log(` ${o+1}. ${n[o]}`);console.log();let e=await s(` choose [1-${n.length}]: `),t=parseInt(e,10);return t>=1&&t<=n.length?t-1:0}export{a,l as b};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ var t="http://localhost:5173/";export{t as a};
@@ -0,0 +1,3 @@
1
+ /*! sootsim v0.0.3 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as s}from"./chunk-3SLEIN6B.js";import{chmodSync as a,existsSync as l,mkdirSync as p,readFileSync as d,rmSync as h,writeFileSync as m}from"node:fs";import{homedir as f,platform as u}from"node:os";import{dirname as g,join as r,resolve as _}from"node:path";function o(){let t=f();if(!t)throw new Error("could not determine home directory");let e=u()==="darwin"?r(t,"Library","Application Support","sootsim"):u()==="win32"?r(process.env.APPDATA||r(t,"AppData","Roaming"),"sootsim"):r(process.env.XDG_CONFIG_HOME||r(t,".config"),"sootsim");return r(e,"credentials.json")}function k(){let t=o();if(!l(t))return null;try{let e=JSON.parse(d(t,"utf8"));return e.version!==1||typeof e.apiKey!="string"||!e.apiKey.startsWith("sk_sootsim_")?null:e.apiKey}catch{return null}}function K(t){if(!t.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let e=o();p(g(_(e)),{recursive:!0}),m(e,JSON.stringify({version:1,apiKey:t,savedAt:new Date().toISOString()},null,2)+`
3
+ `);try{a(e,384)}catch{}}function b(){h(o(),{force:!0})}var y=["ghs_","ghp_","gho_","ghu_","github_pat_"];function A(t){return!!(t&&t.length>=20&&t.length<=256&&y.some(e=>t.startsWith(e)))}function S(){let t=process.env.SOOT_INSTALLATION_TOKEN?.trim(),e=process.env.GITHUB_TOKEN?.trim(),i=t||e;if(!A(i))return null;let n=(process.env.SOOT_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!n)return null;let c=(process.env.SOOT_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:i,repoId:n,installationId:c||null,source:t?"soot-runner":"github-actions"}}function E(){let t=process.env.SOOTSIM_API_KEY?.trim();if(t&&t.startsWith("sk_sootsim_"))return{kind:"api-key",secret:t,source:"env"};let e=S();if(e)return e;let i=k();if(i)return{kind:"api-key",secret:i,source:"file"};let n=s();return n?.token?{kind:"session",token:n.token,origin:n.origin}:null}function w(t){return t.kind==="api-key"?`Bearer ${t.secret}`:`Bearer ${t.token}`}export{k as a,K as b,b as c,E as d,w as e};