typebulb 0.55.5 → 0.56.1
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 +4 -4
- package/SKILL.md +6 -6
- package/dist/agents/claude/client.js +69 -66
- package/dist/agents/codex/client.js +67 -64
- package/dist/agents/pi/client.js +208 -205
- package/dist/index.js +264 -256
- package/dist/render.js +35 -32
- package/dist/resolver/semver.d.ts +2 -0
- package/dist/resolver/semver.d.ts.map +1 -1
- package/dist/resolver/semver.js +5 -1
- package/dist/resolver/semver.js.map +1 -1
- package/dist/resolver/versionResolver.d.ts.map +1 -1
- package/dist/resolver/versionResolver.js +6 -4
- package/dist/resolver/versionResolver.js.map +1 -1
- package/dist/servers.js +67 -64
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ This document is dedicated to the typebulb CLI. At its core, it compiles and ser
|
|
|
30
30
|
- **`tb.infer()`** — one-shot runtime inference over the bulb's own blocks (`infer.md` + `data.txt` → `insight.json`), with a confirmation modal, streaming, and share/save of a good run. Requires `--trust`.
|
|
31
31
|
- **Restricted by default** — A plain `npx typebulb my-app.bulb.md` runs with no filesystem or `server.ts` (like typebulb.com); `--trust` grants those for a run. Trust is **remembered**: `typebulb trust <file>` elevates a bulb once so later plain runs are trusted, `untrust` revokes it, and `--no-trust` forces a Restricted run.
|
|
32
32
|
- **Predict trust** — `typebulb predict <file>` reports the capability a bulb will likely need (fs / AI / `server.ts`) without running it, so you can decide on `--trust` up front rather than after a mid-run permission failure.
|
|
33
|
-
- **Agent mirror** — a browser view of your coding agent's sessions, rendering inline bulbs, KaTeX, and mermaid live in the conversation, plus runs/stops local bulbs. On Pi it also carries a prompt panel, so the user can drive their pi sessions from the mirror directly. `typebulb agent` brings it up, auto-detecting your harness (Claude Code, Codex, or Pi).
|
|
33
|
+
- **Agent mirror** — a browser view of your coding agent's sessions, rendering inline bulbs, KaTeX, and mermaid live in the conversation, plus runs/stops local bulbs. On Pi it also carries a prompt panel, so the user can drive their pi sessions from the mirror directly. `typebulb agent` brings it up, auto-detecting your harness (Claude Code, Codex, or Pi). Bulbs the agent runs open where the mirror is: in VS Code beside it, or in your browser.
|
|
34
34
|
- **Proxying Claude** — the agent mirror lets you proxy Claude with a model from [OpenRouter](https://openrouter.ai). This will apply to your project only.
|
|
35
35
|
|
|
36
36
|
## Usage
|
|
@@ -68,7 +68,7 @@ typebulb trust [file] Remember a bulb as trusted (no arg: list trusted
|
|
|
68
68
|
typebulb untrust <file> Forget a bulb's trust (back to Restricted)
|
|
69
69
|
typebulb --no-watch <file> Disable hot reload
|
|
70
70
|
typebulb --port 3333 <file> Bind this exact port (fails if taken)
|
|
71
|
-
typebulb --no-open <file>
|
|
71
|
+
typebulb --no-open <file> Open nothing at launch, not even inside VS Code
|
|
72
72
|
typebulb --mode <name> <file> Also load .env.<name> on top of .env / .env.local
|
|
73
73
|
typebulb --batch <name> <file> Scope tb.dir + relative tb.fs paths to <bulb-folder>/batches/<name> (batch runs)
|
|
74
74
|
typebulb --trust <file> Grant filesystem + AI + server.ts for this run (default: Restricted)
|
|
@@ -258,7 +258,7 @@ The agent mirror turns that block into a live, sandboxed app, with a *breakout
|
|
|
258
258
|
|
|
259
259
|
### Emitting a local bulb
|
|
260
260
|
|
|
261
|
-
- **Launch once, and share the printed link.** `npx typebulb foo.bulb.md` starts the server (
|
|
261
|
+
- **Launch once, and share the printed link.** `npx typebulb foo.bulb.md` starts the server (the page opens where the agent mirror is; with no mirror page open, VS Code's terminal and agent shells print the link to share rather than opening a tab). The link stays good: a bulb keeps its port across runs, keyed to the filename, so re-share it after a rename.
|
|
262
262
|
- **In an agent shell, background the launch** (Claude Code: `run_in_background`; pi: run it plainly). The server runs until stopped, so a foreground launch only holds your turn.
|
|
263
263
|
|
|
264
264
|
### Iterating on a local bulb
|
|
@@ -281,7 +281,7 @@ That one launch *is* the loop: the server watches the file, so every save recomp
|
|
|
281
281
|
- **Measuring layout** — `typebulb send <file> 'tb:rect button "Pass"'` prints that control's viewport-relative rect as JSON (`{x, y, width, height, viewport}`, integers): how big something ended up, whether two things align, whether one is offscreen — arithmetic on rects, no probe handler. Only what the outline names is measurable; give a structural container a `role` **and** an `aria-label` (`<div role="group" aria-label="board">`) to measure it — a label alone leaves it invisible.
|
|
282
282
|
- **Acting on the page** — `typebulb send <file> 'tb:click button "Pass"'` clicks the one control matching that role and name (exact, else a unique case-insensitive substring) and replies with a fresh snapshot; `tb:set combobox "strength" = hard` is the same for form controls (checkboxes and radios take `tb:click`). A disabled, readonly, or covered target is an error naming it — that silence is the bug class these verbs catch. The click is synthetic, so a handler needing user activation (a clipboard write, fullscreen) does nothing and reports nothing. Needs exactly one page open, and the reply is the immediate frame (slow work: follow up with `tb:snapshot`). Only what the outline names is targetable: real `<button>`s and labeled controls, not an `onClick` `<div>`.
|
|
283
283
|
- **Poking state** — for state beyond what a form control expresses (`tb:set` covers those), author a set-handler up front: a `tb.onMessage` branch that takes a data payload (JSON arrives parsed), applies it to your state — committing the change if your framework needs an explicit step — and returns the new state: `typebulb send <file> '{"set":"speed","value":2}' --wait` prints it. In React, register it in an effect so it closes over the setters (the returned unsubscribe is the cleanup).
|
|
284
|
-
- **A page must be open** — the CLI runs no browser of its own, so every client-side check waits on a real window
|
|
284
|
+
- **A page must be open** — the CLI runs no browser of its own, so every client-side check waits on a real window. The CLI opens one where the agent mirror is open (in VS Code beside it, or in the user's browser): at launch, and again from `send --wait` or any `tb:` verb that finds none, so a tab the user closed reopens and the message delivers. Run the bulb, edit, `send --wait`; never relaunch for a page. With no mirror page open anywhere, nothing can open one: end your turn with the link, arming `typebulb wait <file> --match "[page] connected"` in the background first; the user opening it is your wake-up. Never open a window at the user yourself.
|
|
285
285
|
- **Reading a canvas** — `typebulb send <file> tb:png` writes the page's canvas to a PNG (a stable per-bulb path under `~/.typebulb/`, overwritten each read) and prints the path — rendered truth for a bulb whose output is drawn, with no probe handler and nothing disturbed. One canvas needs no name; several take `tb:png "<name>"` — an `aria-label` on the canvas, or `role="img" aria-label="…"` on the container when a chart library owns the canvas. A WebGL/WebGPU canvas without `preserveDrawingBuffer` reads back blank outside its own frame — capture during the draw instead.
|
|
286
286
|
|
|
287
287
|
### Emitting a server-only bulb
|
package/SKILL.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: typebulb
|
|
3
3
|
description: "Author and run Typebulb bulbs — single-file markdown apps (TypeScript/TSX) that run locally via `npx typebulb` (full power: filesystem, database, `server.ts`, `tb.ai`) or render live inline in your coding agent's session through Typebulb's agent mirror (sandboxed, client-only). A bulb can be a visual widget (chart, simulation, diagram, calculator, UI), a full-stack tool with a Node backend, or an AI app that calls models at runtime. Covers the bulb format, the `tb.*` API, trust, and the local run/inline workflow. Use when the user wants a bulb, a quick local tool (visual, backend-backed, or AI-powered), or something visual rendered inline in the conversation."
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.56.1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
> Generated from typebulb v0.
|
|
7
|
+
> Generated from typebulb v0.56.1. `npx typebulb agent` prints the running version alongside the path to its packaged SKILL.md: if that version is newer than this one, replace this file with that one.
|
|
8
8
|
|
|
9
9
|
# typebulb
|
|
10
10
|
|
|
@@ -38,7 +38,7 @@ This document is dedicated to the typebulb CLI. At its core, it compiles and ser
|
|
|
38
38
|
- **`tb.infer()`** — one-shot runtime inference over the bulb's own blocks (`infer.md` + `data.txt` → `insight.json`), with a confirmation modal, streaming, and share/save of a good run. Requires `--trust`.
|
|
39
39
|
- **Restricted by default** — A plain `npx typebulb my-app.bulb.md` runs with no filesystem or `server.ts` (like typebulb.com); `--trust` grants those for a run. Trust is **remembered**: `typebulb trust <file>` elevates a bulb once so later plain runs are trusted, `untrust` revokes it, and `--no-trust` forces a Restricted run.
|
|
40
40
|
- **Predict trust** — `typebulb predict <file>` reports the capability a bulb will likely need (fs / AI / `server.ts`) without running it, so you can decide on `--trust` up front rather than after a mid-run permission failure.
|
|
41
|
-
- **Agent mirror** — a browser view of your coding agent's sessions, rendering inline bulbs, KaTeX, and mermaid live in the conversation, plus runs/stops local bulbs. On Pi it also carries a prompt panel, so the user can drive their pi sessions from the mirror directly. `typebulb agent` brings it up, auto-detecting your harness (Claude Code, Codex, or Pi).
|
|
41
|
+
- **Agent mirror** — a browser view of your coding agent's sessions, rendering inline bulbs, KaTeX, and mermaid live in the conversation, plus runs/stops local bulbs. On Pi it also carries a prompt panel, so the user can drive their pi sessions from the mirror directly. `typebulb agent` brings it up, auto-detecting your harness (Claude Code, Codex, or Pi). Bulbs the agent runs open where the mirror is: in VS Code beside it, or in your browser.
|
|
42
42
|
- **Proxying Claude** — the agent mirror lets you proxy Claude with a model from [OpenRouter](https://openrouter.ai). This will apply to your project only.
|
|
43
43
|
|
|
44
44
|
## Usage
|
|
@@ -76,7 +76,7 @@ typebulb trust [file] Remember a bulb as trusted (no arg: list trusted
|
|
|
76
76
|
typebulb untrust <file> Forget a bulb's trust (back to Restricted)
|
|
77
77
|
typebulb --no-watch <file> Disable hot reload
|
|
78
78
|
typebulb --port 3333 <file> Bind this exact port (fails if taken)
|
|
79
|
-
typebulb --no-open <file>
|
|
79
|
+
typebulb --no-open <file> Open nothing at launch, not even inside VS Code
|
|
80
80
|
typebulb --mode <name> <file> Also load .env.<name> on top of .env / .env.local
|
|
81
81
|
typebulb --batch <name> <file> Scope tb.dir + relative tb.fs paths to <bulb-folder>/batches/<name> (batch runs)
|
|
82
82
|
typebulb --trust <file> Grant filesystem + AI + server.ts for this run (default: Restricted)
|
|
@@ -266,7 +266,7 @@ The agent mirror turns that block into a live, sandboxed app, with a *breakout
|
|
|
266
266
|
|
|
267
267
|
### Emitting a local bulb
|
|
268
268
|
|
|
269
|
-
- **Launch once, and share the printed link.** `npx typebulb foo.bulb.md` starts the server (
|
|
269
|
+
- **Launch once, and share the printed link.** `npx typebulb foo.bulb.md` starts the server (the page opens where the agent mirror is; with no mirror page open, VS Code's terminal and agent shells print the link to share rather than opening a tab). The link stays good: a bulb keeps its port across runs, keyed to the filename, so re-share it after a rename.
|
|
270
270
|
- **In an agent shell, background the launch** (Claude Code: `run_in_background`; pi: run it plainly). The server runs until stopped, so a foreground launch only holds your turn.
|
|
271
271
|
|
|
272
272
|
### Iterating on a local bulb
|
|
@@ -289,7 +289,7 @@ That one launch *is* the loop: the server watches the file, so every save recomp
|
|
|
289
289
|
- **Measuring layout** — `typebulb send <file> 'tb:rect button "Pass"'` prints that control's viewport-relative rect as JSON (`{x, y, width, height, viewport}`, integers): how big something ended up, whether two things align, whether one is offscreen — arithmetic on rects, no probe handler. Only what the outline names is measurable; give a structural container a `role` **and** an `aria-label` (`<div role="group" aria-label="board">`) to measure it — a label alone leaves it invisible.
|
|
290
290
|
- **Acting on the page** — `typebulb send <file> 'tb:click button "Pass"'` clicks the one control matching that role and name (exact, else a unique case-insensitive substring) and replies with a fresh snapshot; `tb:set combobox "strength" = hard` is the same for form controls (checkboxes and radios take `tb:click`). A disabled, readonly, or covered target is an error naming it — that silence is the bug class these verbs catch. The click is synthetic, so a handler needing user activation (a clipboard write, fullscreen) does nothing and reports nothing. Needs exactly one page open, and the reply is the immediate frame (slow work: follow up with `tb:snapshot`). Only what the outline names is targetable: real `<button>`s and labeled controls, not an `onClick` `<div>`.
|
|
291
291
|
- **Poking state** — for state beyond what a form control expresses (`tb:set` covers those), author a set-handler up front: a `tb.onMessage` branch that takes a data payload (JSON arrives parsed), applies it to your state — committing the change if your framework needs an explicit step — and returns the new state: `typebulb send <file> '{"set":"speed","value":2}' --wait` prints it. In React, register it in an effect so it closes over the setters (the returned unsubscribe is the cleanup).
|
|
292
|
-
- **A page must be open** — the CLI runs no browser of its own, so every client-side check waits on a real window
|
|
292
|
+
- **A page must be open** — the CLI runs no browser of its own, so every client-side check waits on a real window. The CLI opens one where the agent mirror is open (in VS Code beside it, or in the user's browser): at launch, and again from `send --wait` or any `tb:` verb that finds none, so a tab the user closed reopens and the message delivers. Run the bulb, edit, `send --wait`; never relaunch for a page. With no mirror page open anywhere, nothing can open one: end your turn with the link, arming `typebulb wait <file> --match "[page] connected"` in the background first; the user opening it is your wake-up. Never open a window at the user yourself.
|
|
293
293
|
- **Reading a canvas** — `typebulb send <file> tb:png` writes the page's canvas to a PNG (a stable per-bulb path under `~/.typebulb/`, overwritten each read) and prints the path — rendered truth for a bulb whose output is drawn, with no probe handler and nothing disturbed. One canvas needs no name; several take `tb:png "<name>"` — an `aria-label` on the canvas, or `role="img" aria-label="…"` on the container when a chart library owns the canvas. A WebGL/WebGPU canvas without `preserveDrawingBuffer` reads back blank outside its own frame — capture during the draw instead.
|
|
294
294
|
|
|
295
295
|
### Emitting a server-only bulb
|