typebulb 0.42.0 → 0.43.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 +5 -2
- package/dist/agents/claude/client.js +238 -89
- package/dist/agents/claude/styles.css +34 -7
- package/dist/agents/pi/client.js +252 -103
- package/dist/agents/pi/matchu-patchu.ts +1 -1
- package/dist/agents/pi/styles.css +34 -7
- package/dist/index.js +362 -209
- package/dist/render.js +211 -62
- package/dist/servers.js +245 -96
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,6 +44,8 @@ typebulb call <file> <fn> […] Invoke one server.ts export headlessly: prints
|
|
|
44
44
|
typebulb send <file> [msg] Push a message into a running bulb's page (its tb.onMessage handlers); the client-side twin of call, no --trust.
|
|
45
45
|
With --wait, a handler's non-undefined return prints on stdout (JSON; a bare string raw)
|
|
46
46
|
typebulb send <file> tb:snapshot Print the live page's rendered outline (roles, names, visible text)
|
|
47
|
+
typebulb send <file> tb:click … Click a control by role+name ('tb:click button "Pass"'); the reply is a fresh snapshot
|
|
48
|
+
typebulb send <file> tb:set … Set a form control ('tb:set combobox "level" = hard'), firing input+change
|
|
47
49
|
typebulb get <file> <kind> Print one block's content (data, insight, code, …) to stdout
|
|
48
50
|
typebulb put <file> <k>=<src> Write a file's (or stdin's) content into a block, surgically
|
|
49
51
|
typebulb pull <url|file> Fetch a bulb from typebulb.com into typebulbs/u/<user>/<slug>.bulb.md
|
|
@@ -267,8 +269,9 @@ That one launch *is* the loop: the server watches the file, so every save recomp
|
|
|
267
269
|
|
|
268
270
|
- **Structured selftest** — a handler that returns `{ count, verdict }` beats one that logs prose: `typebulb send <file> selftest --wait` prints the object as JSON, and you assert on fields instead of parsing `logs`. At most one handler, in one page, may return a value; a slow check needs `--wait=<ms>` above the 5s default.
|
|
269
271
|
- **Rendered truth** — `typebulb send <file> tb:snapshot` prints the page's accessibility outline (roles, names, visible text) without disturbing its state. Use it when logs say ok but the screen might not, and as the first probe on a live page in a state you can't reproduce — a save would hot-reload and destroy it. (`tb:` messages are answered by the runtime, never your handlers, and imply `--wait`.)
|
|
270
|
-
- **
|
|
271
|
-
- **
|
|
272
|
+
- **Acting on the page** — `typebulb send <file> 'tb:click button "Pass"'` clicks the one control matching that role and name (exact, else a unique case-insensitive substring) and replies with a fresh snapshot; `tb:set combobox "strength" = hard` is the same for form controls (checkboxes and radios take `tb:click`). A disabled, readonly, or covered target is an error naming it — that silence is the bug class these verbs catch. Needs exactly one page open, and the reply is the immediate frame (slow work: follow up with `tb:snapshot`). Only what the outline names is targetable: real `<button>`s and labeled controls, not an `onClick` `<div>`.
|
|
273
|
+
- **Poking state** — for state beyond what a form control expresses (`tb:set` covers those), author a set-handler up front: a `tb.onMessage` branch that takes a data payload (JSON arrives parsed), applies it to your state — committing the change if your framework needs an explicit step — and returns the new state: `typebulb send <file> '{"set":"speed","value":2}' --wait` prints it. In React, register it in an effect so it closes over the setters (the returned unsubscribe is the cleanup). Adding the handler later is itself the edit that destroys the state.
|
|
274
|
+
- **A page must be open** — the CLI runs no browser of its own, so every client-side check waits on a real window (and `--no-open` means there isn't one). `send` says which case it is: nobody has ever connected (share the link), or a page dropped and hasn't returned (it's stale — reload it). Never open a window at the user: the server logs `[page] connected` when a page attaches, so end your turn with the link, arming `typebulb wait <file> --match "[page] connected"` in the background first — the user opening the page is your wake-up.
|
|
272
275
|
|
|
273
276
|
### Emitting a server-only bulb
|
|
274
277
|
|