sootsim 0.1.171 → 0.1.173
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 +25 -0
- package/dist-cli/bin.js +3 -3
- package/dist-cli/chunks/{agent-J4NTKR6V.js → agent-C2E22ESN.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-V2TD3UZR.js → agent-wrapper-IQUZ3DT6.js} +2 -2
- package/dist-cli/chunks/{app-fonts-ROVXMKLG.js → app-fonts-EL3GCMOF.js} +2 -2
- package/dist-cli/chunks/{assert-CXQAEBLS.js → assert-UFDQWVKU.js} +2 -2
- package/dist-cli/chunks/beta-3VFRMFCE.js +2 -0
- package/dist-cli/chunks/{camera-XPZFAU3B.js → camera-YR4LF62J.js} +2 -2
- package/dist-cli/chunks/{chunk-2UEHUM6Q.js → chunk-2IUYPQC6.js} +2 -2
- package/dist-cli/chunks/{chunk-547XSOJL.js → chunk-3N4T6ZCZ.js} +2 -2
- package/dist-cli/chunks/{chunk-YBPF6OGE.js → chunk-4NEHOYQH.js} +3 -3
- package/dist-cli/chunks/chunk-4UNCEOKE.js +2 -0
- package/dist-cli/chunks/{chunk-QIMO6SQX.js → chunk-5RLVAUSR.js} +2 -2
- package/dist-cli/chunks/{chunk-O54LARIO.js → chunk-6D2B6YM5.js} +1 -1
- package/dist-cli/chunks/{chunk-HBR56XPR.js → chunk-6PQ4KSCP.js} +1 -1
- package/dist-cli/chunks/{chunk-RULKWLIO.js → chunk-7LCS6UB7.js} +1 -1
- package/dist-cli/chunks/{chunk-JQW2OOL5.js → chunk-7O64AC44.js} +1 -1
- package/dist-cli/chunks/{chunk-J7DI5B4Y.js → chunk-A43ZSZMJ.js} +1 -1
- package/dist-cli/chunks/{chunk-I5XY2BFR.js → chunk-AOFD6E2Z.js} +2 -2
- package/dist-cli/chunks/{chunk-XD66TGXU.js → chunk-BUCN4NOE.js} +1 -1
- package/dist-cli/chunks/{chunk-OSS2T3WP.js → chunk-CO42HSYV.js} +1 -1
- package/dist-cli/chunks/{chunk-XFSQORQ5.js → chunk-D5MW3FJE.js} +2 -2
- package/dist-cli/chunks/{chunk-JQSGI66Q.js → chunk-DFP5BKYL.js} +2 -2
- package/dist-cli/chunks/chunk-F2VINQ62.js +1 -0
- package/dist-cli/chunks/{chunk-OTN33CWO.js → chunk-FLKV4YHL.js} +2 -2
- package/dist-cli/chunks/{chunk-N64WUTJB.js → chunk-FX3YWIDK.js} +2 -2
- package/dist-cli/chunks/{chunk-OIIPFIZL.js → chunk-GTIQVAJP.js} +1 -1
- package/dist-cli/chunks/{chunk-MBVNBHRK.js → chunk-HGUPRH7F.js} +2 -2
- package/dist-cli/chunks/{chunk-CJTJX3H7.js → chunk-HSACKNHS.js} +2 -2
- package/dist-cli/chunks/{chunk-AOPGVSJW.js → chunk-HTCJBVQD.js} +1 -1
- package/dist-cli/chunks/{chunk-OYQVSV4I.js → chunk-HYCJ7HUJ.js} +2 -2
- package/dist-cli/chunks/{chunk-ICA7K635.js → chunk-I3UUCR2A.js} +1 -1
- package/dist-cli/chunks/{chunk-WXPG6OS6.js → chunk-KBTADP77.js} +1 -1
- package/dist-cli/chunks/{chunk-DR3E2NVD.js → chunk-KHMFZHHP.js} +2 -2
- package/dist-cli/chunks/{chunk-QBCJDPG3.js → chunk-LOP35MNF.js} +2 -2
- package/dist-cli/chunks/{chunk-RISDCDO2.js → chunk-M2GYHZES.js} +3 -3
- package/dist-cli/chunks/chunk-M4TI3GFJ.js +1 -0
- package/dist-cli/chunks/{chunk-E7P6ILZK.js → chunk-MJQCN4PS.js} +2 -2
- package/dist-cli/chunks/{chunk-EXN7SSF3.js → chunk-MPJX3BCR.js} +1 -1
- package/dist-cli/chunks/{chunk-RJZRI3P3.js → chunk-MPVUKE2L.js} +1 -1
- package/dist-cli/chunks/{chunk-KT55MHRH.js → chunk-N7HUNHH6.js} +1 -1
- package/dist-cli/chunks/{chunk-CVLJ4RMA.js → chunk-ODWORXXD.js} +1 -1
- package/dist-cli/chunks/{chunk-X4VXITOI.js → chunk-PPDVP56P.js} +1 -1
- package/dist-cli/chunks/{chunk-RNWTVHIS.js → chunk-Q6VYTVCL.js} +2 -2
- package/dist-cli/chunks/{chunk-I5OLONCL.js → chunk-QGQSKDXQ.js} +2 -2
- package/dist-cli/chunks/{chunk-WPEXAZSS.js → chunk-QYHBVPQH.js} +2 -2
- package/dist-cli/chunks/{chunk-RXBB4S3Q.js → chunk-RXB7KMHB.js} +2 -2
- package/dist-cli/chunks/{chunk-FJ2WDOTA.js → chunk-TAFDTRBK.js} +2 -2
- package/dist-cli/chunks/{chunk-B77QXVTZ.js → chunk-TYCNPLOA.js} +1 -1
- package/dist-cli/chunks/{chunk-LSZRVSXO.js → chunk-VQQVVMNO.js} +2 -2
- package/dist-cli/chunks/{chunk-AHOHHXWK.js → chunk-WS4M3ANJ.js} +1 -1
- package/dist-cli/chunks/{chunk-YPHT4BSL.js → chunk-WYGYIQOE.js} +2 -2
- package/dist-cli/chunks/{chunk-U7NWELJ3.js → chunk-X4A5YX56.js} +2 -2
- package/dist-cli/chunks/cli-version-7EPWQ5XZ.js +2 -0
- package/dist-cli/chunks/{compat-32AVWHB7.js → compat-K733FE26.js} +3 -3
- package/dist-cli/chunks/{control-LF34QRMZ.js → control-PAVODRG5.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-EEAXEDDO.js → cpu-profile-OGUUHMAT.js} +2 -2
- package/dist-cli/chunks/daemon-ITK6NXMP.js +2 -0
- package/dist-cli/chunks/{debug-MW62345L.js → debug-7DNEARGS.js} +3 -3
- package/dist-cli/chunks/{detox-UAPUROWZ.js → detox-JAIVH44U.js} +2 -2
- package/dist-cli/chunks/{device-IWWFCELP.js → device-DLTVU6ZI.js} +2 -2
- package/dist-cli/chunks/{diagnose-DL22YIRH.js → diagnose-3D5ISUJP.js} +2 -2
- package/dist-cli/chunks/drivers-VFK56EQO.js +2 -0
- package/dist-cli/chunks/{electron-KDVB42AG.js → electron-HYOT74T7.js} +3 -3
- package/dist-cli/chunks/flow-AHIM2QYC.js +2 -0
- package/dist-cli/chunks/help-7JOCVVN6.js +2 -0
- package/dist-cli/chunks/{hints-GNVLVDPN.js → hints-5RUWD6KL.js} +2 -2
- package/dist-cli/chunks/{home-paths-4JHJTIX5.js → home-paths-YXPZJSA5.js} +2 -2
- package/dist-cli/chunks/{inspect-RT36PPFH.js → inspect-D476ZLEK.js} +3 -3
- package/dist-cli/chunks/{install-desktop-MXUBQ6NJ.js → install-desktop-AXOXLY57.js} +3 -3
- package/dist-cli/chunks/{keys-PS5IUZ2M.js → keys-OS55YM3T.js} +2 -2
- package/dist-cli/chunks/{login-PLPGPVOR.js → login-CE3ATU7H.js} +4 -4
- package/dist-cli/chunks/{logout-3NCVFTBB.js → logout-55RMHZIG.js} +2 -2
- package/dist-cli/chunks/{maestro-OTPRMCZ3.js → maestro-BWH4Y3OO.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-4IEF2MIB.js +2 -0
- package/dist-cli/chunks/{preview-JM3GALNL.js → preview-YZCH5SS4.js} +2 -2
- package/dist-cli/chunks/{profile-T2BO5XLW.js → profile-Q6CC3BOS.js} +2 -2
- package/dist-cli/chunks/{react-U3FQRLFA.js → react-43Y6I63U.js} +2 -2
- package/dist-cli/chunks/{record-C6FA3WXN.js → record-OAW5IIQH.js} +2 -2
- package/dist-cli/chunks/runtime-C2EIPLM6.js +2 -0
- package/dist-cli/chunks/{screenshot-XPDBDFIK.js → screenshot-JEXBD4GJ.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-4FED7FGF.js → screenshot-mode-AOS3ROPL.js} +2 -2
- package/dist-cli/chunks/{screenshots-GVEUZFXL.js → screenshots-CYTHIJ5W.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-TPGPJZ3J.js → screenshots-capture-YAEYGEHY.js} +2 -2
- package/dist-cli/chunks/{serve-5G4JU44V.js → serve-OYNG5IHK.js} +2 -2
- package/dist-cli/chunks/{setup-BGRJTFGF.js → setup-6O7GJF73.js} +2 -2
- package/dist-cli/chunks/{skills-AGVA7E6K.js → skills-XJOVDRCF.js} +2 -2
- package/dist-cli/chunks/{slides-Z7LW64IW.js → slides-DSY2GHZZ.js} +2 -2
- package/dist-cli/chunks/store-DSH2KPUH.js +2 -0
- package/dist-cli/chunks/telemetry-PJHHQYHR.js +2 -0
- package/dist-cli/chunks/{test-PFT2C45X.js → test-DVS4LMCY.js} +3 -3
- package/dist-cli/chunks/{three-mode-HOCUD4BU.js → three-mode-6KCLSSPS.js} +2 -2
- package/dist-cli/chunks/{timeline-STMBOMTT.js → timeline-ZWPBF46N.js} +5 -5
- package/dist-cli/chunks/{upgrade-UXMJ73RU.js → upgrade-ZV77D7SC.js} +2 -2
- package/dist-cli/chunks/upload-STOKBIDT.js +2 -0
- package/dist-cli/chunks/{version-FNSM3CIG.js → version-WAJ3YX4U.js} +2 -2
- package/dist-cli/chunks/{web-TMIGK6QS.js → web-KVDTMF6L.js} +2 -2
- package/dist-cli/chunks/{what-happened-R5KC4F7B.js → what-happened-GUIQ3GXK.js} +8 -7
- package/dist-cli/chunks/{whoami-DWRGFQKR.js → whoami-U6J5UL6X.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +66 -1
- package/dist-lib/jump-to-source-babel.cjs +93 -0
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +2 -2
- package/dist-lib/vite.cjs +1 -1
- package/package.json +5 -1
- package/src/index.ts +1 -0
- package/src/jump-to-source-babel.ts +135 -0
- package/src/vite-plugin.ts +83 -0
- package/dist-cli/chunks/beta-BLY4YCCD.js +0 -2
- package/dist-cli/chunks/chunk-3OFDUWRM.js +0 -2
- package/dist-cli/chunks/chunk-DGVQPBNL.js +0 -1
- package/dist-cli/chunks/chunk-HQ3WABUY.js +0 -1
- package/dist-cli/chunks/cli-version-EQIZQ5NI.js +0 -2
- package/dist-cli/chunks/daemon-MUQQZ64R.js +0 -2
- package/dist-cli/chunks/drivers-3LBGADWJ.js +0 -2
- package/dist-cli/chunks/flow-OE7GVTNZ.js +0 -2
- package/dist-cli/chunks/help-G7XRDP3G.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-RMRKVBDN.js +0 -2
- package/dist-cli/chunks/runtime-IGGC2EEX.js +0 -2
- package/dist-cli/chunks/store-KKALNEVX.js +0 -2
- package/dist-cli/chunks/telemetry-WHOFSYSH.js +0 -2
- package/dist-cli/chunks/upload-NJTGOKHA.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{C as N,D as F,E as y,P as T,Q as b,R as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{C as N,D as F,E as y,P as T,Q as b,R as S}from"./chunk-PPDVP56P.js";import{c as A,e as _}from"./chunk-HSACKNHS.js";import"./chunk-KBTADP77.js";import{b as k}from"./chunk-6D2B6YM5.js";import"./chunk-7LCS6UB7.js";import"./chunk-HTCJBVQD.js";function O(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--since"&&e+1<n.length){t.push(e,e+1);let s=n[e+1].trim(),l=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(s);if(l){let r=Number(l[1]),u=l[2]??"ms",v=u==="s"?r*1e3:u==="m"?r*6e4:r;return{since:Date.now()-v,consumed:t}}let i=Number(s);if(Number.isFinite(i)&&i>1e12)return{since:i,consumed:t}}return{consumed:t}}function B(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--kinds"&&e+1<n.length)return t.push(e,e+1),{kinds:n[e+1].split(",").map(s=>s.trim()).filter(Boolean),consumed:t};return{consumed:t}}function D(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--limit"&&e+1<n.length){t.push(e,e+1);let s=Number(n[e+1]);if(Number.isFinite(s)&&s>0)return{limit:s,consumed:t}}return{consumed:t}}function x(n){let t=[],e={label:"initial state",events:[],startedAt:n[0]?.t??null};t.push(e);for(let s of n)if(e.events.push(s),s.kind==="screen"||s.kind==="route"){let l=s.data,i=l?.phase;if(!i||i==="enter"||i==="appear"||i==="active"){let r=l?.name||l?.activeName||l?.path||l?.pathname||s.kind;t.length===1&&e.events.length===1?e.label=`${s.kind}: ${r}`:(e={label:`${s.kind}: ${r}`,events:[],startedAt:s.t},t.push(e))}}return t}async function J(n,t){let e=A(n,{port:t.port,stripBooleanFlags:["--summary","--all","--json","--no-advance","--help","-h","--flow","--noisy"],stripValueFlags:["--since","--kinds","--limit"]});(n.includes("--help")||n.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim what-happened \u2014 show recent events from the semantic timeline
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -13,10 +13,11 @@ usage:
|
|
|
13
13
|
sootsim what-happened --json
|
|
14
14
|
sootsim what-happened --no-advance # don't advance cursor after read
|
|
15
15
|
|
|
16
|
-
note:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
${f}
|
|
16
|
+
note: react-commit, layout, and scroll are opt-in/noisy events. enable them
|
|
17
|
+
with "sootsim timeline start <kind>", then pass --noisy or include them in
|
|
18
|
+
--kinds to see them.
|
|
19
|
+
`),process.exit(0));let s=n.includes("--summary"),l=n.includes("--flow"),i=n.includes("--all"),r=n.includes("--json"),u=n.includes("--no-advance"),v=n.includes("--noisy"),{since:a}=O(n),{kinds:d}=B(n),{limit:C}=D(n),g=k(),$={limit:C??200,...d&&d.length?{kinds:d}:{},...a!==void 0?{since:a}:i?{}:{sinceCursor:g}},h=_(e);try{if(s){let c=await N(h,$);if(r)console.log(JSON.stringify(c));else{let m=i?"all time":a!==void 0?`last ${((Date.now()-a)/1e3).toFixed(1)}s`:"since last call";console.log(` ${m}: ${T(c)}`)}!u&&!i&&c.lastAt&&await y(h,g,c.lastAt);return}let o=await F(h,$),E=Array.isArray(d)&&d.some(c=>b.has(c)),I=!v&&!E,p=0;if(I){let c=o.events.filter(m=>b.has(m.kind)?(p+=1,!1):!0);o.events=c}if(r)console.log(JSON.stringify(l?x(o.events):o,null,2));else{if(o.events.length===0)p>0?console.log(` no non-noise events (${p} react-commit/layout/scroll hidden)`):console.log(i?" no events recorded":a!==void 0?" no events in window":" no new events since last call");else if(l){let c=o.events[0]?.t??null,m=x(o.events),w=i?`\u2500\u2500\u2500 ${o.events.length} event(s) total \u2014 flow view \u2500\u2500\u2500`:a!==void 0?`\u2500\u2500\u2500 ${o.events.length} event(s) in last ${((Date.now()-a)/1e3).toFixed(1)}s \u2014 flow view \u2500\u2500\u2500`:`\u2500\u2500\u2500 ${o.events.length} event(s) since last call \u2014 flow view \u2500\u2500\u2500`;console.log(` ${w}`);for(let f of m){console.log(`
|
|
20
|
+
\u2500\u2500 ${f.label} (${f.events.length} event${f.events.length===1?"":"s"}) \u2500\u2500`);for(let M of f.events)console.log(S(M,c))}}else{let c=o.events[0]?.t??null,m=i?`\u2500\u2500\u2500 ${o.events.length} event(s) total \u2500\u2500\u2500`:a!==void 0?`\u2500\u2500\u2500 ${o.events.length} event(s) in last ${((Date.now()-a)/1e3).toFixed(1)}s \u2500\u2500\u2500`:`\u2500\u2500\u2500 ${o.events.length} event(s) since last call \u2500\u2500\u2500`;console.log(` ${m}`);for(let w of o.events)console.log(S(w,c))}p>0&&o.events.length>0&&process.stderr.write(`
|
|
21
|
+
${p} high-frequency event(s) hidden (react-commit/layout/scroll)
|
|
21
22
|
rerun with --noisy or --kinds react-commit,layout,scroll to include them
|
|
22
23
|
`)}!u&&!i&&o.watermark>0&&await y(h,g,o.watermark)}finally{h.close()}}export{J as runWhatHappened};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{d as i}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as i}from"./chunk-X4A5YX56.js";import{d as n}from"./chunk-VQQVVMNO.js";import"./chunk-7LCS6UB7.js";import"./chunk-HTCJBVQD.js";async function u(){let o=i();if(o||(console.log(" not signed in"),console.log(" set SOOTSIM_API_KEY=sk_sootsim_\u2026 or run `sootsim login`"),process.exit(1)),o.kind==="api-key"){let r=`${o.secret.slice(0,14)}\u2026`,t=o.source==="env"?"SOOTSIM_API_KEY env var":"saved key (~/.config/sootsim/credentials.json)";console.log(` api key ${r}`),console.log(` source: ${t}`);return}if(o.kind==="github"){console.log(` github token (${o.source})`),console.log(` repo: ${o.repoId}`);return}let e=await n(),s=e?.user;console.log(` ${s?.email||s?.name||s?.id||"signed in"}`),console.log(` origin: ${e?.origin??o.origin}`),e?.updatedAt&&console.log(` updated: ${e.updatedAt}`)}export{u as runWhoami};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/config.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/detox/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/home-paths.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/host/fetch-proxy-overrides.ts
|
|
4
4
|
var FETCH_PROXY_BROWSER_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -34,6 +34,7 @@ var src_exports = {};
|
|
|
34
34
|
__export(src_exports, {
|
|
35
35
|
DEFAULT_SOOTSIM_BRIDGE_PORT: () => DEFAULT_SOOTSIM_BRIDGE_PORT,
|
|
36
36
|
DEFAULT_SOOTSIM_SHELL_URL: () => DEFAULT_SOOTSIM_SHELL_URL,
|
|
37
|
+
jumpToSourceBabelPlugin: () => sootsimJumpToSourceBabelPlugin,
|
|
37
38
|
metroPlugin: () => metro_plugin_default,
|
|
38
39
|
sootsimPlugin: () => sootsimPlugin
|
|
39
40
|
});
|
|
@@ -345,6 +346,69 @@ function withSootsim(config, options = {}) {
|
|
|
345
346
|
}
|
|
346
347
|
var metro_plugin_default = withSootsim;
|
|
347
348
|
|
|
349
|
+
// src/jump-to-source-babel.ts
|
|
350
|
+
function normalizeSourcePath(path5) {
|
|
351
|
+
const queryStart = path5.indexOf("?");
|
|
352
|
+
const clean = queryStart >= 0 ? path5.slice(0, queryStart) : path5;
|
|
353
|
+
return clean.replace(/\\/g, "/");
|
|
354
|
+
}
|
|
355
|
+
function matchesPath(path5, matcher) {
|
|
356
|
+
return typeof matcher === "string" ? path5.includes(matcher) : matcher.test(path5);
|
|
357
|
+
}
|
|
358
|
+
function shouldStampFile(filename, options) {
|
|
359
|
+
const normalized = normalizeSourcePath(filename);
|
|
360
|
+
if (normalized.includes("/node_modules/")) return false;
|
|
361
|
+
if (normalized.includes("/dist/") || normalized.includes("/build/")) return false;
|
|
362
|
+
if (options.exclude?.some((matcher) => matchesPath(normalized, matcher))) return false;
|
|
363
|
+
if (options.include?.length) {
|
|
364
|
+
return options.include.some((matcher) => matchesPath(normalized, matcher));
|
|
365
|
+
}
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
function getJSXName(node) {
|
|
369
|
+
if (!node) return null;
|
|
370
|
+
if (node.type === "JSXIdentifier" && node.name) return node.name;
|
|
371
|
+
if (node.type === "JSXMemberExpression") {
|
|
372
|
+
const object = getJSXName(node.object);
|
|
373
|
+
const property = getJSXName(node.property);
|
|
374
|
+
return object && property ? `${object}.${property}` : null;
|
|
375
|
+
}
|
|
376
|
+
return null;
|
|
377
|
+
}
|
|
378
|
+
function hasAttribute(node, attrName) {
|
|
379
|
+
return node.attributes?.some((attr) => {
|
|
380
|
+
if (attr.type !== "JSXAttribute") return false;
|
|
381
|
+
return attr.name?.type === "JSXIdentifier" && attr.name.name === attrName;
|
|
382
|
+
}) ?? false;
|
|
383
|
+
}
|
|
384
|
+
function sootsimJumpToSourceBabelPlugin(api, options = {}) {
|
|
385
|
+
const attrName = options.attrName || "srcloc";
|
|
386
|
+
return {
|
|
387
|
+
name: "sootsim-jump-to-source",
|
|
388
|
+
visitor: {
|
|
389
|
+
JSXOpeningElement(path5, state) {
|
|
390
|
+
if (options.enabled === false) return;
|
|
391
|
+
const filename = state.file?.opts?.filename;
|
|
392
|
+
if (!filename || !shouldStampFile(filename, options)) return;
|
|
393
|
+
const node = path5.node;
|
|
394
|
+
const tagName = getJSXName(node.name);
|
|
395
|
+
if (!tagName || tagName === "Fragment" || tagName.endsWith(".Fragment")) return;
|
|
396
|
+
if (hasAttribute(node, attrName)) return;
|
|
397
|
+
const loc = node.loc?.start;
|
|
398
|
+
if (!loc) return;
|
|
399
|
+
const source = `${normalizeSourcePath(filename)}:${loc.line}:${loc.column + 1}`;
|
|
400
|
+
node.attributes ??= [];
|
|
401
|
+
node.attributes.push(
|
|
402
|
+
api.types.jsxAttribute(
|
|
403
|
+
api.types.jsxIdentifier(attrName),
|
|
404
|
+
api.types.stringLiteral(source)
|
|
405
|
+
)
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
|
|
348
412
|
// src/bridge-constants.ts
|
|
349
413
|
var DEFAULT_SOOTSIM_BRIDGE_PORT = 7668;
|
|
350
414
|
|
|
@@ -354,6 +418,7 @@ var DEFAULT_SOOTSIM_SHELL_URL = "http://localhost:5173/";
|
|
|
354
418
|
0 && (module.exports = {
|
|
355
419
|
DEFAULT_SOOTSIM_BRIDGE_PORT,
|
|
356
420
|
DEFAULT_SOOTSIM_SHELL_URL,
|
|
421
|
+
jumpToSourceBabelPlugin,
|
|
357
422
|
metroPlugin,
|
|
358
423
|
sootsimPlugin
|
|
359
424
|
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/jump-to-source-babel.ts
|
|
23
|
+
var jump_to_source_babel_exports = {};
|
|
24
|
+
__export(jump_to_source_babel_exports, {
|
|
25
|
+
default: () => sootsimJumpToSourceBabelPlugin,
|
|
26
|
+
sootsimJumpToSourceBabelPlugin: () => sootsimJumpToSourceBabelPlugin
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(jump_to_source_babel_exports);
|
|
29
|
+
function normalizeSourcePath(path) {
|
|
30
|
+
const queryStart = path.indexOf("?");
|
|
31
|
+
const clean = queryStart >= 0 ? path.slice(0, queryStart) : path;
|
|
32
|
+
return clean.replace(/\\/g, "/");
|
|
33
|
+
}
|
|
34
|
+
function matchesPath(path, matcher) {
|
|
35
|
+
return typeof matcher === "string" ? path.includes(matcher) : matcher.test(path);
|
|
36
|
+
}
|
|
37
|
+
function shouldStampFile(filename, options) {
|
|
38
|
+
const normalized = normalizeSourcePath(filename);
|
|
39
|
+
if (normalized.includes("/node_modules/")) return false;
|
|
40
|
+
if (normalized.includes("/dist/") || normalized.includes("/build/")) return false;
|
|
41
|
+
if (options.exclude?.some((matcher) => matchesPath(normalized, matcher))) return false;
|
|
42
|
+
if (options.include?.length) {
|
|
43
|
+
return options.include.some((matcher) => matchesPath(normalized, matcher));
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
function getJSXName(node) {
|
|
48
|
+
if (!node) return null;
|
|
49
|
+
if (node.type === "JSXIdentifier" && node.name) return node.name;
|
|
50
|
+
if (node.type === "JSXMemberExpression") {
|
|
51
|
+
const object = getJSXName(node.object);
|
|
52
|
+
const property = getJSXName(node.property);
|
|
53
|
+
return object && property ? `${object}.${property}` : null;
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function hasAttribute(node, attrName) {
|
|
58
|
+
return node.attributes?.some((attr) => {
|
|
59
|
+
if (attr.type !== "JSXAttribute") return false;
|
|
60
|
+
return attr.name?.type === "JSXIdentifier" && attr.name.name === attrName;
|
|
61
|
+
}) ?? false;
|
|
62
|
+
}
|
|
63
|
+
function sootsimJumpToSourceBabelPlugin(api, options = {}) {
|
|
64
|
+
const attrName = options.attrName || "srcloc";
|
|
65
|
+
return {
|
|
66
|
+
name: "sootsim-jump-to-source",
|
|
67
|
+
visitor: {
|
|
68
|
+
JSXOpeningElement(path, state) {
|
|
69
|
+
if (options.enabled === false) return;
|
|
70
|
+
const filename = state.file?.opts?.filename;
|
|
71
|
+
if (!filename || !shouldStampFile(filename, options)) return;
|
|
72
|
+
const node = path.node;
|
|
73
|
+
const tagName = getJSXName(node.name);
|
|
74
|
+
if (!tagName || tagName === "Fragment" || tagName.endsWith(".Fragment")) return;
|
|
75
|
+
if (hasAttribute(node, attrName)) return;
|
|
76
|
+
const loc = node.loc?.start;
|
|
77
|
+
if (!loc) return;
|
|
78
|
+
const source = `${normalizeSourcePath(filename)}:${loc.line}:${loc.column + 1}`;
|
|
79
|
+
node.attributes ??= [];
|
|
80
|
+
node.attributes.push(
|
|
81
|
+
api.types.jsxAttribute(
|
|
82
|
+
api.types.jsxIdentifier(attrName),
|
|
83
|
+
api.types.stringLiteral(source)
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
+
0 && (module.exports = {
|
|
92
|
+
sootsimJumpToSourceBabelPlugin
|
|
93
|
+
});
|
package/dist-lib/menu.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/menu.mjs
CHANGED
package/dist-lib/metro.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/profiles.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/render-mode.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/sdk.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/sdk.mjs
CHANGED
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -16367,7 +16367,7 @@ var init_upload = __esm({
|
|
|
16367
16367
|
init_telemetry();
|
|
16368
16368
|
init_ws_bridge();
|
|
16369
16369
|
REMOTE_DEFAULT_ORIGIN = process.env.SOOTSIM_UPLOAD_ORIGIN || "https://sootbean.com";
|
|
16370
|
-
REMOTE_DEFAULT_PUBLIC_PREVIEW_ORIGIN = process.env.SOOTSIM_PREVIEW_ORIGIN || "https://
|
|
16370
|
+
REMOTE_DEFAULT_PUBLIC_PREVIEW_ORIGIN = process.env.SOOTSIM_PREVIEW_ORIGIN || "https://sootsim.com";
|
|
16371
16371
|
LOCAL_DEFAULT_ORIGIN = "http://localhost:3000";
|
|
16372
16372
|
LOCAL_UPLOAD_PROBE_TIMEOUT_MS = 2e3;
|
|
16373
16373
|
}
|
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.173 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sootsim",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.173",
|
|
4
4
|
"description": "sootsim CLI + vite/metro plugins + skills registry. bridge client for driving the proprietary sootsim-engine over WebSocket.",
|
|
5
5
|
"author": "Tamagui LLC",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"source": "./src/metro-plugin.ts",
|
|
30
30
|
"default": "./dist-lib/metro.cjs"
|
|
31
31
|
},
|
|
32
|
+
"./jump-to-source-babel": {
|
|
33
|
+
"source": "./src/jump-to-source-babel.ts",
|
|
34
|
+
"default": "./dist-lib/jump-to-source-babel.cjs"
|
|
35
|
+
},
|
|
32
36
|
"./menu": {
|
|
33
37
|
"source": "./src/menu.ts",
|
|
34
38
|
"bun": "./src/menu.ts",
|
package/src/index.ts
CHANGED
|
@@ -5,5 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
export { sootsimPlugin } from './vite-plugin-one'
|
|
7
7
|
export { default as metroPlugin } from './metro-plugin'
|
|
8
|
+
export { default as jumpToSourceBabelPlugin } from './jump-to-source-babel'
|
|
8
9
|
export { DEFAULT_SOOTSIM_BRIDGE_PORT } from './bridge-constants'
|
|
9
10
|
export { DEFAULT_SOOTSIM_SHELL_URL } from './cli-constants'
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export interface SootsimJumpToSourceBabelOptions {
|
|
2
|
+
enabled?: boolean
|
|
3
|
+
attrName?: string
|
|
4
|
+
include?: readonly SourcePathMatcher[]
|
|
5
|
+
exclude?: readonly SourcePathMatcher[]
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type SourcePathMatcher = string | RegExp
|
|
9
|
+
|
|
10
|
+
interface BabelApi {
|
|
11
|
+
types: {
|
|
12
|
+
jsxAttribute(name: unknown, value: unknown): JSXAttributeNode
|
|
13
|
+
jsxIdentifier(name: string): unknown
|
|
14
|
+
stringLiteral(value: string): unknown
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface BabelPluginState {
|
|
19
|
+
file?: {
|
|
20
|
+
opts?: {
|
|
21
|
+
filename?: string
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface SourceLocation {
|
|
27
|
+
line: number
|
|
28
|
+
column: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface JSXNameNode {
|
|
32
|
+
type: string
|
|
33
|
+
name?: string
|
|
34
|
+
object?: JSXNameNode
|
|
35
|
+
property?: JSXNameNode
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface JSXAttributeNode {
|
|
39
|
+
type: string
|
|
40
|
+
name?: JSXNameNode
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface JSXOpeningElementNode {
|
|
44
|
+
name?: JSXNameNode
|
|
45
|
+
attributes?: JSXAttributeNode[]
|
|
46
|
+
loc?: {
|
|
47
|
+
start?: SourceLocation
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface JSXOpeningElementPath {
|
|
52
|
+
node: JSXOpeningElementNode
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function normalizeSourcePath(path: string): string {
|
|
56
|
+
const queryStart = path.indexOf('?')
|
|
57
|
+
const clean = queryStart >= 0 ? path.slice(0, queryStart) : path
|
|
58
|
+
return clean.replace(/\\/g, '/')
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function matchesPath(path: string, matcher: SourcePathMatcher): boolean {
|
|
62
|
+
return typeof matcher === 'string' ? path.includes(matcher) : matcher.test(path)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function shouldStampFile(
|
|
66
|
+
filename: string,
|
|
67
|
+
options: SootsimJumpToSourceBabelOptions,
|
|
68
|
+
): boolean {
|
|
69
|
+
const normalized = normalizeSourcePath(filename)
|
|
70
|
+
if (normalized.includes('/node_modules/')) return false
|
|
71
|
+
if (normalized.includes('/dist/') || normalized.includes('/build/')) return false
|
|
72
|
+
if (options.exclude?.some((matcher) => matchesPath(normalized, matcher))) return false
|
|
73
|
+
if (options.include?.length) {
|
|
74
|
+
return options.include.some((matcher) => matchesPath(normalized, matcher))
|
|
75
|
+
}
|
|
76
|
+
return true
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function getJSXName(node: JSXNameNode | undefined): string | null {
|
|
80
|
+
if (!node) return null
|
|
81
|
+
if (node.type === 'JSXIdentifier' && node.name) return node.name
|
|
82
|
+
if (node.type === 'JSXMemberExpression') {
|
|
83
|
+
const object = getJSXName(node.object)
|
|
84
|
+
const property = getJSXName(node.property)
|
|
85
|
+
return object && property ? `${object}.${property}` : null
|
|
86
|
+
}
|
|
87
|
+
return null
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function hasAttribute(node: JSXOpeningElementNode, attrName: string): boolean {
|
|
91
|
+
return (
|
|
92
|
+
node.attributes?.some((attr) => {
|
|
93
|
+
if (attr.type !== 'JSXAttribute') return false
|
|
94
|
+
return attr.name?.type === 'JSXIdentifier' && attr.name.name === attrName
|
|
95
|
+
}) ?? false
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export default function sootsimJumpToSourceBabelPlugin(
|
|
100
|
+
api: BabelApi,
|
|
101
|
+
options: SootsimJumpToSourceBabelOptions = {},
|
|
102
|
+
) {
|
|
103
|
+
const attrName = options.attrName || 'srcloc'
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
name: 'sootsim-jump-to-source',
|
|
107
|
+
visitor: {
|
|
108
|
+
JSXOpeningElement(path: JSXOpeningElementPath, state: BabelPluginState) {
|
|
109
|
+
if (options.enabled === false) return
|
|
110
|
+
|
|
111
|
+
const filename = state.file?.opts?.filename
|
|
112
|
+
if (!filename || !shouldStampFile(filename, options)) return
|
|
113
|
+
|
|
114
|
+
const node = path.node
|
|
115
|
+
const tagName = getJSXName(node.name)
|
|
116
|
+
if (!tagName || tagName === 'Fragment' || tagName.endsWith('.Fragment')) return
|
|
117
|
+
if (hasAttribute(node, attrName)) return
|
|
118
|
+
|
|
119
|
+
const loc = node.loc?.start
|
|
120
|
+
if (!loc) return
|
|
121
|
+
|
|
122
|
+
const source = `${normalizeSourcePath(filename)}:${loc.line}:${loc.column + 1}`
|
|
123
|
+
node.attributes ??= []
|
|
124
|
+
node.attributes.push(
|
|
125
|
+
api.types.jsxAttribute(
|
|
126
|
+
api.types.jsxIdentifier(attrName),
|
|
127
|
+
api.types.stringLiteral(source),
|
|
128
|
+
),
|
|
129
|
+
)
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { sootsimJumpToSourceBabelPlugin }
|