pi-chrome 0.15.3 → 0.15.4

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 CHANGED
@@ -134,7 +134,7 @@ You: [files the ticket with the folder attached]
134
134
  | Uses your real signed-in Chrome | ✅ extension in your profile | ❌ throwaway profile | ⚠️ requires `--remote-debug` | ❌ throwaway profile |
135
135
  | Re-login required | **Never** | Every run | Sometimes | Every run |
136
136
  | **Multiple agents drive the same Chrome at once** | ✅ shared bridge | ❌ port collisions | ❌ | ❌ |
137
- | Watch agent work, live | ✅ default; toggle quiet | ❌ headless or new window | ⚠️ debugger banner always | ❌ new window |
137
+ | Watch agent work, live | ✅ default; run in background optional | ❌ headless or new window | ⚠️ debugger banner always | ❌ new window |
138
138
  | Real browser input | ✅ always for input tools | ✅ | ✅ | ✅ |
139
139
  | Network/console capture | ✅ built-in | ✅ | ✅ | ⚠️ via extensions |
140
140
  | **Honest result envelopes¹** | ✅ | ⚠️ | ❌ | ❌ |
@@ -185,23 +185,23 @@ Each tool is documented inline in Pi — agents see the parameters and gotchas (
185
185
 
186
186
  `pi-chrome` drives interactive controls through Chrome's real input layer: clicks, typing, fill, keys, hover, drag, scroll, and touch. Under the hood it uses `chrome.debugger` / CDP, so input satisfies normal user-activation gates. Chrome may show the *"Pi Chrome Connector started debugging this browser"* banner while attached.
187
187
 
188
- ### Background / watch modes
188
+ ### Run in background / watch modes
189
189
 
190
190
  By default, every `chrome_*` call focuses Chrome and activates the target tab so you can **watch the agent work** — invaluable for demos, debugging, and first-time confidence.
191
191
 
192
192
  ```text
193
- /chrome quiet # toggle for the whole session
194
- /chrome quiet on # explicit
195
- /chrome quiet off # explicit
193
+ /chrome background # toggle for the whole session
194
+ /chrome background on # run in background
195
+ /chrome background off # bring Chrome forward so you can watch
196
196
  ```
197
197
 
198
- Per-call `background: true` wins over the session toggle.
198
+ Per-call `background: true` wins over the session setting.
199
199
 
200
200
  ### Diagnostics
201
201
 
202
202
  - `/chrome doctor` — single command: connectivity, extension version, bridge owner, version drift, MAIN-world helper injection, `chrome_evaluate("1+1") === 2`, fingerprint flags.
203
203
  - `/chrome onboard` — guided first-time setup.
204
- - `/chrome quiet status` — current watch/background setting.
204
+ - `/chrome background status` — current watch/background setting.
205
205
 
206
206
  If the loaded Chrome extension is older than `pi-chrome` on disk, `/chrome doctor` tells you to reload it from `chrome://extensions`.
207
207
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Pi Chrome Connector",
4
- "version": "0.15.3",
4
+ "version": "0.15.4",
5
5
  "description": "Lets Pi control tabs in Chrome via a local connector at 127.0.0.1.",
6
6
  "permissions": [
7
7
  "tabs",
@@ -446,7 +446,7 @@ Usage rules:
446
446
  2. \`includeSnapshot=true\` on click/type/fill to verify in one round trip.
447
447
  3. If \`chrome_evaluate\` returns null when you expected a value, the expression evaluated to null/undefined in the page; surface the value via \`JSON.stringify\` to confirm.
448
448
  4. \`chrome_navigate\` supports an optional \`initScript\` that runs at document_start in MAIN world for the next navigation (good for seeding localStorage or stubbing Date.now).
449
- 5. By default chrome_* tools focus Chrome so the user can watch; pass \`background=true\` or run /chrome quiet to silence the whole session.
449
+ 5. By default chrome_* tools focus Chrome so the user can watch; pass \`background=true\` or run /chrome background on for session-wide background execution.
450
450
  6. If you hit a native file-picker or privileged browser prompt gate, tell the user; generic clicks/typing/CSP gates are handled by Chrome input.
451
451
  7. Run /chrome doctor when in doubt about connectivity or capabilities.
452
452
  </chrome-profile-bridge>`;
@@ -517,9 +517,9 @@ Usage rules:
517
517
  ctx.ui.notify(lines.join("\n"), "info");
518
518
  };
519
519
 
520
- // Quiet (Chrome focus) handler. No args = toggle. Explicit on/off/status.
521
- const QUIET_DESC: Record<string, string> = {
522
- on: "pi-chrome works in the background; Chrome won't pop up or steal focus.",
520
+ // Run-in-background (Chrome focus) handler. No args = toggle. Explicit on/off/status.
521
+ const BACKGROUND_DESC: Record<string, string> = {
522
+ on: "pi-chrome runs in the background; Chrome won't pop up or steal focus.",
523
523
  off: "Chrome pops to the front and switches tabs so you can watch what pi-chrome is doing.",
524
524
  };
525
525
 
@@ -528,7 +528,7 @@ Usage rules:
528
528
  const currentLabel = backgroundDefault ? "on" : "off";
529
529
 
530
530
  if (arg === "status") {
531
- ctx.ui.notify(`Quiet mode is ${currentLabel}. ${QUIET_DESC[currentLabel]}`, "info");
531
+ ctx.ui.notify(`Run in background is ${currentLabel}. ${BACKGROUND_DESC[currentLabel]}`, "info");
532
532
  return;
533
533
  }
534
534
 
@@ -536,12 +536,12 @@ Usage rules:
536
536
  else if (arg === "off" || arg === "false" || arg === "0") backgroundDefault = false;
537
537
  else if (arg === "toggle" || arg === "") backgroundDefault = !backgroundDefault;
538
538
  else {
539
- ctx.ui.notify(`Unknown quiet mode '${arg}'. Pick one of: on | off | toggle | status.`, "warning");
539
+ ctx.ui.notify(`Unknown background setting '${arg}'. Pick one of: on | off | toggle | status.`, "warning");
540
540
  return;
541
541
  }
542
542
 
543
543
  const nextLabel = backgroundDefault ? "on" : "off";
544
- ctx.ui.notify(`Quiet mode → ${nextLabel}. ${QUIET_DESC[nextLabel]}`, "info");
544
+ ctx.ui.notify(`Run in background → ${nextLabel}. ${BACKGROUND_DESC[nextLabel]}`, "info");
545
545
  };
546
546
 
547
547
  const onboardHandler = async (ctx: ExtensionContext) => {
@@ -579,7 +579,7 @@ Usage rules:
579
579
  } catch {
580
580
  parts.push(`✗ Chrome not responding`);
581
581
  }
582
- parts.push(`quiet: ${backgroundDefault ? "on" : "off"}`);
582
+ parts.push(`background: ${backgroundDefault ? "on" : "off"}`);
583
583
  return parts.join(" · ");
584
584
  };
