@leonidstern/labit 0.6.3-edge.4.1 → 0.6.3-main.10

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.
@@ -66,6 +66,24 @@ async function runMcp({ HERE, ME, CMD, VERSION, WRITE_SHORT, AGENTS, agentKind,
66
66
  },
67
67
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }
68
68
  },
69
+ {
70
+ name: "pin",
71
+ title: "Leave your own pin",
72
+ description: `Leave your own pin on a spot of a page in the local lab: for suggestions and questions about the page, one pin per point, numbered, instead of a list in a reply. Returns the pin's id. ${WRITE_SHORT}`,
73
+ inputSchema: {
74
+ type: "object",
75
+ properties: {
76
+ selector: { type: "string", description: 'CSS selector of the element, e.g. "#pricing h2"' },
77
+ text: { type: "string", description: 'The suggestion or question, e.g. "1. The price is easy to miss: make it bigger?"' },
78
+ page: { type: "string", description: "The page: its path (/pricing), file (pricing.html) or address. Default: the lab's only page" },
79
+ at: { type: "string", description: 'Where on the element, x,y as shares of it (default "0.5,0.5", its middle)' },
80
+ dir: { type: "string", description: "The project folder, if the server started somewhere else (default: the client's root or the folder it started in)" }
81
+ },
82
+ required: ["selector", "text"],
83
+ additionalProperties: false
84
+ },
85
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }
86
+ },
69
87
  {
70
88
  name: "wait",
71
89
  title: "Wait for the next pin",
@@ -122,6 +140,13 @@ async function runMcp({ HERE, ME, CMD, VERSION, WRITE_SHORT, AGENTS, agentKind,
122
140
  const r = await run(["reply", a.id, a.text, ...flag ? [flag] : [], ...a.resolve ? ["--resolve"] : []], 3e4, project(a));
123
141
  return text(r.text, !r.ok);
124
142
  }
143
+ if (name === "pin") {
144
+ for (const k of ["selector", "text"])
145
+ if (typeof a[k] !== "string" || !a[k].trim()) return text(`\`${k}\` is required: ${k === "selector" ? "the CSS selector of the element" : "your suggestion or question"}.`, true);
146
+ for (const k of ["page", "at", "dir"]) if (a[k] !== void 0 && typeof a[k] !== "string") return text(`\`${k}\` must be a string.`, true);
147
+ const r = await run(["pin", ...a.page ? ["--page", a.page] : [], ...a.at ? ["--at", a.at] : [], "--", a.selector, a.text], 3e4, project(a));
148
+ return text(r.text, !r.ok);
149
+ }
125
150
  if (a.seconds !== void 0 && (typeof a.seconds !== "number" || !Number.isFinite(a.seconds))) return text("`seconds` must be a number.", true);
126
151
  if (a.dir !== void 0 && typeof a.dir !== "string") return text("`dir` must be a folder path.", true);
127
152
  if (a.model !== void 0 && typeof a.model !== "string") return text("`model` must be a name, e.g. Sonnet 5.5.", true);
@@ -7,7 +7,7 @@ import {
7
7
  import fs from "node:fs";
8
8
  import os from "node:os";
9
9
  import path from "node:path";
10
- var SHORTCUTS = { toggle: "m", comment: "1", go: "2", zoom: "3", pointer: "4", chat: "c", next: "w", pause: "p", done: "d", reply: "r", resolve: "e" };
10
+ var SHORTCUTS = { toggle: "m", comment: "1", go: "2", pointer: "3", chat: "c", next: "w", pause: "p", done: "d", reply: "r", resolve: "e" };
11
11
  var SPEC = {
12
12
  port: { type: "number", def: 4400, min: 1 },
13
13
  proxy: { type: "string", def: "", only: "project" },
@@ -22,7 +22,6 @@ var SPEC = {
22
22
  name: { type: "string", def: "", only: "personal" },
23
23
  model: { type: "string", def: "", only: "personal" },
24
24
  shortcuts: { type: "shortcuts", def: SHORTCUTS },
25
- zoom: { type: "zoom", def: { skill: "" }, only: "project" },
26
25
  // What is being tried here (lib/flags.ts). Off unless a file or the ⋯ menu turns one on.
27
26
  flags: { type: "flags", def: flagDefaults() }
28
27
  };
@@ -75,12 +74,6 @@ var check = (key, v, file, problems) => {
75
74
  }
76
75
  return out;
77
76
  }
78
- if (s.type === "zoom") {
79
- if (!v || typeof v !== "object" || typeof v.skill !== "string") return bad('must be { "skill": "<path to a .md file>" }');
80
- const skill = path.resolve(path.dirname(file), v.skill);
81
- if (!fs.existsSync(skill)) return bad(`.skill: no file ${skill}`);
82
- return { skill };
83
- }
84
77
  if (typeof v !== s.type) return bad(`must be a ${s.type}`);
85
78
  if (s.type === "number" && (!Number.isFinite(v) || v < (s.min ?? -Infinity))) return bad(`must be a number of at least ${s.min}`);
86
79
  if (s.type === "string" && key === "folder") return path.resolve(path.dirname(file), v);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonidstern/labit",
3
- "version": "0.6.3-edge.4.1",
3
+ "version": "0.6.3-main.10",
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": {
@@ -8,7 +8,6 @@
8
8
  },
9
9
  "files": [
10
10
  "dist/",
11
- "api/",
12
11
  "public/_lab/comments.js",
13
12
  "public/_lab/lab.css",
14
13
  "public/_lab/favicon.svg",