typebulb 0.20.1 → 0.20.2

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.
@@ -1191,6 +1191,10 @@ a.server-port:hover { text-decoration: underline; }
1191
1191
  padding-left: .6rem;
1192
1192
  border-left: 2px solid color-mix(in srgb, var(--fg) 18%, transparent);
1193
1193
  opacity: .82;
1194
+ /* Same column geometry as .messages — the tools-only negative-margin rule assumes a 1rem gap. */
1195
+ display: flex;
1196
+ flex-direction: column;
1197
+ gap: 1rem;
1194
1198
  /* --turn-color is a custom property and INHERITS — the stub's own .bubble.turn-N sets it, so without
1195
1199
  this reset every nested orphan bubble inherits the parent turn's color and redraws the stripe
1196
1200
  (the recursive-line bug). Reset to transparent so .bubble::before falls back to no stripe here. */
@@ -1191,6 +1191,10 @@ a.server-port:hover { text-decoration: underline; }
1191
1191
  padding-left: .6rem;
1192
1192
  border-left: 2px solid color-mix(in srgb, var(--fg) 18%, transparent);
1193
1193
  opacity: .82;
1194
+ /* Same column geometry as .messages — the tools-only negative-margin rule assumes a 1rem gap. */
1195
+ display: flex;
1196
+ flex-direction: column;
1197
+ gap: 1rem;
1194
1198
  /* --turn-color is a custom property and INHERITS — the stub's own .bubble.turn-N sets it, so without
1195
1199
  this reset every nested orphan bubble inherits the parent turn's color and redraws the stripe
1196
1200
  (the recursive-line bug). Reset to transparent so .bubble::before falls back to no stripe here. */
