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,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
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
);
|
|
738
|
-
|
|
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
|
|
789
|
+
await openCommandMenu(ctx);
|
|
799
790
|
return;
|
|
800
791
|
}
|
|
801
792
|
const [head, ...rest] = tokens;
|