sootsim 0.1.39 → 0.1.41
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/README.md +15 -15
- package/dist-cli/bin.js +16 -15
- package/dist-cli/chunks/{agent-HZP3LUGJ.js → agent-7BJ2ZP22.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-CS6TV5UR.js → agent-wrapper-OXBYRJVT.js} +2 -2
- package/dist-cli/chunks/{assert-WVTX4CNR.js → assert-NZTYFTTT.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-4KQT4TCR.js +2 -0
- package/dist-cli/chunks/beta-3S56PNSS.js +2 -0
- package/dist-cli/chunks/{chunk-NYZGZDHI.js → chunk-2T6UOHPO.js} +1 -1
- package/dist-cli/chunks/chunk-334L67M2.js +2 -0
- package/dist-cli/chunks/{chunk-7J4UIBA5.js → chunk-33R6QMNO.js} +2 -2
- package/dist-cli/chunks/{chunk-XYTDYBXJ.js → chunk-4UA6P3T2.js} +1 -1
- package/dist-cli/chunks/{chunk-GUHXSXNO.js → chunk-5JOYGXCS.js} +2 -2
- package/dist-cli/chunks/chunk-6PLNIOJP.js +17 -0
- package/dist-cli/chunks/{chunk-YGUQSPU6.js → chunk-7YZJHZ7X.js} +1 -1
- package/dist-cli/chunks/{chunk-4YUHJ5FX.js → chunk-ANDSHXLU.js} +2 -2
- package/dist-cli/chunks/chunk-AOYBIMKL.js +4 -0
- package/dist-cli/chunks/chunk-ASSV2FFC.js +1 -0
- package/dist-cli/chunks/chunk-BR6QRN7U.js +11 -0
- package/dist-cli/chunks/{chunk-C6GUAXKO.js → chunk-C4AMFYK3.js} +2 -2
- package/dist-cli/chunks/{chunk-B2SCT4DL.js → chunk-ECIRRKKE.js} +2 -2
- package/dist-cli/chunks/{chunk-FEMOLCB5.js → chunk-FZB4W23Y.js} +2 -2
- package/dist-cli/chunks/chunk-G2QUPNHI.js +2 -0
- package/dist-cli/chunks/chunk-GB3G5LVB.js +108 -0
- package/dist-cli/chunks/{chunk-NJ4WXWKO.js → chunk-GI7FXE7J.js} +2 -2
- package/dist-cli/chunks/{chunk-JXKW62SL.js → chunk-GOFKXREQ.js} +2 -2
- package/dist-cli/chunks/chunk-HAVQS3PI.js +2 -0
- package/dist-cli/chunks/{chunk-223TXYOC.js → chunk-HZVPHAJX.js} +20 -20
- package/dist-cli/chunks/{runtime-YJPWA3XA.js → chunk-I5Y4IECP.js} +3 -3
- package/dist-cli/chunks/{chunk-YHYSOUIJ.js → chunk-IF33CQL4.js} +2 -2
- package/dist-cli/chunks/chunk-IP2MARRU.js +27 -0
- package/dist-cli/chunks/{chunk-ECDPQ6S7.js → chunk-J3JJRXIP.js} +1 -1
- package/dist-cli/chunks/{chunk-2ESCYOZW.js → chunk-LMNB7NYI.js} +2 -2
- package/dist-cli/chunks/{chunk-YUKH7HF6.js → chunk-LX6KS6TL.js} +1 -1
- package/dist-cli/chunks/{chunk-RJQ73DLG.js → chunk-MBGNDWGV.js} +4 -4
- package/dist-cli/chunks/{chunk-WD54RD4K.js → chunk-N7DDNZTO.js} +1 -1
- package/dist-cli/chunks/chunk-NZ5O2OEL.js +56 -0
- package/dist-cli/chunks/{chunk-ZBB7YS6C.js → chunk-OJFHAMXD.js} +2 -2
- package/dist-cli/chunks/{chunk-VLUFTHBB.js → chunk-OPDPXAYA.js} +2 -2
- package/dist-cli/chunks/chunk-OXTFYLZJ.js +4 -0
- package/dist-cli/chunks/{chunk-MGVTLDI3.js → chunk-Q6DGMQ2V.js} +2 -2
- package/dist-cli/chunks/{chunk-UWRBEBML.js → chunk-S3SQITOO.js} +2 -2
- package/dist-cli/chunks/{chunk-P6F636LU.js → chunk-SHHUVGL2.js} +1 -1
- package/dist-cli/chunks/{chunk-RLGCJT2D.js → chunk-SWHWVYZS.js} +1 -1
- package/dist-cli/chunks/{chunk-CBPTHIJV.js → chunk-TBIGAH3T.js} +1 -1
- package/dist-cli/chunks/chunk-UNJTJDZZ.js +62 -0
- package/dist-cli/chunks/chunk-WN6YFWS5.js +117 -0
- package/dist-cli/chunks/{chunk-E5RYQUFB.js → chunk-WZDE344I.js} +3 -3
- package/dist-cli/chunks/{chunk-NF65BNJR.js → chunk-Y2YNXUBT.js} +2 -2
- package/dist-cli/chunks/chunk-YFX2XIR4.js +1 -0
- package/dist-cli/chunks/chunk-YKFRPIVC.js +1 -0
- package/dist-cli/chunks/chunk-ZPURE62G.js +1 -0
- package/dist-cli/chunks/{compat-UMJ2IXUW.js → compat-BA6HDW3Q.js} +5 -5
- package/dist-cli/chunks/{config-YMJK426V.js → config-QQ63IS5P.js} +2 -2
- package/dist-cli/chunks/control-GNJNC524.js +2 -0
- package/dist-cli/chunks/cpu-profile-3DDV2SYN.js +2 -0
- package/dist-cli/chunks/{daemon-LIVCJZR3.js → daemon-RYSVONEV.js} +2 -2
- package/dist-cli/chunks/{debug-EV73WC7H.js → debug-YXE4XZLP.js} +20 -20
- package/dist-cli/chunks/demo-app-registry-3VFEW4NV.js +2 -0
- package/dist-cli/chunks/{detox-NBT5BVX3.js → detox-2UI3EAXA.js} +2 -2
- package/dist-cli/chunks/{device-MMROWQZ3.js → device-UGDJBZKD.js} +2 -2
- package/dist-cli/chunks/diagnose-IRDRYKYZ.js +41 -0
- package/dist-cli/chunks/drivers-EAONIWG3.js +2 -0
- package/dist-cli/chunks/{electron-F5DT7CFY.js → electron-ZCYWIZAE.js} +3 -3
- package/dist-cli/chunks/flow-ECSMFTKS.js +2 -0
- package/dist-cli/chunks/{hints-RODH4XE4.js → hints-OWOBCWJH.js} +2 -2
- package/dist-cli/chunks/{home-paths-PCUMN33Z.js → home-paths-5QMCFTBP.js} +2 -2
- package/dist-cli/chunks/inspect-K4VXPM5J.js +995 -0
- package/dist-cli/chunks/install-YFE7C2NU.js +2 -0
- package/dist-cli/chunks/{install-desktop-ASRNFHZU.js → install-desktop-U3723T63.js} +3 -3
- package/dist-cli/chunks/{keys-DOOCGNTD.js → keys-IFVXJ7C2.js} +2 -2
- package/dist-cli/chunks/{launch-DTVAQMZG.js → launch-NDGFTRZ5.js} +3 -3
- package/dist-cli/chunks/{login-JA6VEDEP.js → login-KEU6RAV3.js} +4 -4
- package/dist-cli/chunks/{logout-H4WFWTPC.js → logout-KNFLP5OQ.js} +2 -2
- package/dist-cli/chunks/{maestro-4TR7U6TS.js → maestro-GBUBLS6L.js} +2 -2
- package/dist-cli/chunks/{preview-GP7XXDW6.js → preview-7OKMPPMN.js} +2 -2
- package/dist-cli/chunks/{profile-3FESGAZD.js → profile-CHKDPGJF.js} +2 -2
- package/dist-cli/chunks/{react-SJD2DQQV.js → react-GYI5VITJ.js} +2 -2
- package/dist-cli/chunks/record-DQR2TEIF.js +45 -0
- package/dist-cli/chunks/runtime-XXNKSGFE.js +2 -0
- package/dist-cli/chunks/runtime-delivery-JCAY2QVQ.js +2 -0
- package/dist-cli/chunks/{screenshot-45SAK7EW.js → screenshot-3T6MNPH7.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-TCY7FBGR.js → screenshot-mode-BUGXY7SQ.js} +2 -2
- package/dist-cli/chunks/{screenshots-KZ364S2O.js → screenshots-EMTXGI2Q.js} +2 -2
- package/dist-cli/chunks/server-46H2M4TF.js +35 -0
- package/dist-cli/chunks/setup-repo-P4LCPAF6.js +2 -0
- package/dist-cli/chunks/{skills-SMXCCJCM.js → skills-2RP2CFPD.js} +2 -2
- package/dist-cli/chunks/start-QFREXALP.js +23 -0
- package/dist-cli/chunks/store-GH77HGEB.js +2 -0
- package/dist-cli/chunks/telemetry-WC5J4TE5.js +2 -0
- package/dist-cli/chunks/{test-ZXTSA5GV.js → test-LI4PGGTE.js} +3 -3
- package/dist-cli/chunks/{three-mode-4Q65J2ZA.js → three-mode-PKINB46T.js} +2 -2
- package/dist-cli/chunks/{timeline-ISEDS6XR.js → timeline-5AREJDL5.js} +2 -2
- package/dist-cli/chunks/upgrade-W2AGIOSC.js +4 -0
- package/dist-cli/chunks/upload-RLS6KTG6.js +2 -0
- package/dist-cli/chunks/web-JM6WDSZQ.js +2 -0
- package/dist-cli/chunks/what-happened-SVCASJKT.js +15 -0
- package/dist-cli/chunks/whoami-5NJ6IPLT.js +2 -0
- 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/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.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 +127 -88
- package/dist-lib/host/fetch-proxy-handler.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/vite-base.cjs +152 -94
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-3TUCG2BC.js +0 -2
- package/dist-cli/chunks/beta-3SCMB3IN.js +0 -2
- package/dist-cli/chunks/chunk-4LHQRDSN.js +0 -2
- package/dist-cli/chunks/chunk-4UI5OHEO.js +0 -1
- package/dist-cli/chunks/chunk-5L5SZXXG.js +0 -2
- package/dist-cli/chunks/chunk-5RSSCKBF.js +0 -1
- package/dist-cli/chunks/chunk-6TSUQHSC.js +0 -4
- package/dist-cli/chunks/chunk-B3OEHV2C.js +0 -1
- package/dist-cli/chunks/chunk-DSDLGFWH.js +0 -61
- package/dist-cli/chunks/chunk-HWRR23AJ.js +0 -17
- package/dist-cli/chunks/chunk-MIE6NMPJ.js +0 -117
- package/dist-cli/chunks/chunk-NFJDHJHK.js +0 -1
- package/dist-cli/chunks/chunk-OB3TB4AN.js +0 -4
- package/dist-cli/chunks/chunk-SLQ2GTYF.js +0 -27
- package/dist-cli/chunks/chunk-W4QHQT64.js +0 -2
- package/dist-cli/chunks/chunk-WHQWINDB.js +0 -11
- package/dist-cli/chunks/control-DJR3DUAB.js +0 -2
- package/dist-cli/chunks/cpu-profile-67MCPAA2.js +0 -22
- package/dist-cli/chunks/demo-app-registry-NZBZVJ52.js +0 -2
- package/dist-cli/chunks/diagnose-WXOKGBAJ.js +0 -41
- package/dist-cli/chunks/drivers-NSPV5S6T.js +0 -2
- package/dist-cli/chunks/flow-T6DZQWHE.js +0 -2
- package/dist-cli/chunks/inspect-BIMFJFDR.js +0 -1101
- package/dist-cli/chunks/install-5YPVP466.js +0 -2
- package/dist-cli/chunks/record-PQUAMW5K.js +0 -37
- package/dist-cli/chunks/server-S5CRYXXZ.js +0 -35
- package/dist-cli/chunks/setup-repo-TH3GXOP7.js +0 -2
- package/dist-cli/chunks/start-KLSAQM3C.js +0 -23
- package/dist-cli/chunks/store-E2N5NOUS.js +0 -2
- package/dist-cli/chunks/telemetry-RJXVYJSN.js +0 -2
- package/dist-cli/chunks/upload-KB7INQRC.js +0 -2
- package/dist-cli/chunks/what-happened-STY3AOCQ.js +0 -15
- package/dist-cli/chunks/whoami-VKRQOG2U.js +0 -2
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.39 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{c as I,e as N,i as S}from"./chunk-HWRR23AJ.js";import"./chunk-RLGCJT2D.js";import"./chunk-B3OEHV2C.js";import"./chunk-ECDPQ6S7.js";import"./chunk-WD54RD4K.js";import{createWriteStream as v,mkdirSync as k,writeFileSync as w}from"fs";import{dirname as C,resolve as T}from"path";import{Readable as x}from"stream";import{pipeline as y}from"stream/promises";import{createGzip as F}from"zlib";async function E(r,l){if(r.includes("--help")||r.includes("-h"))return console.log(`
|
|
3
|
-
sootsim cpu-profile \u2014 capture a sampled CPU trace from the tenant worker
|
|
4
|
-
|
|
5
|
-
usage:
|
|
6
|
-
sootsim cpu-profile [options]
|
|
7
|
-
|
|
8
|
-
options:
|
|
9
|
-
--duration <seconds> recording duration (default: 5)
|
|
10
|
-
--output <path> output file (default: /tmp/sootsim.cpuprofile)
|
|
11
|
-
if the path ends in .gz, the output is gzipped
|
|
12
|
-
--sample-interval <ms> requested sample interval in ms (default: 10 \u2014
|
|
13
|
-
chrome may clamp upward)
|
|
14
|
-
--max-buffer <n> max samples buffered (default: 100000)
|
|
15
|
-
--sim <sim> target a specific sim
|
|
16
|
-
--port <number> ws bridge port (default: 7668)
|
|
17
|
-
|
|
18
|
-
examples:
|
|
19
|
-
sootsim cpu-profile --duration 3
|
|
20
|
-
sootsim cpu-profile --duration 10 --output /tmp/after.cpuprofile.gz
|
|
21
|
-
sootsim cpu-profile --duration 3 -o /tmp/before.cpuprofile
|
|
22
|
-
`),0;let n=Number(b(r,"--duration")??"5");if(!Number.isFinite(n)||n<=0)return console.error(" --duration must be a positive number (seconds)"),1;let m=Number(b(r,"--sample-interval")??"10");if(!Number.isFinite(m)||m<=0)return console.error(" --sample-interval must be a positive number (milliseconds)"),1;let s=Number(b(r,"--max-buffer")??"100000");if(!Number.isFinite(s)||s<=0)return console.error(" --max-buffer must be a positive number"),1;let p=b(r,"--output")??b(r,"-o"),u=T(process.cwd(),p??"/tmp/sootsim.cpuprofile"),g=u.endsWith(".gz"),h=I(r,{port:l.port,stripValueFlags:["--duration","--output","-o","--sample-interval","--max-buffer"]}),c=N({...h,commandTimeoutMs:Math.max(3e4,(n+20)*1e3)});try{let a=await S(c,"SootSim.bridges.workerCpuProfileStart",{sampleInterval:m,maxBufferSize:s});if(!a?.started)return console.error(" could not start tenant-worker profiler."),console.error(" is sootsim running? (try `bun sootsim list`)"),1;l.verbose&&console.error(` started: sampleInterval=${a.sampleInterval}ms buffer=${a.maxBufferSize}`),console.log(` recording for ${n}s\u2026`),await new Promise(o=>setTimeout(o,n*1e3));let t=await S(c,"SootSim.bridges.workerCpuProfileStop");if(!t||t.error||!t.trace)return console.error(` profile capture failed: ${t?.error??"no trace returned"}`),t?.error?.includes("not available")&&(console.error(" your browser or page is missing the JS Self-Profiler API."),console.error(" requires chromium-based browser and Document-Policy: js-profiling.")),1;let P=z(t.trace),e=JSON.stringify(P);k(C(u),{recursive:!0}),g?await y(x.from([e]),F(),v(u)):w(u,e);let i=(Buffer.byteLength(e)/1024/1024).toFixed(2);return console.log(` samples: ${P.samples.length} (${i} MB uncompressed)`),console.log(` saved: ${u}`),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}catch(a){let t=a?.message??String(a);return console.error(` profile failed: ${t}`),/could not connect|ECONNREFUSED/i.test(t)&&console.error(" is sootsim running? (try `bun sootsim list`)"),1}finally{c.close()}}function z(r){let l=r.frames??[],n=r.resources??[],m=r.stacks??[],s=r.samples??[],p=1,u=[{id:p,callFrame:{functionName:"(root)",scriptId:"0",url:"",lineNumber:-1,columnNumber:-1},hitCount:0,children:[]}];for(let e=0;e<m.length;e++){let i=m[e],o=l[i.frameId]??{name:"(unknown)"},f=o.resource!==void 0?n[o.resource]??"":"";u.push({id:e+2,callFrame:{functionName:o.name||"(anonymous)",scriptId:o.resource!==void 0?String(o.resource):"0",url:f,lineNumber:typeof o.line=="number"?o.line-1:-1,columnNumber:typeof o.column=="number"?o.column-1:-1},hitCount:0,children:[]})}for(let e=0;e<m.length;e++){let i=m[e],o=e+2,f=i.parentId!==void 0?i.parentId+2:p,d=u[f-1];d&&!d.children.includes(o)&&d.children.push(o)}let g=[],h=[],c=s.length>0?s[0].timestamp:0,a=c;for(let e=0;e<s.length;e++){let i=s[e],o=i.stackId!==void 0?i.stackId+2:p;g.push(o);let f=u[o-1];f&&f.hitCount++;let d=e===0?0:i.timestamp-a;h.push(Math.max(0,Math.round(d*1e3))),a=i.timestamp}let t=Math.round(c*1e3),P=s.length>0?Math.round(s[s.length-1].timestamp*1e3):t;return{nodes:u,startTime:t,endTime:P,samples:g,timeDeltas:h}}function b(r,l){let n=r.indexOf(l);if(!(n<0||n===r.length-1))return r[n+1]}export{E as runCpuProfile};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.39 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{c as v,e as R,h as b}from"./chunk-HWRR23AJ.js";import{b as $}from"./chunk-RLGCJT2D.js";import"./chunk-B3OEHV2C.js";import"./chunk-ECDPQ6S7.js";import"./chunk-WD54RD4K.js";function j(e){return e.ts??e.t??0}function F(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var W=new Set(["timeline","network","react","console","screen"]);function A(){console.log(`
|
|
3
|
-
sootsim diagnose \u2014 compact "what just went wrong?" report
|
|
4
|
-
|
|
5
|
-
usage:
|
|
6
|
-
sootsim diagnose recent [--since <duration>] [--include <csv>] [--json]
|
|
7
|
-
|
|
8
|
-
options:
|
|
9
|
-
--since <d> absolute window for timeline + network (e.g. 90s, 2m, 500ms; default 90s)
|
|
10
|
-
--include <csv> comma-separated dimensions: timeline, network, react, console, screen
|
|
11
|
-
(default: all)
|
|
12
|
-
--slow-threshold <n> network slow-request threshold in ms (default 1000)
|
|
13
|
-
--limit <n> rows to print per react table (default 8)
|
|
14
|
-
--json emit a single structured JSON document
|
|
15
|
-
|
|
16
|
-
the diagnose report runs every dimension in parallel against the same
|
|
17
|
-
sim and returns a grouped summary. use \`sootsim what-happened\`
|
|
18
|
-
for chronological events, \`sootsim network\` for full request inspection,
|
|
19
|
-
\`sootsim react summary\` for the React tables on their own.
|
|
20
|
-
|
|
21
|
-
examples:
|
|
22
|
-
sootsim diagnose recent
|
|
23
|
-
sootsim diagnose recent --since 30s --include network,react
|
|
24
|
-
sootsim diagnose recent --json > /tmp/diagnose.json
|
|
25
|
-
`)}function D(e,s){if(!e)return s;let o=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(e.trim());if(!o)return s;let r=Number(o[1]),t=o[2]??"ms";return t==="s"?r*1e3:t==="m"?r*6e4:r}function O(e){if(!e)return W;let s=new Set;for(let o of e.split(",")){let r=o.trim().toLowerCase();r&&s.add(r)}return s}function k(e,s){let o=e.indexOf(s);if(o>=0&&o+1<e.length)return e[o+1];let r=`${s}=`;return e.find(t=>t.startsWith(r))?.slice(r.length)}function E(e,s,o){let r=k(e,s);if(r===void 0)return o;let t=Number(r);return Number.isFinite(t)&&t>0?Math.round(t):o}async function P(e,s){let o={limit:500,since:Date.now()-s},t=(await b(e,"SootSim.bridges.timeline.recent",o)).events??[],i={},c=[],m=[],p=[];for(let u of t){i[u.kind]=(i[u.kind]??0)+1;let l=u.data,g=l&&typeof l=="object"?l.level:void 0;u.kind==="console"&&(g==="error"||g==="warn")&&c.push(u),(u.kind==="alert"||u.kind==="actionsheet"||u.kind==="picker")&&m.push(u),(u.kind==="screen"||u.kind==="route")&&p.push(u)}return{events:t,byKind:i,total:t.length,errors:c,alerts:m,screens:p}}async function B(e,s,o){let r=await e.send({type:"evaluate",code:`(() => {
|
|
26
|
-
const obs = window.__sootsimObservability;
|
|
27
|
-
if (!obs) return { ok: false };
|
|
28
|
-
return { ok: true, entries: obs.network.getSnapshot() };
|
|
29
|
-
})()`});if(!r||!r.ok)return{error:"observability bridge not installed"};let t=r.entries??[],i=Date.now()-s,c=t.filter(l=>(l.startTs??l.startedAt??0)>=i),m=c.filter(l=>!!l.error||l.status!=null&&l.status>=400),p=c.filter(l=>l.durationMs!=null&&l.durationMs>=o).sort((l,g)=>(g.durationMs??0)-(l.durationMs??0)),u=c.filter(l=>l.durationMs==null).length;return{total:c.length,failed:m,slow:p,inFlight:u,slowThresholdMs:o}}async function L(e,s){let[o,r]=await Promise.all([b(e,"SootSim.bridges.reactProfile.slow",{limit:s}),b(e,"SootSim.bridges.reactProfile.rerenders",{limit:s})]);return{commits:o.commits??r.commits??0,slow:o.rows??[],rerenders:r.rows??[],durationWarning:o.durationWarning,error:o.error??r.error}}async function C(e,s){let o=await e.send({type:"evaluate",code:`(() => {
|
|
30
|
-
const obs = window.__sootsimObservability;
|
|
31
|
-
if (!obs) return { ok: false };
|
|
32
|
-
return { ok: true, entries: obs.logs.getSnapshot() };
|
|
33
|
-
})()`});if(!o||!o.ok)return{error:"observability bridge not installed"};let r=Date.now()-s,i=(o.entries??[]).filter(c=>j(c)>=r&&(c.level==="error"||c.level==="warn"));return{entries:i.slice(-20),total:i.length}}function T(e){let s=e.error?"err":e.status!=null?String(e.status):"...",o=(e.method??"GET").padEnd(6),r=e.durationMs!=null?`${e.durationMs.toFixed(0)}ms`:"...",t=e.displayUrl??e.url,i=t.length>96?`${t.slice(0,92)}\u2026`:t;return` ${s.padStart(3)} ${o} ${r.padStart(7)} ${i} (${e.id})`}function N(e,s){let o=((e.t-s)/1e3).toFixed(2),r=e.t>=s?"-":"+",t=e.data,i="";if(t&&typeof t=="object"){let c=(t.message??"").toString().slice(0,120),m=(t.title??t.name??t.path??t.url??"").toString();i=[(t.phase??"").toString(),m,c].filter(Boolean).join(" \xB7 ")}return` -${o.padStart(5)}s [${e.kind}] ${i}`}function M(e,s,o){if(s.length===0)return`${o}(no rows)`;let r=e.map((i,c)=>Math.max(i.length,...s.map(m=>m[c]?.length??0))),t=i=>i.map((c,m)=>c.padEnd(r[m])).join(" ").trimEnd();return[t(e),t(e.map(i=>"-".repeat(i.length))),...s.map(t)].map(i=>`${o}${i}`).join(`
|
|
34
|
-
`)}async function q(e,s){if(e.includes("--help")||e.includes("-h"))return A(),0;let o=v(e,{port:s.port,stripBooleanFlags:["--json","--help","-h"],stripValueFlags:["--since","--include","--limit","--slow-threshold"]}),r=o.positional[0]??"recent";if(r!=="recent")return console.error(` unknown subcommand: ${r}`),console.error(" did you mean: sootsim diagnose recent ?"),1;let t=D(k(e,"--since"),9e4),i=O(k(e,"--include")),c=E(e,"--limit",8),m=E(e,"--slow-threshold",1e3),p=e.includes("--json"),u=R(o);try{let l=[],g=[];(i.has("timeline")||i.has("screen")||i.has("alert"))&&(g.push("timeline"),l.push(P(u,t))),(i.has("network")||i.has("fetch"))&&(g.push("network"),l.push(B(u,t,m))),i.has("react")&&(g.push("react"),l.push(L(u,c))),i.has("console")&&(g.push("console"),l.push(C(u,t)));let x=await Promise.all(l),w={};for(let n=0;n<g.length;n++)w[g[n]]=x[n];if(p)return console.log(JSON.stringify({generatedAt:Date.now(),sinceMs:t,include:Array.from(i),slices:w},null,2)),0;let S=Date.now();if(console.log(` diagnose recent (last ${(t/1e3).toFixed(0)}s, include: ${Array.from(i).sort().join(",")}):`),w.timeline){let n=w.timeline;console.log(`
|
|
35
|
-
timeline \u2014 ${n.total} event(s) in window`);let f=Object.entries(n.byKind).sort((a,d)=>d[1]-a[1]).map(([a,d])=>`${d} ${a}`).join(" \xB7 ");if(f&&console.log(` summary: ${f}`),n.screens.length){let d=n.screens[n.screens.length-1].data,h=d?d.name??d.activeName??d.path??"?":"?";console.log(` last screen: ${String(h)}`)}if(n.alerts.length){console.log(` alerts (${n.alerts.length}):`);for(let a of n.alerts.slice(-5))console.log(N(a,S))}if(n.errors.length){console.log(` console errors/warns from timeline (${n.errors.length}):`);for(let a of n.errors.slice(-5))console.log(N(a,S))}}if(w.network){let n=w.network;if("error"in n)console.log(`
|
|
36
|
-
network \u2014 ${n.error}`);else{if(console.log(`
|
|
37
|
-
network \u2014 ${n.total} request(s), ${n.failed.length} failed, ${n.slow.length} slow (>${n.slowThresholdMs}ms), ${n.inFlight} in-flight`),n.failed.length){console.log(" failed:");for(let f of n.failed.slice(-8))console.log(T(f))}if(n.slow.length){console.log(" slowest:");for(let f of n.slow.slice(0,5))console.log(T(f))}}}if(w.react){let n=w.react;console.log(`
|
|
38
|
-
react \u2014 ${n.commits} commit(s)`),n.error&&console.log(` warning: ${n.error}`),n.durationWarning&&console.log(` warning: ${n.durationWarning}`),n.slow.length>0&&n.slow.every(a=>a.totalMs<=0&&a.slowestMs<=0)&&!n.durationWarning&&console.log(" warning: every commit reports actualDuration=0ms \u2014 bundle has React profiler timer disabled"),n.slow.length&&(console.log(" slowest:"),console.log(M(["component","total","commits","slowest"],n.slow.slice(0,c).map(a=>[a.displayName,`${a.totalMs.toFixed(2)}ms`,String(a.commitCount),`${a.slowestMs.toFixed(2)}ms`])," "))),n.rerenders.length&&(console.log(" most rerenders:"),console.log(M(["component","renders","top causes"],n.rerenders.slice(0,c).map(a=>{let d=Object.entries(a.causes??{}).filter(([,h])=>h>0).sort((h,y)=>y[1]-h[1]).slice(0,3).map(([h,y])=>`${h}:${y}`).join(", ");return[a.displayName,String(a.renders??a.count??0),d||"-"]})," ")))}if(w.console){let n=w.console;if("error"in n)console.log(`
|
|
39
|
-
console \u2014 ${n.error}`);else{console.log(`
|
|
40
|
-
console errors/warns \u2014 ${n.total} in window`);for(let f of n.entries.slice(-8)){let a=((j(f)-S)/1e3).toFixed(2),d=F(f).slice(0,160);console.log(` -${a.padStart(5)}s [${f.level}] ${d}`)}}}return $()&&console.log(`
|
|
41
|
-
next: sootsim what-happened (cursor advances) \xB7 sootsim network get <id> \xB7 sootsim react why <fiber-id>`),0}finally{u.close()}}export{q as runDiagnose};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.39 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import"./chunk-5RSSCKBF.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-5L5SZXXG.js";import"./chunk-YGUQSPU6.js";import"./chunk-MGVTLDI3.js";import"./chunk-4UI5OHEO.js";import"./chunk-C6GUAXKO.js";import"./chunk-ECDPQ6S7.js";import"./chunk-WD54RD4K.js";export{e as ALL_DRIVERS,i as buildDriverListRows,a as chromiumDriver,b as electronDriver,f as getAllDrivers,g as getDriver,c as playwrightDriver,h as resolveDriver,d as systemDriver};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.39 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a,b,c,d}from"./chunk-223TXYOC.js";import"./chunk-ZBB7YS6C.js";import"./chunk-JXKW62SL.js";import"./chunk-NFJDHJHK.js";import"./chunk-SLQ2GTYF.js";import"./chunk-NJ4WXWKO.js";import"./chunk-WHQWINDB.js";import"./chunk-YUKH7HF6.js";import"./chunk-P6F636LU.js";import"./chunk-5L5SZXXG.js";import"./chunk-YGUQSPU6.js";import"./chunk-MGVTLDI3.js";import"./chunk-FEMOLCB5.js";import"./chunk-NF65BNJR.js";import"./chunk-4YUHJ5FX.js";import"./chunk-4UI5OHEO.js";import"./chunk-GUHXSXNO.js";import"./chunk-4LHQRDSN.js";import"./chunk-W4QHQT64.js";import"./chunk-7J4UIBA5.js";import"./chunk-VLUFTHBB.js";import"./chunk-UWRBEBML.js";import"./chunk-C6GUAXKO.js";import"./chunk-HWRR23AJ.js";import"./chunk-RLGCJT2D.js";import"./chunk-B3OEHV2C.js";import"./chunk-ECDPQ6S7.js";import"./chunk-WD54RD4K.js";export{b as discoverSootsimUrl,a as parseFlowFile,d as runFlow,c as runFlowPlayback};
|