bermudis-pi-goodies 0.23.2 → 0.23.3
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 +6 -5
- package/goodies.ts +10 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ extensions. One entry point, twelve independent features.
|
|
|
25
25
|
After publishing the package to npm:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
pi install npm:bermudis-pi-goodies@0.23.
|
|
28
|
+
pi install npm:bermudis-pi-goodies@0.23.3
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Remove any old `bermudis-pi-goodies.ts` symlink before reloading Pi. Each
|
|
@@ -118,11 +118,12 @@ commands it is logged as a digest, never raw text.
|
|
|
118
118
|
|
|
119
119
|
Two honest trade-offs:
|
|
120
120
|
|
|
121
|
-
- **Separate opt-in,
|
|
121
|
+
- **Separate opt-in, off until you enable it.** A bash summary is one request per unique
|
|
122
122
|
command; a thinking summary recurs for as long as the model reasons.
|
|
123
|
-
Same provider, different volume — so
|
|
124
|
-
|
|
125
|
-
It takes effect immediately, no
|
|
123
|
+
Same provider, different volume — so thinking summaries are a separate
|
|
124
|
+
toggle (`/goodies thinking-summaries on|off`), default off, persisted to
|
|
125
|
+
`goodies.json` like every other toggle. It takes effect immediately, no
|
|
126
|
+
`/reload`.
|
|
126
127
|
- **It does not replace the `Thinking...` row itself.** Pi's only seam for
|
|
127
128
|
that text is one global label applied to every assistant message at
|
|
128
129
|
once — updating it mid-stream would rewrite every past thinking row, and
|
package/goodies.ts
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
* State persists to ~/.pi/agent/goodies.json. Toggling a feature writes the
|
|
9
9
|
* config but does NOT unload/reload the extension — every feature is registered
|
|
10
10
|
* at load time, so a toggle needs `/reload` or a new session to take effect.
|
|
11
|
-
* Exceptions read at request time: `summary-model
|
|
12
|
-
* which is session-only (off on every pi launch, never persisted — token spend).
|
|
11
|
+
* Exceptions read at request time: `summary-model` and `thinking-summaries`.
|
|
13
12
|
*/
|
|
14
13
|
import type { Api, Model } from "@earendil-works/pi-ai";
|
|
15
14
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
@@ -26,16 +25,9 @@ import { rankCandidates } from "./vision-core.ts";
|
|
|
26
25
|
|
|
27
26
|
let CONFIG_PATH = join(homedir(), ".pi", "agent", "goodies.json");
|
|
28
27
|
|
|
29
|
-
/** Session-only flag: thinking summaries default off every pi launch. */
|
|
30
|
-
let sessionThinkingEnabled = false;
|
|
31
|
-
|
|
32
28
|
export function __setConfigPathForTesting(path: string): void {
|
|
33
29
|
CONFIG_PATH = path;
|
|
34
30
|
config = loadConfig();
|
|
35
|
-
// Thinking summaries are session-only (default off every pi launch), so a
|
|
36
|
-
// fresh config scope in tests also means a fresh flag — otherwise an
|
|
37
|
-
// earlier test's `on` would leak into later ones sharing the process.
|
|
38
|
-
sessionThinkingEnabled = false;
|
|
39
31
|
}
|
|
40
32
|
|
|
41
33
|
type FeatureName =
|
|
@@ -77,10 +69,10 @@ type Config = Partial<Record<FeatureName, boolean>> & {
|
|
|
77
69
|
*/
|
|
78
70
|
"summary-model"?: string;
|
|
79
71
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
72
|
+
* Whether live thinking summaries are on. Persisted like every other
|
|
73
|
+
* toggle; read at request time so `/goodies thinking-summaries on|off`
|
|
74
|
+
* takes effect immediately. Unset means off — the volume (a request per
|
|
75
|
+
* reasoning run, not per command) is why the default stays off.
|
|
84
76
|
*/
|
|
85
77
|
"thinking-summaries"?: boolean;
|
|
86
78
|
};
|
|
@@ -185,20 +177,13 @@ export function setSummaryModel(model: string | undefined): void {
|
|
|
185
177
|
}
|
|
186
178
|
|
|
187
179
|
export function getThinkingSummariesEnabled(): boolean {
|
|
188
|
-
return
|
|
180
|
+
return config["thinking-summaries"] === true; // default off when unset
|
|
189
181
|
}
|
|
190
182
|
|
|
191
183
|
export function setThinkingSummariesEnabled(enabled: boolean): void {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
try {
|
|
196
|
-
updateConfig((next) => {
|
|
197
|
-
delete next["thinking-summaries"];
|
|
198
|
-
});
|
|
199
|
-
} catch {
|
|
200
|
-
// ignore: the in-memory flag above already took effect
|
|
201
|
-
}
|
|
184
|
+
updateConfig((next) => {
|
|
185
|
+
next["thinking-summaries"] = enabled;
|
|
186
|
+
});
|
|
202
187
|
}
|
|
203
188
|
|
|
204
189
|
// ── Summary-model resolution against pi's model registry ────────────────────
|
|
@@ -563,7 +548,7 @@ export default function goodies(pi: ExtensionAPI): void {
|
|
|
563
548
|
setThinkingSummariesEnabled(value === "on");
|
|
564
549
|
const model = getSummaryModel();
|
|
565
550
|
ctx.ui.notify(
|
|
566
|
-
`thinking summaries ${value}
|
|
551
|
+
`thinking summaries ${value} (persisted). ` +
|
|
567
552
|
(value === "on" && !model
|
|
568
553
|
? `No summary model set yet — run /goodies summary-model <provider/model> or nothing will happen. `
|
|
569
554
|
: "") +
|