Lines 1238-1278javascript
1238 if (de.style.overflowX !== ox) de.style.overflowX = ox;
1239 if (de.scrollHeight > de.clientHeight + 1) {
1240 if (de.style.overflowY !== 'auto' && !confirm) confirm = setTimeout(showYScroll, 100);
1242 if (confirm) { clearTimeout(confirm); confirm = 0; }
1243 if (de.style.overflowY !== 'hidden') de.style.overflowY = 'hidden';
1245 post({ __typebulbEmbed: true, kind: 'height', height: Math.ceil(document.body.scrollHeight) });
1247 var update = function () { if (!raf) raf = requestAnimationFrame(apply); };
1248 de.style.overflow = 'hidden';
1249 // Run at load (module mounted \u2192 real content, not the empty pre-mount body that would
1250 // collapse the frame and snap back). Observe BOTH body (content growth) and the root
1251 // element (the viewport \u2014 so a host resize/cap re-syncs overflow on the next frame).
1252 window.addEventListener('load', function () {
1254 if (window.ResizeObserver) {
1255 try { var ro = new ResizeObserver(update); ro.observe(document.body); ro.observe(de); } catch (e) {}
1259</script>`;function vv(r){let e={};for(let[t,n]of Object.entries(r))e[t]=n.startsWith("https://")?"/proxy/"+n:n;return e}import*as Rs from"fs/promises";import*as Cs from"path";import{existsSync as Rd,readFileSync as Sv}from"fs";import{execFile as xv}from"child_process";import{promisify as kv}from"util";import{satisfies as Ev}from"semver";var Av=kv(xv);async function Ns(r,e,t){let s=r.map(o=>Tv(o,t)).filter(o=>!Pv(o,e));if(s.length===0)return;await Rs.mkdir(e,{recursive:!0});let i=Cs.join(e,"package.json");Rd(i)||await Rs.writeFile(i,JSON.stringify({name:"typebulb-server",private:!0})),console. ...
1260`,"utf8"),await Z.writeFile(Q.join(e,"code.tsx"),r.code,"utf8"),await Z.writeFile(Q.join(e,"tb.d.ts"),Aa,"utf8"),{dir:e}}function Uv(r,e,t=[]){return{compilerOptions:{target:"es2023",module:"esnext",moduleResolution:
1261`,"utf8"),{dir:e}}function zv(r){let e={target:"es2023",module:"esnext",moduleResolution:"bundler",lib:["ES2023"],types:["node"],strict:!0,noEmit:!0,skipLibCheck:!0,esModuleInterop:!0,allowSyntheticDefaultImports:!0,forceConsistentCasingInFileNames:!0};if(r?.typesAbs){let t=i=>i.replace(/\\/g,"/"),n=t(Re.dirname(r.typesAbs)),s=t(r.typesAbs).replace(/\.d\.ts$/,"");e.paths={[r.name]:[s],[`${r.name}/*`]:[`${n}/*`]}}return{compilerOptions:e,include:["server.ts","tb.d.ts"]}}async function Qv(r,e){if(!Yv(r)){await le.mkdir(e,{recursive:!0});return}await le.rm(e,{recursive:!0,force:!0});let t=process ...
1262`))console.log(`${e} ${n}`);return r.length>0}function rS(r,e){return new Promise(t=>{let n=Xv(process.execPath,[r,"--noEmit"],{cwd:e}),s="";n.stdout?.on("data",i=>{s+=i.toString()}),n.stderr?.on("data",i=>{s+=i.toString()}),n.on("close",i=>t({stdout:s,exitCode:i??1}))})}var nS=eS(import.meta.url);function sS(r){let e=n=>{try{let s=nS.resolve("typescript/package.json",{paths:n}),i=Ve.join(Ve.dirname(s),"lib","tsc.js");return tS(i)?i:void 0}catch{return}},t=e(r);if(t)return t;try{let n=Zv("npm root -g",{encoding:"utf8"}).trim();return e([n])}catch{return}}Bs();Xr();async function Wd(r,e){let{bu ...
HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/index.jsView on unpkg · L1258 1264description: ${YS(za(),"utf8").trim().replace(/\s+/g," ")}
1266---`}function XS(r){return`> Generated from typebulb v${r}. If \`npx typebulb --version\` reports a newer version, re-run \`npx typebulb skill\` to refresh this file.`}function yp(r,e){return`${QS(e)}
1271`}function Qa(r){let e=t=>n=>r?`\x1B[${t}m${n}\x1B[0m`:n;return{lit:e("38;5;70"),litLink:e("4;38;5;70"),brand:e("38;5;135")}}async function vp(r){let e=mp(process.cwd());if("ambiguous"in e){let t=await ZS(r,e.ambiguous);return t?bp(r,t):ex(r,e.ambiguous)}return bp(r,e.name)}async function bp(r,e){let t,n;try{t=await sp(e)}catch(f){n=f instanceof Error?f.message:String(f)}let{lit:s,litLink:i,brand:o}=Qa(process.stdout.isTTY===!0),a=[" Read the authoring skill before writing a bulb:",` \u2022 ${s("npx typebulb skill")} \u2014 assembles one SKILL.md`," \u2022 or, open its parts:",` ...
1273`)}async function ZS(r,e){if(!process.stdin.isTTY||!process.stdout.isTTY)return;let{lit:t,brand:n}=Qa(!0),s=[` ${n(`typebulb v${r}`)}`," This project has sessions for more than one agent harness.",...e.map((o,a)=>` ${t(String(a+1))}) ${o}`),""];process.stdout.write(s.join(`
1275`);let i=wp.createInterface({input:process.stdin,output:process.stdout});try{let o=(await new Promise(c=>i.question(" Open which? [1]: ",c))).trim();if(o==="")return e[0];let a=Number(o);return Number.isInteger(a)&&a>=1&&a<=e.length?e[a-1]:e.find(c=>c===o.toLowerCase())}finally{i.close()}}function ex(r,e){let{lit:t,brand:n}=Qa(process.stdout.isTTY===!0),s=[` ${n(`typebulb v${r}`)}`," This project has sessions for more than one agent harness."," Open the mirror for the one you want:",...e.map(i=>` \u2022 ${t(`npx typebulb agent:${i}`)}`),""];process.stdout.write(s.join(`
1277`)}import{readFileSync as tx,existsSync as rx}from"fs";import*as Ne from"path";function nx(r){return[...r?[`.env.${r}.local`,`.env.${r}`]:[],".env.local",".env"]}function Ee(r,e=process.cwd()){let t={},n=[];for(let s of nx(r)){let i;try{i=tx(Ne.resolve(e,s),"utf-8")}catch{continue}n.push(s);for(let[o,a]of sx(i))process.env[o]===void 0&&(process.env[o]=a,t[o]=s)}return{mode:r,sources:t,loaded:n}}function*sx(r){for(let e of r.split(`
1278`)){let t=e.trim();if(!t||t.startsWith("#"))continue;let n=t.indexOf("=");if(n===-1)continue;let s=t.slice(0,n).trim(),i=t.slice(n+1).trim();(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),yield[s,i]}}function ix(r){let e=new Set,t=/process\.env\.([A-Za-z_$][\w$]*)|process\.env\[\s*['"]([^'"]+)['"]\s*\]/g;for(let n;n=t.exec(r);)e.add(n[1]??n[2]);return[...e]}function Ge(r,e,t){let{sources:n,mode:s,loaded:i}=r,o=process.cwd(),a=Ne.dirname(e),c=`(mode: ${s??"none"})`,l=t?ix(t):[],f=l.filter(p=>n[p]).map(p=>`${p} \u2190 ${n[p]}`);f.length?console.log(`e ...
Long lines were clipped for display.