typebulb 0.59.0 → 0.59.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 +2 -2
- package/SKILL.md +4 -4
- package/dist/agents/claude/client.js +12 -0
- package/dist/agents/codex/client.js +12 -0
- package/dist/agents/pi/client.js +45 -33
- package/dist/dts/tbTypings.d.ts.map +1 -1
- package/dist/dts/tbTypings.js +2 -0
- package/dist/dts/tbTypings.js.map +1 -1
- package/dist/index.js +251 -237
- package/dist/render.js +12 -0
- package/dist/servers.js +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This document is dedicated to the typebulb CLI. At its core, it compiles and ser
|
|
|
21
21
|
- **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.
|
|
22
22
|
- **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.
|
|
23
23
|
- **Type-check without running** — `typebulb check <file>` runs `tsc --noEmit` against the bulb: non-zero exit with diagnostics on errors, a one-line all-clear on stderr on success.
|
|
24
|
-
- **Filesystem access** — `tb.fs.read()` (UTF-8 text), `tb.fs.readBytes()` (raw `Uint8Array`), `tb.fs.write()` (text or bytes),
|
|
24
|
+
- **Filesystem access** — `tb.fs.read()` (UTF-8 text), `tb.fs.readBytes()` (raw `Uint8Array`), `tb.fs.write()` (text or bytes), `tb.fs.list()` (a folder's immediate children as `{ name, dir, mtime }`), and `tb.fs.remove()` (a file, or a folder and its contents); relative paths land in the bulb's own folder, and nothing reaches outside it (`../` throws). Requires `--trust`.
|
|
25
25
|
- **Hot reload** — Recompiles on save and refreshes the browser (on by default; disable with `--no-watch`)
|
|
26
26
|
- **Package resolution** — Client dependencies are automatically resolved by generating import maps (same resolver as typebulb.com). Server dependencies are automatically installed via npm.
|
|
27
27
|
- **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.
|
|
@@ -202,7 +202,7 @@ everywhere.
|
|
|
202
202
|
| `tb.aiAccess()` | What backs `tb.ai` — `'own' \| 'courtesy' \| 'none'` | |
|
|
203
203
|
| `tb.log(...)` | Print to the CLI's stdout (read back with `typebulb logs`); falls back to the browser console when no CLI serves the page | |
|
|
204
204
|
| `tb.onMessage(cb)` | Receive a value pushed in from the terminal by `typebulb send`; a non-`undefined` return becomes the reply `send --wait` prints — inert when inline (no sender) | |
|
|
205
|
-
| `tb.fs.read/readBytes/write/list` | Read, write, and
|
|
205
|
+
| `tb.fs.read/readBytes/write/list/remove` | Read, write, list, and remove local files | yes |
|
|
206
206
|
| `tb.dir` | The bulb's folder (absolute path), where relative `tb.fs` paths land | |
|
|
207
207
|
| `tb.server.<name>(...)` | Call a function exported from the `server.ts` block | yes |
|
|
208
208
|
| `tb.ai({ messages, … })` | General-purpose AI call (chat, agents) | yes |
|
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.59.
|
|
4
|
+
version: 0.59.1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
> Generated from typebulb v0.59.
|
|
7
|
+
> Generated from typebulb v0.59.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
|
|
|
@@ -29,7 +29,7 @@ This document is dedicated to the typebulb CLI. At its core, it compiles and ser
|
|
|
29
29
|
- **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.
|
|
30
30
|
- **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.
|
|
31
31
|
- **Type-check without running** — `typebulb check <file>` runs `tsc --noEmit` against the bulb: non-zero exit with diagnostics on errors, a one-line all-clear on stderr on success.
|
|
32
|
-
- **Filesystem access** — `tb.fs.read()` (UTF-8 text), `tb.fs.readBytes()` (raw `Uint8Array`), `tb.fs.write()` (text or bytes),
|
|
32
|
+
- **Filesystem access** — `tb.fs.read()` (UTF-8 text), `tb.fs.readBytes()` (raw `Uint8Array`), `tb.fs.write()` (text or bytes), `tb.fs.list()` (a folder's immediate children as `{ name, dir, mtime }`), and `tb.fs.remove()` (a file, or a folder and its contents); relative paths land in the bulb's own folder, and nothing reaches outside it (`../` throws). Requires `--trust`.
|
|
33
33
|
- **Hot reload** — Recompiles on save and refreshes the browser (on by default; disable with `--no-watch`)
|
|
34
34
|
- **Package resolution** — Client dependencies are automatically resolved by generating import maps (same resolver as typebulb.com). Server dependencies are automatically installed via npm.
|
|
35
35
|
- **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.
|
|
@@ -210,7 +210,7 @@ everywhere.
|
|
|
210
210
|
| `tb.aiAccess()` | What backs `tb.ai` — `'own' \| 'courtesy' \| 'none'` | |
|
|
211
211
|
| `tb.log(...)` | Print to the CLI's stdout (read back with `typebulb logs`); falls back to the browser console when no CLI serves the page | |
|
|
212
212
|
| `tb.onMessage(cb)` | Receive a value pushed in from the terminal by `typebulb send`; a non-`undefined` return becomes the reply `send --wait` prints — inert when inline (no sender) | |
|
|
213
|
-
| `tb.fs.read/readBytes/write/list` | Read, write, and
|
|
213
|
+
| `tb.fs.read/readBytes/write/list/remove` | Read, write, list, and remove local files | yes |
|
|
214
214
|
| `tb.dir` | The bulb's folder (absolute path), where relative `tb.fs` paths land | |
|
|
215
215
|
| `tb.server.<name>(...)` | Call a function exported from the `server.ts` block | yes |
|
|
216
216
|
| `tb.ai({ messages, … })` | General-purpose AI call (chat, agents) | yes |
|
|
@@ -1218,6 +1218,18 @@ ${V9t}
|
|
|
1218
1218
|
});
|
|
1219
1219
|
await failIfNotOk(resp, 'list', path);
|
|
1220
1220
|
return resp.json();
|
|
1221
|
+
},
|
|
1222
|
+
// Remove a file, or a folder and its contents. Throws on a missing path; the bulb's folder
|
|
1223
|
+
// itself is refused.
|
|
1224
|
+
remove: async (path) => {
|
|
1225
|
+
if (isFramed) throw inlineErr('tb.fs');
|
|
1226
|
+
const resp = await fetch('/__fs/remove', {
|
|
1227
|
+
method: 'POST',
|
|
1228
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1229
|
+
body: JSON.stringify({ path })
|
|
1230
|
+
});
|
|
1231
|
+
await failIfNotOk(resp, 'remove', path);
|
|
1232
|
+
return true;
|
|
1221
1233
|
}
|
|
1222
1234
|
};
|
|
1223
1235
|
|
|
@@ -1218,6 +1218,18 @@ ${q9t}
|
|
|
1218
1218
|
});
|
|
1219
1219
|
await failIfNotOk(resp, 'list', path);
|
|
1220
1220
|
return resp.json();
|
|
1221
|
+
},
|
|
1222
|
+
// Remove a file, or a folder and its contents. Throws on a missing path; the bulb's folder
|
|
1223
|
+
// itself is refused.
|
|
1224
|
+
remove: async (path) => {
|
|
1225
|
+
if (isFramed) throw inlineErr('tb.fs');
|
|
1226
|
+
const resp = await fetch('/__fs/remove', {
|
|
1227
|
+
method: 'POST',
|
|
1228
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1229
|
+
body: JSON.stringify({ path })
|
|
1230
|
+
});
|
|
1231
|
+
await failIfNotOk(resp, 'remove', path);
|
|
1232
|
+
return true;
|
|
1221
1233
|
}
|
|
1222
1234
|
};
|
|
1223
1235
|
|