typebulb 0.62.0 → 0.62.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.
- package/README.md +6 -4
- package/SKILL.md +8 -6
- package/dist/agents/claude/client.js +205 -205
- package/dist/agents/claude/styles.css +33 -35
- package/dist/agents/codex/client.js +228 -228
- package/dist/agents/codex/styles.css +33 -35
- package/dist/agents/pi/client.js +212 -212
- package/dist/agents/pi/styles.css +33 -35
- package/dist/index.js +313 -288
- package/dist/servers.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,9 +64,11 @@ typebulb stop [file|pid|agent] Stop a running bulb or mirror (no arg: list this
|
|
|
64
64
|
typebulb stop --bulbs Stop this project's bulbs; the agent mirror keeps running
|
|
65
65
|
typebulb stop --agent Stop this project's agent mirror; its bulbs keep running
|
|
66
66
|
typebulb stop --global Stop every running bulb and mirror, all projects (housekeeping)
|
|
67
|
+
typebulb restart [file|pid|agent] Relaunch running servers on this version, flags and port kept (no arg: this project's bulbs and mirror)
|
|
67
68
|
typebulb trust [file] Remember a bulb as trusted (no arg: list trusted bulbs)
|
|
68
69
|
typebulb untrust <file> Forget a bulb's trust (back to Restricted)
|
|
69
|
-
typebulb status [agent] A sub-agent's status: what it waits on, its commands
|
|
70
|
+
typebulb status [agent] A sub-agent's status: what it waits on, its commands and files (no arg: the session's overview)
|
|
71
|
+
typebulb babysit Watch your sub-agents silently; print and exit when one needs you (run it in the background — the exit is your wake-up)
|
|
70
72
|
typebulb --no-watch <file> Disable hot reload
|
|
71
73
|
typebulb --no-open <file> Open nothing at launch, not even inside VS Code
|
|
72
74
|
typebulb --mode <name> <file> Also load .env.<name> on top of .env / .env.local
|
|
@@ -242,7 +244,7 @@ The agent mirror turns that block into a live, sandboxed app, with a *breakout
|
|
|
242
244
|
|
|
243
245
|
**An inline bulb's outcome reads back — and can wake you.** The mirror forwards each inline bulb's outcome to `typebulb logs agent`: `[inline <name> vN] ok`, or its compile/runtime error verbatim — so when one breaks, pull the error from the log instead of asking the user to copy-paste.
|
|
244
246
|
|
|
245
|
-
- **For an inline bulb worth verifying, arm `typebulb wait agent --match "[inline <name>"` before ending your turn.** On Claude Code that's the Bash tool's `run_in_background`; on pi run the command plainly — it is backgrounded for you: never shell `&`, never redirect its output; on Codex run it in the *foreground before ending the turn*, bounded with `--timeout 120`
|
|
247
|
+
- **For an inline bulb worth verifying, arm `typebulb wait agent --match "[inline <name>"` before ending your turn.** On Claude Code that's the Bash tool's `run_in_background`; on pi run the command plainly — it is backgrounded for you: never shell `&`, never redirect its output; on Codex run it in the *foreground before ending the turn*, bounded with `--timeout 120`, through `exec_command`, and while it still runs, poll it with `write_stdin` until it exits (a yield only returns the call early; it never kills the wait) — the render streams mid-turn. The render happens after the turn flushes, and the line the wake prints *is* the verdict — `ok` or the error, captured at the source, no separate state to read back.
|
|
246
248
|
- **`--match` is a literal substring, not a regex** — copy the form verbatim, leading `[` and all (don't escape or close the bracket; the open `[inline <name>` is intentional, so it matches every version).
|
|
247
249
|
- **The `vN` counts your emits under that `name:`** — after a re-emit, a wake tagged with an *older* `vN` is a leftover line from the version you just replaced, not a verdict on your fix; ignore it and re-arm the same command (the re-arm resumes past the stale line and delivers the new version's).
|
|
248
250
|
- **On `ok`, stay silent** — the user already sees the bulb (a clean `ok` may not wake you at all: silence is success); only an error earns a reply, fixed by re-emitting under the same `name:`.
|
|
@@ -250,7 +252,7 @@ The agent mirror turns that block into a live, sandboxed app, with a *breakout
|
|
|
250
252
|
|
|
251
253
|
### Wake-on-event
|
|
252
254
|
|
|
253
|
-
`typebulb wait` turns a background task into a subscription. It blocks until the target server logs a new line (`--match <substr>` filters), prints it, and exits — and since an agent harness re-invokes the agent when a background task finishes, the exit *is* the wake-up (Claude Code and pi
|
|
255
|
+
`typebulb wait` turns a background task into a subscription. It blocks until the target server logs a new line (`--match <substr>` filters), prints it, and exits — and since an agent harness re-invokes the agent when a background task finishes, the exit *is* the wake-up (Claude Code and pi). On Codex, where a process exit wakes nothing, add `--wake` (experimental): the wait then starts your next turn itself, which inside Codex's sandbox may need elevated permissions. It resumes where your last `wait` or `call` on that target left off, so an event that lands while you're acting — or before the wait attaches — still fires it immediately; arm order doesn't matter. It parks until the event. Exit `2` means it gave up before any event arrived (re-arm if you still care, or move on); exit `3` means the server died.
|
|
254
256
|
|
|
255
257
|
**The turn-based loop** (a game, an approval flow): a bulb whose `server.ts` does `console.log` on each user action is the event channel. Per turn — act via `typebulb call`, arm `wait <file> --match <tag>` in the background, end your turn; on wake, read state with `typebulb call <file> <getState>` (never parse it from the log line) and repeat. **`call` always boots a fresh `server.ts` instance** — it never attaches to the running bulb's server — so any state shared between the page and your calls must live on disk (load/save it in each export), not in `server.ts` module memory. A bulb's uncaught browser errors land in the same log as `[runtime error] …`, so the wake channel also catches your bulb breaking. A run whose page closes never completes, so the wait ends itself when that happens (exit 3, the code a stopped server gives) rather than parking on a tag nothing can log. For inline bulbs, the same subscription is `typebulb wait agent` on the mirror — see [Emitting an inline bulb](#emitting-an-inline-bulb).
|
|
256
258
|
|
|
@@ -322,7 +324,7 @@ The host owns light/dark; you style for both.
|
|
|
322
324
|
- **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.
|
|
323
325
|
- **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.
|
|
324
326
|
- **See what's already running** — `typebulb logs` with no argument lists every running bulb and mirror; check it before launching anything.
|
|
325
|
-
- **Checking on sub-agents you spawned** — `typebulb status` is your session's overview
|
|
327
|
+
- **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, so handle it and arm it again.
|
|
326
328
|
- **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.
|
|
327
329
|
- **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).
|
|
328
330
|
- **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.62.
|
|
4
|
+
version: 0.62.2
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
> Generated from typebulb v0.62.
|
|
7
|
+
> Generated from typebulb v0.62.2. `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
|
|
|
@@ -72,9 +72,11 @@ typebulb stop [file|pid|agent] Stop a running bulb or mirror (no arg: list this
|
|
|
72
72
|
typebulb stop --bulbs Stop this project's bulbs; the agent mirror keeps running
|
|
73
73
|
typebulb stop --agent Stop this project's agent mirror; its bulbs keep running
|
|
74
74
|
typebulb stop --global Stop every running bulb and mirror, all projects (housekeeping)
|
|
75
|
+
typebulb restart [file|pid|agent] Relaunch running servers on this version, flags and port kept (no arg: this project's bulbs and mirror)
|
|
75
76
|
typebulb trust [file] Remember a bulb as trusted (no arg: list trusted bulbs)
|
|
76
77
|
typebulb untrust <file> Forget a bulb's trust (back to Restricted)
|
|
77
|
-
typebulb status [agent] A sub-agent's status: what it waits on, its commands
|
|
78
|
+
typebulb status [agent] A sub-agent's status: what it waits on, its commands and files (no arg: the session's overview)
|
|
79
|
+
typebulb babysit Watch your sub-agents silently; print and exit when one needs you (run it in the background — the exit is your wake-up)
|
|
78
80
|
typebulb --no-watch <file> Disable hot reload
|
|
79
81
|
typebulb --no-open <file> Open nothing at launch, not even inside VS Code
|
|
80
82
|
typebulb --mode <name> <file> Also load .env.<name> on top of .env / .env.local
|
|
@@ -250,7 +252,7 @@ The agent mirror turns that block into a live, sandboxed app, with a *breakout
|
|
|
250
252
|
|
|
251
253
|
**An inline bulb's outcome reads back — and can wake you.** The mirror forwards each inline bulb's outcome to `typebulb logs agent`: `[inline <name> vN] ok`, or its compile/runtime error verbatim — so when one breaks, pull the error from the log instead of asking the user to copy-paste.
|
|
252
254
|
|
|
253
|
-
- **For an inline bulb worth verifying, arm `typebulb wait agent --match "[inline <name>"` before ending your turn.** On Claude Code that's the Bash tool's `run_in_background`; on pi run the command plainly — it is backgrounded for you: never shell `&`, never redirect its output; on Codex run it in the *foreground before ending the turn*, bounded with `--timeout 120`
|
|
255
|
+
- **For an inline bulb worth verifying, arm `typebulb wait agent --match "[inline <name>"` before ending your turn.** On Claude Code that's the Bash tool's `run_in_background`; on pi run the command plainly — it is backgrounded for you: never shell `&`, never redirect its output; on Codex run it in the *foreground before ending the turn*, bounded with `--timeout 120`, through `exec_command`, and while it still runs, poll it with `write_stdin` until it exits (a yield only returns the call early; it never kills the wait) — the render streams mid-turn. The render happens after the turn flushes, and the line the wake prints *is* the verdict — `ok` or the error, captured at the source, no separate state to read back.
|
|
254
256
|
- **`--match` is a literal substring, not a regex** — copy the form verbatim, leading `[` and all (don't escape or close the bracket; the open `[inline <name>` is intentional, so it matches every version).
|
|
255
257
|
- **The `vN` counts your emits under that `name:`** — after a re-emit, a wake tagged with an *older* `vN` is a leftover line from the version you just replaced, not a verdict on your fix; ignore it and re-arm the same command (the re-arm resumes past the stale line and delivers the new version's).
|
|
256
258
|
- **On `ok`, stay silent** — the user already sees the bulb (a clean `ok` may not wake you at all: silence is success); only an error earns a reply, fixed by re-emitting under the same `name:`.
|
|
@@ -258,7 +260,7 @@ The agent mirror turns that block into a live, sandboxed app, with a *breakout
|
|
|
258
260
|
|
|
259
261
|
### Wake-on-event
|
|
260
262
|
|
|
261
|
-
`typebulb wait` turns a background task into a subscription. It blocks until the target server logs a new line (`--match <substr>` filters), prints it, and exits — and since an agent harness re-invokes the agent when a background task finishes, the exit *is* the wake-up (Claude Code and pi
|
|
263
|
+
`typebulb wait` turns a background task into a subscription. It blocks until the target server logs a new line (`--match <substr>` filters), prints it, and exits — and since an agent harness re-invokes the agent when a background task finishes, the exit *is* the wake-up (Claude Code and pi). On Codex, where a process exit wakes nothing, add `--wake` (experimental): the wait then starts your next turn itself, which inside Codex's sandbox may need elevated permissions. It resumes where your last `wait` or `call` on that target left off, so an event that lands while you're acting — or before the wait attaches — still fires it immediately; arm order doesn't matter. It parks until the event. Exit `2` means it gave up before any event arrived (re-arm if you still care, or move on); exit `3` means the server died.
|
|
262
264
|
|
|
263
265
|
**The turn-based loop** (a game, an approval flow): a bulb whose `server.ts` does `console.log` on each user action is the event channel. Per turn — act via `typebulb call`, arm `wait <file> --match <tag>` in the background, end your turn; on wake, read state with `typebulb call <file> <getState>` (never parse it from the log line) and repeat. **`call` always boots a fresh `server.ts` instance** — it never attaches to the running bulb's server — so any state shared between the page and your calls must live on disk (load/save it in each export), not in `server.ts` module memory. A bulb's uncaught browser errors land in the same log as `[runtime error] …`, so the wake channel also catches your bulb breaking. A run whose page closes never completes, so the wait ends itself when that happens (exit 3, the code a stopped server gives) rather than parking on a tag nothing can log. For inline bulbs, the same subscription is `typebulb wait agent` on the mirror — see [Emitting an inline bulb](#emitting-an-inline-bulb).
|
|
264
266
|
|
|
@@ -330,7 +332,7 @@ The host owns light/dark; you style for both.
|
|
|
330
332
|
- **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.
|
|
331
333
|
- **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.
|
|
332
334
|
- **See what's already running** — `typebulb logs` with no argument lists every running bulb and mirror; check it before launching anything.
|
|
333
|
-
- **Checking on sub-agents you spawned** — `typebulb status` is your session's overview
|
|
335
|
+
- **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, so handle it and arm it again.
|
|
334
336
|
- **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.
|
|
335
337
|
- **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).
|
|
336
338
|
- **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.
|