pi-blackhole 0.3.1 → 0.3.2
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 +22 -0
- package/package.json +1 -1
- package/src/om/compaction-trigger.ts +8 -0
package/README.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# pi-blackhole
|
|
2
2
|
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> **For blackhole to handle all compaction automatically**, set `"overrideDefaultCompaction": true` in your config at
|
|
5
|
+
> `~/.pi/agent/pi-blackhole/pi-blackhole-config.json`. Without this, blackhole stays out of Pi's compaction by default
|
|
6
|
+
> and only activates via the `/blackhole` command.
|
|
7
|
+
>
|
|
8
|
+
> See [`CONFIG.md`](CONFIG.md) for the full reference.
|
|
9
|
+
|
|
3
10
|
**Algorithmic compaction + session-aware observational memory for [Pi](https://github.com/badlogic/pi-mono) — in one unified extension.**
|
|
4
11
|
|
|
5
12
|
Blackhole merges the best ideas from [pi-vcc](https://github.com/sting8k/pi-vcc) and [pi-observational-memory](https://github.com/elpapi42/pi-observational-memory) into something that's become its own beast entirely. Deterministic compaction that costs nothing. A memory layer that survives compactions. Per-worker model fallback chains with persisted cooldowns. Manual flush mode. All configured from one JSON file.
|
|
@@ -8,6 +15,21 @@ Blackhole merges the best ideas from [pi-vcc](https://github.com/sting8k/pi-vcc)
|
|
|
8
15
|
>
|
|
9
16
|
> The codebase has since diverged heavily from both upstreams, but tries to keep up-to-date with any fixes from them..
|
|
10
17
|
|
|
18
|
+
> [!IMPORTANT]
|
|
19
|
+
> **Auto-compaction behavior & configuration**
|
|
20
|
+
>
|
|
21
|
+
> Blackhole's auto-compaction **only activates when explicitly opted in**. By default (`overrideDefaultCompaction: false`), blackhole stays out of Pi's compaction — Pi handles its own automatically, and blackhole's `/blackhole` command still works manually.
|
|
22
|
+
>
|
|
23
|
+
> Configure via your Pi agent's `config.json`:
|
|
24
|
+
>
|
|
25
|
+
> | What you want | `overrideDefaultCompaction` | `noAutoCompact` |
|
|
26
|
+
> |---|---|---|
|
|
27
|
+
> | Blackhole auto-compacts at your threshold | `true` | `false` |
|
|
28
|
+
> | Pi handles auto-compaction (default) | `false` | `false` |
|
|
29
|
+
> | Manual only — use `/blackhole` | any | `true` |
|
|
30
|
+
>
|
|
31
|
+
> See [`CONFIG.md`](CONFIG.md) for the full reference.
|
|
32
|
+
|
|
11
33
|
📖 See [`CHANGELOG.md`](CHANGELOG.md) for release history.
|
|
12
34
|
⚙️ See [`CONFIG.md`](CONFIG.md) for the full configuration reference.
|
|
13
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-blackhole",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"packageManager": "pnpm@11.2.2",
|
|
5
5
|
"description": "Unified compaction + observational memory extension for Pi — compresses conversation context while preserving durable observations and reflections",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,6 +24,7 @@ export function registerCompactionTrigger(pi: ExtensionAPI, runtime: Runtime): v
|
|
|
24
24
|
passive: runtime.config.passive,
|
|
25
25
|
memory: runtime.config.memory,
|
|
26
26
|
noAutoCompact: runtime.config.noAutoCompact,
|
|
27
|
+
overrideDefaultCompaction: runtime.config.overrideDefaultCompaction,
|
|
27
28
|
compactInFlight: runtime.compactInFlight,
|
|
28
29
|
compactAfterTokens: runtime.config.compactAfterTokens,
|
|
29
30
|
});
|
|
@@ -40,6 +41,13 @@ export function registerCompactionTrigger(pi: ExtensionAPI, runtime: Runtime): v
|
|
|
40
41
|
dbg("compaction_trigger.skip", { reason: "noAutoCompact" });
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
44
|
+
// Don't force Pi to compact unless the user explicitly opted into blackhole's pipeline.
|
|
45
|
+
// When overrideDefaultCompaction is false (default), blackhole stays out of the way
|
|
46
|
+
// and lets Pi handle its own compaction naturally.
|
|
47
|
+
if (runtime.config.overrideDefaultCompaction === false) {
|
|
48
|
+
dbg("compaction_trigger.skip", { reason: "overrideDefaultCompaction_false" });
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
43
51
|
if (runtime.compactInFlight) {
|
|
44
52
|
dbg("compaction_trigger.skip", { reason: "compactInFlight" });
|
|
45
53
|
return;
|