package/dist/index.js CHANGED
@@ -1375,5 +1375,5 @@ Shutting down...`);try{a.shutdownSwitcher?.()}catch{}g.close(),v?.(),s(),await y
1375
1375
  `),St({target:r,onChange:async()=>{try{console.log("Re-running..."),await a()}catch(c){console.error("Error:",c)}}}))}import{Console as o0}from"node:console";Le();async function Wm(r,e,t,n,s){f0();try{let p=Xt(await J(),r)[0];p&&si(p.pid,ve(p.pid).offset)}catch{}let i=ke(t),{bulb:o,config:a}=await me(r);o.server||hn("This bulb has no **server.ts** block; nothing to call."),rt(i,r,o.server);let c;try{c=await Zr(o.server,s,n,a.dependencies)}catch(p){hn(p instanceof Error?p.message:String(p))}let l=gi(c,e.fn);if(!l){let p=[...Object.keys(c).filter(y=>typeof c[y]=="function"),...Object.keys(pc)];hn(`Function '${e.fn}' not found. Available: ${p.length?p.join(", "):"(none)"}.`)}let f=await a0(e);if(yi(l)){try{for await(let p of l(...f))await Km(JSON.stringify(p,Hm)+`
1376
1376
  `)}catch(p){hn(p instanceof Error?p.stack??p.message:String(p))}return Jm(0)}let u;try{u=await l(...f)}catch(p){hn(p instanceof Error?p.stack??p.message:String(p))}let d=u0(u);d!==void 0&&await Km(d+`
1377
1377
  `),Jm(0)}function Jm(r){process.exitCode=r,setTimeout(()=>process.exit(r),2e3).unref?.()}async function a0(r){if(r.hasArgsFlag){let e=r.argsJson??"";return e==="-"&&(e=await d0()),l0(e)}return c0(r.positional)}function c0(r){return r.map(e=>{try{return JSON.parse(e)}catch{return e}})}function l0(r){let e;try{e=JSON.parse(r)}catch(t){throw new Error(`--args must be a JSON array: ${t instanceof Error?t.message:String(t)}`)}if(!Array.isArray(e))throw new Error(`--args must be a JSON array, got ${e===null?"null":typeof e}`);return e}function u0(r){if(r!==void 0)return JSON.stringify(r,Hm,2)}function Hm(r,e){return typeof e=="bigint"?e.toString():e}function hn(r){process.stderr.write(r+`
1378
- `),process.exit(1)}function f0(){let r=new o0(process.stderr,process.stderr);console.log=r.log.bind(r),console.info=r.info.bind(r),console.debug=r.debug.bind(r),console.dir=r.dir.bind(r)}function Km(r){return new Promise((e,t)=>{process.stdout.write(r,n=>n?t(n):e())})}async function d0(){let r=[];for await(let e of process.stdin)r.push(e);return Buffer.concat(r).toString("utf-8")}var $c="0.20.1";function Vm(r,e){r||(console.error(`This bulb runs server-side Node code (server.ts), which --trust must authorize:
1378
+ `),process.exit(1)}function f0(){let r=new o0(process.stderr,process.stderr);console.log=r.log.bind(r),console.info=r.info.bind(r),console.debug=r.debug.bind(r),console.dir=r.dir.bind(r)}function Km(r){return new Promise((e,t)=>{process.stdout.write(r,n=>n?t(n):e())})}async function d0(){let r=[];for await(let e of process.stdin)r.push(e);return Buffer.concat(r).toString("utf-8")}var $c="0.20.2";function Vm(r,e){r||(console.error(`This bulb runs server-side Node code (server.ts), which --trust must authorize:
1379
1379
  ${e}`),process.exit(1))}async function p0(){let r=Hc(process.argv.slice(2));if(r.version&&(console.log(`typebulb ${$c}`),process.exit(0)),r.help&&(Vc(),process.exit(0)),Tp(),r.subcommand==="logs"){await Bp(r.file||void 0,{follow:r.follow,clear:r.clear,run:r.run,lines:r.lines});return}if(r.subcommand==="wait"){await jp(r.file||void 0,{match:r.match,timeoutSec:r.timeoutSec});return}if(r.subcommand==="stop"){r.stopScope?await qp(r.stopScope):await Fp(r.file||void 0);return}if(r.subcommand==="send"){await Jp(r.file,r.sendMessage,r.sendWaitMs??0);return}if(r.subcommand==="skill"){await $p($c);return}if(r.subcommand==="models"){await Ip(r.mode);return}if(r.subcommand==="agent"){await(r.agentTarget?Fm(r):_p($c));return}if(r.subcommand==="trust"||r.subcommand==="untrust"){await np(r.file||void 0,r.subcommand==="trust");return}let e;if(!r.file||r.file==="."){let l=await Kd(process.cwd());l||(console.error("No .bulb.md file found in current directory"),process.exit(1)),e=l}else e=De.resolve(r.file);await Ym.access(e).then(()=>!0,()=>!1)||(Gt().includes(r.file)&&(console.error(`To open the ${r.file} agent mirror, run: npx typebulb agent:${r.file}`),process.exit(1)),console.error(`File not found: ${e}`),process.exit(1)),e.endsWith(".bulb.md")||(console.error("File must have .bulb.md extension"),process.exit(1));let n=r.file&&r.file!=="."?r.file:De.relative(process.cwd(),e)||De.basename(e),s=`npx typebulb --trust ${n.includes(" ")?`"${n}"`:n}`;if(r.subcommand==="predict"){await rp(e,s);return}let i=!r.noTrust&&gt(e);i&&!r.trust&&console.log("trust: granted from memory (run `typebulb untrust` to revoke)"),r.trust=r.noTrust?!1:r.trust||i;let o;try{o=await me(e)}catch{}let a;if(r.local){o&&!(r.local.name in(o.config.dependencies??{}))&&(console.error(`--replace: '${r.local.name}' is not a dependency in this bulb's config.json; nothing to replace.`),process.exit(1)),o&&r.subcommand!=="call"&&(!o.bulb.code||r.server)&&console.warn("warning: --replace has no effect in server mode (the override is client-only).");try{a=await Kc(r.local)}catch(l){console.error(l instanceof Error?l.message:String(l)),process.exit(1)}console.log(`replace: ${a.name} \u2192 ${De.relative(process.cwd(),a.dir)||"."}`)}if(r.subcommand==="check"){await tp(e,a);return}let c=De.dirname(e);if(r.subcommand==="call"){Vm(r.trust,s),await Wm(e,{fn:r.fn,positional:r.callArgs,argsJson:r.argsJson,hasArgsFlag:r.hasArgsFlag},r.mode,a,c);return}if(o&&o.bulb.server&&(gs(o.bulb)||r.server)){Vm(r.trust,s),await Um(e,r.watch,r.mode,a,c);return}await Gp(e,r,s,a,c)}p0().catch(r=>{console.error("Error:",r.message),process.exit(1)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typebulb",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "Typebulb CLI to run single-file markdown apps called bulbs, either as standalone web apps or embedded in agent responses.",
5
5
  "license": "MIT",
6
6
  "repository": {