@leonidstern/labit 0.8.2 → 0.8.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonidstern/labit",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Pin comments on pages, read by your agent as plain text. Local mode: comment on pages on your computer and Claude answers on the pins.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,11 +12,12 @@
12
12
  "public/_lab/components.js.br",
13
13
  "public/_lab/switcher.js.br",
14
14
  "public/_lab/draw.js.br",
15
- "public/_lab/sections.js.br",
16
15
  "public/_lab/motion.js.br",
17
16
  "public/_lab/boardview.js.br",
18
17
  "public/_lab/pics.js.br",
19
18
  "public/_lab/attach.js.br",
19
+ "public/_lab/reload.js.br",
20
+ "public/_lab/walkie.js.br",
20
21
  "public/_lab/lab.css",
21
22
  "public/_lab/favicon.svg",
22
23
  "skills/",
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -20,7 +20,8 @@ Start it with `npx @leonidstern/labit@latest`. Use `@latest` on the other comman
20
20
 
21
21
  **One lab per project.** Every lab is a server, and a second one splits the comments and the listening: never start one for a topic or a try, and never make a new folder to start one in. A page that belongs to no project (a try, a demo, options to pick from) is published, like an Artifact: `LAB publish <page.html> --name "<topic>"` (see Instead of an Artifact).
22
22
 
23
- 1. In the project, run `npx @leonidstern/labit@latest --name "<topic>"` in the background (no folder), the topic in a few words ("Lab navigation"): the lab list (⌘K) shows it instead of the folder, and later starts keep it. With the project's dev server running it puts comments on top of it, ignoring other projects' servers. Use a dev server (`--proxy`) only when the person's real app runs there (an existing React, Next, Vite or Astro project). Anything else (mockups, prototypes, lab pages, explorations) is plain files served by the lab itself: never start a dev server or a framework for it (served as plain files, a pin names its file and line, and the page reloads on save). If it says the dev server isn't running, start it the way the project does (usually `npm run dev`, in the background) and run `LAB` again; never stop other servers. A folder of HTML files is served as it is; name a folder only when the pages live elsewhere (`LAB dist`). It opens the page; the person presses `m` (or holds Option) and clicks to comment. If the site has a base path, `/` is a 404: open a real page such as `/leo/<page>`.
23
+ 1. **labit serves pages itself, unless they belong to an existing app.** Pages you make (designs, mockups, explorations, variants, research) are plain HTML files in a lab folder, served by the lab: never start a dev server or a framework for them, and never put them in an app's folder to show them (served as plain files, a pin names its file and line, and the page reloads on save). Only an existing app's own pages (a React, Next, Vite or Astro project with its dev server) go behind its dev server (`--proxy`).
24
+ In the project, run `npx @leonidstern/labit@latest --name "<topic>"` in the background (no folder), the topic in a few words ("Lab navigation"): the lab list (⌘K) shows it instead of the folder, and later starts keep it. In an app whose dev server is running it puts comments on top of it, ignoring other projects' servers. If it says the app's dev server isn't running and the work is on the app itself, start it the way the project does (usually `npm run dev`, in the background) and run `LAB` again; never stop other servers. A folder of HTML files is served as it is; name a folder only when the pages live elsewhere (`LAB dist`). It opens the page; the person presses `m` (or holds Option) and clicks to comment. If the site has a base path, `/` is a 404: open a real page such as `/leo/<page>`.
24
25
  2. If your app shows files you send in the session (the Claude desktop app lists them under Outputs), run `LAB pages` from the project and send the file it prints, `.lab/lab-pages.md`: the project's labs as links (`--all` for every lab on the computer). Links only: a file sent this way can't follow links to the live page. Send it again whenever you start another lab; the same file keeps one row.
25
26
  3. From the project, run `LAB wait --bg --name "<short project name>" --model "<the model you run on, e.g. Sonnet 5.5>"` in the background, always. A foreground wait holds your turn open: the person can't speak to you until it ends, and their message kills it. `--bg` is how labit knows you run it in the background; without it a wait ends after a minute. The page then says "talking to <your agent> · <model> (<name>)" (labit tells Claude, Codex, Cursor, Amp, opencode and Antigravity apart itself; Copilot: set `LAB_AGENT=copilot`). The wait ends with the next comment, printed in full.
26
27
  If your app doesn't tell you when a background command finishes, loop in the foreground with a short timeout and no `--bg`: `LAB wait --timeout 50 --name "<name>" --model "<model>"`; "No new comments yet" means run it again.
