pi-soly 0.5.6 → 0.5.7
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/package.json +1 -1
- package/switch/index.ts +17 -9
package/package.json
CHANGED
package/switch/index.ts
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
// =============================================================================
|
|
4
4
|
//
|
|
5
5
|
// Wires the agent switcher into pi as a compact footer pill:
|
|
6
|
-
// - Footer status pill: "⚡ worker" (or
|
|
6
|
+
// - Footer status pill: "▶ ⚡ worker" (or "· ⚡ worker" for the default)
|
|
7
7
|
// - Click pill or `/agent` → open full picker modal (SelectList)
|
|
8
|
-
// - Ctrl+
|
|
8
|
+
// - Ctrl+Tab → cycle to next agent (no popup, hot switch)
|
|
9
|
+
// - F2 → same, fallback if your terminal doesn't pass Ctrl+Tab through
|
|
9
10
|
// - Persists current agent to .soly/agent or ~/.pi-switch/agent
|
|
10
11
|
// - Exposes `globalThis.__PI_SWITCH_AGENT__` for other extensions
|
|
11
12
|
// - Injects a short system-prompt section so the LLM knows the current
|
|
@@ -102,14 +103,21 @@ export default function piSwitchExtension(pi: ExtensionAPI) {
|
|
|
102
103
|
};
|
|
103
104
|
});
|
|
104
105
|
|
|
105
|
-
// -----
|
|
106
|
-
|
|
106
|
+
// ----- Hot cycle (no popup, no confirmation) -----
|
|
107
|
+
// Ctrl+Tab is the primary shortcut (most terminals support it).
|
|
108
|
+
// F2 is kept as a backup for terminals that don't pass Ctrl+Tab through.
|
|
109
|
+
const cycleShortcut = (sctx: { ui: ExtensionUIContext }): void => {
|
|
110
|
+
lastUi = sctx.ui;
|
|
111
|
+
refreshCycle();
|
|
112
|
+
setAgent(nextAgent(currentAgent, cycle));
|
|
113
|
+
};
|
|
114
|
+
pi.registerShortcut("ctrl+tab", {
|
|
107
115
|
description: "Cycle to next agent (worker → oracle → scout → …)",
|
|
108
|
-
handler: (sctx) =>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
handler: (sctx) => cycleShortcut(sctx),
|
|
117
|
+
});
|
|
118
|
+
pi.registerShortcut("f2", {
|
|
119
|
+
description: "Cycle to next agent (F2 fallback if Ctrl+Tab isn't passed by your terminal)",
|
|
120
|
+
handler: (sctx) => cycleShortcut(sctx),
|
|
113
121
|
});
|
|
114
122
|
|
|
115
123
|
// ----- /agent: open picker, or subcommands (create / doctor / recommend / set) -----
|