typebulb 0.7.2 → 0.9.0
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/dist/index.js +166 -53
- package/dist/render.d.ts +28 -0
- package/dist/render.js +428 -0
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -47,7 +47,8 @@ typebulb check [file.bulb.md] Type-check a bulb without running it
|
|
|
47
47
|
typebulb --no-watch <file> Disable hot reload
|
|
48
48
|
typebulb --port 3333 <file> Custom port
|
|
49
49
|
typebulb --no-open <file> Don't auto-open browser
|
|
50
|
-
typebulb --
|
|
50
|
+
typebulb --trust <file> Grant filesystem + AI + server.ts (default: sandboxed)
|
|
51
|
+
typebulb --server <file> Run server.ts only, no web server (needs --trust)
|
|
51
52
|
typebulb --replace <name>=<path> Replace a dependency with a local build
|
|
52
53
|
typebulb --help Show help
|
|
53
54
|
typebulb --version Show version
|
|
@@ -55,17 +56,18 @@ typebulb --version Show version
|
|
|
55
56
|
|
|
56
57
|
## Features
|
|
57
58
|
|
|
58
|
-
- **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(...)`)
|
|
59
|
+
- **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`.
|
|
59
60
|
- **CLI logging** — `tb.server.log(...)` prints to the CLI's stdout
|
|
60
61
|
- **Env files** — `.env` and `.env.local` auto-loaded from cwd
|
|
61
62
|
- **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.
|
|
62
63
|
- **Type-check without running** — `typebulb check <file>` runs `tsc --noEmit` against the bulb and exits non-zero on errors. Useful for AI editors / CI.
|
|
63
|
-
- **Filesystem access** — `tb.fs.read()` (UTF-8 text), `tb.fs.readBytes()` (raw `Uint8Array`), and `tb.fs.write()` (text or bytes) for local files
|
|
64
|
+
- **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`.
|
|
64
65
|
- **Hot reload** — Recompiles on save and refreshes the browser (on by default; disable with `--no-watch`)
|
|
65
66
|
- **Package resolution** — Client dependencies are automatically resolved by generating import maps (same resolver as typebulb.com). Server dependencies are automatically installed via npm.
|
|
66
67
|
- **Replace dependency** — `--replace <name>=<path>` replaces a declared dependency with a local *built* package folder (browser-ready ESM, no external bare imports) instead of a CDN, for testing an unpublished build. Supplies both runtime bytes and types; applies to `run` and `check`. Under `--watch` the folder is watched and the browser reloads on rebuild (`--no-watch` freezes it). Dev-only; nothing is written to the bulb.
|
|
67
68
|
- **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.
|
|
68
|
-
- **AI calls** — `tb.ai()` for general-purpose AI (chatbots, agents, experiments). `tb.models()` lists available models. Set API keys in `.env` (see below).
|
|
69
|
+
- **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`.
|
|
70
|
+
- **Sandboxed by default** — A plain `npx typebulb my-app.bulb.md` runs with no filesystem, AI, or `server.ts` (like typebulb.com); `--trust` grants those to a bulb you've vetted.
|
|
69
71
|
|
|
70
72
|
## AI Setup
|
|
71
73
|
|