585
585
 
@@ -591,14 +591,14 @@ Usage rules:
591
591
  // the last value also saves; Esc / 'q' closes. The description below changes with the
592
592
  // current value so users always see what the active setting means.
593
593
  const openSettingsDialog = async (ctx: ExtensionContext): Promise<void> => {
594
- const quietItem: SettingItem = {
595
- id: "quiet",
596
- label: "Quiet mode",
594
+ const backgroundItem: SettingItem = {
595
+ id: "background",
596
+ label: "Run in background",
597
597
  currentValue: backgroundDefault ? "on" : "off",
598
598
  values: ["on", "off"],
599
- description: QUIET_DESC[backgroundDefault ? "on" : "off"] ?? "",
599
+ description: BACKGROUND_DESC[backgroundDefault ? "on" : "off"] ?? "",
600
600
  };
601
- const items: SettingItem[] = [quietItem];
601
+ const items: SettingItem[] = [backgroundItem];
602
602
 
603
603
  await ctx.ui.custom<void>((_tui, theme, _kb, done) => {
604
604
  const container = new Container();
@@ -611,10 +611,10 @@ Usage rules:
611
611
  Math.min(items.length + 2, 8),
612
612
  getSettingsListTheme(),
613
613
  (id, newValue) => {
614
- if (id === "quiet") {
614
+ if (id === "background") {
615
615
  backgroundDefault = newValue === "on";
616
- quietItem.currentValue = newValue;
617
- quietItem.description = QUIET_DESC[newValue] ?? "";
616
+ backgroundItem.currentValue = newValue;
617
+ backgroundItem.description = BACKGROUND_DESC[newValue] ?? "";
618
618
  list.invalidate();
619
619
  }
620
620
  },
@@ -632,7 +632,7 @@ Usage rules:
632
632
 
633
633
  pi.registerCommand("chrome", {
634
634
  description:
635
- "All pi-chrome controls in one place.\n /chrome status — one-line snapshot of connection + quiet mode.\n /chrome doctor — full health check.\n /chrome onboard — install the Chrome companion extension.\n /chrome quiet [on|off|status|toggle] — whether Chrome pops to the front when pi-chrome acts.\nRun with no arguments for an interactive picker that shows current state.",
635
+ "All pi-chrome controls in one place.\n /chrome status — one-line snapshot of connection + background setting.\n /chrome doctor — full health check.\n /chrome onboard — install the Chrome companion extension.\n /chrome background [on|off|status|toggle] — whether pi-chrome runs without focusing Chrome.\nRun with no arguments for an interactive picker that shows current state.",
636
636
  getArgumentCompletions: (prefix) => {
637
637
  const raw = prefix;
638
638
  const trimmedRight = raw.replace(/\s+$/, "");
@@ -649,17 +649,17 @@ Usage rules:
649
649
  let candidates: Item[] = [];
650
650
  if (path.length === 0) {
651
651
  candidates = [
652
- { fullValue: "status", label: "status", description: "One-line summary: connection + quiet mode." },
652
+ { fullValue: "status", label: "status", description: "One-line summary: connection + background setting." },
653
653
  { fullValue: "doctor", label: "doctor", description: "Full health check. Tells you if Chrome is connected and what's wrong if it isn't." },
654
654
  { fullValue: "onboard", label: "onboard", description: "Install the Chrome companion extension (first-time setup)." },
655
- { fullValue: "quiet", label: "quiet", description: "Should Chrome pop to the front when pi-chrome acts, or work silently?" },
655
+ { fullValue: "background", label: "background", description: "Run pi-chrome in the background without focusing Chrome?" },
656
656
  ];
657
- } else if (path[0] === "quiet" && path.length === 1) {
657
+ } else if (path[0] === "background" && path.length === 1) {
658
658
  candidates = [
659
- { fullValue: "quiet on", label: "on", description: "Work silently. Chrome stays in the background. Your editor keeps focus." },
660
- { fullValue: "quiet off", label: "off", description: "Bring Chrome to the front so you can watch (default)." },
661
- { fullValue: "quiet toggle", label: "toggle", description: "Flip whichever way it's currently set." },
662
- { fullValue: "quiet status", label: "status", description: "Show the current setting." },
659
+ { fullValue: "background on", label: "on", description: "Run in background. Chrome stays in the background. Your editor keeps focus." },
660
+ { fullValue: "background off", label: "off", description: "Bring Chrome to the front so you can watch (default)." },
661
+ { fullValue: "background toggle", label: "toggle", description: "Flip whichever way it's currently set." },
662
+ { fullValue: "background status", label: "status", description: "Show the current setting." },
663
663
  ];
664
664
  }
665
665
  if (candidates.length === 0) return null;
@@ -679,18 +679,17 @@ Usage rules:
679
679
  case "status": return statusHandler(ctx);
680
680
  case "doctor": return doctorHandler(ctx);
681
681
  case "onboard": return onboardHandler(ctx);
682
- case "quiet":
683
- case "background": // legacy alias
682
+ case "background":
684
683
  return backgroundHandler(ctx, subArgs);
685
684
  case "settings": {
686
685
  // Legacy nested form: /chrome settings background ...
687
686
  const [setting, ...settingArgs] = rest;
688
687
  if (setting === "background") return backgroundHandler(ctx, settingArgs.join(" "));
689
- ctx.ui.notify(`'/chrome settings' was removed. Use /chrome quiet directly.`, "warning");
688
+ ctx.ui.notify(`'/chrome settings' was removed. Use /chrome background directly.`, "warning");
690
689
  return;
691
690
  }
692
691
  default:
693
- ctx.ui.notify(`Unknown subcommand '${head}'. Try: /chrome status | doctor | onboard | quiet.`, "warning");
692
+ ctx.ui.notify(`Unknown subcommand '${head}'. Try: /chrome status | doctor | onboard | background.`, "warning");
694
693
  }
695
694
  },
696
695
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-chrome",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "scripts": {
5
5
  "version": "node scripts/sync-manifest-version.js",
6
6
  "prepublishOnly": "node scripts/sync-manifest-version.js"