pi-context-map 0.7.3 → 0.7.5
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 +8 -0
- package/extensions/index.ts +11 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.5] - 2026-06-16
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
- Fixed process handler stacking: `SIGINT`/`SIGTERM` now use `once()` + `removeAllListeners` to prevent orphaned servers on extension reload.
|
|
6
|
+
|
|
7
|
+
## [0.7.4] - 2026-06-16
|
|
8
|
+
### Performance & Reliability
|
|
9
|
+
- **Throttled auto-refresh**: `message_end` handler now throttles analysis to max once per 5 seconds. Prevents expensive I/O spam during rapid assistant responses.
|
|
10
|
+
|
|
3
11
|
## [0.7.3] - 2026-06-15
|
|
4
12
|
### Bug Fixes
|
|
5
13
|
- **Fixed insights context window**: Removed hardcoded "128k" from all insight messages. Now shows actual window size (e.g., "your 200k context window").
|
package/extensions/index.ts
CHANGED
|
@@ -304,8 +304,14 @@ export default async function piContextMap(pi: ExtensionAPI): Promise<void> {
|
|
|
304
304
|
}
|
|
305
305
|
});
|
|
306
306
|
|
|
307
|
+
let lastAnalysisTime = 0;
|
|
308
|
+
const ANALYSIS_THROTTLE_MS = 5000; // Don't run analysis more than once per 5 seconds
|
|
309
|
+
|
|
307
310
|
pi.on("message_end", async (_event: any) => {
|
|
308
311
|
if (_event?.message?.role === "assistant" && liveServer.isRunning) {
|
|
312
|
+
const now = Date.now();
|
|
313
|
+
if (now - lastAnalysisTime < ANALYSIS_THROTTLE_MS) return;
|
|
314
|
+
lastAnalysisTime = now;
|
|
309
315
|
try {
|
|
310
316
|
await runAnalysis();
|
|
311
317
|
} catch {
|
|
@@ -318,10 +324,9 @@ export default async function piContextMap(pi: ExtensionAPI): Promise<void> {
|
|
|
318
324
|
liveServer.stop();
|
|
319
325
|
});
|
|
320
326
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
process.
|
|
325
|
-
|
|
326
|
-
});
|
|
327
|
+
// Use once to prevent stacking on reload
|
|
328
|
+
process.removeAllListeners("SIGINT");
|
|
329
|
+
process.removeAllListeners("SIGTERM");
|
|
330
|
+
process.once("SIGINT", () => liveServer.stop());
|
|
331
|
+
process.once("SIGTERM", () => liveServer.stop());
|
|
327
332
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-context-map",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "Professional context profiler for Pi that visualizes the session context window, token distribution, and integrates with Nexus packages for actionable insights.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|