typebulb 0.62.8 → 0.63.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 +12 -3
- package/SKILL.md +14 -5
- package/dist/agents/claude/client.js +244 -238
- package/dist/agents/claude/styles.css +55 -2
- package/dist/agents/codex/client.js +283 -277
- package/dist/agents/codex/styles.css +55 -2
- package/dist/agents/pi/client.js +271 -265
- package/dist/agents/pi/styles.css +55 -2
- package/dist/index.js +318 -311
- 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). Bulbs the agent runs open where the mirror is: in VS Code beside it, or in your browser.
|
|
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 and keeps a board of the questions an orchestrating agent asks the user. 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
|
|
@@ -69,7 +69,7 @@ typebulb trust [file] Remember a bulb as trusted (no arg: list trusted
|
|
|
69
69
|
typebulb untrust <file> Forget a bulb's trust (back to Restricted)
|
|
70
70
|
typebulb status [agent] A sub-agent's status: what it waits on, its commands and files (no arg: the session's overview)
|
|
71
71
|
typebulb status --slow <dur> When a call counts as slow for this session (default 3m)
|
|
72
|
-
typebulb babysit Watch your
|
|
72
|
+
typebulb babysit Watch your session silently; print and exit when a sub-agent or the user's answer needs you (run it in the background: each exit is one wake-up, so re-arm it after handling)
|
|
73
73
|
typebulb babysit --slow <dur> When a call counts as slow for this session (default 3m)
|
|
74
74
|
typebulb --no-watch <file> Disable hot reload
|
|
75
75
|
typebulb --no-open <file> Open nothing at launch, not even inside VS Code
|
|
@@ -295,6 +295,15 @@ A `**server.ts**` block with no `**code.tsx**` is a headless bulb — no UI, no
|
|
|
295
295
|
|
|
296
296
|
- **Invoke one export with `typebulb call <file> <fn> [args…] --trust`.** It boots, runs that export, prints the `return` as JSON to stdout, and exits — a fresh boot per call. Under `call`, logs (`console.log` / `tb.log`) go to stderr, so the JSON result owns stdout.
|
|
297
297
|
|
|
298
|
+
### Asking the user while you orchestrate
|
|
299
|
+
|
|
300
|
+
Tag a question in your reply and the mirror's board lists it, answerable with a click there or under the reply that asked.
|
|
301
|
+
|
|
302
|
+
- **Open a paragraph or list item with the tag:** `**Ask [<id>]:** <question> *Recommend:* <your pick>`. The recommendation becomes the answer button, so keep it to the pick and put the reasoning around it. A tag in a code fence or a `>` quote is an example, not an ask.
|
|
303
|
+
- **The answer wakes you through babysit** as `[answer <id> v<N>] …` (on another harness, arm `typebulb wait agent --match "[answer "`). Act on it, then close it in your next reply with `**Decided [<id>]:** …`, or `**Todo [<id>]:** …` if the user parked it.
|
|
304
|
+
- **An id's latest tag is its state.** `Done` and `Finding` are the other labels; ids are lowercase letters, digits and hyphens.
|
|
305
|
+
- **A sub-agent's brief feeds its row:** the board shows its first line, and a line `**Time box:** 20m` has babysit wake you once it runs past; a follow-up restarts the box only with a line of its own.
|
|
306
|
+
|
|
298
307
|
## Sizing
|
|
299
308
|
|
|
300
309
|
The host owns a bulb's **width**; you own its **height**.
|
|
@@ -326,7 +335,7 @@ The host owns light/dark; you style for both.
|
|
|
326
335
|
- **A bulb's working files land beside it automatically** — relative `tb.fs` paths resolve to the bulb's folder, in `code.tsx` and `server.ts` alike: `tb.fs.write('run.json')`, no path prefix, no mkdir.
|
|
327
336
|
- **Images & media: an `assets/` subfolder of the bulb's folder** (`birds.bulb.md` → `birds/assets/robin.png`) — `<img src="assets/robin.png">` just works (always that relative form, never `/assets/…`), every tier except inline. It holds what the bulb ships in order to run (e.g. images), never results.
|
|
328
337
|
- **See what's already running** — `typebulb logs` with no argument lists every running bulb and mirror; check it before launching anything.
|
|
329
|
-
- **Checking on sub-agents you spawned** — `typebulb status` is your session's overview (what's running, failure streaks, files to check before `git add`), and `typebulb status <id>` one agent's; run it before committing. Arm `typebulb babysit` in the background when you fan out (Claude Code: `run_in_background`; Codex: experimental, may need elevated permissions): it exits with a line when an agent needs you, because a background command wakes you only by exiting. Handle it and arm it again right away; the re-arm loses nothing, as what came up meanwhile fires at once and what it already reported doesn't repeat. Run babysit unpiped, and brief their checks unpiped or after `set -o pipefail`: a command piped into `tail` exits with `tail`'s code, hiding its own. Both take `--slow` (when a call counts as slow, default `3m`): set it to your project's pace once, e.g. `--slow 10m` where the test suite takes 8, and the session keeps it.
|
|
338
|
+
- **Checking on sub-agents you spawned** — `typebulb status` is your session's overview (what's running, failure streaks, files to check before `git add`), and `typebulb status <id>` one agent's; run it before committing. Arm `typebulb babysit` in the background when you fan out (Claude Code: `run_in_background`; Codex: experimental, may need elevated permissions): it exits with a line when an agent or the user's answer needs you, because a background command wakes you only by exiting. Handle it and arm it again right away; the re-arm loses nothing, as what came up meanwhile fires at once and what it already reported doesn't repeat. Run babysit unpiped, and brief their checks unpiped or after `set -o pipefail`: a command piped into `tail` exits with `tail`'s code, hiding its own. Both take `--slow` (when a call counts as slow, default `3m`): set it to your project's pace once, e.g. `--slow 10m` where the test suite takes 8, and the session keeps it.
|
|
330
339
|
- **Self-testing a local bulb** — To confirm a bulb works, run it, instrument with `tb.log(...)`, and read it back with `typebulb logs`. That's the loop to verify behaviour without asking the user to copy-paste console output. `tb.fs.write(...)` is handy for dumping large outputs.
|
|
331
340
|
- **Self-testing client code** — gate checks behind `tb.onMessage(m => { if (m === 'selftest') return run() })`, trigger with `typebulb send <file> selftest --wait`, and assert on the JSON reply — see [Interrogating the live page](#interrogating-the-live-page).
|
|
332
341
|
- **Probe handlers go in the first draft** — the selftest, readback, and set handlers you'll want later: adding one is an edit, and that hot reload destroys the very state you meant to inspect.
|
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.63.1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
> Generated from typebulb v0.
|
|
7
|
+
> Generated from typebulb v0.63.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). Bulbs the agent runs open where the mirror is: in VS Code beside it, or in your browser.
|
|
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 and keeps a board of the questions an orchestrating agent asks the user. 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
|
|
@@ -77,7 +77,7 @@ typebulb trust [file] Remember a bulb as trusted (no arg: list trusted
|
|
|
77
77
|
typebulb untrust <file> Forget a bulb's trust (back to Restricted)
|
|
78
78
|
typebulb status [agent] A sub-agent's status: what it waits on, its commands and files (no arg: the session's overview)
|
|
79
79
|
typebulb status --slow <dur> When a call counts as slow for this session (default 3m)
|
|
80
|
-
typebulb babysit Watch your
|
|
80
|
+
typebulb babysit Watch your session silently; print and exit when a sub-agent or the user's answer needs you (run it in the background: each exit is one wake-up, so re-arm it after handling)
|
|
81
81
|
typebulb babysit --slow <dur> When a call counts as slow for this session (default 3m)
|
|
82
82
|
typebulb --no-watch <file> Disable hot reload
|
|
83
83
|
typebulb --no-open <file> Open nothing at launch, not even inside VS Code
|
|
@@ -303,6 +303,15 @@ A `**server.ts**` block with no `**code.tsx**` is a headless bulb — no UI, no
|
|
|
303
303
|
|
|
304
304
|
- **Invoke one export with `typebulb call <file> <fn> [args…] --trust`.** It boots, runs that export, prints the `return` as JSON to stdout, and exits — a fresh boot per call. Under `call`, logs (`console.log` / `tb.log`) go to stderr, so the JSON result owns stdout.
|
|
305
305
|
|
|
306
|
+
### Asking the user while you orchestrate
|
|
307
|
+
|
|
308
|
+
Tag a question in your reply and the mirror's board lists it, answerable with a click there or under the reply that asked.
|
|
309
|
+
|
|
310
|
+
- **Open a paragraph or list item with the tag:** `**Ask [<id>]:** <question> *Recommend:* <your pick>`. The recommendation becomes the answer button, so keep it to the pick and put the reasoning around it. A tag in a code fence or a `>` quote is an example, not an ask.
|
|
311
|
+
- **The answer wakes you through babysit** as `[answer <id> v<N>] …` (on another harness, arm `typebulb wait agent --match "[answer "`). Act on it, then close it in your next reply with `**Decided [<id>]:** …`, or `**Todo [<id>]:** …` if the user parked it.
|
|
312
|
+
- **An id's latest tag is its state.** `Done` and `Finding` are the other labels; ids are lowercase letters, digits and hyphens.
|
|
313
|
+
- **A sub-agent's brief feeds its row:** the board shows its first line, and a line `**Time box:** 20m` has babysit wake you once it runs past; a follow-up restarts the box only with a line of its own.
|
|
314
|
+
|
|
306
315
|
## Sizing
|
|
307
316
|
|
|
308
317
|
The host owns a bulb's **width**; you own its **height**.
|
|
@@ -334,7 +343,7 @@ The host owns light/dark; you style for both.
|
|
|
334
343
|
- **A bulb's working files land beside it automatically** — relative `tb.fs` paths resolve to the bulb's folder, in `code.tsx` and `server.ts` alike: `tb.fs.write('run.json')`, no path prefix, no mkdir.
|
|
335
344
|
- **Images & media: an `assets/` subfolder of the bulb's folder** (`birds.bulb.md` → `birds/assets/robin.png`) — `<img src="assets/robin.png">` just works (always that relative form, never `/assets/…`), every tier except inline. It holds what the bulb ships in order to run (e.g. images), never results.
|
|
336
345
|
- **See what's already running** — `typebulb logs` with no argument lists every running bulb and mirror; check it before launching anything.
|
|
337
|
-
- **Checking on sub-agents you spawned** — `typebulb status` is your session's overview (what's running, failure streaks, files to check before `git add`), and `typebulb status <id>` one agent's; run it before committing. Arm `typebulb babysit` in the background when you fan out (Claude Code: `run_in_background`; Codex: experimental, may need elevated permissions): it exits with a line when an agent needs you, because a background command wakes you only by exiting. Handle it and arm it again right away; the re-arm loses nothing, as what came up meanwhile fires at once and what it already reported doesn't repeat. Run babysit unpiped, and brief their checks unpiped or after `set -o pipefail`: a command piped into `tail` exits with `tail`'s code, hiding its own. Both take `--slow` (when a call counts as slow, default `3m`): set it to your project's pace once, e.g. `--slow 10m` where the test suite takes 8, and the session keeps it.
|
|
346
|
+
- **Checking on sub-agents you spawned** — `typebulb status` is your session's overview (what's running, failure streaks, files to check before `git add`), and `typebulb status <id>` one agent's; run it before committing. Arm `typebulb babysit` in the background when you fan out (Claude Code: `run_in_background`; Codex: experimental, may need elevated permissions): it exits with a line when an agent or the user's answer needs you, because a background command wakes you only by exiting. Handle it and arm it again right away; the re-arm loses nothing, as what came up meanwhile fires at once and what it already reported doesn't repeat. Run babysit unpiped, and brief their checks unpiped or after `set -o pipefail`: a command piped into `tail` exits with `tail`'s code, hiding its own. Both take `--slow` (when a call counts as slow, default `3m`): set it to your project's pace once, e.g. `--slow 10m` where the test suite takes 8, and the session keeps it.
|
|
338
347
|
- **Self-testing a local bulb** — To confirm a bulb works, run it, instrument with `tb.log(...)`, and read it back with `typebulb logs`. That's the loop to verify behaviour without asking the user to copy-paste console output. `tb.fs.write(...)` is handy for dumping large outputs.
|
|
339
348
|
- **Self-testing client code** — gate checks behind `tb.onMessage(m => { if (m === 'selftest') return run() })`, trigger with `typebulb send <file> selftest --wait`, and assert on the JSON reply — see [Interrogating the live page](#interrogating-the-live-page).
|
|
340
349
|
- **Probe handlers go in the first draft** — the selftest, readback, and set handlers you'll want later: adding one is an edit, and that hot reload destroys the very state you meant to inspect.
|