typebulb 0.51.3 → 0.52.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 +4 -4
- package/SKILL.md +6 -6
- package/dist/agents/claude/client.js +201 -200
- package/dist/agents/claude/styles.css +34 -10
- package/dist/agents/codex/client.js +203 -202
- package/dist/agents/codex/styles.css +34 -10
- package/dist/agents/pi/client.js +217 -216
- package/dist/agents/pi/styles.css +34 -10
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/protocol.d.ts +24 -0
- package/dist/ai/protocol.d.ts.map +1 -1
- package/dist/ai/protocol.js +15 -0
- package/dist/ai/protocol.js.map +1 -1
- package/dist/ai/providers/anthropic.d.ts +4 -0
- package/dist/ai/providers/anthropic.d.ts.map +1 -1
- package/dist/ai/providers/anthropic.js +32 -1
- package/dist/ai/providers/anthropic.js.map +1 -1
- package/dist/ai/providers/chatCompletions.d.ts +13 -0
- package/dist/ai/providers/chatCompletions.d.ts.map +1 -1
- package/dist/ai/providers/chatCompletions.js +19 -11
- package/dist/ai/providers/chatCompletions.js.map +1 -1
- package/dist/ai/providers/gemini.d.ts +10 -0
- package/dist/ai/providers/gemini.d.ts.map +1 -1
- package/dist/ai/providers/gemini.js +21 -2
- package/dist/ai/providers/gemini.js.map +1 -1
- package/dist/ai/providers/ollama.d.ts +3 -0
- package/dist/ai/providers/ollama.d.ts.map +1 -1
- package/dist/ai/providers/ollama.js +5 -1
- package/dist/ai/providers/ollama.js.map +1 -1
- package/dist/ai/providers/openAI.d.ts +12 -0
- package/dist/ai/providers/openAI.d.ts.map +1 -1
- package/dist/ai/providers/openAI.js +18 -1
- package/dist/ai/providers/openAI.js.map +1 -1
- package/dist/ai/providers/openRouter.d.ts +3 -0
- package/dist/ai/providers/openRouter.d.ts.map +1 -1
- package/dist/ai/providers/openRouter.js +5 -0
- package/dist/ai/providers/openRouter.js.map +1 -1
- package/dist/ai/sseParser.d.ts +13 -1
- package/dist/ai/sseParser.d.ts.map +1 -1
- package/dist/ai/sseParser.js +26 -5
- package/dist/ai/sseParser.js.map +1 -1
- package/dist/dts/tbTypings.d.ts.map +1 -1
- package/dist/dts/tbTypings.js +15 -4
- package/dist/dts/tbTypings.js.map +1 -1
- package/dist/index.js +254 -229
- package/dist/render.js +4 -3
- package/dist/servers.js +103 -102
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -420,10 +420,10 @@ Run `typebulb models` to list the models available for the providers specified.
|
|
|
420
420
|
Trusted bulbs can call AI providers **from their own code** at runtime, billed to your API keys.
|
|
421
421
|
|
|
422
422
|
```ts
|
|
423
|
-
tb.ai({ messages, system?, effort?, provider?, model?, webSearch? }) // → Promise<{ text }>
|
|
423
|
+
tb.ai({ messages, system?, effort?, provider?, model?, webSearch? }) // → Promise<{ text, usage? }>
|
|
424
424
|
```
|
|
425
425
|
|
|
426
|
-
Name the provider and model explicitly — `tb.ai({ provider: "openai", model: "gpt-5.6-luna", … })` — or rely on the defaults you set in `.env`. `webSearch` defaults **off**; pass `webSearch: true` to give the model a web-search tool (searches bill to your key).
|
|
426
|
+
Name the provider and model explicitly — `tb.ai({ provider: "openai", model: "gpt-5.6-luna", … })` — or rely on the defaults you set in `.env`. `webSearch` defaults **off**; pass `webSearch: true` to give the model a web-search tool (searches bill to your key). `usage` is the provider-reported token counts — `{ input, output, reasoning?, cacheRead? }`, reasoning included in `output` — absent when the provider reports none; use it to meter calls instead of estimating from text length.
|
|
427
427
|
|
|
428
428
|
### Reasoning effort
|
|
429
429
|
|
|
@@ -446,7 +446,7 @@ const { text } = await tb.ai({
|
|
|
446
446
|
|
|
447
447
|
### Streaming
|
|
448
448
|
|
|
449
|
-
`tb.ai.stream({ … })` is the streaming counterpart of `tb.ai()` — an async iterable of `{ kind: "text" | "reasoning", text }` deltas. `tb.ai()` (await the full text) is unchanged; reach for `.stream` only when a response is long enough to be worth showing as it arrives.
|
|
449
|
+
`tb.ai.stream({ … })` is the streaming counterpart of `tb.ai()` — an async iterable of `{ kind: "text" | "reasoning", text }` deltas, closed by one `{ kind: "usage", usage }` chunk with the call's token counts. `tb.ai()` (await the full text) is unchanged; reach for `.stream` only when a response is long enough to be worth showing as it arrives.
|
|
450
450
|
|
|
451
451
|
```ts
|
|
452
452
|
let answer = "";
|
|
@@ -455,7 +455,7 @@ for await (const c of tb.ai.stream({ messages })) {
|
|
|
455
455
|
}
|
|
456
456
|
```
|
|
457
457
|
|
|
458
|
-
Breaking the loop stops the stream; same options as `tb.ai()`. **`kind: "reasoning"` chunks require `effort: 1-4` and a thinking-capable model**.
|
|
458
|
+
Breaking the loop stops the stream; same options as `tb.ai()`. **`kind: "reasoning"` chunks require `effort: 1-4` and a thinking-capable model**. Match `kind` positively as above — a bare `else` that assumes "not reasoning means text" misreads the usage chunk.
|
|
459
459
|
|
|
460
460
|
### AI access
|
|
461
461
|
|
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.52.1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
> Generated from typebulb v0.
|
|
7
|
+
> Generated from typebulb v0.52.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
|
|
|
@@ -428,10 +428,10 @@ Run `typebulb models` to list the models available for the providers specified.
|
|
|
428
428
|
Trusted bulbs can call AI providers **from their own code** at runtime, billed to your API keys.
|
|
429
429
|
|
|
430
430
|
```ts
|
|
431
|
-
tb.ai({ messages, system?, effort?, provider?, model?, webSearch? }) // → Promise<{ text }>
|
|
431
|
+
tb.ai({ messages, system?, effort?, provider?, model?, webSearch? }) // → Promise<{ text, usage? }>
|
|
432
432
|
```
|
|
433
433
|
|
|
434
|
-
Name the provider and model explicitly — `tb.ai({ provider: "openai", model: "gpt-5.6-luna", … })` — or rely on the defaults you set in `.env`. `webSearch` defaults **off**; pass `webSearch: true` to give the model a web-search tool (searches bill to your key).
|
|
434
|
+
Name the provider and model explicitly — `tb.ai({ provider: "openai", model: "gpt-5.6-luna", … })` — or rely on the defaults you set in `.env`. `webSearch` defaults **off**; pass `webSearch: true` to give the model a web-search tool (searches bill to your key). `usage` is the provider-reported token counts — `{ input, output, reasoning?, cacheRead? }`, reasoning included in `output` — absent when the provider reports none; use it to meter calls instead of estimating from text length.
|
|
435
435
|
|
|
436
436
|
### Reasoning effort
|
|
437
437
|
|
|
@@ -454,7 +454,7 @@ const { text } = await tb.ai({
|
|
|
454
454
|
|
|
455
455
|
### Streaming
|
|
456
456
|
|
|
457
|
-
`tb.ai.stream({ … })` is the streaming counterpart of `tb.ai()` — an async iterable of `{ kind: "text" | "reasoning", text }` deltas. `tb.ai()` (await the full text) is unchanged; reach for `.stream` only when a response is long enough to be worth showing as it arrives.
|
|
457
|
+
`tb.ai.stream({ … })` is the streaming counterpart of `tb.ai()` — an async iterable of `{ kind: "text" | "reasoning", text }` deltas, closed by one `{ kind: "usage", usage }` chunk with the call's token counts. `tb.ai()` (await the full text) is unchanged; reach for `.stream` only when a response is long enough to be worth showing as it arrives.
|
|
458
458
|
|
|
459
459
|
```ts
|
|
460
460
|
let answer = "";
|
|
@@ -463,7 +463,7 @@ for await (const c of tb.ai.stream({ messages })) {
|
|
|
463
463
|
}
|
|
464
464
|
```
|
|
465
465
|
|
|
466
|
-
Breaking the loop stops the stream; same options as `tb.ai()`. **`kind: "reasoning"` chunks require `effort: 1-4` and a thinking-capable model**.
|
|
466
|
+
Breaking the loop stops the stream; same options as `tb.ai()`. **`kind: "reasoning"` chunks require `effort: 1-4` and a thinking-capable model**. Match `kind` positively as above — a bare `else` that assumes "not reasoning means text" misreads the usage chunk.
|
|
467
467
|
|
|
468
468
|
### AI access
|
|
469
469
|
|