Lines 1234-1274javascript
1234 if (de.style.overflowX !== ox) de.style.overflowX = ox;
1235 if (de.scrollHeight > de.clientHeight + 1) {
1236 if (de.style.overflowY !== 'auto' && !confirm) confirm = setTimeout(showYScroll, 100);
1238 if (confirm) { clearTimeout(confirm); confirm = 0; }
1239 if (de.style.overflowY !== 'hidden') de.style.overflowY = 'hidden';
1241 post({ __typebulbEmbed: true, kind: 'height', height: Math.ceil(document.body.scrollHeight) });
1243 var update = function () { if (!raf) raf = requestAnimationFrame(apply); };
1244 de.style.overflow = 'hidden';
1245 // Run at load (module mounted \u2192 real content, not the empty pre-mount body that would
1246 // collapse the frame and snap back). Observe BOTH body (content growth) and the root
1247 // element (the viewport \u2014 so a host resize/cap re-syncs overflow on the next frame).
1248 window.addEventListener('load', function () {
1250 if (window.ResizeObserver) {
1251 try { var ro = new ResizeObserver(update); ro.observe(document.body); ro.observe(de); } catch (e) {}
1255</script>`;function wv(r){let e={};for(let[t,n]of Object.entries(r))e[t]=n.startsWith("https://")?"/proxy/"+n:n;return e}import*as Ns from"fs/promises";import*as Rs from"path";import{existsSync as Cd,readFileSync as vv}from"fs";import{execFile as Sv}from"child_process";import{promisify as xv}from"util";import{satisfies as kv}from"semver";var Ev=xv(Sv);async function _s(r,e,t){let s=r.map(o=>Av(o,t)).filter(o=>!Tv(o,e));if(s.length===0)return;await Ns.mkdir(e,{recursive:!0});let i=Rs.join(e,"package.json");Cd(i)||await Ns.writeFile(i,JSON.stringify({name:"typebulb-server",private:!0})),console. ...
1256`,"utf8"),await ee.writeFile(X.join(e,"code.tsx"),r.code,"utf8"),await ee.writeFile(X.join(e,"tb.d.ts"),Ta,"utf8"),{dir:e}}function qv(r,e,t=[]){return{compilerOptions:{target:"es2023",module:"esnext",moduleResolution:"bundler",lib:Uv
1257`,"utf8"),{dir:e}}function Gv(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 zv(r,e){if(!Vv(r)){await le.mkdir(e,{recursive:!0});return}await le.rm(e,{recursive:!0,force:!0});let t=process ...
1258`))console.log(`${e} ${n}`);return r.length>0}function tS(r,e){return new Promise(t=>{let n=Qv(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 rS=Zv(import.meta.url);function nS(r){let e=n=>{try{let s=rS.resolve("typescript/package.json",{paths:n}),i=Ve.join(Ve.dirname(s),"lib","tsc.js");return eS(i)?i:void 0}catch{return}},t=e(r);if(t)return t;try{let n=Xv("npm root -g",{encoding:"utf8"}).trim();return e([n])}catch{return}}js();Xr();async function Kd(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 · L1254 1260description: ${VS(za(),"utf8").trim().replace(/\s+/g," ")}
1262---`}function QS(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 gp(r,e){return`${zS(e)}
1267`}async function wp(r){let e=await hp(process.cwd());if("ambiguous"in e){let t=await XS(r,e.ambiguous);return t?yp(r,t):ZS(r,e.ambiguous)}return yp(r,e.name)}async function yp(r,e){let t,n;try{t=await np(e)}catch(f){n=f instanceof Error?f.message:String(f)}let s=process.stdout.isTTY===!0,i=f=>p=>s?`\x1B[${f}m${p}\x1B[0m`:p,o=i("1;92"),a=i("1;4;92"),c=i("38;5;135"),l=[" Read the authoring skill before writing a bulb:",` \u2022 ${o("npx typebulb skill")} \u2014 assembles one SKILL.md`," \u2022 or, open its parts:",` ${o(za())}`,` ${o(Zs())}`],d=t?[" Agent mirror i ...
1269`)}async function XS(r,e){if(!process.stdin.isTTY||!process.stdout.isTTY)return;let t=a=>c=>`\x1B[${a}m${c}\x1B[0m`,n=t("1;92"),i=[` ${t("38;5;135")(`typebulb v${r}`)}`," This project has sessions for more than one agent harness.",...e.map((a,c)=>` ${n(String(c+1))}) ${a}`),""];process.stdout.write(i.join(`
1271`);let o=bp.createInterface({input:process.stdin,output:process.stdout});try{let a=(await new Promise(l=>o.question(" Open which? [1]: ",l))).trim();if(a==="")return e[0];let c=Number(a);return Number.isInteger(c)&&c>=1&&c<=e.length?e[c-1]:e.find(l=>l===a.toLowerCase())}finally{o.close()}}function ZS(r,e){let t=process.stdout.isTTY===!0,n=a=>c=>t?`\x1B[${a}m${c}\x1B[0m`:c,s=n("1;92"),o=[` ${n("38;5;135")(`typebulb v${r}`)}`," This project has sessions for more than one agent harness."," Open the mirror for the one you want:",...e.map(a=>` \u2022 ${s(`npx typebulb agent:${a}`)}`),""] ...
1273`)}import{readFileSync as ex,existsSync as tx}from"fs";import*as Ne from"path";function rx(r){return[...r?[`.env.${r}.local`,`.env.${r}`]:[],".env.local",".env"]}function Ee(r,e=process.cwd()){let t={},n=[];for(let s of rx(r)){let i;try{i=ex(Ne.resolve(e,s),"utf-8")}catch{continue}n.push(s);for(let[o,a]of nx(i))process.env[o]===void 0&&(process.env[o]=a,t[o]=s)}return{mode:r,sources:t,loaded:n}}function*nx(r){for(let e of r.split(`
1274`)){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 sx(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?sx(t):[],d=l.filter(p=>n[p]).map(p=>`${p} \u2190 ${n[p]}`);d.length?console.log(`e ...
Long lines were clipped for display.