@henryqw/pi-auto-compact 1.1.9 → 1.1.10
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 +20 -20
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# `@henryqw/pi-auto-compact`
|
|
2
2
|
|
|
3
|
-
Compact context before it
|
|
3
|
+
Compact context before it reaches the configured threshold. Then resume the current task.
|
|
4
4
|
|
|
5
5
|
## Why
|
|
6
6
|
|
|
7
|
-
- **Created for**:
|
|
8
|
-
- **Advantage**:
|
|
7
|
+
- **Created for**: Compact session context automatically before it reaches the configured threshold.
|
|
8
|
+
- **Advantage**: Trigger early, use a dedicated model, and resume the interrupted task without manual work.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
@@ -14,14 +14,6 @@ pi install npm:@henryqw/pi-task-models
|
|
|
14
14
|
pi install npm:@henryqw/pi-auto-compact
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Requires Pi Coding Agent 0.84.4+.
|
|
18
|
-
|
|
19
|
-
## With
|
|
20
|
-
|
|
21
|
-
| Package | Why |
|
|
22
|
-
| --- | --- |
|
|
23
|
-
| `@henryqw/pi-task-models` | Required. Shared model profiles for compaction routes. |
|
|
24
|
-
|
|
25
17
|
Disable Pi's built-in auto-compaction in `~/.pi/agent/settings.json`:
|
|
26
18
|
|
|
27
19
|
```json
|
|
@@ -34,13 +26,23 @@ Disable Pi's built-in auto-compaction in `~/.pi/agent/settings.json`:
|
|
|
34
26
|
|
|
35
27
|
Restart Pi after install or settings changes. Trusted project settings in `.pi/settings.json` must not set `compaction.enabled` back to `true`.
|
|
36
28
|
|
|
29
|
+
## With
|
|
30
|
+
|
|
31
|
+
This package requires `@henryqw/pi-task-models` for shared compaction routes.
|
|
32
|
+
|
|
33
|
+
`~/.pi/agent/config/pi-task-models.json` is shared and owned by `@henryqw/pi-task-models`. The local `pi-auto-compact/autoCompact` declaration defaults to `fast`. A task entry is an explicit user override.
|
|
34
|
+
|
|
35
|
+
Malformed shared task-model config is reported and left unchanged. Compaction then uses the current session model.
|
|
36
|
+
|
|
37
37
|
## Use
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
| --- | --- | --- |
|
|
41
|
-
| `/auto-compact` | command | Set the compaction threshold. |
|
|
39
|
+
Use `/auto-compact` to set the compaction threshold.
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
- It refuses to activate unless effective `compaction.enabled` is `false`.
|
|
42
|
+
- It checks `turn_start`, tool-call `turn_end`, `agent_end`, `context`, and resumed or forked `session_start`.
|
|
43
|
+
- Its consumer-owned `pi-auto-compact/autoCompact` task defaults to `fast`.
|
|
44
|
+
- It tries the effective profile primary, then fallback. If neither route works, the current session model still compacts.
|
|
45
|
+
- After mid-task compaction, a follow-up message continues the current task.
|
|
44
46
|
|
|
45
47
|
## Config
|
|
46
48
|
|
|
@@ -52,10 +54,8 @@ Package-owned: `~/.pi/agent/config/pi-auto-compact.json`
|
|
|
52
54
|
}
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
| --- | --- | --- | --- |
|
|
57
|
-
| `autoCompactThreshold` | No | Number, at least 25, below 100 | `50` |
|
|
57
|
+
`autoCompactThreshold` is optional. It must be a number that is at least 25 and below 100. The default is `50`.
|
|
58
58
|
|
|
59
|
-
Unknown fields are ignored
|
|
59
|
+
Unknown fields are ignored. Legacy model fields are obsolete. `/auto-compact` writes this file.
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
A missing file uses the default. A malformed or invalid file fails visibly at session start, falls back to 50%, and stays unchanged.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-auto-compact",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Proactively compact Pi context at a configurable threshold and resume the current task.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"files": [
|
|
17
|
+
"LICENSE",
|
|
17
18
|
"extensions",
|
|
18
|
-
"README.md"
|
|
19
|
-
"LICENSE"
|
|
19
|
+
"README.md"
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
22
|
"test": "node --test test/*.test.ts",
|