opencode-browser-annotation-plugin 0.6.0 → 0.6.2

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.
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,27 @@
1
+ <svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" y1="0" x2="0" y2="128" gradientUnits="userSpaceOnUse">
4
+ <stop offset="0" stop-color="#22262e"/>
5
+ <stop offset="1" stop-color="#15171c"/>
6
+ </linearGradient>
7
+ <linearGradient id="mint" x1="34" y1="30" x2="94" y2="98" gradientUnits="userSpaceOnUse">
8
+ <stop offset="0" stop-color="#7ef0c8"/>
9
+ <stop offset="1" stop-color="#39c79a"/>
10
+ </linearGradient>
11
+ </defs>
12
+
13
+ <!-- rounded dark badge -->
14
+ <rect x="4" y="4" width="120" height="120" rx="28" fill="url(#bg)"/>
15
+ <rect x="4.5" y="4.5" width="119" height="119" rx="27.5" fill="none" stroke="#3a3f49" stroke-width="1"/>
16
+
17
+ <!-- element-picker corner brackets (mint) -->
18
+ <g stroke="url(#mint)" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" fill="none">
19
+ <path d="M34 50 V38 A4 4 0 0 1 38 34 H50"/>
20
+ <path d="M78 34 H90 A4 4 0 0 1 94 38 V50"/>
21
+ <path d="M34 78 V90 A4 4 0 0 1 38 94 H50"/>
22
+ </g>
23
+
24
+ <!-- cursor / pick arrow, lower-right, on top of brackets -->
25
+ <path d="M66 60 L98 74 L83 80 L91 98 L82 102 L74 84 L62 92 Z"
26
+ fill="#ffffff" stroke="#15171c" stroke-width="3" stroke-linejoin="round"/>
27
+ </svg>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "OpenCode Browser Annotation",
4
- "version": "0.6.0",
4
+ "version": "0.6.2",
5
5
  "description": "Alt+A to annotate an element, Alt+Shift+A for the annotation list. Sends element metadata to your OpenCode agent.",
6
6
  "permissions": [
7
7
  "activeTab",
@@ -16,8 +16,20 @@
16
16
  "service_worker": "background.js",
17
17
  "type": "module"
18
18
  },
19
+ "icons": {
20
+ "16": "icons/icon-16.png",
21
+ "32": "icons/icon-32.png",
22
+ "48": "icons/icon-48.png",
23
+ "128": "icons/icon-128.png"
24
+ },
19
25
  "action": {
20
- "default_title": "OpenCode Annotation — Alt+A to pick, Alt+Shift+A for list"
26
+ "default_title": "OpenCode Annotation — Alt+A to pick, Alt+Shift+A for list",
27
+ "default_icon": {
28
+ "16": "icons/icon-16.png",
29
+ "32": "icons/icon-32.png",
30
+ "48": "icons/icon-48.png",
31
+ "128": "icons/icon-128.png"
32
+ }
21
33
  },
22
34
  "options_page": "options.html",
23
35
  "commands": {
@@ -355,9 +355,18 @@
355
355
  try {
356
356
  const tag = el.tagName.toLowerCase();
357
357
  const attrs = [];
358
+ const nameAttr = el.getAttribute("name") || "";
359
+ const typeAttr = el.getAttribute("type") || "";
360
+ // Redact the value= of any input whose name/type looks sensitive (CSRF
361
+ // tokens, passwords, hidden auth fields), regardless of input type.
362
+ const valueIsSecret = SECRET_ATTR.test(nameAttr) || /password|hidden/i.test(typeAttr);
358
363
  for (const a of Array.from(el.attributes || [])) {
364
+ // Skip class/style: class is already captured (cleaned) in `classes`,
365
+ // and inline style is noise. This avoids duplication and the ugly
366
+ // mid-class truncation.
367
+ if (a.name === "class" || a.name === "style") continue;
359
368
  let v = a.value;
360
- if (SECRET_ATTR.test(a.name) || (a.name === "value" && /password|hidden/i.test(el.getAttribute("type") || ""))) {
369
+ if (SECRET_ATTR.test(a.name) || (a.name === "value" && valueIsSecret)) {
361
370
  v = "[redacted]";
362
371
  } else if (v && v.length > 120) {
363
372
  v = v.slice(0, 120) + "…";
@@ -365,7 +374,7 @@
365
374
  attrs.push(v === "" ? a.name : `${a.name}="${v}"`);
366
375
  }
367
376
  const open = `<${tag}${attrs.length ? " " + attrs.join(" ") : ""}>`;
368
- return open.slice(0, 600);
377
+ return open;
369
378
  } catch {
370
379
  return undefined;
371
380
  }
@@ -395,6 +404,9 @@
395
404
  framework: fw ? fw.framework : undefined,
396
405
  html: safeOpenTag(el),
397
406
  };
407
+ // Drop the opening tag if it carries no attributes beyond the tag name
408
+ // (redundant with `tag` once class/style are excluded).
409
+ if (m.html && /^<[a-z0-9-]+>$/i.test(m.html)) delete m.html;
398
410
  for (const k of Object.keys(m)) if (m[k] === undefined) delete m[k];
399
411
  if (Array.isArray(m.ancestors) && m.ancestors.length === 0) delete m.ancestors;
400
412
  return m;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-browser-annotation-plugin",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Select an element in your browser, type an instruction, and send it to your OpenCode agent over a loopback + SSH tunnel. Text and element metadata only (no screenshots).",
5
5
  "keywords": [
6
6
  "opencode",
@@ -34,6 +34,7 @@
34
34
  "scripts": {
35
35
  "build": "tsc -p tsconfig.json",
36
36
  "typecheck": "tsc -p tsconfig.json --noEmit",
37
+ "pack:ext": "node scripts/pack-extension.mjs",
37
38
  "prepublishOnly": "npm run build"
38
39
  },
39
40
  "peerDependencies": {