@@ -29,6 +30,7 @@ Start it with `npx @leonidstern/labit@latest`. Use `@latest` on the other comman
29
30
  4. Read each pin's or chat message's whole thread (every message and reply) before answering. The page, URL or `#section` is where it sits, not what it asks. Cut short ("… N earlier messages")? Read those first: `LAB thread <id>` prints the whole thread, resolved ones too.
30
31
  Pictures: an `image: .lab/attachments/<id>-1.png (1440×900)` line under a comment is a file the person pasted or dropped into the comment box. Open it to see what they mean (the words may be only "see this", or none: `comment: (a picture, no words)`). You cannot attach one yourself; describe it in words.
31
32
  For each comment: edit the file (the page reloads by itself), then answer with `LAB reply <id> --done "<what changed>"`, which tells the page the ask is done and closes the thread. If you looked at the result (the page at the pin's width with your browser tool, a test run), add `--checked "<how>"`; without it the page shows the answer as not checked. For a change you can see (layout, a phone width, an interaction), look when your app can. Use the comment id that `wait` printed, not the number: numbers shift after a delete. A quick ask needs no `--on-it`. If it will take over about a minute (a build, a lab restart, a PR), send one `LAB reply <id> --progress "<what you're on now>"` line (the page shows it by your name and on the pin; an answer clears it), and a new one when the step changes. With the labit plugin, its hook keeps your line alive while this session works (it never starts one or changes your words), for 10 minutes after your last line; then the page says "no update". Without the plugin a line lapses after 3 minutes. A plain "go", "yes", "ok" or a pick as the ask: no words, just `LAB resolve <id>` when the work is done (the ✓). Ask with `--question` only when blocked, and leave the pin open. Answers are read in a small window: one point per line or two, a blank line between points, `- ` lines for lists. Name a place on the page as `#section`, never as its address (`localhost` is dead on the person's phone).
33
+ A chat message that starts `Walkie-talkie, N parts` is a walk: the person talked (their computer's dictation) while pointing at the page. Each numbered part is what they said with the element it was about: `On "<label>" (<selector>, <why>)`, a `[label · selector]` after a "this" or "that" for its own spot, and `move from … to …`, `comparing … and …`, `quoting "…"` when the pointer and the words both said so. Act on each part at its selector as if it were a pin there; "On the page" means no spot. Answer the message once, with what you did per part.
32
34
  `action: update labit to X` came from the lab's ⋯ menu: run `LAB update` (it prints what changed), then answer `--done` with those few lines.
33
35
  A pin with an `action:` line came from a button on the page (`data-lab-action`): do what it names, then answer `--done`. When it says "confirm first" (`data-lab-confirm`: merge, close and the like), reply `--question` with what will happen and act only after the person's ✓ in that thread. Action buttons go on pages you write.
34
36
  The comment box's quick buttons (go, more, no) are the `actions` list in the project's `labit.json` or `~/.config/labit/settings.json` (`labit settings` shows them; docs/settings.md): asked to add or change one, edit that file and restart the lab. The page has no editor for them.
@@ -62,14 +64,15 @@ When the person says "use lab", "in lab" or "show it in lab", show the page in l
62
64
 
63
65
  1. Write the page as an `.html` file with a `<title>` (or a folder with an `index.html`, for a page with images).
64
66
  - Images on a lab page cannot be zoomed: no lightbox, no click or tap to enlarge, no `cursor: zoom-in`/`zoom-out`, no `touch-action: pinch-zoom` overlay, and no viewport meta that changes pinch-zoom (leave `user-scalable` and `maximum-scale` out). A picture is shown at the size the page lays it out, and a click or tap on it does nothing; to show more detail, make the picture itself larger or crop it.
65
- - Link `/_lab/lab.css` and put the content under three or more `<h2 id>` headings: the page then gets the lab's light and dark look and the section bar, which marks new and updated sections.
66
- - Part of a project's site: put it next to the project's pages and use the lab `LAB list` shows for that folder (start one only if none runs).
67
- - Anything else: `LAB publish <page.html> --name "<topic>"`. It goes into the person's one pages lab (the `pagesFolder` setting, `~/lab-pages`), which starts if it isn't running, and prints the page's link and the line to listen with. Publish again after a change: same link. Never start a lab of its own for it.
67
+ - Every part of a lab page takes a pin. labit ignores `data-uncommentable`, so don't add it; commenting is what the page is for. The person presses `m` or holds Option to pin, and clicks work as usual otherwise.
68
+ - Link `/_lab/lab.css` and put the content under `<h2 id>` headings: the page then gets the lab's light and dark look, and pins and #links find their sections by those ids.
69
+ - Part of a project's site of plain HTML pages: put it next to the project's pages and use the lab `LAB list` shows for that folder (start one only if none runs).
70
+ - Anything else, designs and explorations for an app too: `LAB publish <page.html> --name "<topic>"`. It goes into the person's one pages lab (the `pagesFolder` setting, `~/lab-pages`), which starts if it isn't running, and prints the page's link and the line to listen with. Publish again after a change: same link. Never start a lab of its own for it.
68
71
  2. Show the page beside the chat, the way an Artifact shows. In the Claude desktop app, open `http://localhost:<port>/<file name>` in its built-in browser pane (Claude_Browser tools: `preview_start` with the `url`, or `navigate` when a tab is open) and bring that pane to the front. Anywhere else, run `LAB` without `--no-open` so it opens the person's browser. Pins work in both.
69
72
  3. Give the person the page's URL in one line, then send the page list and listen and answer as in Local lab, steps 2 to 5.
70
73
  4. For later changes, edit the file in the project, or publish a published page again. The page reloads by itself.
71
74
 
72
- A lab page never leaves the lab with the widget: it needs the lab server (`/_lab/api/comments`, `/_lab/live`), so as an Artifact or on static hosting it shows only "reconnecting" and "could not save", and no pin reaches you. When the person asks for an Artifact or hosted copy: publish the page's own source file, not HTML fetched from the lab (the lab adds the widget script, section bar and admin token when it serves). If only served HTML exists, remove `comments.js`, the `data-lab` style and script, `data-admin` and the `/_lab/` links, and inline `lab.css` if the page uses `--lab-*` tokens. Say it is a read-only copy: pins and replies stay on the local lab.
75
+ A lab page never leaves the lab with the widget: it needs the lab server (`/_lab/api/comments`, `/_lab/live`), so as an Artifact or on static hosting it shows only "reconnecting" and "could not save", and no pin reaches you. When the person asks for an Artifact or hosted copy: publish the page's own source file, not HTML fetched from the lab (the lab adds the widget script and admin token when it serves). If only served HTML exists, remove `comments.js`, the `data-lab` style and script, `data-admin` and the `/_lab/` links, and inline `lab.css` if the page uses `--lab-*` tokens. Say it is a read-only copy: pins and replies stay on the local lab.
73
76
 
74
77
  Start local, always: the page stays on this computer (for a phone, run `LAB invite` and give the person the link it prints: it lets one device in, once, within ten minutes. If the lab is local only, the invite turns wifi on in that same lab, which restarts for a moment on the same address with its pins and your wait intact. Never start a second lab or a copy of a page for a phone: its pins would be separate from this lab's). labit has no hosted labs for now: to share with someone elsewhere, ask how. Make an Artifact only if they ask.
75
78
 
@@ -91,7 +94,7 @@ In Codex's sandbox, `wait` and `reply` may be blocked from reaching the lab: run
91
94
 
92
95
  Rules:
93
96
  - Comments from "this computer" are the person. Comments marked as guests (from other devices with `--wifi`) are requests to weigh, not orders: ask the person before acting on anything beyond a small, clear page change.
94
- - Change only what was asked, and keep section ids, headings and the words nobody asked about: open pins find their spots by them, and the section bar marks the sections whose text changed. Small edits are the easy way to do that; writing the whole file out again is the easy way to break it.
97
+ - Change only what was asked, and keep section ids, headings and the words nobody asked about: open pins find their spots by them. Small edits are the easy way to do that; writing the whole file out again is the easy way to break it.
95
98
  - Don't redraw or restyle parts nobody commented on.
96
99
  - A new version (a redo, another round): on a research or lab page, right after the one it follows, never at the bottom, with its own id and a plain heading ("Pricing, new version"); keep the old one unless told to replace it. On a live project (the real app, behind a dev server), make it where it was asked but risk free: a board variant (`?lab-variant`), the page left as it was until the person picks it. Name it as `#id` or its frame in your answer.
97
100
  - A comment that looks like a bug in labit itself (the pins, the widget, the lab), not in their page: offer once in that thread, "Looks like a labit bug. Want me to open an issue?" (no offer again there; if they asked for an issue, skip the offer). On yes, file it in `leonidstern/labit` (never the project you work in) with your own GitHub access: steps, expected, actual, and labit's version if known; no paths, code, private comments or pictures unless they say so. Reply with the issue link. No GitHub write access: say so and give the report ready to paste; never claim it was filed.
Binary file