pi-chrome 0.15.5 → 0.15.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable user-facing changes to `pi-chrome`.
4
4
 
5
+ ## 0.15.6 — 2026-05-14
6
+
7
+ - **Bare `/chrome` is now a command menu.** Running `/chrome` shows interactive options for every `/chrome ...` command, including authorize/revoke/status/doctor/onboard/background variants.
8
+
5
9
  ## 0.15.5 — 2026-05-14
6
10
 
7
11
  - **Chrome control authorization.** `chrome_*` tools are locked until the user runs `/chrome authorize` in the current Pi session. Grants can be one command, 15 minutes, 1 hour, or the session; `/chrome revoke` locks control again and `/chrome status` shows auth state.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Pi Chrome Connector",
4
- "version": "0.15.5",
4
+ "version": "0.15.6",
5
5
  "description": "Lets Pi control tabs in Chrome via a local connector at 127.0.0.1.",
6
6
  "permissions": [
7
7
  "tabs",
@@ -1,6 +1,4 @@
1
1
  import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
2
- import { getSettingsListTheme } from "@earendil-works/pi-coding-agent";
3
- import { Container, type SettingItem, SettingsList, Text } from "@earendil-works/pi-tui";
4
2
  import { Type } from "typebox";
5
3
  import { existsSync, readFileSync, statSync } from "node:fs";
6
4
  import { mkdir, writeFile } from "node:fs/promises";
@@ -702,47 +700,40 @@ Usage rules:
702
700
  ctx.ui.notify(await statusSummary(), "info");
703
701
  };
704
702
 
705
- // Interactive dialog: each row is a setting whose value cycles with Space/Enter. Enter on
706
- // the last value also saves; Esc / 'q' closes. The description below changes with the
707
- // current value so users always see what the active setting means.
708
- const openSettingsDialog = async (ctx: ExtensionContext): Promise<void> => {
709
- const backgroundItem: SettingItem = {
710
- id: "background",
711
- label: "Run in background",
712
- currentValue: backgroundDefault ? "on" : "off",
713
- values: ["on", "off"],
714
- description: BACKGROUND_DESC[backgroundDefault ? "on" : "off"] ?? "",
715
- };
716
- const items: SettingItem[] = [backgroundItem];
717
-
718
- await ctx.ui.custom<void>((_tui, theme, _kb, done) => {
719
- const container = new Container();
720
- container.addChild(new Text(theme.fg("accent", theme.bold("pi-chrome settings")), 1, 1));
721
- container.addChild(new Text(theme.fg("muted", "\u2191\u2193 navigate · space/enter cycle · esc close"), 1, 0));
722
-
723
- let list: SettingsList;
724
- list = new SettingsList(
725
- items,
726
- Math.min(items.length + 2, 8),
727
- getSettingsListTheme(),
728
- (id, newValue) => {
729
- if (id === "background") {
730
- backgroundDefault = newValue === "on";
731
- backgroundItem.currentValue = newValue;
732
- backgroundItem.description = BACKGROUND_DESC[newValue] ?? "";
733
- list.invalidate();
734
- }
735
- },
736
- () => done(undefined),
737
- );
738
- container.addChild(list);
739
-
740
- return {
741
- render: (w) => container.render(w),
742
- invalidate: () => container.invalidate(),
743
- handleInput: (data: string) => list.handleInput(data),
744
- };
745
- });
703
+ const openCommandMenu = async (ctx: ExtensionContext): Promise<void> => {
704
+ const choice = await ctx.ui.select("pi-chrome", [
705
+ "/chrome authorize",
706
+ "/chrome authorize once",
707
+ "/chrome authorize 15m",
708
+ "/chrome authorize 1h",
709
+ "/chrome authorize status",
710
+ "/chrome revoke",
711
+ "/chrome status",
712
+ "/chrome doctor",
713
+ "/chrome onboard",
714
+ "/chrome background",
715
+ "/chrome background toggle",
716
+ "/chrome background on",
717
+ "/chrome background off",
718
+ "/chrome background status",
719
+ ]);
720
+ if (!choice) return;
721
+ switch (choice) {
722
+ case "/chrome authorize": return authorizeHandler(ctx, "session");
723
+ case "/chrome authorize once": return authorizeHandler(ctx, "once");
724
+ case "/chrome authorize 15m": return authorizeHandler(ctx, "15m");
725
+ case "/chrome authorize 1h": return authorizeHandler(ctx, "1h");
726
+ case "/chrome authorize status": return authorizeHandler(ctx, "status");
727
+ case "/chrome revoke": return revokeHandler(ctx);
728
+ case "/chrome status": return statusHandler(ctx);
729
+ case "/chrome doctor": return doctorHandler(ctx);
730
+ case "/chrome onboard": return onboardHandler(ctx);
731
+ case "/chrome background": return backgroundHandler(ctx, "");
732
+ case "/chrome background toggle": return backgroundHandler(ctx, "toggle");
733
+ case "/chrome background on": return backgroundHandler(ctx, "on");
734
+ case "/chrome background off": return backgroundHandler(ctx, "off");
735
+ case "/chrome background status": return backgroundHandler(ctx, "status");
736
+ }
746
737
  };
747
738
 
748
739
  pi.registerCommand("chrome", {
@@ -795,7 +786,7 @@ Usage rules:
795
786
  handler: async (args, ctx) => {
796
787
  const tokens = (args || "").trim().split(/\s+/).filter(Boolean);
797
788
  if (tokens.length === 0) {
798
- await openSettingsDialog(ctx);
789
+ await openCommandMenu(ctx);
799
790
  return;
800
791
  }
801
792
  const [head, ...rest] = tokens;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-chrome",
3
- "version": "0.15.5",
3
+ "version": "0.15.6",
4
4
  "scripts": {
5
5
  "version": "node scripts/sync-manifest-version.js",
6
6
  "prepublishOnly": "node scripts/sync-manifest-version.js"