@leonidstern/labit 0.6.3-main.15 → 0.6.3-main.17

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: labit
3
- description: Read and answer pin comments from labit. Use when the person says "start labit" or wants to comment on their project's pages locally (local.mjs); when they say "use lab", "in lab" or "show it in lab" (show a page in labit instead of publishing an Artifact or another hosted page); when they paste a lab agent link (/_lab/agent/...); or when they say "check the comments" on a lab page.
3
+ description: Read and answer pin comments from labit. Use when the person says "start labit" or wants to comment on their project's pages locally (local.mjs); when they say "use lab", "in lab" or "show it in lab" (show a page in labit instead of publishing an Artifact or another hosted page); or when they say "check the comments" on a lab page.
4
4
  ---
5
5
 
6
6
  # labit
@@ -11,23 +11,17 @@ Works the same in Claude Code, Codex, Cursor, Copilot, Amp, opencode, Antigravit
11
11
 
12
12
  People ask for "a lab" when they mean the one they already have. Look first, and use what exists:
13
13
  - Local: run `LAB list` (below `LAB`). If a running lab already serves the folder, open its page there. Starting `LAB` inside a served folder points you to that lab anyway.
14
- - Cloud: if they have a lab domain, use it. Before adding a project, look in their lab repo for that project and reuse its secret. Before adding a page, look for the page; a new one is only for a page they asked for by name.
15
14
  - Other sessions: if your app lets you search the person's other sessions or conversations, search for the lab's address or folder. If another session already works on it, point the person there instead of starting it again here.
16
15
  If their words could mean "the existing one" or "a new one", use the existing one, or ask in one line.
17
16
 
18
- ## Cloud lab (a link like https://<lab domain>/_lab/agent/<page path>)
19
-
20
- 1. Fetch the link. It is plain text: every open comment with its number, author, the quoted words, the element, the image file and pixel, the code line or the video second.
21
- 2. Find each spot in the page's source from those details, not from a screenshot.
22
- 3. Make the changes the person agrees with. Deploy the way the repo does: with an `npm run ship` script (prebuilt deploy, the labit default), run it, check the page answers 200, then commit and push for the history; otherwise push. Tell the person which numbers you did and which you skipped and why.
23
- 4. When you make or open a cloud lab page for the person, save it with the project: run `npx @leonidstern/labit add <page address>` from the project's folder, so `pages` shows it with that project's labs.
24
-
25
17
  ## Local lab (local.mjs on this computer)
26
18
 
27
19
  Start it with `npx @leonidstern/labit@latest`, so the person gets the newest version. The other commands (`wait`, `reply`, `pages`…) can run as `npx @leonidstern/labit` (below `LAB`). From a clone of the repo, `node <clone>/local.mjs` works the same.
28
20
 
29
- 1. In the project, run `npx @leonidstern/labit@latest` in the background (no folder). With the project's dev server running (Astro, Next, Vite…) it puts comments on top of it by itself, ignoring other projects' servers. If it says the dev server isn't running, start it the way the project does (usually `npm run dev`, in the background), then 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>`.
30
- 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`: this project's labs and saved cloud pages, as links (`--all` for every lab on the computer). Links only: an HTML file sent this way opens as a single file that can't follow links, so it never reaches the live page. Send it again whenever you start another lab; the same file keeps one row.
21
+ **Reuse labs, one per project.** Every lab is a server: never start one for a topic or a try. First run `LAB list`. If a lab already serves the folder you're working in, use it: running `LAB` there again only prints its address. 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). Never make a new folder to start a lab in.
22
+
23
+ 1. In the project, run `npx @leonidstern/labit@latest --name "<topic>"` in the background (no folder), with the topic of the work in a few words ("Lab navigation"): the person's lab list (⌘K) shows it instead of the folder, and later starts keep it. With the project's dev server running (Astro, Next, Vite…) it puts comments on top of it by itself, ignoring other projects' servers. If it says the dev server isn't running, start it the way the project does (usually `npm run dev`, in the background), then 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
+ 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`: this project's labs, as links (`--all` for every lab on the computer). Links only: an HTML file sent this way opens as a single file that can't follow links, so it never reaches the live page. Send it again whenever you start another lab; the same file keeps one row.
31
25
  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 — in the background, always. A wait left in the foreground holds your turn open for as long as it listens: the person cannot say a word to you until it ends, and the message they send to reach you kills it. Nothing in the command can tell the two apart, so `--bg` is your word for it, and without that word 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 by themselves (Copilot: set `LAB_AGENT=copilot`). It ends with the next comment, printed in full.
32
26
  If your app doesn't tell you when a background command finishes, run it in the foreground instead and loop, with no `--bg` and a short timeout so the person is never held up for long: `LAB wait --timeout 50 --name "<name>" --model "<model>"`; "No new comments yet" means run it again.
33
27
  4. For each comment: edit the file (the page reloads by itself), then answer on the pin with `LAB reply <id> --done "<what changed>"`: `--done` tells the page the ask is done and closes the thread. Use the comment id that `wait` printed, not the number: numbers shift after a delete. Starting on something that takes a while: `--on-it`. If you need something from the person, ask in the reply with `--question` and leave it open. (Older labit read "Done: …" at the start of the text; that still works, the flag is clearer.) Keep answers short, since they're read in a small window: one point per line or two, a blank line between points, `- ` lines for lists.
@@ -38,13 +32,14 @@ Start it with `npx @leonidstern/labit@latest`, so the person gets the newest ver
38
32
 
39
33
  When the person says "use lab", "in lab" or "show it in lab", show the page in labit, not as an Artifact. The page lives on this computer, and their comments come back to you as pins.
40
34
 
41
- 1. Write the page as an `.html` file. Put it in the project you're working in, next to its pages. With no project, use a `lab-pages/` folder in the working directory. One file per page, with a clear name (`pricing.html`), and a `<title>`.
42
- 2. Run `LAB --no-open` in the background from that folder (or `LAB <folder> --no-open`) and read the port it prints. If a lab already runs there, it says so and prints its port.
35
+ 1. Write the page as an `.html` file with a `<title>` (or a folder with an `index.html`, for a page with images).
36
+ - Part of a project's site: put it in the project, next to its pages, and use the lab `LAB list` shows for that folder (start one there only if none runs).
37
+ - Anything else: publish it, as you would an Artifact: `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.
43
38
  3. 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 (the 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.
44
39
  4. 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.
45
- 5. For later changes, edit the file. The page reloads by itself, so there's nothing to republish.
40
+ 5. For later changes, edit the file in the project, or publish a published page again. The page reloads by itself.
46
41
 
47
- Start local, always. The page stays on this computer (for a phone, add `--wifi`, then run `LAB invite` and give the person the link it prints: it lets one device in, once, within ten minutes). Put it on their cloud lab only when the person asks to upload or share it: then follow Cloud lab, reusing their lab and project. Make an Artifact only if they ask for one.
42
+ Start local, always. The page stays on this computer (for a phone, add `--wifi`, then run `LAB invite` and give the person the link it prints: it lets one device in, once, within ten minutes). labit has no hosted labs for now, so to share a page with someone elsewhere, ask the person how they want it shared. Make an Artifact only if they ask for one.
48
43
 
49
44
  With MCP instead of a terminal: `LAB mcp` gives the tools `comments`, `reply`, `pin` and `wait` (Codex: `codex mcp add labit -- npx @leonidstern/labit@latest mcp`). Its `wait` returns after 50 seconds by default; call it again to keep listening. In Codex's sandbox, `wait` and `reply` on the command line may be blocked from reaching the lab: use the MCP tools then.
50
45