Initial: pi-skill — 68 skills, 43 extensions, 11 themes for Pi

This commit is contained in:
Kunthawat Greethong
2026-05-25 16:38:02 +07:00
commit 69f7d8bdda
1689 changed files with 342427 additions and 0 deletions

28
extensions/agent-nav.ts Normal file
View File

@@ -0,0 +1,28 @@
// ABOUTME: Shared F-key navigation for agent widgets (chain, team)
// ABOUTME: Dispatches F1-F4 to the first active NavProvider on globalThis
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
export default function (pi: ExtensionAPI) {
function getActiveProvider() {
const providers = (globalThis as any).__piNavProviders || [];
return providers.find((p: any) => p.isActive());
}
pi.registerShortcut("f1", {
description: "Select previous item",
handler: async (ctx) => { getActiveProvider()?.selectPrev(ctx); },
});
pi.registerShortcut("f2", {
description: "Select next item",
handler: async (ctx) => { getActiveProvider()?.selectNext(ctx); },
});
pi.registerShortcut("f3", {
description: "Open detail view",
handler: async (ctx) => { await getActiveProvider()?.showDetail(ctx); },
});
pi.registerShortcut("f4", {
description: "Exit selection",
handler: async (ctx) => { getActiveProvider()?.exitSelection(ctx); },
});
}