typebulb 0.9.4 → 0.9.6
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 +5 -1
- package/dist/bulbs/claude.bulb.md +3260 -0
- package/dist/index.js +85 -56
- package/dist/render.js +23 -4
- package/dist/servers.d.ts +7 -0
- package/dist/servers.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,9 @@ npm install -g typebulb
|
|
|
43
43
|
|
|
44
44
|
```
|
|
45
45
|
typebulb [file.bulb.md] Run a bulb (defaults to .bulb.md in cwd)
|
|
46
|
+
typebulb claude Launch claude.bulb, the built-in session viewer
|
|
46
47
|
typebulb check [file.bulb.md] Type-check a bulb without running it
|
|
48
|
+
typebulb predict [file] Report the capability a bulb probably needs, without running it
|
|
47
49
|
typebulb logs [file|pid] Print a running bulb's captured console (-f follow, -n N tail)
|
|
48
50
|
typebulb stop [file|pid] Stop a running bulb (no arg: list running servers)
|
|
49
51
|
typebulb trust [file] Remember a bulb as trusted (no arg: list trusted bulbs)
|
|
@@ -51,6 +53,7 @@ typebulb untrust <file> Forget a bulb's trust (back to sandboxed)
|
|
|
51
53
|
typebulb --no-watch <file> Disable hot reload
|
|
52
54
|
typebulb --port 3333 <file> Custom port
|
|
53
55
|
typebulb --no-open <file> Don't auto-open browser
|
|
56
|
+
typebulb --mode <name> <file> Also load .env.<name> on top of .env / .env.local
|
|
54
57
|
typebulb --trust <file> Grant filesystem + AI + server.ts for this run (default: sandboxed)
|
|
55
58
|
typebulb --no-trust <file> Force sandboxed even if the bulb is remembered-trusted
|
|
56
59
|
typebulb --server <file> Run server.ts only, no web server (needs --trust)
|
|
@@ -63,7 +66,7 @@ typebulb --version Show version
|
|
|
63
66
|
|
|
64
67
|
- **Server-side code** — Add a `**server.ts**` section; exported functions become callable from the browser via `tb.server.<name>()` (e.g., `export async function query(...)` → `await tb.server.query(...)`). Requires `--trust`.
|
|
65
68
|
- **CLI logging** — `tb.server.log(...)` prints to the CLI's stdout
|
|
66
|
-
- **Env files** — `.env`
|
|
69
|
+
- **Env files** — `.env` / `.env.local` load from cwd, `.env.local` overriding `.env` (an exported shell var wins over both). `--mode <name>` adds `.env.<name>` to switch environments (local/staging/prod); a startup line reports which keys loaded from where.
|
|
67
70
|
- **Server mode** — `--server` runs only the `**server.ts**` section in Node, skipping the web server. Bulbs with only `**server.ts**` (no `**code.tsx**`) use this mode automatically.
|
|
68
71
|
- **Type-check without running** — `typebulb check <file>` runs `tsc --noEmit` against the bulb and exits non-zero on errors. Useful for AI editors / CI.
|
|
69
72
|
- **Filesystem access** — `tb.fs.read()` (UTF-8 text), `tb.fs.readBytes()` (raw `Uint8Array`), and `tb.fs.write()` (text or bytes) for local files. Requires `--trust`.
|
|
@@ -73,6 +76,7 @@ typebulb --version Show version
|
|
|
73
76
|
- **Local caching** — Resolver metadata and CDN package bytes are cached under `~/.typebulb/cache/`, so repeat runs don't re-hit the network and warm runs work offline.
|
|
74
77
|
- **AI calls** — `tb.ai()` for general-purpose AI (chatbots, agents, experiments). `tb.models()` lists available models. Set API keys in `.env` (see below). Requires `--trust`.
|
|
75
78
|
- **Sandboxed 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 sandboxed for a single run.
|
|
79
|
+
- **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.
|
|
76
80
|
|
|
77
81
|
## AI Setup
|
|
78
82
|
|