typebulb 0.11.8 → 0.11.9
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 +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -261,7 +261,7 @@ The host owns a bulb's **width**; you own its **height**.
|
|
|
261
261
|
|
|
262
262
|
**Width is the host's.** Standalone, a bulb fills its browser window; in the agent viewer, an embed fits the conversation column by default, with a per-embed *spread* toggle to the full transcript width — and a cap so a tall embed doesn't run away down the transcript. Don't set a width or guess how much room you'll get.
|
|
263
263
|
|
|
264
|
-
**Height follows your content.** Prose, a form, a chart flow to their natural height — set none. A full-bleed canvas
|
|
264
|
+
**Height follows your content.** Prose, a form, a chart flow to their natural height — set none. A full-bleed canvas has no natural height: give its root `height: 100dvh` **and** a pixel floor like `min-height: 420px`. Both are needed — `100dvh` fills its own window if the bulb is broken out, and the floor holds a definite band when embedded. Without the floor a bare `100dvh` collapses to zero embedded, because the viewer sizes an embed to its content height and `100dvh` gives it nothing to measure against.
|
|
265
265
|
|
|
266
266
|
**When embedded, keep vertical space on the root in `padding`, not `margin`.** The viewer measures an embed by `document.body.scrollHeight`, and the runtime makes `body` a block formatting context so a root child's vertical margin (yours, or a UA default like `<h1>`'s) is contained rather than escaping the measurement — so you no longer have to get this exactly right. It's still cleaner to keep the horizontal `auto` for centering and move the vertical space to padding:
|
|
267
267
|
|
package/dist/index.js
CHANGED
|
@@ -735,6 +735,6 @@ ${Zi}
|
|
|
735
735
|
`);async function w(){await(await import("esbuild")).build({entryPoints:[O.join(c,"client","index.ts")],bundle:!0,platform:"browser",format:"esm",outfile:O.join(a,"client.js")});for(let T of["styles.css","index.html"])qa(O.join(c,T),O.join(a,T))}let D;if(r.watch&&n){let E=Ga(c),T=!1;D=Jt({dir:E?c:a,onChange:async()=>{if(!T){T=!0;try{E&&await w(),console.log(`Viewer rebuilt. Browser reloading...
|
|
736
736
|
`),n.emit("reload")}catch(p){console.error("Viewer rebuild failed:",p instanceof Error?p.message:p)}finally{T=!1}}}})}r.open&&await Pe(h);let M=async()=>{console.log(`
|
|
737
737
|
Shutting down...`),m.close(),D?.(),t(),await et(process.pid),process.exit(0)};process.on("SIGINT",M),process.on("SIGTERM",M)}import*as eo from"path";import{EventEmitter as Xa}from"events";async function to(r,e,t,n,s){let o=ne(t),i=!1,a=async()=>{let{bulb:c,config:l}=await G(r);i||(Ae(o,r,c.server),i=!0),await fr(c.server,s,n,l.dependencies)};if(console.log(`Running ${eo.basename(r)}...`),await a(),e){console.log(`Watching for changes...
|
|
738
|
-
`);let c=new Xa;c.on("reload",async()=>{try{console.log("Re-running..."),await a()}catch(l){console.error("Error:",l)}}),Wt({bulbPath:r,emitter:c})}}var ro="0.11.
|
|
738
|
+
`);let c=new Xa;c.on("reload",async()=>{try{console.log("Re-running..."),await a()}catch(l){console.error("Error:",l)}}),Wt({bulbPath:r,emitter:c})}}var ro="0.11.9";async function Qa(){let r=Zr(process.argv.slice(2));if(r.version&&(console.log(`typebulb ${ro}`),process.exit(0)),r.help&&(en(),process.exit(0)),r.subcommand==="logs"){await us(r.file||void 0,{follow:r.follow,lines:r.lines});return}if(r.subcommand==="stop"){r.stopScope?await fs(r.stopScope):await ps(r.file||void 0);return}if(r.subcommand==="skill"){await as(ro);return}if(r.subcommand==="models"){await os(r.mode);return}if(r.subcommand==="agent"){if(!r.agentTarget){await ts();return}Bn(r.agentTarget)||(console.error(`Unknown agent '${r.agentTarget}'. Known: ${yr().join(", ")}.`),process.exit(1));let l=await Sr(process.cwd(),r.agentTarget);if(l){console.log(`Viewer '${r.agentTarget}' is already running for this project:
|
|
739
739
|
${l.url}`),r.open&&await Pe(l.url);return}await Zs(r);return}if(r.subcommand==="trust"||r.subcommand==="untrust"){await Vn(r.file||void 0,r.subcommand==="trust");return}let e;if(!r.file||r.file==="."){let l=await In(process.cwd());l||(console.error("No .bulb.md file found in current directory"),process.exit(1)),e=l}else e=X.resolve(r.file);await no.access(e).then(()=>!0,()=>!1)||(yr().includes(r.file)&&(console.error(`To open the ${r.file} agent viewer, 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:X.relative(process.cwd(),e)||X.basename(e),s=`npx typebulb --trust ${n.includes(" ")?`"${n}"`:n}`;if(r.subcommand==="predict"){await Hn(e,s);return}let o=!r.noTrust&&le(e);o&&!r.trust&&console.log("trust: granted from memory (run `typebulb untrust` to revoke)"),r.trust=r.noTrust?!1:r.trust||o;let i;try{i=await G(e)}catch{}let a;if(r.local){i&&!(r.local.name in(i.config.dependencies??{}))&&(console.error(`--replace: '${r.local.name}' is not a dependency in this bulb's config.json; nothing to replace.`),process.exit(1)),i&&(!i.bulb.code||r.server)&&console.warn("warning: --replace has no effect in server mode (the override is client-only).");try{a=await Xr(r.local)}catch(l){console.error(l instanceof Error?l.message:String(l)),process.exit(1)}console.log(`replace: ${a.name} \u2192 ${X.relative(process.cwd(),a.dir)||"."}`)}if(r.subcommand==="check"){await Jn(e,a);return}let c=X.dirname(e);if(i&&i.bulb.server&&(!i.bulb.code||r.server)){r.trust||(console.error(`This bulb runs server-side Node code (server.ts), which --trust must authorize:
|
|
740
740
|
${s}`),process.exit(1)),await to(e,r.watch,r.mode,a,c);return}await Ps(e,r,s,a,c)}Qa().catch(r=>{console.error("Error:",r.message),process.exit(1)});
|